burne-ui 1.7.3 → 1.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./themeRuntimeContext-C87sCqcm.cjs"),c=require("react/jsx-runtime"),a=require("react"),$=require("gsap");require("gsap/CustomEase");const be=require("react-icons/io5"),Ut=require("react-dom"),dt={size:"--toast-scrim-size",density:"--toast-scrim-density",height:"--toast-scrim-height",insetX:"--toast-scrim-inset-x",offsetY:"--toast-scrim-offset-y",gradientTop:"--toast-scrim-gradient-top",gradientBottom:"--toast-scrim-gradient-bottom",mask:"--toast-scrim-mask"};function ft(e){return`var(${e})`}const nh={size:1,density:1},oh=["small","base","mid","large"];function js(e){return e??"base"}const ye={small:{title:"small",desc:"xsmall",gridGap:"gap-x-small gap-y-xsmall",listItemGapX:"gap-x-small"},base:{title:"base",desc:"small",gridGap:"gap-x-base gap-y-xsmall",listItemGapX:"gap-x-base"},mid:{title:"mid",desc:"small",gridGap:"gap-x-base gap-y-xsmall",listItemGapX:"gap-x-base"},large:{title:"large",desc:"base",gridGap:"gap-x-mid gap-y-xsmall",listItemGapX:"gap-x-mid"}},rh={small:{maxWidthClass:"max-w-component-base",shellPadding:`${i.CONTROL_SIZE_LAYOUT.small.rounded} p-base`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-small",titleVariant:"small",descVariant:"xsmall",loadingSize:"small",toastWidthPx:280},base:{maxWidthClass:"max-w-component-large",shellPadding:`${i.CONTROL_SIZE_LAYOUT.base.rounded} p-mid`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-mid",titleVariant:"base",descVariant:"small",loadingSize:"small",toastWidthPx:360},mid:{maxWidthClass:"max-w-component-xlarge",shellPadding:`${i.CONTROL_SIZE_LAYOUT.mid.rounded} p-mid`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-large",titleVariant:"mid",descVariant:"base",loadingSize:"base",toastWidthPx:400},large:{maxWidthClass:"max-w-component-2xlarge",shellPadding:`${i.CONTROL_SIZE_LAYOUT.large.rounded} p-large`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-large",titleVariant:"large",descVariant:"base",loadingSize:"mid",toastWidthPx:440}};function Ms(e){return js(e)}function pt(e){return rh[Ms(e)]}function sh(e){const t=pt(e);return`w-fit ${t.maxWidthClass} ${t.shellPadding}`}function ah(e,t="base"){const n=pt(t).toastWidthPx;return e.length===0?n:Math.max(n,...e.map(o=>pt(o.size??t).toastWidthPx))}const zo={small:{rounded:i.CONTROL_SIZE_LAYOUT.small.rounded,panelMax:"max-w-component-base",panelMin:"min-w-component-xsmall",popoverMax:"max-w-component-small",maxHeight:"max-h-[min(85dvh,26rem)]",headerPadding:"px-mid pb-base pt-mid",bodyPadding:"p-mid",footerPadding:"px-mid pt-base pb-mid",headerGap:"gap-base",alertHeaderGap:"gap-x-base",headingGap:"gap-small",titleVariant:"base",alertTitleVariant:"base",descVariant:"small",bodyVariant:"small",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-mid",footerButtonSize:"small",closeButtonSize:"small"},base:{rounded:i.CONTROL_SIZE_LAYOUT.base.rounded,panelMax:"max-w-component-large",panelMin:"min-w-component-small",popoverMax:"max-w-component-base",maxHeight:"max-h-[min(90dvh,36rem)]",headerPadding:"px-mid pt-mid pb-base",bodyPadding:"p-mid",footerPadding:"px-mid pb-mid pt-base",headerGap:"gap-base",alertHeaderGap:"gap-x-mid gap-y-xsmall",headingGap:"gap-base",titleVariant:"mid",alertTitleVariant:"mid",descVariant:"base",bodyVariant:"base",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-large",footerButtonSize:"base",closeButtonSize:"small"},mid:{rounded:i.CONTROL_SIZE_LAYOUT.mid.rounded,panelMax:"max-w-component-xlarge",panelMin:"min-w-component-small",popoverMax:"max-w-component-mid",maxHeight:"max-h-[min(90dvh,40rem)]",headerPadding:"px-large pb-mid pt-large",bodyPadding:"p-large",footerPadding:"px-large pt-mid pb-large",headerGap:"gap-mid",alertHeaderGap:"gap-x-mid gap-y-small",headingGap:"gap-base",titleVariant:"mid",alertTitleVariant:"mid",descVariant:"base",bodyVariant:"base",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-large",footerButtonSize:"base",closeButtonSize:"base"},large:{rounded:i.CONTROL_SIZE_LAYOUT.large.rounded,panelMax:"max-w-component-2xlarge",panelMin:"min-w-component-base",popoverMax:"max-w-component-large",maxHeight:"max-h-[min(90dvh,44rem)]",headerPadding:"px-large pb-mid pt-large",bodyPadding:"p-large",footerPadding:"px-large pt-mid pb-large",headerGap:"gap-mid",alertHeaderGap:"gap-x-mid gap-y-small",headingGap:"gap-base",titleVariant:"large",alertTitleVariant:"large",descVariant:"base",bodyVariant:"base",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-large",footerButtonSize:"base",closeButtonSize:"base"}};function Wc(e){return js(e)}function Ee(e){return zo[Wc(e)]}const Yc=Wc,lh={small:{triggerPadding:"p-base",contentPadding:"p-base",titleVariant:"small",titleClassName:"leading-none",descVariant:"small"},base:{triggerPadding:"p-mid",contentPadding:"p-mid",titleVariant:"base",titleClassName:"leading-none",descVariant:"small"},mid:{triggerPadding:"p-mid",contentPadding:"p-mid",titleVariant:"mid",titleClassName:"leading-none",descVariant:"base"},large:{triggerPadding:"p-large",contentPadding:"p-large",titleVariant:"large",titleClassName:"leading-none",descVariant:"base"}};function ih(e){return js(e)}function It(e){return lh[ih(e)]}function ch(){return{"aria-hidden":!0}}const uh={color:"--overlay-backdrop-color",blur:"--overlay-backdrop-blur",saturate:"--overlay-backdrop-saturate",scrim:"--overlay-backdrop-scrim"};function dh(e){return`var(${e})`}const fh={color:"color-mix(in oklab, var(--color-foreground) 14%, transparent)",blur:"14px",saturate:1.5,scrim:"color-mix(in oklab, black 58%, transparent)"},mh=["dialog","dropdown","dropdown-sub","popover","toast","tooltip"],ph={dialog:"--z-dialog",dropdown:"--z-dropdown","dropdown-sub":"--z-dropdown-sub",popover:"--z-popover",toast:"--z-toast",tooltip:"--z-tooltip"},Ch={dialog:100,dropdown:200,"dropdown-sub":210,popover:200,toast:300,tooltip:400};function gh(e){return`var(--z-${e})`}const Co={primarySolid:i.colorToken("converge-ripple-primary-fill"),neutral:i.colorToken("converge-ripple-neutral"),neutralMuted:i.colorToken("converge-ripple-neutral-muted"),danger:i.colorToken("converge-ripple-danger"),success:i.colorToken("converge-ripple-success"),info:i.colorToken("converge-ripple-info"),warning:i.colorToken("converge-ripple-warning")};function Sh(e){return e==null||e===""?Co.neutral:e in Co?Co[e]:e}function hh(e){return e.closest("button,a[href],[role='button']")??e.parentElement}const xh="pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]",$c=a.memo(a.forwardRef(function({tone:t,durationMs:n,opacityFrom:o,direction:r},s){const{ripples:l,pushAtClientCoords:u,dismiss:d}=i.useConvergeRipples();return a.useImperativeHandle(s,()=>({pushAtClientCoords:u}),[u]),c.jsx(i.ConvergeRippleLayer,{ripples:l,tone:t,onDone:d,durationMs:n,opacityFrom:o,direction:r})}));$c.displayName="ConvergeRipplePaint";function Dn({color:e,disabled:t=!1,duration:n=i.getMotionConfig().rippleDefaultDuration,direction:o="out",className:r=""}){const s=a.useRef(null),l=a.useRef(null),u=Sh(e),d=i.getMotionConfig().rippleDefaultOpacityFrom;return a.useLayoutEffect(()=>{const f=s.current;if(!f||t)return;const m=hh(f);if(!m)return;const p=C=>{var S;t||i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableRipple")||C.defaultPrevented||C.pointerType==="mouse"&&C.button!==0||(S=l.current)==null||S.pushAtClientCoords(m,C.clientX,C.clientY)};return m.addEventListener("pointerdown",p),()=>m.removeEventListener("pointerdown",p)},[t]),c.jsx("span",{ref:s,className:i.cn(xh,r),...ch(),children:c.jsx($c,{ref:l,tone:u,durationMs:n,opacityFrom:d,direction:o})})}function ue(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function $e(...e){return t=>{for(const n of e)n!=null&&ue(n,t)}}function bh(e){return/^on[A-Z]/.test(e)}function Ah(e){const t=e.props.ref;return t??e.ref}function Vi(e,t){return(...n)=>{e(...n),t(...n)}}function yt(e,t,n,o){const r=e.props,s=o==null?void 0:o.runBeforeChild,l={...r};for(const[f,m]of Object.entries(t))if(!(f==="className"||f==="style"||f==="ref")){if(bh(f)&&typeof m=="function"&&typeof r[f]=="function"){const p=m,C=r[f];l[f]=(s==null?void 0:s.includes(f))===!0?Vi(p,C):Vi(C,p);continue}l[f]=m}(r.className!=null||t.className!=null)&&(l.className=i.cn(r.className,t.className));const u=r.style,d=t.style;return(u!=null||d!=null)&&(l.style=u!=null&&d!=null?{...u,...d}:d??u),l.ref=$e(Ah(e),n),l}function Uo({isGloss:e,enabled:t,hasHoverShadow:n,useContentRef:o=!1,forwardedRef:r,onPointerEnter:s,onPointerLeave:l,onPointerDown:u,onPressReleaseStart:d}){const f=a.useRef(null),m=a.useRef(null),p=a.useRef(!1),C=a.useMemo(()=>i.createGlossInteractiveRefCallback(f,e),[e]),S=a.useCallback(L=>{C(L),f.current=L,ue(r,L)},[C,r]),g=a.useCallback(()=>o?m.current:f.current,[o]);a.useEffect(()=>{if(t)return;const L=f.current,_=m.current;p.current=!1,L&&(i.killMotion(L),L.style.removeProperty("--el-shadow")),_&&(i.killMotion(_),_.style.transform="")},[t]);const h=a.useMemo(()=>n&&!e?i.firstLevelHoverShadow():void 0,[n,e]),x=a.useCallback(L=>{if(s==null||s(L),!t||L.defaultPrevented||i.shouldSkipInteractiveHoverLift())return;const _=g();_&&(p.current=!0,e&&!o?i.animateGlossInteractiveHoverLift(_,!0):i.animateInteractiveHoverLift(_,!0,void 0,o?void 0:h))},[h,t,e,g,s,o]),A=a.useCallback(L=>{if(l==null||l(L),p.current=!1,!t||i.shouldSkipInteractiveHoverLift())return;const _=g();_&&(e&&!o?i.animateGlossInteractiveHoverLift(_,!1):i.animateInteractiveHoverLift(_,!1,void 0,o?void 0:h))},[h,t,e,g,l,o]),b=a.useCallback(L=>{if(u==null||u(L),!t||L.defaultPrevented||i.prefersReducedMotion())return;const _=g();if(_){if(e&&!o){i.animateGlossInteractivePressSqueeze(_,p.current,void 0,d);return}i.animateInteractivePressSqueeze(_,{pointerInside:p.current,shadow:o?void 0:h,onReleaseStart:d})}},[h,t,e,g,u,d,o]);return{setRefs:S,btnRef:f,contentMotionRef:m,hoverPointerInsideRef:p,handlePointerEnter:x,handlePointerLeave:A,handlePointerDown:b}}const Xc=new Set(["ButtonContent","ButtonLabel","ButtonIcon","ButtonText","ButtonLoader","ButtonSuccess","ButtonError"]);function Kc(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function qc(e){return Kc(e,t=>t!=null&&Xc.has(t))}function ro(e,t){return Kc(e,n=>n===t)}function vh(e){if(e==null||e===!1)return!1;if(typeof e=="string"||typeof e=="number")return!0;const t=a.Children.toArray(e).filter(r=>r!=null);if(t.length!==1)return!1;const n=t[0];if(typeof n=="string"||typeof n=="number")return!0;if(!a.isValidElement(n))return!1;const o=n.type.displayName;return o==null||!Xc.has(o)}function Lh(e,t,n,o){return Math.max(...[[0,0],[n,0],[0,o],[n,o]].map(([s,l])=>Math.hypot(s-e,l-t)))}function _h(e,t){return 2*Lh(e/2,t/2,e,t)}function Th(e,t){switch(t){case"label":return e==="idle";case"loader":return e==="loading";case"success":return e==="success";case"error":return e==="error"}}const zi="data-button-async-layer-init",Eh={label:{in:1,out:.92},loader:{in:1,out:.85},success:{in:1,out:.85},error:{in:1,out:.85}};function Rh(e,t,n){const o=Th(t,n),{in:r,out:s}=Eh[n];$.set(e,{autoAlpha:o?1:0,scale:o?r:s})}function so(e,t,n){return o=>{e.current=o,o&&!o.hasAttribute(zi)&&(o.setAttribute(zi,""),Rh(o,t,n))}}function Ih({variant:e,asyncState:t,isControlled:n,blocked:o,groupSegment:r,forwardedRef:s,onPointerEnter:l,onPointerLeave:u,onPointerDown:d}){const f=a.useRef(null),m=a.useRef(null),p=a.useRef(null),C=a.useRef(null),S=a.useRef("idle"),g=a.useRef(void 0),h=a.useRef(!1),x=a.useRef(null),A=a.useRef(t),b=a.useMemo(()=>so(f,A.current,"label"),[]),L=a.useMemo(()=>so(m,A.current,"loader"),[]),_=a.useMemo(()=>so(p,A.current,"success"),[]),v=a.useMemo(()=>so(C,A.current,"error"),[]),R=Uo({isGloss:e==="gloss",enabled:!o,hasHoverShadow:i.BUTTON_VARIANT_HAS_HOVER_SHADOW.has(e),useContentRef:!!r,forwardedRef:s,onPointerEnter:l,onPointerLeave:u,onPointerDown:d}),T=a.useCallback(I=>{var y;const O=R.btnRef.current;if(!O)return;const N=O.getBoundingClientRect();(y=x.current)==null||y.push(I,_h(N.width,N.height))},[R.btnRef]);a.useLayoutEffect(()=>{if(!n)return;const I=S.current;(t==="success"||t==="error")&&I==="loading"&&T(t==="success"?"success":"error"),S.current=t},[t,n,T]),a.useLayoutEffect(()=>{const I=f.current,O=m.current,N=p.current,y=C.current;if(!I||!O||!N||!y)return;const w=i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableAsyncButtonCrossfade"),P=i.motionInteractive(),k=[{el:I,active:t==="idle",scaleIn:1,scaleOut:.92},{el:O,active:t==="loading",scaleIn:1,scaleOut:.85},{el:N,active:t==="success",scaleIn:1,scaleOut:.85},{el:y,active:t==="error",scaleIn:1,scaleOut:.85}];if(g.current===void 0){g.current=t;for(const{el:j,active:B,scaleIn:D,scaleOut:F}of k)i.killMotion(j),$.set(j,{autoAlpha:B?1:0,scale:B?D:F});return}if(g.current!==t){g.current=t;for(const{el:j,active:B,scaleIn:D,scaleOut:F}of k){if(i.killMotion(j),w){$.set(j,{autoAlpha:B?1:0,scale:B?D:F});continue}$.to(j,{autoAlpha:B?1:0,scale:B?D:F,...P,overwrite:"auto"})}}},[t]);const E=a.useCallback((I,O,N,y,w,P)=>k=>{I==null||I(k),!(N||!O||k.defaultPrevented)&&(h.current||y!=="idle"||(h.current=!0,w("loading"),Promise.resolve(O(k)).then(j=>{const B=j?"success":"error";w(B),T(B),P()}).catch(()=>{w("error"),T("error"),P()}).finally(()=>{h.current=!1})))},[T]);return{setRefs:R.setRefs,contentMotionRef:R.contentMotionRef,bindLabelRef:b,bindLoaderRef:L,bindSuccessRef:_,bindErrorRef:v,expandRippleLayerRef:x,pushExpandRipple:T,handlePointerEnter:R.handlePointerEnter,handlePointerLeave:R.handlePointerLeave,handlePointerDown:R.handlePointerDown,createAsyncClickHandler:E,asyncInFlight:h}}const Zc=a.createContext(null),kr=a.createContext({});function yh({classNames:e,children:t}){const n=a.useContext(kr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(kr.Provider,{value:o,children:t})}function Wt(){return a.useContext(kr)}function Yt(){return a.useContext(Zc)}function Nh({value:e,children:t}){return c.jsx(Zc.Provider,{value:e,children:t})}function wh(e,t){return e??t}const Oh={"accent-header":"text-accent-header","header-1":"text-header-1","header-2":"text-header-2",large:"text-large",mid:"text-mid",base:"text-base",small:"text-small",xsmall:"text-xsmall"},Ph={"accent-header":"h1","header-1":"h2","header-2":"h3",large:"p",mid:"p",base:"p",small:"p",xsmall:"p"},Dh="text-foreground";function kh(e,t,n){return i.cn(Oh[e],!t&&Dh,n)}const q=a.forwardRef(function({variant:t,as:n,inheritColor:o,className:r,children:s,...l},u){const d=wh(n,Ph[t]);return a.createElement(d,{...l,ref:u,className:kh(t,o,r)},s)});function Bh({className:e}){return c.jsx("span",{className:i.cn(i.buttonSpinnerInnerClass(),e),"aria-hidden":!0})}function jh({className:e}){return c.jsx("svg",{className:i.cn(i.buttonIconSvgClass(),e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"M20 6L9 17l-5-5"})})}function Mh({className:e}){return c.jsx("svg",{className:i.cn(i.buttonIconSvgClass(),e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function Fh({size:e,tone:t,onDone:n}){const o=a.useRef(null),r=a.useRef(n);return r.current=n,a.useLayoutEffect(()=>{const s=o.current;if(!s)return;let l=!1;if(i.killMotion(s),i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableFeedbackExpand")){r.current();return}i.setWillChangeTransform(s,!0);const d=$.fromTo(s,{scale:0,autoAlpha:.5},{scale:1,autoAlpha:0,...i.motionFeedbackExpand(),ease:i.ensureRippleEase(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(s,()=>{l||r.current()})});return()=>{l=!0,d.kill(),i.killMotion(s)}},[e,t]),c.jsx("span",{ref:o,className:i.buttonFeedbackExpandRippleClass(),style:{width:e,height:e,marginLeft:-e/2,marginTop:-e/2,background:t==="success"?"color-mix(in oklab, var(--color-success) 55%, transparent)":"color-mix(in oklab, var(--color-danger) 55%, transparent)",transform:"scale(0)"},"aria-hidden":!0})}const vo=a.forwardRef(function({className:t="",children:n,...o},r){const s=Yt(),l=Wt();return c.jsx("span",{ref:r??(s==null?void 0:s.contentMotionRef),className:i.buttonContentClass({groupSegment:!!(s!=null&&s.groupSegment),slotClass:l.content,className:t}),...o,children:n})});vo.displayName="ButtonContent";const Fs=a.forwardRef(function({className:t="",children:n,...o},r){const s=Yt(),l=Wt();return c.jsx("span",{ref:r??(s==null?void 0:s.bindLabelRef),className:i.buttonLabelClass({slotClass:l.label,className:t}),...o,children:n})});Fs.displayName="ButtonLabel";function Hs({className:e="",children:t,...n}){const o=Yt(),r=Wt(),s=(o==null?void 0:o.size)??"base";return c.jsx("span",{className:i.buttonIconClass(s,i.cn(r.icon,e)),"aria-hidden":!0,...n,children:t})}Hs.displayName="ButtonIcon";function Gs({className:e="",children:t,...n}){const o=Yt(),r=Wt(),s=(o==null?void 0:o.size)??"base";return c.jsx(q,{variant:i.BUTTON_SIZE_TEXT_VARIANT[s],as:"span",inheritColor:!0,className:i.buttonTextClass(r.text,e),...n,children:t})}Gs.displayName="ButtonText";const Lo=a.forwardRef(function({className:t="",...n},o){const r=Yt(),s=Wt(),l=(r==null?void 0:r.size)??"base",u=(r==null?void 0:r.asyncState)??"idle",d=(r==null?void 0:r.loaderTextClass)??"";return c.jsx("span",{ref:o??(r==null?void 0:r.bindLoaderRef),"data-button-async-layer":!0,className:i.buttonLoaderLayerClass(d,i.cn(s.loader,t)),"aria-hidden":u!=="loading",...n,children:c.jsx(Bh,{className:i.cn(i.buttonSpinnerClass(l),i.BUTTON_SPINNER_MOTION_CLASS)})})});Lo.displayName="ButtonLoader";const _o=a.forwardRef(function({className:t="",...n},o){const r=Yt(),s=Wt(),l=(r==null?void 0:r.size)??"base",u=(r==null?void 0:r.asyncState)??"idle",d=i.CONTROL_SIZE_LAYOUT[l];return c.jsx("span",{ref:o??(r==null?void 0:r.bindSuccessRef),"data-button-async-layer":!0,className:i.buttonSuccessLayerClass(i.cn(s.success,t)),"aria-hidden":u!=="success",...n,children:c.jsx(jh,{className:d.icon})})});_o.displayName="ButtonSuccess";const To=a.forwardRef(function({className:t="",...n},o){const r=Yt(),s=Wt(),l=(r==null?void 0:r.size)??"base",u=(r==null?void 0:r.asyncState)??"idle",d=i.CONTROL_SIZE_LAYOUT[l];return c.jsx("span",{ref:o??(r==null?void 0:r.bindErrorRef),"data-button-async-layer":!0,className:i.buttonErrorLayerClass(i.cn(s.error,t)),"aria-hidden":u!=="error",...n,children:c.jsx(Mh,{className:d.icon})})});To.displayName="ButtonError";const Qc=a.memo(a.forwardRef(function({clipClass:t},n){const[o,r]=a.useState([]),s=a.useRef(0);a.useImperativeHandle(n,()=>({push(u,d){const f=++s.current;r(m=>[...m,{id:f,size:d,tone:u}])}}),[]);const l=a.useCallback(u=>{r(d=>d.filter(f=>f.id!==u))},[]);return c.jsx("span",{className:i.cn(i.BUTTON_CLIP_LAYER_CLASS,t),"aria-hidden":!0,children:o.map(u=>c.jsx(Fh,{size:u.size,tone:u.tone,onDone:()=>l(u.id)},u.id))})}));Qc.displayName="ButtonExpandRippleLayer";function Hh({icon:e,iconPosition:t="start",children:n}){const o=vh(n),r=e!=null?c.jsx(Hs,{children:e}):null;return c.jsxs(c.Fragment,{children:[t==="start"?r:null,o?c.jsx(Gs,{children:n}):n,t==="end"?r:null]})}const Jc=a.createContext(null),eu=a.createContext(null),Br=a.createContext({});function Gh({value:e,children:t}){return c.jsx(eu.Provider,{value:e,children:t})}function tu({segment:e,buttonSize:t,variant:n,children:o}){const r=a.useMemo(()=>({segment:e,buttonSize:t,variant:n}),[t,e,n]);return c.jsx(Jc.Provider,{value:r,children:o})}function gt(){return a.useContext(Jc)}function mn(){return a.useContext(eu)}function Vh({classNames:e,children:t}){const n=a.useContext(Br),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Br.Provider,{value:o,children:t})}function nu(){return a.useContext(Br)}const jr=a.createContext({}),ou=a.createContext(null),ru=a.createContext(null);function zh({classNames:e,children:t}){const o={...a.useContext(jr),...e};return c.jsx(jr.Provider,{value:o,children:t})}function Uh({shellIds:e,children:t}){return c.jsx(ou.Provider,{value:e,children:t})}function $t(){return a.useContext(jr)}function Wo(){return a.useContext(ou)}function et(){return a.useContext(ru)}function Wh(e){return e==="loading"}function Yh({variant:e,status:t="default",size:n,type:o="button",asyncState:r,onAsyncStateChange:s,onAsyncClick:l,asyncFeedbackMs:u=2e3,disabled:d,icon:f,iconPosition:m="start",ripple:p=!1,iconOnly:C=!1,groupSegment:S,className:g="",classNames:h,children:x,onClick:A}){const b=mn(),L=gt(),_=et(),v=b!=null&&b.segmented?void 0:S??(L==null?void 0:L.segment),R=n??(L==null?void 0:L.buttonSize)??(_==null?void 0:_.size)??"base",T=e??(L==null?void 0:L.variant)??"default",E=!!(d??(_==null?void 0:_.disabled)??(_==null?void 0:_.isSubmitting)),I=T==="gloss",[O,N]=a.useState("idle"),y=r!==void 0,w=y?r:O,P=a.useCallback(ee=>{N(ee),s==null||s(ee)},[s]),k=a.useCallback(()=>{window.setTimeout(()=>{P("idle")},u)},[u,P]),j=w==="loading"||w==="success"||w==="error",B=E||j,D=i.CONTROL_SIZE_LAYOUT[R].rounded,F=v?i.buttonGroupRoundingClasses(v):D,H=v?i.buttonGroupSegmentSurfaceClasses(v):"",U=v?i.buttonGroupRoundingClasses(v):D,G=a.useMemo(()=>qc(x),[x]),K=G?void 0:g,V=i.cn(i.BUTTON_BASE_INTERACTIVE_CLASS,i.BUTTON_STATUS_FOCUS_OUTLINE[t],i.buttonRootClass(R,C),i.buttonSurfaceMotionClass(I,t,T,!!v,B),E?i.BUTTON_DISABLED_OPACITY_CLASS:"",F,H,i.BUTTON_CURSOR_CLASS,h==null?void 0:h.root,g),oe=i.buttonConvergeRippleColor(T,t),J=i.buttonLoaderTextClass(T,t);return{type:o,size:R,variant:T,status:t,ripple:p,blocked:B,busy:j,userDisabled:E,isGloss:I,groupSegment:v,clipClass:U,buttonClass:V,convergeRippleColor:oe,loaderTextClass:J,asyncState:w,isControlled:y,internalAsync:O,icon:f,iconPosition:m,children:x,classNames:h,isCompound:G,labelLayoutClass:K,onClick:A,onAsyncClick:l,setUncontrolledAsync:P,scheduleAsyncIdleReset:k,ariaBusy:Wh(w)}}function $h({children:e,isCompound:t,hasCompoundContent:n,hasCompoundLoader:o,hasCompoundSuccess:r,hasCompoundError:s,icon:l,iconPosition:u,classNames:d,labelLayoutClass:f}){return t?n?e:c.jsxs(vo,{children:[e,o?null:c.jsx(Lo,{}),r?null:c.jsx(_o,{}),s?null:c.jsx(To,{})]}):c.jsxs(vo,{children:[c.jsx(Fs,{className:i.cn(d==null?void 0:d.label,f),children:c.jsx(Hh,{icon:l,iconPosition:u,children:e})}),c.jsx(Lo,{}),c.jsx(_o,{}),c.jsx(To,{})]})}const su=a.forwardRef(function({className:t,classNames:n,variant:o,status:r,size:s,type:l,asyncState:u,onAsyncStateChange:d,onAsyncClick:f,asyncFeedbackMs:m,disabled:p,icon:C,iconPosition:S,ripple:g,iconOnly:h,groupSegment:x,asChild:A=!1,children:b,onClick:L,onPointerDown:_,onPointerEnter:v,onPointerLeave:R,onMouseDown:T,...E},I){const O=A&&a.isValidElement(b)&&a.Children.count(b)===1?b:null,N=O?O.props.children:b,y=Yh({className:t,classNames:n,variant:o,status:r,size:s,type:l,asyncState:u,onAsyncStateChange:d,onAsyncClick:f,asyncFeedbackMs:m,disabled:p,icon:C,iconPosition:S,ripple:g,iconOnly:h,groupSegment:x,children:N,onClick:L}),w=Ih({variant:y.variant,asyncState:y.asyncState,isControlled:y.isControlled,blocked:y.blocked,groupSegment:y.groupSegment,forwardedRef:I,onPointerEnter:v,onPointerLeave:R,onPointerDown:_}),P=w.createAsyncClickHandler(y.onClick,y.onAsyncClick,y.isControlled,y.internalAsync,y.setUncontrolledAsync,y.scheduleAsyncIdleReset),k={size:y.size,variant:y.variant,status:y.status,asyncState:y.asyncState,groupSegment:y.groupSegment,loaderTextClass:y.loaderTextClass,bindLabelRef:w.bindLabelRef,bindLoaderRef:w.bindLoaderRef,bindSuccessRef:w.bindSuccessRef,bindErrorRef:w.bindErrorRef,contentMotionRef:w.contentMotionRef},{hasCompoundContent:j,hasCompoundLoader:B,hasCompoundSuccess:D,hasCompoundError:F,isCompound:H}=a.useMemo(()=>({hasCompoundContent:ro(N,"ButtonContent"),hasCompoundLoader:ro(N,"ButtonLoader"),hasCompoundSuccess:ro(N,"ButtonSuccess"),hasCompoundError:ro(N,"ButtonError"),isCompound:qc(N)}),[N]),U=c.jsxs(c.Fragment,{children:[y.ripple?c.jsx(Dn,{color:y.convergeRippleColor,disabled:y.blocked||y.asyncState!=="idle",duration:i.getMotionConfig().rippleDefaultDuration,className:y.clipClass}):null,c.jsx(Qc,{ref:w.expandRippleLayerRef,clipClass:y.clipClass}),$h({children:N,isCompound:H,hasCompoundContent:j,hasCompoundLoader:B,hasCompoundSuccess:D,hasCompoundError:F,icon:y.icon,iconPosition:y.iconPosition,classNames:y.classNames,labelLayoutClass:y.labelLayoutClass})]});return c.jsx(Nh,{value:k,children:c.jsx(yh,{classNames:y.classNames,children:O?a.cloneElement(O,yt(O,{...E,className:y.buttonClass,"aria-busy":y.ariaBusy,"aria-disabled":y.blocked||void 0,tabIndex:y.blocked?-1:E.tabIndex,onPointerDown:w.handlePointerDown,onPointerEnter:w.handlePointerEnter,onPointerLeave:w.handlePointerLeave,onMouseDown:T,onClick:G=>{if(y.blocked){G.preventDefault();return}P(G)},children:U},w.setRefs)):c.jsx("button",{ref:w.setRefs,...E,type:y.type,disabled:y.blocked,"aria-busy":y.ariaBusy,className:y.buttonClass,onPointerDown:w.handlePointerDown,onPointerEnter:w.handlePointerEnter,onPointerLeave:w.handlePointerLeave,onMouseDown:T,onClick:P,children:U})})})});su.displayName="ButtonRoot";const Vt=Object.assign(su,{Content:vo,Label:Fs,Icon:Hs,Text:Gs,Loader:Lo,Success:_o,Error:To}),Xh=new Set(["default","primary","outline","secondary","ghost"]),Kh={default:"default",primary:"primary",outline:"transparent-hover",secondary:"secondary",ghost:"transparent-hover",gloss:"default"},qh={default:{convergeBg:i.colorToken("converge-ripple-neutral")},primary:{convergeBg:i.colorToken("converge-ripple-primary-fill")},outline:{convergeBg:i.colorToken("converge-ripple-neutral")},secondary:{convergeBg:i.colorToken("converge-ripple-neutral")},ghost:{convergeBg:i.colorToken("converge-ripple-neutral")},gloss:{convergeBg:i.colorToken("converge-ripple-neutral")}},au={small:{root:"h-control-xsmall w-control-xsmall",icon:"icon-small"},base:{root:"h-control-small w-control-small",icon:"icon-base"},mid:{root:"h-control-base w-control-base",icon:"icon-mid"},large:{root:"h-control-mid w-control-mid",icon:"icon-large"}},Zh="relative z-0 flex shrink-0 cursor-pointer items-center justify-center rounded-full outline-none focus-ring overflow-hidden",Qh="cursor-not-allowed opacity-50",Jh="relative z-[1] shrink-0 text-current",ex="rounded-full";function tx(e){return qh[e]}function nx({variant:e,size:t,disabled:n,className:o,slotRoot:r}){const s=e==="gloss",l=au[t];return i.cn(Zh,s?i.cn("gloss-btn",i.GLOSS_INTERACTIVE_MOTION_CLASS):i.SHADOW_LIFT_MOTION_CLASS,!n&&!s&&i.hoverVariant(Kh[e]),!s&&i.INTERACTIVE_VARIANT_ROOT[e],l.root,n&&Qh,o,r)}function ox(e,t){return i.cn(Jh,au[e].icon,t)}function rx({variant:e,disabled:t,forwardedRef:n,onPointerDown:o,onPointerEnter:r,onPointerLeave:s}){const l=Uo({isGloss:e==="gloss",enabled:!t,hasHoverShadow:Xh.has(e),useContentRef:!1,forwardedRef:n,onPointerEnter:r,onPointerLeave:s,onPointerDown:o});return{setRefs:l.setRefs,handlePointerEnter:l.handlePointerEnter,handlePointerLeave:l.handlePointerLeave,handlePointerDown:l.handlePointerDown}}const Mr=a.createContext({});function sx({classNames:e,children:t}){const n=a.useContext(Mr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Mr.Provider,{value:o,children:t})}function lu(){return a.useContext(Mr)}function ax({color:e,disabled:t,className:n}){const o=lu();return c.jsx(Dn,{color:e,disabled:t,duration:i.getMotionConfig().rippleDefaultDuration,className:i.cn(ex,o.ripple,n)})}function lx({size:e}){const t=lu();return c.jsx(be.IoClose,{"aria-hidden":!0,className:ox(e,t.icon)})}const Se={close:"Close",openSearch:"Open search",search:"Search",clearField:"Clear field",time:"Time",timeHours:"hours",timeMinutes:"minutes",timeSeconds:"seconds",openList:"Open list",closeList:"Close list",showPassword:"Show password",hidePassword:"Hide password",removeFile:"Remove file",resizeHeight:"Resize height",breadcrumbs:"Breadcrumbs",breadcrumbsShowHidden:"Show {count} hidden sections",breadcrumbsHiddenSections:"Hidden sections",pagination:"Pagination",paginationPrevious:"Back",paginationNext:"Forward",paginationPage:"Page {n}",drawerDragDownToClose:"Drag down to close",drawerDragUpToClose:"Drag up to close",drawerDragLeftToClose:"Drag left to close",drawerDragRightToClose:"Drag right to close",toastNotifications:"Notifications ({placement})",colorPickerArea:"Saturation and brightness",colorPickerAreaValue:"{saturation}% saturation, {brightness}% brightness",colorPickerContent:"Color selection",colorPickerHex:"Hex code of the color",colorPickerAlpha:"Transparency (%)",colorPickerSelected:"Selected color: {hex}"},ix={close:"Закрыть",openSearch:"Открыть поиск",search:"Поиск",clearField:"Очистить поле",time:"Время",timeHours:"часы",timeMinutes:"минуты",timeSeconds:"секунды",openList:"Открыть список",closeList:"Закрыть список",showPassword:"Показать пароль",hidePassword:"Скрыть пароль",removeFile:"Удалить файл",resizeHeight:"Изменить высоту",breadcrumbs:"Навигационная цепочка",breadcrumbsShowHidden:"Показать скрытые разделы: {count}",breadcrumbsHiddenSections:"Скрытые разделы",pagination:"Пагинация",paginationPrevious:"Назад",paginationNext:"Вперёд",paginationPage:"Страница {n}",drawerDragDownToClose:"Потяните вниз, чтобы закрыть",drawerDragUpToClose:"Потяните вверх, чтобы закрыть",drawerDragLeftToClose:"Потяните влево, чтобы закрыть",drawerDragRightToClose:"Потяните вправо, чтобы закрыть",toastNotifications:"Уведомления ({placement})",colorPickerArea:"Насыщенность и яркость",colorPickerAreaValue:"Насыщенность {saturation}%, яркость {brightness}%",colorPickerContent:"Выбор цвета",colorPickerHex:"HEX-код цвета",colorPickerAlpha:"Прозрачность (%)",colorPickerSelected:"Выбранный цвет: {hex}"};function iu(e){return e?{...Se,...e}:Se}function pn(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>{const r=t[o];return r===void 0?n:String(r)})}const cu=a.createContext(Se);function uu({children:e,labels:t}){const n=a.useMemo(()=>iu(t),[t]);return c.jsx(cu.Provider,{value:n,children:e})}function Ie(){return a.useContext(cu)}function St(e){return Ie()[e]}function cx(e,t=Se.close){return e??t}function ux({variant:e="default",size:t="base",ripple:n=!1,className:o,disabled:r,type:s="button","aria-label":l,classNames:u}){const d=St("close"),f=!!r,m=tx(e),p=nx({variant:e,size:t,disabled:f,className:o,slotRoot:u==null?void 0:u.root});return{variant:e,size:t,ripple:n,disabled:f,type:s,ariaLabel:cx(l,d),buttonClass:p,convergeRippleColor:m.convergeBg,classNames:u}}const Cn=a.forwardRef(function({variant:t,size:n,ripple:o,className:r,classNames:s,disabled:l,type:u,"aria-label":d,onPointerDown:f,onPointerEnter:m,onPointerLeave:p,...C},S){const g=ux({variant:t,size:n,ripple:o,className:r,classNames:s,disabled:l,type:u,"aria-label":d}),h=rx({variant:g.variant,disabled:g.disabled,forwardedRef:S,onPointerDown:f,onPointerEnter:m,onPointerLeave:p});return c.jsx(sx,{classNames:g.classNames,children:c.jsxs("button",{ref:h.setRefs,type:g.type,disabled:g.disabled,"aria-label":g.ariaLabel,className:g.buttonClass,onPointerEnter:h.handlePointerEnter,onPointerLeave:h.handlePointerLeave,onPointerDown:h.handlePointerDown,...C,children:[g.ripple?c.jsx(ax,{color:g.convergeRippleColor,disabled:g.disabled}):null,c.jsx(lx,{size:g.size})]})})});Cn.displayName="CloseButton";const du=a.createContext(null),Fr=a.createContext({}),Vs=a.createContext(null);function dx({value:e,children:t}){return c.jsx(du.Provider,{value:e,children:t})}function Xt(){const e=a.useContext(du);if(!e)throw new Error("Expandable components must be used inside <Expandable>.");return e}function fx({classNames:e,children:t}){const n=a.useContext(Fr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Fr.Provider,{value:o,children:t})}function Nt(){return a.useContext(Fr)}function mx({gridSlots:e,children:t}){return c.jsx(Vs.Provider,{value:e,children:t})}function px(){const e=a.useContext(Vs);if(!e)throw new Error("Expandable trigger parts must be inside <Expandable.Trigger>.");return e}function Yo(){return a.useContext(Vs)}function $o(e){return e?2:1}function Cx(e){return e.hasAction?$o(e.hasIndicator)+1:null}function gx(e){return e.hasClose?$o(e.hasIndicator)+(e.hasAction?2:1):null}function Sx(e){const{hasIndicator:t,hasAction:n,hasClose:o}=e;return t&&n&&o?"grid-cols-[auto_minmax(0,1fr)_auto_auto]":t&&(n||o)?"grid-cols-[auto_minmax(0,1fr)_auto]":t?"grid-cols-[auto_minmax(0,1fr)]":n&&o?"grid-cols-[minmax(0,1fr)_auto_auto]":n||o?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]"}const Xo={1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4"};function gn(e,t="gap-x-base"){const n=e.hasTitle&&e.hasDescription;return i.cn("grid w-full min-w-0 text-left",Sx(e),n?"grid-rows-[auto_auto] gap-y-xsmall":"grid-rows-[auto]",t)}function Ft(e){return e.hasIndicator?"col-start-1 row-start-1 self-center shrink-0":"hidden"}function Sn(e){return i.cn("row-start-1 self-center min-w-0 max-w-full justify-self-start",Xo[$o(e.hasIndicator)])}function kn(e){return i.cn(e.hasTitle?"row-start-2":"row-start-1","min-w-0 w-full max-w-full justify-self-stretch self-start",Xo[$o(e.hasIndicator)])}function Bn(e){const t=Cx(e);return t==null?"hidden":i.cn("row-start-1 self-center shrink-0 justify-self-end",Xo[t])}function fu(e){const t=gx(e);return t==null?"hidden":i.cn("row-start-1 self-center shrink-0 justify-self-end",Xo[t])}const Ui="data-chevron-init";function go(e,t){$.set(e,{rotation:t?180:0})}function hx(e,t){return n=>{e.current=n,n&&!n.hasAttribute(Ui)&&(n.setAttribute(Ui,""),go(n,t))}}function Kt(e,t,n=()=>!0,o){const r=a.useRef(e),s=a.useRef(void 0),l=i.usePrefersReducedMotion(),u=a.useMemo(()=>hx(t,r.current),[t]);return a.useLayoutEffect(()=>{const d=t.current;if(!d)return;if(o!=null&&o.current){o.current=!1,s.current=e,go(d,e);return}const f=l||!n();if(s.current===void 0){s.current=e,go(d,e);return}if(s.current!==e){if(s.current=e,i.killMotion(d),f){go(d,e);return}$.to(d,{rotation:e?180:0,...i.motionInteractive(),overwrite:"auto"})}},[e,t,n,o,l]),u}function Eo(e){return e.scrollHeight}function xx(e,t){const n=Eo(t),o=e.getBoundingClientRect().height;if(n<=0){$.set(e,{clearProps:"height"}),e.style.removeProperty("overflow");return}if(Math.abs(n-o)<=.5){requestAnimationFrame(()=>{requestAnimationFrame(()=>{$.set(e,{clearProps:"height"}),e.style.removeProperty("height"),e.style.removeProperty("overflow")})});return}e.style.height=`${n}px`,e.style.overflow="hidden",requestAnimationFrame(()=>{requestAnimationFrame(()=>{$.set(e,{clearProps:"height"}),e.style.removeProperty("height"),e.style.removeProperty("overflow")})})}function So(e,t){t?($.set(e,{clearProps:"height"}),e.style.removeProperty("height"),e.style.removeProperty("overflow")):(e.style.height="0px",e.style.overflow="hidden")}const Wi="data-collapsible-init";function mu(e,t){const n=a.useRef(t);return a.useCallback(o=>{e.current=o,o&&!o.hasAttribute(Wi)&&(o.setAttribute(Wi,""),So(o,n.current))},[e])}function pu(e,t,n,o){const r=a.useRef((o==null?void 0:o.enabled)??(()=>i.isMotionFeatureEnabled("enableExpandable")));r.current=(o==null?void 0:o.enabled)??(()=>i.isMotionFeatureEnabled("enableExpandable"));const s=o==null?void 0:o.skipAnimRef,l=a.useRef(void 0),u=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const d=t.current,f=n.current;if(!d||!f)return;const m=u||!r.current();if(l.current===void 0){l.current=e,So(d,e);return}if(s!=null&&s.current){s.current=!1,l.current=e,So(d,e);return}if(l.current!==e){if(l.current=e,i.killMotion(d),m){So(d,e);return}if(e)d.style.overflow="hidden",$.fromTo(d,{height:0},{height:()=>Eo(f),...i.motionExpand(),overwrite:"auto",onComplete:()=>xx(d,f)});else{const p=d.getBoundingClientRect().height||Eo(f);d.style.height=`${p}px`,d.style.overflow="hidden",$.to(d,{height:0,...i.motionExpand(),overwrite:"auto",onComplete:()=>{d.style.height="0px",d.style.overflow="hidden"}})}}},[e,t,n,s,u])}function bx({open:e,disabled:t,toggle:n,forwardedRef:o,onClick:r,onKeyDown:s,onPointerDown:l}){const u=a.useRef(null),d=a.useRef(null),f=Kt(e,d,()=>i.isMotionFeatureEnabled("enableExpandable"));a.useEffect(()=>{const g=u.current;return()=>{g&&i.killMotion(g)}},[]),a.useEffect(()=>{if(!t)return;const g=u.current;g&&i.killMotion(g)},[t]);const m=a.useCallback(g=>{ue(o,g)},[o]),p=a.useCallback(g=>{r==null||r(g),!(g.defaultPrevented||t)&&n()},[t,r,n]),C=a.useCallback(g=>{s==null||s(g),!(g.defaultPrevented||t)&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n())},[t,s,n]),S=a.useCallback(g=>{if(!t){const h=u.current;h&&!i.prefersReducedMotion()&&i.animateInteractivePressSqueeze(h)}l==null||l(g)},[t,l]);return{liftSpanRef:u,bindChevronRef:f,setTriggerRef:m,handleClick:p,handleKeyDown:C,handlePointerDown:S}}function Ax(e){const t=a.useRef(null),n=a.useRef(null),o=mu(t,e);return pu(e,t,n),{shellRef:t,innerRef:n,bindShellRef:o}}const vx=new Set(["ExpandableIcon","Accordion.Icon"]),Lx=new Set(["ExpandableTitle","Accordion.Title"]),_x=new Set(["ExpandableDescription","Accordion.Description"]),Tx=new Set(["ExpandableChevron","Accordion.Chevron"]),Ex=new Set(["ExpandableMessage","Accordion.Message"]),Rx=new Set(["ExpandableTrigger","ExpandablePanel","ExpandableMessage","Accordion.Trigger","Accordion.Panel","Accordion.Message","Accordion.Heading"]);function Ix(...e){return t=>{for(const n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function zs(e){return e.displayName}function yx(e){const t=[],n=[];return a.Children.forEach(e,o=>{a.isValidElement(o)&&o.type===Dn?t.push(o):n.push(o)}),{ripples:t,rest:n}}function Nx(e){let t=!1;return a.Children.forEach(e,n=>{if(t||!a.isValidElement(n))return;const o=zs(n.type);o!=null&&Ex.has(o)&&(t=!0)}),t}function wx(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;const s=zs(r.type);if(s!=null&&Rx.has(s)){t=!0;return}n(r.props.children)}};return n(e),t}function Ko(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=zs(s.type);if(l!=null&&t.has(l)){n=!0;return}o(s.props.children)}};return o(e),n}function Ox(e){return Ko(e,vx)}function Px(e){return Ko(e,Lx)}function Dx(e){return Ko(e,_x)}function Cu(e){return Ko(e,Tx)}function kx({children:e,hideChevron:t,hasPanel:n}){const o=Cu(e),r=n&&!t&&!o;return{hasIndicator:Ox(e),hasTitle:Px(e),hasDescription:Dx(e),hasAction:r||o,hasClose:!1}}const Bx="rounded-mid text-left text-foreground",jx="border-token bg-surface shadow-token-base",Mx="gloss-panel gloss-deep border-0",Fx="gloss-content flex min-w-0 flex-col",Hx="relative w-full overflow-hidden rounded-[inherit] text-left outline-none focus-ring",Gx="cursor-not-allowed opacity-50",Vx="cursor-pointer",zx="relative z-[1] w-full min-w-0 origin-center",gu="contents",Su="relative z-[1] flex shrink-0 origin-center self-center",Ux=gu,Wx="shrink-0 text-primary [&_svg]:size-full",Yx=gu,$x="text-muted",Xx="font-w-mid",Kx=Su,qx="overflow-hidden",Zx="pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]";function Qx({variant:e,className:t,slotClass:n}){return i.cn(Bx,e==="gloss"?Mx:jx,n,t)}function Jx({size:e,disabled:t,className:n,slotClass:o}){return i.cn(Hx,It(e).triggerPadding,t?Gx:Vx,o,n)}function eb({gridSlots:e,slotClass:t}){return i.cn(zx,gn(e),t)}function tb({size:e,className:t,slotClass:n}){return i.cn(Wx,i.CONTROL_SIZE_LAYOUT[e].icon,n,t)}function nb({size:e,className:t,slotClass:n}){return i.cn(It(e).contentPadding,"text-left",n,t)}function ob(e){return i.CONTROL_SIZE_LAYOUT[e].chevronIcon}function rb(e){return i.CONTROL_SIZE_LAYOUT[e].chevronIcon}function sb(e){return It(e).titleVariant}function ab(e){return It(e).titleClassName}function lb(e){return It(e).descVariant}function hu({className:e}){return c.jsx("svg",{className:i.cn("shrink-0",e),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"m6 9 6 6 6-6"})})}const Us=a.forwardRef(function({className:t,...n},o){const r=Nt();return c.jsx("div",{ref:o,className:i.cn(Ux,r.message,t),...n})});Us.displayName="ExpandableMessage";const Ws=a.forwardRef(function({hideChevron:t=!1,asChild:n,className:o,onClick:r,onKeyDown:s,onPointerDown:l,children:u,type:d="button",...f},m){const{open:p,disabled:C,hasPanel:S,size:g,toggle:h,headerId:x,panelId:A}=Xt(),b=Nt(),L=bx({open:p,disabled:C,toggle:h,forwardedRef:m,onClick:r,onKeyDown:s,onPointerDown:l}),{ripples:_,rest:v}=a.useMemo(()=>yx(u),[u]),R=a.useMemo(()=>kx({children:v,hideChevron:t,hasPanel:S}),[v,t,S]),T=Nx(v)?c.jsx(c.Fragment,{children:v}):c.jsx(Us,{children:v}),E=S&&!t&&!Cu(v),I=_.length>0?c.jsx("span",{className:i.cn(Zx,b.triggerRippleOverlay),"aria-hidden":!0,children:_}):null,O=c.jsxs(c.Fragment,{children:[T,E?c.jsx("span",{ref:L.bindChevronRef,className:i.cn(Bn(R),Su,b.chevron),"aria-hidden":!0,children:c.jsx(hu,{className:rb(g)})}):null]});if(n&&a.isValidElement(u)){const N=u;return a.cloneElement(N,{...f,id:x,ref:Ix(m,N.props.ref),className:i.cn(N.props.className,o),disabled:C||N.props.disabled,"aria-expanded":S?p:void 0,"aria-controls":S?A:void 0,onClick:y=>{var w,P;(P=(w=N.props).onClick)==null||P.call(w,y),L.handleClick(y)},onKeyDown:y=>{var w,P;(P=(w=N.props).onKeyDown)==null||P.call(w,y),L.handleKeyDown(y)}})}return c.jsxs("button",{ref:L.setTriggerRef,type:d,id:x,className:Jx({size:g,disabled:C,className:o,slotClass:b.trigger}),"aria-expanded":S?p:void 0,"aria-controls":S?A:void 0,disabled:C,onPointerDown:L.handlePointerDown,onClick:L.handleClick,onKeyDown:L.handleKeyDown,...f,children:[I,c.jsx(mx,{gridSlots:R,children:c.jsx("span",{ref:L.liftSpanRef,className:eb({gridSlots:R,slotClass:b.triggerLift}),children:O})})]})});Ws.displayName="ExpandableTrigger";function Ys({className:e,children:t,...n}){const{size:o}=Xt(),r=Nt(),s=Yo();return t==null?null:c.jsx("span",{"aria-hidden":!0,className:i.cn(tb({size:o,className:e,slotClass:r.icon}),s&&Ft(s)),...n,children:t})}Ys.displayName="ExpandableIcon";function xu({className:e,...t}){const n=Nt();return c.jsx("div",{className:i.cn(Yx,n.content,e),...t})}xu.displayName="ExpandableContent";function $s({className:e,...t}){const{size:n}=Xt(),o=Nt(),r=Yo();return c.jsx(q,{as:"div",variant:sb(n),className:i.cn(Xx,ab(n),r&&Sn(r),o.title,e),...t})}$s.displayName="ExpandableTitle";function Xs({className:e,...t}){const{size:n}=Xt(),o=Nt(),r=Yo();return c.jsx(q,{as:"div",variant:lb(n),className:i.cn($x,r&&kn(r),o.description,e),...t})}Xs.displayName="ExpandableDescription";function bu({className:e,...t}){const{open:n,hasPanel:o,size:r}=Xt(),s=Nt(),l=px(),u=a.useRef(null),d=Kt(n,u,()=>i.isMotionFeatureEnabled("enableExpandable"));return o?c.jsx("span",{ref:d,className:i.cn(Bn(l),Kx,s.chevron,e),"aria-hidden":!0,...t,children:c.jsx(hu,{className:ob(r)})}):null}bu.displayName="ExpandableChevron";const Ks=a.forwardRef(function({className:t,children:n,...o},r){const{open:s,headerId:l,panelId:u,size:d,setHasPanel:f}=Xt(),m=Nt(),p=Ax(s);a.useLayoutEffect(()=>(f(!0),()=>f(!1)),[f]);const C=a.useCallback(S=>{typeof r=="function"?r(S):r&&(r.current=S)},[r]);return c.jsx("div",{ref:p.bindShellRef,className:i.cn(qx,m.panelShell),children:c.jsx("div",{ref:p.innerRef,children:c.jsx("section",{ref:C,id:u,"aria-labelledby":l,"aria-hidden":!s,inert:!s,className:nb({size:d,className:t,slotClass:m.panel}),...o,children:n})})})});Ks.displayName="ExpandablePanel";function ib({title:e,description:t,icon:n,panelChildren:o}){return c.jsxs(c.Fragment,{children:[c.jsxs(Ws,{children:[n!=null?c.jsx(Ys,{children:n}):null,e!=null?c.jsx($s,{children:e}):null,t!=null?c.jsx(Xs,{children:t}):null]}),o!=null?c.jsx(Ks,{children:o}):null]})}function cb({children:e,compound:t,defaultOpen:n=!1,open:o,onOpenChange:r,disabled:s=!1,size:l="base",variant:u="default"}){const d=a.useId(),f=a.useId(),m=o!==void 0,[p,C]=a.useState(n),[S,g]=a.useState(!1),h=a.useCallback(_=>{g(_)},[]),x=m?o:p,A=a.useCallback(()=>{if(s||!S)return;const _=!x;m||C(_),r==null||r(_)},[m,s,S,x,r]),b={open:x,disabled:s,hasPanel:S,size:l,variant:u,toggle:A,headerId:f,panelId:d,setHasPanel:h},L=t===!0||wx(e);return{contextValue:b,isCompound:L,isGloss:u==="gloss"}}const Au=a.forwardRef(function({children:t,compound:n,title:o,description:r,icon:s,variant:l="default",size:u="base",defaultOpen:d=!1,open:f,onOpenChange:m,disabled:p=!1,className:C,classNames:S,...g},h){const x=cb({children:t,compound:n,defaultOpen:d,open:f,onOpenChange:m,disabled:p,size:u,variant:l}),A=i.useMergedGlossPanelRef(h,x.isGloss),b=x.isCompound?t:c.jsx(ib,{title:o,description:r,icon:s,panelChildren:t});return c.jsx(dx,{value:x.contextValue,children:c.jsx(fx,{classNames:S,children:c.jsx("div",{ref:A,className:Qx({variant:l,className:C,slotClass:S==null?void 0:S.root}),...g,children:x.isGloss?c.jsx("div",{className:i.cn(Fx,S==null?void 0:S.glossContent),children:b}):b})})})});Au.displayName="ExpandableRoot";const ht=Object.assign(Au,{Trigger:Ws,Message:Us,Icon:Ys,Content:xu,Title:$s,Description:Xs,Chevron:bu,Panel:Ks}),jn=a.createContext(null),Hr=a.createContext({});function ub({classNames:e,children:t}){const n=a.useContext(Hr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Hr.Provider,{value:o,children:t})}function hn(){return a.useContext(Hr)}const qs={danger:be.IoCloseCircleOutline,success:be.IoCheckmarkCircleOutline,info:be.IoInformationCircleOutline,warning:be.IoWarning};function Zs(e){return e??"default"}function Qs(e){return e??"default"}function Mn(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function db(e){return Mn(e,t=>t==="AlertTitle")}function fb(e){return Mn(e,t=>t==="AlertDescription")}function mb(e){return Mn(e,t=>t==="AlertIndicator")}function vu(e,t){for(const n of a.Children.toArray(e)){if(!a.isValidElement(n))continue;n.type.displayName==="AlertIndicator"&&t(n.props),vu(n.props.children,t)}}function pb(e,t,n,o){const r=o??t;return n===null?!1:n!==void 0||r!=="default"?!0:e==="outline"}function Cb(e,t,n){if(!mb(e))return!1;let o=!1;return vu(e,r=>{pb(t,n,r.children,r.status)&&(o=!0)}),o}function gb(e){return Mn(e,t=>t==="AlertAction")}const Sb=new Set(["AlertMessage","AlertIndicator","AlertContent","AlertTitle","AlertDescription","AlertAction"]);function hb(e){return Mn(e,t=>t!=null&&Sb.has(t))}function Js(e,t){return t!=="default"?!0:e==="outline"}function ea(e,t){return t!=="default"?qs[t]:e==="outline"?be.IoHelpCircleOutline:null}function xb(e,t,n,o,r){return o?Cb(r,e,t):n===null?!1:n!==void 0?!0:Js(e,t)&&ea(e,t)!==null}const bb={default:"bg-surface border-token text-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground"};function Lu(e,t="default"){return e==="gloss"?"gloss-panel border-0 text-foreground":bb[e]}function _u(e){return e!=="default"?i.SEMANTIC_STATUS_TEXT[e]:"text-primary"}const Ab="inline-flex shrink-0 items-center justify-center";function vb(e,t){return i.cn(Ab,t,_u(e))}const Tu="contents",Lb="font-w-mid";function _b(e){return i.cn(Lb,e!=="default"?i.SEMANTIC_STATUS_TEXT[e]:"")}const Tb="text-muted";function ta({status:e,className:t="",children:n,...o}){const r=a.useContext(jn),s=hn(),l=(r==null?void 0:r.variant)??"default",u=e??(r==null?void 0:r.status)??"default",d=(r==null?void 0:r.sizePreset)??pt("base"),f=r==null?void 0:r.gridSlots;if(n===null)return null;const m=ea(l,u),p=n!==void 0?n:Js(l,u)&&m!==null?c.jsx(m,{"aria-hidden":!0}):null;return p===null?null:c.jsx("span",{className:i.cn(vb(u,d.iconSvgClass),f&&Ft(f),s.indicator,t),...o,children:p})}ta.displayName="AlertIndicator";function Eu({className:e="",...t}){const n=hn();return c.jsx("div",{className:i.cn(Tu,n.content,e),...t})}Eu.displayName="AlertContent";const Ru=a.forwardRef(function({className:t="",...n},o){const r=hn();return c.jsx("div",{ref:o,className:i.cn(Tu,r.message,t),...n})});Ru.displayName="AlertMessage";function na({className:e="",id:t,...n}){const o=a.useContext(jn),r=hn(),s=(o==null?void 0:o.sizePreset)??pt("base"),l=(o==null?void 0:o.status)??"default";return c.jsx(q,{as:"div",id:t??(o==null?void 0:o.titleId),variant:s.titleVariant,className:i.cn(_b(l),(o==null?void 0:o.gridSlots)&&Sn(o.gridSlots),r.title,e),...n})}na.displayName="AlertTitle";function oa({className:e="",id:t,...n}){const o=a.useContext(jn),r=hn(),s=(o==null?void 0:o.sizePreset)??pt("base");return c.jsx(q,{as:"div",id:t??(o==null?void 0:o.descriptionId),variant:s.descVariant,className:i.cn(Tb,(o==null?void 0:o.gridSlots)&&kn(o.gridSlots),r.description,e),...n})}oa.displayName="AlertDescription";function ra({className:e="",...t}){const n=a.useContext(jn),o=hn();return c.jsx("div",{className:i.cn((n==null?void 0:n.gridSlots)&&Bn(n.gridSlots),o.action,e),...t})}ra.displayName="AlertAction";function Eb({gridSlots:e,title:t,description:n,icon:o,action:r,children:s}){return c.jsxs(c.Fragment,{children:[e.hasIndicator?c.jsx(ta,{children:o}):null,t!=null?c.jsx(na,{children:t}):null,n!=null?c.jsx(oa,{children:n}):null,s,r!=null?c.jsx(ra,{children:r}):null]})}function Rb({variant:e,status:t,hoverLift:n=!0,ref:o,onPointerOver:r,onPointerOut:s}){const l=e==="gloss",u=n,d=a.useRef(null),f=a.useMemo(()=>i.createGlossInteractiveRefCallback(d,u&&l),[l,u]),m=a.useCallback(x=>{f(x),d.current=x,typeof o=="function"?o(x):o&&(o.current=x)},[f,o]),p=i.useGlossInteractiveHandlers(d,u&&l),C=i.useSecondLevelShadow(d,u&&!l),S=u?l?i.GLOSS_INTERACTIVE_MOTION_CLASS:C.motionClass:"",g=i.cn(Lu(e,t),S),h=a.useMemo(()=>({onPointerOver:x=>{r==null||r(x),!(x.defaultPrevented||!u)&&(l?p.onPointerOver(x):C.onPointerEnter(x))},onPointerOut:x=>{s==null||s(x),u&&(l?p.onPointerOut(x):C.onPointerLeave(x))}}),[p.onPointerOut,p.onPointerOver,l,u,s,r,C.onPointerEnter,C.onPointerLeave]);return{setRootRef:m,surfaceClass:g,pointerHandlers:h}}function Iu(e,t){return t??(e==="danger"||e==="warning"?"alert":"status")}function Ib(e,t,n,o){if(n)return e;if(o)return t}function yb(e,t,n){if(t&&n)return e}function Nb(e,t,n,o,r,s,l,u){return{hasIndicator:xb(e,t,n,r,s),hasTitle:l,hasDescription:u,hasAction:r?gb(s):o!=null,hasClose:!1}}function wb({variant:e,status:t,size:n,role:o,title:r,description:s,icon:l,action:u,children:d,ariaLabelledByProp:f,ariaDescribedByProp:m}){const p=Zs(e),C=Qs(t),S=Ms(n),g=pt(S),h=a.useId(),x=`${h}-title`,A=`${h}-description`,b=a.useMemo(()=>hb(d),[d]),L=a.useMemo(()=>r!=null||db(d),[d,r]),_=a.useMemo(()=>s!=null||fb(d),[d,s]),v=a.useMemo(()=>Nb(p,C,l,u,b,d,L,_),[u,d,_,L,l,b,C,p]),R=Iu(C,o),T=f??Ib(x,A,L,_),E=m??yb(A,L,_),I=a.useMemo(()=>({variant:p,status:C,size:S,sizePreset:g,titleId:x,descriptionId:A,gridSlots:v}),[A,v,S,g,C,x,p]);return{variant:p,status:C,size:S,sizePreset:g,isCompound:b,gridSlots:v,liveRole:R,ariaLabelledBy:T,ariaDescribedBy:E,contextValue:I}}const yu=a.forwardRef(function({variant:t="default",status:n,size:o="base",role:r,title:s,description:l,icon:u,action:d,classNames:f,hoverLift:m=!0,className:p="",children:C,onPointerOver:S,onPointerOut:g,"aria-labelledby":h,"aria-describedby":x,...A},b){const{isCompound:L,gridSlots:_,sizePreset:v,liveRole:R,ariaLabelledBy:T,ariaDescribedBy:E,contextValue:I}=wb({variant:t,status:n,size:o,role:r,title:s,description:l,icon:u,action:d,children:C,ariaLabelledByProp:h,ariaDescribedByProp:x}),{setRootRef:O,surfaceClass:N,pointerHandlers:y}=Rb({variant:I.variant,status:I.status,hoverLift:m,ref:b,onPointerOver:S,onPointerOut:g});return c.jsx(jn.Provider,{value:I,children:c.jsx(ub,{classNames:f,children:c.jsx("div",{ref:O,role:R,"aria-labelledby":T,"aria-describedby":E,className:i.cn(gn(_,v.gridGap),sh(o),N,f==null?void 0:f.root,p),...y,...A,children:L?C:c.jsx(Eb,{gridSlots:_,title:s,description:l,icon:u,action:d,children:C})})})})});yu.displayName="AlertRoot";const Ob=Object.assign(yu,{Indicator:ta,Message:Ru,Content:Eu,Title:na,Description:oa,Action:ra}),Nu=a.createContext(null),Gr=a.createContext({});function Pb(){const e=a.useContext(Nu);if(!e)throw new Error("Accordion components must be inside <Accordion>.");return e}function wu({classNames:e,children:t}){const n=a.useContext(Gr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Gr.Provider,{value:o,children:t})}function sa(){return a.useContext(Gr)}function Db(){return"h3"}function Ou(){return{"aria-hidden":!0}}function kb(e){const t=a.useRef(null);return Kt(e,t,()=>i.isMotionFeatureEnabled("enableExpandable"))}function Bb(e,t){return e??(t!=null?String(t):null)}function jb(e){return{root:e.item,glossContent:e.glossContent,trigger:e.trigger,triggerLift:e.triggerLift,message:e.message,icon:e.icon,content:e.content,title:e.title,description:e.description,chevron:e.chevron,panelShell:e.panelShell,panel:e.panel}}function Mb({className:e,slotClass:t}){return i.cn("flex w-full flex-col text-left","[&>[data-accordion-item]:first-child]:!rounded-t-mid","[&>[data-accordion-item]:last-child]:!rounded-b-mid","[&>[data-accordion-item]:not(:first-child)]:-mt-px",t,e)}function Fb(e){return i.cn("relative !rounded-none",e)}function Hb({className:e,slotClass:t}){return i.cn("m-0 font-[inherit] text-[inherit]",t,e)}function Gb({className:e,slotClass:t}){return i.cn("relative z-[1] flex shrink-0 origin-center self-center",t,e)}function Vb(e){return i.cn("text-muted",e)}const zb="shrink-0";function Ub({className:e=""}){return c.jsx("svg",{className:i.cn(zb,e),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...Ou(),children:c.jsx("path",{d:"m6 9 6 6 6-6"})})}const Pu=a.forwardRef(function({value:t,disabled:n,classNames:o,className:r,children:s,...l},u){const{value:d,setValue:f,getItemId:m,size:p}=Pb(),C=sa(),S=a.useMemo(()=>({...C,...o}),[C,o]),g=m(t),h=d===g;return c.jsx(wu,{classNames:o,children:c.jsx(ht,{ref:u,compound:!0,size:p,"data-accordion-item":!0,disabled:n,open:h,onOpenChange:x=>f(x?g:null),className:Fb(r),classNames:jb(S),...l,children:s})})});Pu.displayName="Accordion.Item";function Du({className:e,children:t,...n}){const o=sa(),r=Db();return c.jsx(r,{className:Hb({className:e,slotClass:o.heading}),...n,children:t})}Du.displayName="Accordion.Heading";const ku=a.forwardRef(function({hideChevron:t=!0,className:n,...o},r){return c.jsx(ht.Trigger,{ref:r,hideChevron:t,className:n,...o})});ku.displayName="Accordion.Trigger";function Bu(e){return c.jsx(ht.Message,{...e})}Bu.displayName="Accordion.Message";function ju(e){return c.jsx(ht.Icon,{...e})}ju.displayName="Accordion.Icon";function Mu(e){return c.jsx(ht.Content,{...e})}Mu.displayName="Accordion.Content";function Fu(e){return c.jsx(ht.Title,{...e})}Fu.displayName="Accordion.Title";function Hu(e){return c.jsx(ht.Description,{...e})}Hu.displayName="Accordion.Description";function Gu({className:e,children:t,...n}){const{open:o,hasPanel:r}=Xt(),s=sa(),l=kb(o),u=Yo();return r?c.jsx("span",{ref:l,className:i.cn(u&&Bn(u),Gb({className:e,slotClass:s.chevron})),...Ou(),...n,children:t??c.jsx(Ub,{})}):null}Gu.displayName="Accordion.Chevron";const Vu=a.forwardRef(function(t,n){return c.jsx(ht.Panel,{ref:n,...t})});Vu.displayName="Accordion.Panel";function zu({className:e,...t}){return c.jsx(q,{as:"div",variant:"base",className:Vb(e),...t})}zu.displayName="Accordion.Body";function Wb({defaultValue:e=null,defaultOpenIndex:t=null,value:n,onValueChange:o,size:r="base"}){const s=n!==void 0,l=Bb(e,t),[u,d]=a.useState(l),f=s?n:u,m=a.useRef(0);m.current=0;const p=a.useCallback(g=>{if(g!=null)return g;const h=String(m.current);return m.current+=1,h},[]),C=a.useCallback(g=>{s||d(g),o==null||o(g)},[s,o]);return{contextValue:a.useMemo(()=>({value:f,setValue:C,getItemId:p,size:r}),[p,f,C,r])}}const Uu=a.forwardRef(function({defaultValue:t=null,defaultOpenIndex:n=null,value:o,onValueChange:r,size:s="base",className:l,classNames:u,children:d,...f},m){const{contextValue:p}=Wb({defaultValue:t,defaultOpenIndex:n,value:o,onValueChange:r,size:s});return c.jsx(Nu.Provider,{value:p,children:c.jsx(wu,{classNames:u,children:c.jsx("div",{ref:m,className:Mb({className:l,slotClass:u==null?void 0:u.root}),...f,children:d})})})});Uu.displayName="Accordion";const Yb=Object.assign(Uu,{Item:Pu,Heading:Du,Trigger:ku,Message:Bu,Icon:ju,Content:Mu,Title:Fu,Description:Hu,Chevron:Gu,Panel:Vu,Body:zu});function Wu(e){return e?!0:void 0}function $b({descriptionId:e,errorSummaryId:t,hasErrors:n}){const o=[e,n?t:void 0].filter(Boolean);return o.length>0?o.join(" "):void 0}function Xb(e){return e<=0?"":e===1?"Fix the error in the form":`Fix ${e} errors in the form`}function Kb(){return"Form submitted successfully"}function Yi(e,t){const n=Object.keys(t)[0];if(n==null)return;const o=e.get(n);o==null||o.focus()}function Nr(e){return Object.keys(e).length}function qb(e){return Object.entries(e)}function Zb(e,t,n){if(!t.includes("."))return{...e,[t]:n};const o=t.split("."),r={...e};let s=r;for(let l=0;l<o.length-1;l+=1){const u=o[l],d=s[u],f=d!=null&&typeof d=="object"&&!Array.isArray(d)?{...d}:{};s[u]=f,s=f}return s[o[o.length-1]]=n,r}function Qb(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:!1}function wr(e,t,n){if(n!=null){if(n.required){const o=typeof n.required=="string"?n.required:"Required field";if(typeof e=="boolean"){if(!e)return o}else if(Qb(e))return o}if(typeof e=="string"){if(n.minLength&&e.length<n.minLength.value)return n.minLength.message;if(n.maxLength&&e.length>n.maxLength.value)return n.maxLength.message;if(n.pattern&&!n.pattern.value.test(e))return n.pattern.message}if(n.validate)return n.validate(e,t)}}function Yu(...e){const t={};for(const n of e)n!=null&&Object.assign(t,n);return Object.keys(t).length>0?t:void 0}function Jb(e,t){if(e==null||typeof e!="object"||!("target"in e))return e;const n=e.target;if(n instanceof HTMLInputElement)return t==="checkbox"?n.checked:t==="number"?n.value===""?void 0:Number(n.value):n.value}function eA(e,t){return i.cn("flex w-full max-w-full flex-col gap-large text-left",t==null?void 0:t.root,e)}function tA(e,t){return i.cn("flex flex-col gap-base",t==null?void 0:t.section,e)}function nA(e,t){return i.cn("text-base font-w-mid text-foreground",t==null?void 0:t.title,e)}function oA(e,t){return i.cn("text-base text-muted",t==null?void 0:t.description,e)}function rA(e,t){return i.cn("flex flex-wrap items-center justify-end gap-small pt-small",t==null?void 0:t.actions,e)}function sA(e,t){return i.cn("sr-only",t==null?void 0:t.errorSummary,e)}function aA(e,t){return i.cn("sr-only",t==null?void 0:t.announce,e)}function lA(e,t){return i.cn(e,t==null?void 0:t.field)}const $u=a.forwardRef(function({className:t="",classNames:n,...o},r){const s=$t();return c.jsx("div",{ref:r,className:tA(t,{...s,section:n==null?void 0:n.section}),...o})});$u.displayName="Form.Section";const Xu=a.forwardRef(function({className:t="",id:n,...o},r){const s=$t(),l=Wo();return c.jsx(q,{ref:r,as:"h2",variant:"mid",id:n??(l==null?void 0:l.titleId),className:nA(t,s),...o})});Xu.displayName="Form.Title";const Ku=a.forwardRef(function({className:t="",id:n,...o},r){const s=$t(),l=Wo();return c.jsx("p",{ref:r,id:n??(l==null?void 0:l.descriptionId),className:oA(t,s),...o})});Ku.displayName="Form.Description";const qu=a.forwardRef(function({className:t="",...n},o){const r=$t();return c.jsx("div",{ref:o,className:rA(t,r),...n})});qu.displayName="Form.Actions";const aa=a.forwardRef(function({className:t="",id:n,children:o,...r},s){const l=$t(),u=Wo(),d=et(),f=(d==null?void 0:d.getErrors())??{},m=qb(f);if(m.length===0)return null;const p=typeof o=="function"?o(m):o??m.map(([,C])=>C).join(". ");return c.jsx("div",{ref:s,id:n??(u==null?void 0:u.errorSummaryId),role:"alert",className:sA(t,l),...r,children:p})});aa.displayName="Form.ErrorSummary";const la=a.forwardRef(function({className:t="",id:n,message:o,...r},s){const l=$t(),u=Wo();return o?c.jsx("div",{ref:s,id:n??(u==null?void 0:u.announceId),role:"status","aria-live":"polite","aria-atomic":"true",className:aA(t,l),...r,children:o}):null});la.displayName="Form.Announce";const Zu=a.forwardRef(function({name:t,rules:n,className:o="",classNames:r,children:s,...l},u){const d=$t(),f=et();return a.useEffect(()=>{if(!(!f||!n))return f.registerFieldRules(t,n),()=>f.unregisterFieldRules(t)},[f,t,n]),c.jsx("div",{ref:u,className:lA(o,{...d,field:r==null?void 0:r.field}),...l,children:s})});Zu.displayName="Form.Field";function iA({defaultValues:e,values:t,onValuesChange:n,rules:o,resolver:r,validateMode:s="onSubmit",disabled:l=!1,readOnly:u=!1,size:d,onSubmit:f,onSubmitError:m}){const p=a.useId(),C=a.useId(),S=a.useId(),g=a.useId(),h={titleId:p,descriptionId:C,errorSummaryId:S,announceId:g},x=t!==void 0,[A,b]=a.useState(e??{}),L=x?t:A,[_,v]=a.useState({}),[R,T]=a.useState({}),[E,I]=a.useState(0),[O,N]=a.useState(!1),[y,w]=a.useState(null),P=a.useRef(new Map),k=a.useRef(o??{});k.current=o??{};const j=a.useCallback(z=>{x||b(z),n==null||n(z)},[x,n]),B=a.useCallback(z=>z.split(".").reduce((te,me)=>{if(!(te==null||typeof te!="object"))return te[me]},L),[L]),D=a.useCallback((z,Q,te)=>{const me=Zb(L,z,Q);if(j(me),te!=null&&te.shouldValidate){const Ae=wr(Q,me,k.current[z]);v(he=>{const X={...he};return Ae?X[z]=Ae:delete X[z],X})}},[j,L]),F=a.useCallback(z=>_[z],[_]),H=a.useCallback(()=>_,[_]),U=a.useCallback(z=>k.current[z],[]),G=a.useCallback((z,Q)=>{T(te=>({...te,[z]:Q}))},[]),K=a.useCallback(z=>!!R[z],[R]),V=a.useCallback((z,Q)=>{Q?P.current.set(z,Q):P.current.delete(z)},[]),oe=a.useCallback((z,Q)=>{Q!=null&&(k.current={...k.current,[z]:Q})},[]),J=a.useCallback(z=>{const Q={...k.current};delete Q[z],k.current=Q},[]),ee=a.useCallback(z=>{const Q=wr(B(z),L,k.current[z]);return v(te=>{const me={...te};return Q?me[z]=Q:delete me[z],me}),Q},[B,L]),se=a.useCallback(()=>{const z={};for(const Q of Object.keys(k.current)){const te=wr(B(Q),L,k.current[Q]);te&&(z[Q]=te)}return v(z),z},[B,L]),M=a.useCallback(()=>{Yi(P.current,_)},[_]),W=a.useCallback(()=>w(null),[]),Y=a.useMemo(()=>({disabled:l,readOnly:u,size:d,validateMode:s,isSubmitting:O,submitCount:E,getValue:B,setValue:D,getError:F,getErrors:H,getFieldRules:U,setTouched:G,isTouched:K,registerRef:V,registerFieldRules:oe,unregisterFieldRules:J,validateField:ee,validateForm:se,focusFirstInvalid:M,announce:y,clearAnnounce:W}),[y,W,l,M,F,H,U,B,O,K,u,V,oe,J,G,D,d,E,ee,se,s]),Z=a.useCallback(async z=>{z.preventDefault(),I(te=>te+1),w(null);let Q=se();if(r){const te=await r(L);te.errors&&(Q={...Q,...te.errors},v(Q))}if(Nr(Q)>0){w(Xb(Nr(Q))),Yi(P.current,Q),m==null||m(Q);return}if(f)try{N(!0),await f(L),w(Kb())}finally{N(!1)}},[f,m,r,se,L]),ce=Nr(_)>0;return{shellIds:h,bindingValue:Y,handleSubmit:Z,errors:_,hasErrors:ce,isSubmitting:O,announce:y}}const Qu=a.forwardRef(function({children:t,className:n="",classNames:o,defaultValues:r,values:s,onValuesChange:l,rules:u,resolver:d,validateMode:f,readOnly:m,size:p,disabled:C,onSubmit:S,onSubmitError:g,errorSummary:h,...x},A){const{shellIds:b,bindingValue:L,handleSubmit:_,hasErrors:v,announce:R}=iA({defaultValues:r,values:s,onValuesChange:l,rules:u,resolver:d,validateMode:f,readOnly:m,size:p,disabled:C,onSubmit:S,onSubmitError:g,classNames:o});return c.jsx(zh,{classNames:o,children:c.jsx(ru.Provider,{value:L,children:c.jsx(Uh,{shellIds:b,children:c.jsxs("form",{ref:A,noValidate:!0,onSubmit:_,"aria-labelledby":b.titleId,"aria-describedby":$b({descriptionId:b.descriptionId,errorSummaryId:b.errorSummaryId,hasErrors:v}),className:eA(n,o),...x,children:[c.jsx(la,{message:R}),c.jsx(aa,{children:h}),t]})})})})});Qu.displayName="Form";function ia({name:e,value:t,onChange:n,onBlur:o,disabled:r,readOnly:s,type:l,rules:u}){const d=et(),f=t!==void 0,m=d!=null&&e!=null&&!f,p=a.useRef(null),C=a.useCallback(_=>{p.current=_,m&&e&&d.registerRef(e,_)},[m,d,e]),S=r??(d==null?void 0:d.disabled)??!1,g=s??(d==null?void 0:d.readOnly)??!1,h=m&&e?d.getError(e):void 0,x=a.useMemo(()=>Yu(e?d==null?void 0:d.getFieldRules(e):void 0,u),[d,e,u]),A=m&&e?d.getValue(e):t,b=a.useCallback(_=>{if(n==null||n(_),!m||!e||!d)return;const v=Jb(_,l);d.setValue(e,v,{shouldValidate:d.validateMode==="onChange"})},[m,d,e,n,l]),L=a.useCallback(_=>{o==null||o(_),!(!m||!e||!d)&&(d.setTouched(e,!0),d.validateMode==="onBlur"&&d.validateField(e))},[m,d,e,o]);return{bound:m,name:e,value:m&&l==="checkbox"?!!A:m?A??"":A,checked:m&&l==="checkbox"?!!A:void 0,onChange:b,onBlur:L,disabled:S||(d==null?void 0:d.isSubmitting),readOnly:g,ref:C,"aria-invalid":Wu(h),error:h,rules:x}}function cA(e,t){return ia({name:e,rules:t})}function Ju({name:e,value:t,onChange:n,disabled:o,readOnly:r,rules:s}){const l=et(),u=t!==void 0,d=l!=null&&e!=null&&!u,f=a.useRef(null),m=a.useCallback(L=>{f.current=L,d&&e&&l.registerRef(e,L)},[d,l,e]),p=o??(l==null?void 0:l.disabled)??!1,C=r??(l==null?void 0:l.readOnly)??!1,S=d&&e?l.getError(e):void 0,g=a.useMemo(()=>Yu(e?l==null?void 0:l.getFieldRules(e):void 0,s),[l,e,s]),h=d&&e?l.getValue(e):t,x=d?h??"":h,A=a.useCallback(L=>{n==null||n(L),!(!d||!e||!l)&&l.setValue(e,L,{shouldValidate:l.validateMode==="onChange"})},[d,l,e,n]),b=a.useCallback(()=>{!d||!e||!l||(l.setTouched(e,!0),l.validateMode==="onBlur"&&l.validateField(e))},[d,l,e]);return{bound:d,name:e,value:x,setValue:A,onBlur:b,disabled:p||(l==null?void 0:l.isSubmitting),readOnly:C,ref:m,"aria-invalid":Wu(S),error:S,rules:g}}const uA=Object.assign(Qu,{Section:$u,Title:Xu,Description:Ku,Actions:qu,ErrorSummary:aa,Announce:la,Field:Zu}),Ge=a.createContext(null),Vr=a.createContext({});function dA({classNames:e,children:t}){const n=a.useContext(Vr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Vr.Provider,{value:o,children:t})}function ca(){return a.useContext(Ge)}function ed(){return a.useContext(Vr)}const fA="inline-flex flex-wrap items-baseline gap-x-xsmall gap-y-0",mA="font-w-mid",pA="text-danger";function CA({className:e,slotClass:t}){return i.cn(fA,t,e)}function gA(e){return i.cn(mA,e)}function SA(e){return i.cn(pA,e)}const hA=!0;function td(e){return null}td.displayName="Label";function $i({children:e,required:t}){const n=ed();return c.jsxs(c.Fragment,{children:[c.jsx(q,{as:"span",variant:"base",className:gA(n.text),children:e}),t?c.jsx("span",{className:SA(n.required),"aria-hidden":hA,children:"*"}):null]})}function xA({required:e,htmlFor:t,id:n}){const o=ca();return{htmlFor:t??(o==null?void 0:o.controlId),id:n??(o==null?void 0:o.labelId),required:e??(o==null?void 0:o.required)??!1}}function bA({children:e,className:t,required:n,htmlFor:o,id:r,...s}){const{htmlFor:l,id:u,required:d}=xA({required:n,htmlFor:o,id:r}),f=ed(),m=CA({className:t,slotClass:f.root});if(l!=null)return c.jsx("label",{id:u,htmlFor:l,className:m,...s,children:c.jsx($i,{required:d,children:e})});const p=s;return c.jsx("span",{id:u,className:m,...p,children:c.jsx($i,{required:d,children:e})})}function AA({classNames:e,...t}){return c.jsx(dA,{classNames:e,children:c.jsx(bA,{...t})})}const ve=Object.assign(AA,{Slot:td}),vA=new Set(["FieldLegend","OptionGroupLegend","RadioGroup.Legend","CheckboxGroup.Legend"]);function je(...e){const t=e.filter(Boolean).join(" ");return t.length>0?t:void 0}function Ve(e){return`${e}-hint`}function ze(e){return`${e}-error`}const zr=a.createContext({}),Ur=a.createContext({}),nd=a.createContext("base");function LA({classNames:e,children:t}){const n=a.useContext(zr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(zr.Provider,{value:o,children:t})}function ua(){return a.useContext(zr)}function _A({classNames:e,children:t}){const n=a.useContext(Ur),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ur.Provider,{value:o,children:t})}function xn(){return a.useContext(Ur)}function TA({size:e,children:t}){return c.jsx(nd.Provider,{value:e,children:t})}function da(){return a.useContext(nd)}const EA="flex w-full flex-col gap-xsmall",RA={default:"text-muted",danger:"text-danger",success:"text-success",info:"text-info",warning:"text-warning"},IA="m-0 min-w-0 border-0 p-0 disabled:pointer-events-none disabled:opacity-55",yA="flex min-w-0 w-full flex-col",NA="m-0 block w-full max-w-full border-0 p-0",wA="flex flex-col w-fit",OA="flex min-w-0 w-full flex-col",PA="flex flex-wrap w-fit items-center",fa={small:{legendGap:"mt-large",stackGap:"gap-large",groupGap:"gap-base",actionsGap:"gap-base"},base:{legendGap:"mt-xlarge",stackGap:"gap-xlarge",groupGap:"gap-mid",actionsGap:"gap-mid"},mid:{legendGap:"mt-2xlarge",stackGap:"gap-2xlarge",groupGap:"gap-large",actionsGap:"gap-large"},large:{legendGap:"mt-2xlarge",stackGap:"gap-2xlarge",groupGap:"gap-xlarge",actionsGap:"gap-xlarge"}};function DA({status:e,className:t,slotClass:n}){return i.cn(RA[e],n,t)}function kA({size:e,hasLegend:t,slotClass:n}){const o=fa[e];return i.cn(yA,o.stackGap,t&&o.legendGap,n)}function BA({size:e,className:t,slotClass:n}){return i.cn(OA,fa[e].groupGap,n,t)}function jA({size:e,className:t,slotClass:n}){return i.cn(PA,fa[e].actionsGap,n,t)}function MA({className:e,children:t,...n}){const o=ua();return c.jsx("div",{className:i.cn(EA,o.root,e),...n,children:t})}function FA({classNames:e,...t}){return c.jsx(LA,{classNames:e,children:c.jsx(MA,{...t})})}const ma=a.forwardRef(function({children:t,className:n,status:o="default",as:r="p",variant:s="small",...l},u){const d=ua();return c.jsx(q,{ref:u,as:r,variant:s,inheritColor:r==="span",className:DA({status:o,className:n,slotClass:d.hint}),...l,children:t})});ma.displayName="FieldHint";const HA=ve;function GA({role:e="alert",className:t,...n}){const o=ua();return c.jsx(ma,{status:"danger",role:e,className:i.cn(o.error,t),...n})}const pa=a.forwardRef(function({className:t,children:n,...o},r){const s=xn();return c.jsx("legend",{ref:r,className:i.cn(NA,s.legend,t),...o,children:n})});pa.displayName="FieldLegend";function od({children:e,className:t,...n}){const o=xn();return c.jsx("span",{className:i.cn(wA,o.legendHeader,t),...n,children:e})}const qo=a.forwardRef(function({className:t,children:n,...o},r){const s=da(),l=xn();return c.jsx("div",{ref:r,className:BA({size:s,className:t,slotClass:l.group}),...o,children:n})});qo.displayName="FieldSetGroup";const Ca=a.forwardRef(function({className:t,children:n,...o},r){const s=da(),l=xn();return c.jsx("div",{ref:r,className:jA({size:s,className:t,slotClass:l.actions}),...o,children:n})});Ca.displayName="FieldSetActions";function VA({legend:e,loose:t,groups:n,actions:o}){const r=da(),s=xn(),l=[];return n.length>0?l.push(...t,...n):t.length>0&&l.push(c.jsx(qo,{children:t},"field-set-group")),o!=null&&l.push(o),l.length===0?null:c.jsx("div",{className:kA({size:r,hasLegend:e!=null,slotClass:s.stack}),children:l})}const rd=a.forwardRef(function({className:t,hintId:n,errorId:o,disabled:r,state:s,...l},u){const d=xn();return c.jsxs("fieldset",{ref:u,disabled:r,"aria-describedby":je(n,o),className:i.cn(IA,d.root,t),...l,children:[s.legend,c.jsx(VA,{...s})]})});rd.displayName="FieldSetRootInner";function zA(e){return e.displayName}function ga(e){if(a.isValidElement(e))return zA(e.type)}function UA(e){if(!a.isValidElement(e))return!1;if(e.type==="legend")return!0;const t=ga(e);return t!=null&&vA.has(t)}function WA(e){return ga(e)==="FieldSetGroup"}function YA(e){return ga(e)==="FieldSetActions"}function $A(e){const t=a.Children.toArray(e),n=t.findIndex(UA);return n===-1?{legend:null,body:t}:{legend:t[n],body:[...t.slice(0,n),...t.slice(n+1)]}}function XA(e){const t=[],n=[];let o=null;for(const r of e)YA(r)?o=r:WA(r)?n.push(r):t.push(r);return{loose:t,groups:n,actions:o}}function KA(e){return a.useMemo(()=>{const{legend:t,body:n}=$A(e),{loose:o,groups:r,actions:s}=XA(n);return{legend:t,loose:o,groups:r,actions:s}},[e])}const sd=a.forwardRef(function({children:t,className:n,classNames:o,hintId:r,errorId:s,disabled:l,size:u="base",...d},f){const m=KA(t);return c.jsx(TA,{size:u,children:c.jsx(_A,{classNames:o,children:c.jsx(rd,{ref:f,className:n,hintId:r,errorId:s,disabled:l,state:m,...d})})})});sd.displayName="FieldSet";function Sa(e){const t=a.useId();return e??`${t}-hint`}function ha(e){const t=a.useId();return e??`${t}-error`}const qA=Object.assign(sd,{Legend:pa,LegendHeader:od,Group:qo,Actions:Ca}),le=Object.assign(FA,{Hint:ma,Label:HA,Error:GA,Set:qA,Legend:pa,LegendHeader:od,Group:qo,Actions:Ca}),xa={vertical:"flex flex-col gap-mid",horizontal:"flex flex-row flex-wrap items-start gap-x-large gap-y-mid"},ad=a.forwardRef(function({size:t="small",...n},o){return c.jsx(le.Set,{ref:o,size:t,...n})}),ld=a.forwardRef(function({children:t,...n},o){return c.jsx(le.Legend,{ref:o,...n,children:t})});ld.displayName="OptionGroupLegend";const id=le.Set.Group,cd=le.Set.Actions;function ZA({children:e,className:t,id:n,...o}){return c.jsx(le.Hint,{as:"span",variant:"small",id:n,className:t,...o,children:e})}function QA({children:e,className:t,...n}){return c.jsx(le.LegendHeader,{className:t,...n,children:e})}a.forwardRef(function({className:t,orientation:n="vertical",children:o,...r},s){return c.jsx("div",{ref:s,className:i.cn("text-left",xa[n],t),...r,children:o})});function ud(e){function t({children:n,...o}){return c.jsx(ld,{...o,children:c.jsx(QA,{children:n})})}return t.displayName=e,t}function dd(e,t,n){function o({id:r,className:s,...l}){const u=e(),d=t();return c.jsx(ZA,{id:r??u,className:i.cn(d,s),...l})}return o.displayName=n,o}function fd(e,t,n){function o({id:r,className:s,...l}){const u=e(),d=t();return c.jsx(le.Error,{id:r??u,className:i.cn(d,s),...l})}return o.displayName=n,o}function md(){const e=a.createContext({});function t({classNames:o,children:r}){const s=a.useContext(e),l=a.useMemo(()=>({...s,...o}),[o,s]);return c.jsx(e.Provider,{value:l,children:r})}function n(){return a.useContext(e)}return{Context:e,Provider:t,useClassNames:n}}const ba=a.createContext(null),{Provider:JA,useClassNames:Zo}=md();function ev({value:e,children:t}){return c.jsx(ba.Provider,{value:e,children:t})}function pd(){const e=a.useContext(ba);if(!e)throw new Error("CheckboxGroup components must be inside <CheckboxGroup>.");return e}function tv(){return a.useContext(ba)}function nv(e="vertical",t){return i.cn("text-left",xa[e],t)}const ov=ud("CheckboxGroup.Legend"),rv=dd(()=>pd().hintId,()=>Zo().hint,"CheckboxGroup.Hint"),sv=fd(()=>pd().errorId,()=>Zo().error,"CheckboxGroup.Error"),Cd=a.forwardRef(function({className:t,orientation:n="vertical",...o},r){const s=Zo().list;return c.jsx("div",{ref:r,className:nv(n,i.cn(s,t)),...o})});Cd.displayName="CheckboxGroup.List";function gd(e){const t=a.useRef(!1);return a.useEffect(()=>{t.current=!1},e),{claimRequiredAnchor:a.useCallback(()=>t.current?!1:(t.current=!0,!0),[])}}function Sd({value:e,defaultValue:t,onValueChange:n,allowClear:o=!0}){const r=e!==void 0,[s,l]=a.useState(t),u=r?e==null?void 0:String(e):s,d=a.useCallback(f=>{!o&&f===void 0||(r||l(f),n==null||n(f))},[o,r,n]);return{selectedValue:u,selectValue:d}}function av({required:e=!1,selection:t="multiple",value:n,defaultValue:o,onValueChange:r,disabled:s=!1,hintId:l,errorId:u}){const d=Sa(l),f=ha(u),{selectedValue:m,selectValue:p}=Sd({value:n,defaultValue:o,onValueChange:r,allowClear:!0}),C=t==="single"?m:void 0,S=a.useCallback((b,L)=>{t==="single"&&p(L?b:void 0)},[p,t]),{claimRequiredAnchor:g}=gd([e,t]),h=a.useCallback(()=>t!=="single"||!e?!1:g(),[g,e,t]),x=a.useMemo(()=>({selection:t,disabled:s,required:e,hintId:d,errorId:f,selectedValue:C,selectSingleValue:S,claimRequiredAnchor:h}),[h,s,f,d,e,S,C,t]),A=a.useMemo(()=>({required:e}),[e]);return{contextValue:x,fieldLabelCtx:A,hintId:d,errorId:f,disabled:s}}const lv=a.forwardRef(function(t,n){const o=Zo();return c.jsx(ad,{ref:n,classNames:o,...t})}),hd=a.forwardRef(function(t,n){const{children:o,className:r,classNames:s,size:l,disabled:u=!1,required:d,selection:f,value:m,defaultValue:p,onValueChange:C,hintId:S,errorId:g,...h}=t,{contextValue:x,fieldLabelCtx:A,hintId:b,errorId:L}=av(t),_=c.jsx(lv,{ref:n,disabled:u,hintId:b,errorId:L,size:l,className:r,...h,children:o});return c.jsx(ev,{value:x,children:c.jsx(JA,{classNames:s,children:c.jsx(Ge.Provider,{value:A,children:_})})})});hd.displayName="CheckboxGroup";const iv=Object.assign(hd,{Legend:ov,Label:ve,Hint:rv,Error:sv,List:Cd,Group:id,Actions:cd});function cv(e,t){return e??`radio-group-${t}`}const Aa=a.createContext(null),{Provider:uv,useClassNames:Qo}=md();function dv({value:e,children:t}){return c.jsx(Aa.Provider,{value:e,children:t})}function xd(){const e=a.useContext(Aa);if(!e)throw new Error("RadioGroup components must be inside <RadioGroup>.");return e}function fv(){return a.useContext(Aa)}function mv(e="vertical",t){return i.cn("text-left",xa[e],t)}const pv=ud("RadioGroup.Legend"),Cv=dd(()=>xd().hintId,()=>Qo().hint,"RadioGroup.Hint"),gv=fd(()=>xd().errorId,()=>Qo().error,"RadioGroup.Error"),bd=a.forwardRef(function({className:t,orientation:n="vertical",...o},r){const s=Qo().list;return c.jsx("div",{ref:r,className:mv(n,i.cn(s,t)),...o})});bd.displayName="RadioGroup.List";function Sv({required:e=!1,value:t,defaultValue:n,onValueChange:o,disabled:r=!1,name:s,hintId:l,errorId:u}){const d=a.useId(),f=cv(s,d),m=Sa(l),p=ha(u),{selectedValue:C,selectValue:S}=Sd({value:t,defaultValue:n,onValueChange:o,allowClear:!e}),{claimRequiredAnchor:g}=gd([e,f]),h=a.useCallback(()=>e?g():!1,[g,e]),x=a.useMemo(()=>({name:f,disabled:r,required:e,hintId:m,errorId:p,selectedValue:C,selectValue:S,claimRequiredAnchor:h}),[h,r,p,f,m,e,S,C]),A=a.useMemo(()=>({required:e}),[e]);return{contextValue:x,fieldLabelCtx:A,hintId:m,errorId:p,disabled:r}}const hv=a.forwardRef(function(t,n){const o=Qo();return c.jsx(ad,{ref:n,classNames:o,...t})}),Ad=a.forwardRef(function(t,n){const{children:o,className:r,classNames:s,size:l,disabled:u=!1,name:d,required:f,value:m,defaultValue:p,onValueChange:C,hintId:S,errorId:g,...h}=t,{contextValue:x,fieldLabelCtx:A,hintId:b,errorId:L}=Sv(t),_=c.jsx(hv,{ref:n,disabled:u,hintId:b,errorId:L,size:l,className:r,...h,children:o});return c.jsx(dv,{value:x,children:c.jsx(uv,{classNames:s,children:c.jsx(Ge.Provider,{value:A,children:_})})})});Ad.displayName="RadioGroup";const xv=Object.assign(Ad,{Legend:pv,Label:ve,Hint:Cv,Error:gv,List:bd,Group:id,Actions:cd}),bv="group";function Av(){return{"aria-hidden":!0}}const vd=a.createContext(null),Ld=a.createContext(null),Wr=a.createContext({});function vv({value:e,children:t}){return c.jsx(vd.Provider,{value:e,children:t})}function Fn(){const e=a.useContext(vd);if(!e)throw new Error("ComboBox.* must be inside <ComboBox>.");return e}function Lv({value:e,children:t}){return c.jsx(Ld.Provider,{value:e,children:t})}function _d(){const e=a.useContext(Ld);if(!e)throw new Error("ComboBox compound-parts must be inside <ComboBox>.");return e}function _v({classNames:e,children:t}){const n=a.useContext(Wr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Wr.Provider,{value:o,children:t})}function wt(){return a.useContext(Wr)}const Tv="No matches";function va(e,t){return`${e}-opt-${t}`}function Ev({ariaLabel:e,ariaLabelledBy:t}){return{"aria-label":e,"aria-labelledby":t}}function Rv(e,t){return t?va(e,t):void 0}function Jo(e){return Array.from(e.querySelectorAll('[role="option"]:not([disabled]):not([aria-disabled="true"])'))}function un(e){return e.dataset.value??null}const Td=a.createContext(null),Ed=a.createContext(null),Yr=a.createContext({}),Rd=a.createContext(null);function Iv({value:e,children:t}){return c.jsx(Td.Provider,{value:e,children:t})}function yv({value:e,children:t}){return c.jsx(Ed.Provider,{value:e,children:t})}function bn(e){const t=a.useContext(Td);if(!t)throw new Error(`${e} must be inside <ListBox>.`);return t}function Id(){return a.useContext(Ed)}function Nv({classNames:e,children:t}){const n=a.useContext(Yr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Yr.Provider,{value:o,children:t})}function tt(){return a.useContext(Yr)}function wv({value:e,children:t}){return c.jsx(Rd.Provider,{value:e,children:t})}function Ov(){return a.useContext(Rd)}function La(){return{"aria-hidden":!0}}const yd=a.createContext(null);function Pv({value:e,children:t}){return c.jsx(yd.Provider,{value:e,children:t})}function Nd(){const e=a.useContext(yd);if(!e)throw new Error("SelectionIndicator.* parts must be inside <SelectionIndicator>.");return e}const Dv={xsmall:"selection-indicator-xsmall",small:"selection-indicator-small",base:"selection-indicator-base",mid:"selection-indicator-mid",large:"selection-indicator-large"},Ye={xsmall:"rounded-[var(--selection-indicator-radius-xsmall)]",small:"rounded-[var(--selection-indicator-radius-small)]",base:"rounded-[var(--selection-indicator-radius-base)]",mid:"rounded-[var(--selection-indicator-radius-mid)]",large:"rounded-[var(--selection-indicator-radius-large)]"},_a={xsmall:"size-[length:calc(var(--icon-size-xsmall)*0.75)]",small:"size-[length:calc(var(--icon-size-small)*0.75)]",base:"size-[length:calc(var(--icon-size-base)*0.75)]",mid:"size-[length:calc(var(--icon-size-mid)*0.75)]",large:"size-[length:calc(var(--icon-size-large)*0.75)]"},kv="pointer-events-none relative z-[2] inline-flex items-center justify-center";function Bv(e){return i.cn("[&_svg]:size-full",_a[e])}function jv(e){return _a[e]}const Mv={xsmall:"size-[calc(var(--selection-indicator-xsmall)*0.333333)] rounded-[var(--selection-indicator-radius-xsmall)]",small:"size-[calc(var(--selection-indicator-small)*0.333333)] rounded-[var(--selection-indicator-radius-small)]",base:"size-[calc(var(--selection-indicator-base)*0.333333)] rounded-[var(--selection-indicator-radius-base)]",mid:"size-[calc(var(--selection-indicator-mid)*0.333333)] rounded-[var(--selection-indicator-radius-mid)]",large:"size-[calc(var(--selection-indicator-large)*0.333333)] rounded-[var(--selection-indicator-radius-large)]"},Fv="shrink-0 bg-indicator-foreground",Hv="shrink-0 bg-foreground",$r="relative box-border inline-flex shrink-0 items-center justify-center overflow-hidden",Ta="pointer-events-none absolute -inset-[var(--border-width)] z-[0] flex origin-center items-center justify-center rounded-[inherit]",Gv="bg-indicator text-indicator-foreground",Vv="bg-secondary text-secondary-foreground",zv=i.cn(Ta,"z-[1] gloss-indicator-fill text-foreground");i.cn(Ta,"z-[1] bg-primary-tint");const Uv={xsmall:"--selection-indicator-xsmall",small:"--selection-indicator-small",base:"--selection-indicator-base",mid:"--selection-indicator-mid",large:"--selection-indicator-large"},Wv={xsmall:.875,small:1,base:1.125,mid:1.25,large:1.5};function He(e,t=16){if(typeof document<"u"){const n=getComputedStyle(document.documentElement).getPropertyValue(Uv[e]).trim(),o=/^([\d.]+)rem$/i.exec(n);if(o)return Number.parseFloat(o[1])*t;const r=/^([\d.]+)px$/i.exec(n);if(r)return Number.parseFloat(r[1])}return Wv[e]*t}function Yv(e){switch(e){case"gloss":case"outline":return Hv;case"secondary":return"shrink-0 bg-secondary-foreground";default:return Fv}}function $v(e){return e!=="outline"}function Xv(e){if(e==="gloss")return zv;const t=e==="secondary"?Vv:Gv;return i.cn(Ta,t)}function Kv(e){switch(e){case"gloss":case"outline":return"text-foreground";case"secondary":return"text-secondary-foreground";default:return"text-indicator-foreground"}}function qv(e,t){return i.cn($r,Dv[e],Ye[e],t)}function Zv(e,t){switch(e){case"default":return"border border-primary bg-surface";case"secondary":return"border-token bg-secondary";case"outline":return"border border-primary bg-surface";case"gloss":return"gloss-indicator border-0 [--border-width:0px]"}}const wd="SelectionIndicatorFill",Od="SelectionIndicatorMark";function Pd(e){return e.type.displayName===wd}function Dd(e){return e.type.displayName===Od}function Qv({resolvedIcon:e,showCheck:t,showDot:n,size:o,variant:r}){if(e!=null)return e;if(t)return a.createElement(be.IoCheckmarkSharp,{"aria-hidden":!0,className:"size-full"});if(n)return a.createElement("span",{"aria-hidden":!0,className:i.cn(Mv[o],Yv(r))})}function Jv(e){return a.Children.toArray(e).some(t=>a.isValidElement(t)&&(Pd(t)||Dd(t)))}function eL(e){const t=a.Children.toArray(e);let n,o;const r=[];for(const s of t){if(a.isValidElement(s)&&Pd(s)){n=s;continue}if(a.isValidElement(s)&&Dd(s)){o=s;continue}r.push(s)}return{fillSlot:n,markSlot:o,legacyIcon:r.length===0?void 0:r.length===1?r[0]:r}}function tL({root:e,fill:t,mark:n,classNames:o,className:r}){return{root:i.cn(e,o==null?void 0:o.root,r),fill:i.cn(t,o==null?void 0:o.fill),mark:i.cn(n,o==null?void 0:o.mark)}}const nL={transform:"scale(0)",opacity:0},oL={opacity:0},Ro=a.forwardRef(function({className:t,style:n,...o},r){const s=Nd();return c.jsx("span",{ref:l=>{s.fillRef.current=l,ue(r,l)},...La(),className:i.cn(s.fillClassName,t),style:{...nL,...n},...o})});Ro.displayName=wd;const Io=a.forwardRef(function({className:t,children:n,style:o,...r},s){const l=Nd(),u=n??l.markContent;return u==null?null:c.jsx("span",{ref:d=>{l.markRef.current=d,ue(s,d)},...La(),className:i.cn(l.markClassName,t),style:{...oL,...o},...r,children:u})});Io.displayName=Od;function rL(e,t,n){const o=a.useRef(!0),r=i.usePrefersReducedMotion()||!i.isMotionFeatureEnabled("enableSelectionFill");a.useLayoutEffect(()=>{const s=t==null?void 0:t.current,l=n==null?void 0:n.current,u=m=>{s&&(s.style.transform=`scale(${m?1:0})`,s.style.opacity=m?"1":"0"),l&&(l.style.opacity=m?"1":"0",l.style.transform="scale(1)")};if(!s&&!l)return;if(r){s&&i.killMotion(s),l&&i.killMotion(l),u(e);return}if(o.current){o.current=!1,s&&i.killMotion(s),l&&i.killMotion(l),u(e);return}const d={...i.motionSelectionFill(),overwrite:"auto"},f={...i.motionSelectionFill(),overwrite:"auto"};s&&(i.killMotion(s),e?$.fromTo(s,{scale:0,autoAlpha:0},{scale:1,autoAlpha:1,...d}):$.to(s,{scale:0,autoAlpha:0,...d})),l&&(i.killMotion(l),e?$.fromTo(l,{scale:.88,autoAlpha:0},{scale:1,autoAlpha:1,...f}):$.to(l,{scale:.92,autoAlpha:0,...f}))},[e,t,n,r])}function sL({size:e="base",variant:t="default",selected:n,check:o=!1,dot:r=!1,icon:s,children:l,className:u,classNames:d}){const f=a.useRef(null),m=a.useRef(null),{fillSlot:p,markSlot:C,legacyIcon:S,usesCompound:g}=a.useMemo(()=>({...eL(l),usesCompound:Jv(l)}),[l]),h=C!=null,x=s??(h?C.props.children:S),A=x!=null,b=o&&!A,_=Qv({resolvedIcon:x,showCheck:b,showDot:r&&!A&&!b,size:e,variant:t}),v=h||_!=null,R=$v(t);rL(n,R?f:void 0,v?m:void 0);const T=tL({root:Zv(t),fill:Xv(t),mark:i.cn(kv,b&&Bv(e),A&&jv(e),Kv(t)),classNames:d,className:u}),E=a.useMemo(()=>({fillRef:f,markRef:m,fillClassName:T.fill,markClassName:T.mark,markContent:_}),[T.fill,T.mark,_]);return{shellClassName:qv(e,T.root),contextValue:E,usesCompound:g,fillSlot:p,markSlot:C,hasMark:v,markContent:_,showsFill:R}}function kd({size:e="base",variant:t="default",selected:n,check:o=!1,dot:r=!1,icon:s,children:l,className:u,classNames:d,...f}){const{shellClassName:m,contextValue:p,usesCompound:C,fillSlot:S,markSlot:g,hasMark:h,markContent:x,showsFill:A}=sL({size:e,variant:t,selected:n,check:o,dot:r,icon:s,children:l,className:u,classNames:d}),b=C?c.jsxs(c.Fragment,{children:[A?S??c.jsx(Ro,{}):null,h?g??c.jsx(Io,{}):null]}):c.jsxs(c.Fragment,{children:[A?c.jsx(Ro,{}):null,h?c.jsx(Io,{children:x}):null]});return c.jsx(Pv,{value:p,children:c.jsx("span",{className:m,...La(),...f,children:b})})}kd.displayName="SelectionIndicator";const Be=Object.assign(kd,{Fill:Ro,Mark:Io});function Ea(e,t,n="right",o){const r=n==="left"?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[auto_minmax(0,1fr)]",s=e>=2?"grid-rows-[auto_auto_auto]":e===1?"grid-rows-[auto_auto]":"grid-rows-[auto] items-center";return i.cn("grid",r,s,t,o)}function er(e="right"){return i.cn("row-start-1 self-center justify-self-start",e==="left"?"col-start-2":"col-start-1")}function tr(e="right"){return i.cn("row-start-1 inline-flex min-w-0 max-w-full items-center justify-self-start [width:fit-content]",e==="left"?"col-start-1":"col-start-2")}function nr(e,t="right"){return i.cn(e===2?"row-start-2":"row-start-3","min-w-0 max-w-full justify-self-start [width:fit-content]",t==="left"?"col-start-1":"col-start-2")}function Ra(e){return e?3:2}function Bd(e,t,n,o){const r=n&&o?"grid-cols-[auto_minmax(0,1fr)_auto]":n?"grid-cols-[auto_minmax(0,1fr)]":o?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]",s=e?"grid-rows-[auto_auto] gap-y-xsmall":"grid-rows-[auto] items-center";return i.cn("grid w-full min-w-0 text-left",r,s,t)}function aL(){return er()}function lL(e){return e?tr():i.cn("row-start-1 col-start-1 inline-flex min-w-0 max-w-full items-center justify-self-start [width:fit-content]")}function iL(e){return e?nr(2):i.cn("row-start-2 col-start-1 min-w-0 max-w-full justify-self-start [width:fit-content]")}function cL(e){return i.cn("row-start-1 self-center shrink-0 justify-self-end",e?"col-start-3":"col-start-2")}const jd=a.createContext(null);function Xr({value:e,children:t}){return c.jsx(jd.Provider,{value:e,children:t})}function Hn(e){const t=a.useContext(jd);if(!t)throw new Error(`${e} must be used inside a list item (Dropdown.Item / ListBox.Item).`);return t}const uL="inline-flex min-w-0 items-center",dL="min-w-0",fL="origin-center",mL="font-w-mid",pL="text-muted",CL="text-muted",gL="opacity-80",SL="inline-flex items-center [&_svg]:icon-base",hL="relative inline-flex shrink-0 items-center justify-center";function Md(e){return e?CL:gL}function xL(e){return i.cn(mL,e&&pL)}function Fd({className:e,children:t,textVariant:n="base",...o}){const r=Hn("ItemLabel");return c.jsx("span",{ref:s=>{r.enableLabelMotion&&r.labelMotionRef&&(r.labelMotionRef.current=s)},className:i.cn(uL,lL(r.showIndicatorSlot),r.hasHint&&dL,r.enableLabelMotion&&fL,e),...o,children:c.jsx(q,{as:"span",variant:n,inheritColor:!0,className:xL(!!r.disabled),children:t})})}function Hd({className:e,children:t,...n}){const o=Hn("ItemHint");return c.jsx(q,{as:"span",variant:"xsmall",inheritColor:!0,className:i.cn(iL(o.showIndicatorSlot),Md(!!(o.mutedHint||o.disabled)),e),...n,children:t})}function Gd({className:e,children:t,...n}){const o=Hn("ItemIcon");return c.jsx("span",{className:i.cn(SL,cL(o.showIndicatorSlot),Md(!!(o.mutedHint||o.disabled)),e),...n,children:t})}function Vd({className:e,children:t,...n}){return c.jsx("span",{className:i.cn(hL,aL(),e),...n,children:t})}const bL=new Set(["ListBoxItemIndicator","DropdownItemIndicator"]),AL=new Set(["ListBoxLabel","DropdownItemLabel","Dropdown.ItemLabel"]),vL=new Set(["ListBoxHint","DropdownItemHint","Dropdown.ItemHint"]),LL=new Set(["ListBoxIcon","DropdownItemIcon","Dropdown.ItemIcon"]);function _L(e){return e.displayName}function zd(e){let t=null,n=null,o=null,r=null;const s=[];for(const l of a.Children.toArray(e)){if(!a.isValidElement(l)){s.push(l);continue}const u=_L(l.type);if(u&&bL.has(u)){t==null&&(t=l);continue}if(u&&AL.has(u)){n==null&&(n=l);continue}if(u&&vL.has(u)){o==null&&(o=l);continue}if(u&&LL.has(u)){r==null&&(r=l);continue}s.push(l)}return{indicator:t,label:n,hint:o,icon:r,rest:s}}const TL={small:"xsmall",base:"small",mid:"base",large:"large"};function EL(e,t){return t??TL[e]}function RL({slotClassNames:e,classNames:t}){return{root:i.cn(e.itemIndicatorShell,t==null?void 0:t.root,t==null?void 0:t.itemIndicatorShell),fill:i.cn(e.itemIndicatorFill,t==null?void 0:t.fill,t==null?void 0:t.itemIndicatorFill),mark:i.cn(e.itemIndicatorMark,t==null?void 0:t.mark,t==null?void 0:t.itemIndicatorMark)}}function Xi(e){return e==null?[]:Array.isArray(e)?[...e]:[e]}function IL(e){return zd(e)}function yL({children:e,label:t,hint:n,icon:o,showIndicator:r}){const s=IL(e),l=s.indicator!=null,u=s.hint!=null||n!=null,d=s.icon!=null||o!=null,f=s.label!=null||s.hint!=null||s.icon!=null,m=t!=null||s.label!=null;return{parts:s,hasCompoundIndicator:l,hasHint:u,hasIcon:d,isCompound:f,hasLabel:m,showIndicatorSlot:f?r&&l:r}}function Ki({root:e,activeValue:t,delta:n}){const o=Jo(e);if(o.length===0)return t;const r=t?o.findIndex(l=>un(l)===t):-1;let s;return r<0?s=n>0?0:o.length-1:s=(r+n+o.length)%o.length,un(o[s])??t}function Ud(e){const t=Jo(e)[0];return t?un(t):null}function NL(e){const t=Jo(e),n=t[t.length-1];return n?un(n):null}function qi(e){const t=e.querySelector('[role="option"][aria-selected="true"]:not([disabled]):not([aria-disabled="true"])');if(t){const n=un(t);if(n)return n}return Ud(e)}function wL(e){const t=Jo(e),n=[],o=[];for(const r of t){const s=un(r);s&&(n.push(s),o.push((r.textContent??"").trim().replace(/\s+/g," ")))}return{values:n,labels:o}}function xt({isDisabled:e,enabled:t,textMotionRef:n,hoverLift:o=!1,hoverLiftScale:r,onPointerEnter:s,onPointerLeave:l,onPointerDown:u}){const d=i.usePrefersReducedMotion(),f=a.useRef(!1),m=a.useCallback(()=>{if(r!=="adaptive")return typeof r=="number"?r:i.getMotionConfig().hoverLiftScale},[r]);a.useEffect(()=>{const g=n.current;return()=>{g&&i.killMotion(g)}},[]),a.useEffect(()=>{const g=n.current;!g||!e||(f.current=!1,i.killMotion(g),g.style.transform="")},[e,n]);const p=a.useCallback(g=>{if(s==null||s(g),!o||!t||e||g.defaultPrevented||i.shouldSkipInteractiveHoverLift())return;f.current=!0;const h=n.current;h&&i.animateInteractiveHoverLift(h,!0,m())},[t,o,e,s,m,n]),C=a.useCallback(g=>{if(l==null||l(g),!o||(f.current=!1,i.shouldSkipInteractiveHoverLift()))return;const h=n.current;h&&i.animateInteractiveHoverLift(h,!1,m())},[o,l,m,n]),S=a.useCallback(g=>{if(u==null||u(g),g.defaultPrevented||e||!t||d)return;const h=n.current;h&&(o?i.animateInteractivePressSqueeze(h,{pointerInside:f.current,liftScale:m()}):i.animateInteractivePressSqueeze(h))},[t,o,e,u,d,m,n]);return{handlePointerEnter:p,handlePointerLeave:C,handlePointerDown:S}}function OL(e){return i.useMergedGlossPanelRef(void 0,e)}function PL({listId:e,activeValue:t,rootRef:n}){a.useLayoutEffect(()=>{const o=n.current;if(!o)return;for(const s of o.querySelectorAll('[role="option"][data-active]'))s.removeAttribute("data-active");if(!t)return;const r=document.getElementById(va(e,t));r&&o.contains(r)&&r.setAttribute("data-active","")},[t,e,n])}function DL({disabled:e,hasLabel:t,onPointerDown:n}){const o=a.useRef(null),r=!e&&t,{handlePointerDown:s}=xt({isDisabled:e,enabled:r,textMotionRef:o,onPointerDown:n});return{labelMotionRef:o,enableLabelMotion:r,handlePointerDown:s}}const kL="flex min-h-0 flex-col gap-xsmall text-left outline-none",BL="gloss-panel gloss-deep rounded-mid p-mid text-foreground",jL="flex min-w-0 flex-col gap-xsmall",ML="px-mid text-left",FL="text-muted",HL="my-xsmall h-0 w-full shrink-0 border-t-token",GL="px-large py-small text-center text-muted",VL="w-full min-w-0 rounded-mid text-left outline-none",zL={small:i.cn(i.CONTROL_SIZE_LAYOUT.small.padX,i.CONTROL_SIZE_LAYOUT.small.padY),base:i.cn(i.CONTROL_SIZE_LAYOUT.base.padX,i.CONTROL_SIZE_LAYOUT.base.padY),mid:i.cn(i.CONTROL_SIZE_LAYOUT.mid.padX,i.CONTROL_SIZE_LAYOUT.mid.padY),large:i.cn(i.CONTROL_SIZE_LAYOUT.large.padX,i.CONTROL_SIZE_LAYOUT.large.padY)},UL="cursor-pointer text-foreground focus-ring",WL="cursor-not-allowed bg-transparent text-muted opacity-45",YL="data-active:bg-default-hover";function $L({isGloss:e,slotClass:t,className:n}){return i.cn(kL,e&&BL,t,n)}function XL({slotClass:e,className:t}){return i.cn(jL,e,t)}function KL({slotClass:e,className:t}){return i.cn(ML,e,t)}function qL({slotClass:e,className:t}){return i.cn(FL,e,t)}function ZL({slotClass:e,className:t}){return i.cn(HL,e,t)}function QL({slotClass:e,className:t}){return i.cn(GL,e,t)}function JL({size:e,disabled:t,slotClass:n,className:o}){return i.cn(VL,zL[e],!t&&i.cn(UL,i.SURFACE_COLOR_TRANSITION,YL),t&&WL,n,o)}function e_({children:e,label:t,hint:n,icon:o,value:r,disabled:s=!1}){const{listId:l,size:u,selected:d,showIndicator:f,indicatorMode:m,disabled:p,selectItem:C,setActiveValue:S}=bn("ListBox.Item"),g=s||!!p,h=d.has(r),x=va(l,r),A=a.useMemo(()=>yL({children:e,label:t,hint:n,icon:o,showIndicator:f}),[e,n,o,t,f]);return{size:u,disabled:g,isSelected:h,optionId:x,indicatorMode:m,selectItem:C,setActiveValue:S,...A}}const t_=500;function or(){return{buffer:"",timeoutId:null}}function Ia(e,t){return!(t.ctrlKey||t.altKey||t.metaKey||e.length!==1||e===" ")}function ya(e,t,n=t_){return e.buffer+=t,e.timeoutId!=null&&clearTimeout(e.timeoutId),e.timeoutId=setTimeout(()=>{e.buffer="",e.timeoutId=null},n),e.buffer}function n_(e){return e.length>1&&e.split("").every(t=>t===e[0])?e[0]:e}function Na(e,t,n){const o=n_(t).toLowerCase();if(!o||e.length===0)return-1;const r=e.length,s=n>=0?n:-1;for(let l=1;l<=r;l+=1){const u=(s+l)%r;if((e[u]??"").toLowerCase().startsWith(o))return u}return-1}function Wd({listId:e,variant:t="default",className:n,ariaLabel:o,ariaLabelledBy:r,children:s,tabIndex:l,onKeyDown:u,onFocus:d,...f}){const m=tt(),{setActiveValue:p,selectItem:C,multiple:S,disabled:g,standaloneKeyboard:h}=bn("ListBox"),x=Id(),A=t==="gloss",b=a.useRef(null),L=OL(A),_=a.useCallback(I=>{b.current=I,L(I)},[L]);PL({listId:e,activeValue:x,rootRef:b});const v=a.useRef(or()),R=a.useCallback(I=>{if(u==null||u(I),I.defaultPrevented||!h||g)return;const O=I.currentTarget,N=()=>{document.activeElement!==O&&O.focus()};if(I.key==="ArrowDown"){I.preventDefault();const y=Ki({root:O,activeValue:x,delta:1});y&&p(y),N();return}if(I.key==="ArrowUp"){I.preventDefault();const y=Ki({root:O,activeValue:x,delta:-1});y&&p(y),N();return}if(I.key==="Home"){I.preventDefault();const y=Ud(O);y&&p(y),N();return}if(I.key==="End"){I.preventDefault();const y=NL(O);y&&p(y),N();return}if(I.key==="Enter"||I.key===" "){if(!x){const y=qi(O);y&&(I.preventDefault(),p(y),C(y),N());return}I.preventDefault(),C(x),N();return}if(Ia(I.key,I)){I.preventDefault();const{values:y,labels:w}=wL(O),P=x?y.indexOf(x):-1,k=Na(w,ya(v.current,I.key),P);if(k<0)return;const j=y[k];j&&p(j),N()}},[x,g,u,C,p,h]),T=a.useCallback(I=>{if(d==null||d(I),I.defaultPrevented||!h||g||x)return;const O=qi(I.currentTarget);O&&p(O)},[x,g,d,p,h]),E=l??(h&&!g?0:void 0);return c.jsx("div",{ref:_,id:e,role:"listbox","aria-label":o,"aria-labelledby":r,"aria-multiselectable":S||void 0,"aria-activedescendant":h?Rv(e,x):void 0,"aria-disabled":g||void 0,tabIndex:E,onKeyDown:R,onFocus:T,className:$L({isGloss:A,slotClass:m.root,className:n}),...f,children:s})}Wd.displayName="ListBox";function Yd({className:e,children:t,...n}){const o=tt(),[r,s]=a.useState(),l=a.useCallback(u=>{s(u)},[]);return c.jsx(wv,{value:l,children:c.jsx("div",{role:"group","aria-labelledby":r,className:XL({slotClass:o.section,className:e}),...n,children:t})})}Yd.displayName="ListBoxSection";function $d({className:e,textClassName:t,children:n,id:o,...r}){const s=a.useId(),l=o??s,u=tt(),d=Ov();return a.useEffect(()=>(d==null||d(l),()=>d==null?void 0:d(void 0)),[l,d]),c.jsx("div",{id:l,className:KL({slotClass:u.header,className:e}),...r,children:c.jsx(q,{as:"span",variant:"small",className:qL({slotClass:u.headerText,className:t}),children:n})})}$d.displayName="ListBoxHeader";function Xd({className:e,...t}){const n=tt();return c.jsx("div",{role:"presentation","aria-hidden":!0,className:ZL({slotClass:n.separator,className:e}),...t})}Xd.displayName="ListBoxSeparator";function Kd({className:e,children:t,...n}){const o=tt();return c.jsx(q,{as:"p",variant:"base",className:QL({slotClass:o.empty,className:e}),...n,children:t??Tv})}Kd.displayName="ListBoxEmpty";const o_=a.forwardRef(function({children:t,className:n,value:o,disabled:r=!1,label:s,hint:l,icon:u,onClick:d,onPointerDown:f,onPointerEnter:m,...p},C){const S=tt(),{size:g,disabled:h,isSelected:x,optionId:A,indicatorMode:b,isCompound:L,hasHint:_,hasIcon:v,hasLabel:R,showIndicatorSlot:T,selectItem:E,setActiveValue:I}=e_({children:t,label:s,hint:l,icon:u,value:o,disabled:r}),{labelMotionRef:O,enableLabelMotion:N,handlePointerDown:y}=DL({disabled:h,hasLabel:R,onPointerDown:f}),w=a.useCallback(B=>{d==null||d(B),!(B.defaultPrevented||h)&&E(o)},[h,d,E,o]),P=a.useCallback(B=>{m==null||m(B),!h&&I(o)},[h,m,I,o]),k=a.useMemo(()=>({showIndicatorSlot:T,hasHint:_,hasIcon:v,selected:x,indicatorMode:b,disabled:h,mutedHint:h,enableLabelMotion:N,labelMotionRef:O}),[h,N,_,v,b,x,O,T]),j=L?c.jsx(c.Fragment,{children:t}):c.jsxs(c.Fragment,{children:[T?c.jsx(Da,{}):null,s!=null?c.jsx(wa,{children:s}):null,l!=null?c.jsx(Oa,{children:l}):null,u!=null?c.jsx(Pa,{children:u}):null]});return c.jsx(Xr,{value:k,children:c.jsx("button",{ref:C,type:"button",id:A,role:"option","data-value":o,"aria-selected":x,disabled:h,tabIndex:-1,className:i.cn(JL({size:g,disabled:h}),Bd(_,ye[g].listItemGapX,T,v),S.item,n),onClick:w,onPointerDown:y,onPointerEnter:P,...p,children:j})})}),qd=a.memo(o_);qd.displayName="ListBoxItem";function wa({className:e,...t}){const{size:n}=bn("ListBox.Label"),o=tt();return c.jsx(Fd,{textVariant:i.CONTROL_SIZE_LAYOUT[n].controlText,className:i.cn(o.label,e),...t})}wa.displayName="ListBoxLabel";function Oa({className:e,...t}){const n=tt();return c.jsx(Hd,{className:i.cn(n.hint,e),...t})}Oa.displayName="ListBoxHint";function Pa({className:e,...t}){const{size:n}=bn("ListBox.Icon"),o=tt();return c.jsx(Gd,{className:i.cn(`[&_svg]:${i.CONTROL_SIZE_LAYOUT[n].icon}`,o.icon,e),...t})}Pa.displayName="ListBoxIcon";function Da({variant:e="default",size:t,check:n,children:o,className:r,classNames:s,...l}){const u=Hn("ListBox.ItemIndicator"),{size:d}=bn("ListBox.ItemIndicator"),f=tt(),m=EL(d,t);if(!u.showIndicatorSlot)return null;const p=n??u.indicatorMode==="multi";return c.jsx(Vd,{className:i.cn(f.itemIndicator,s==null?void 0:s.itemIndicator,r),...l,children:c.jsx(Be,{variant:e,size:m,selected:u.selected,check:p,classNames:RL({slotClassNames:f,classNames:s}),children:o})})}Da.displayName="ListBoxItemIndicator";function ka(e,t,n){if(n){const o=[...e],r=o.indexOf(t);return r>=0?o.splice(r,1):o.push(t),o}return e.includes(t)?[]:[t]}function r_({size:e="base",multiple:t=!1,value:n,defaultValue:o,onValueChange:r,selectionIndicator:s=!0,disabled:l=!1,activeValue:u,onActiveValueChange:d,listId:f}){const m=a.useId(),p=f??`listbox-${m}`,C=n!==void 0,[S,g]=a.useState(()=>Xi(o)),h=C?Xi(n):S,x=a.useMemo(()=>new Set(h),[h]),A=a.useRef(h);A.current=h;const[b,L]=a.useState(null),_=u!==void 0,v=_?u:b,R=a.useCallback(O=>{_||L(O),d==null||d(O)},[_,d]),T=a.useCallback(O=>{C||g(O),r==null||r(t?O:O[0]??"")},[C,t,r]),E=a.useCallback(O=>{const N=ka(A.current,O,t);A.current=N,T(N)},[t,T]),I=a.useMemo(()=>({listId:p,size:e,multiple:t,selected:x,selectItem:E,setActiveValue:R,showIndicator:s,indicatorMode:t?"multi":"radio",disabled:l,standaloneKeyboard:!_}),[l,_,p,t,E,x,s,R,e]);return{listId:p,contextValue:I,activeValue:v}}function Zd({classNames:e,children:t,className:n,size:o,variant:r="default",multiple:s,value:l,defaultValue:u,onValueChange:d,selectionIndicator:f,disabled:m,activeValue:p,onActiveValueChange:C,listId:S,"aria-label":g,"aria-labelledby":h,...x}){const{listId:A,contextValue:b,activeValue:L}=r_({size:o,multiple:s,value:l,defaultValue:u,onValueChange:d,selectionIndicator:f,disabled:m,activeValue:p,onActiveValueChange:C,listId:S}),_=Ev({ariaLabel:g,ariaLabelledBy:h});return c.jsx(Iv,{value:b,children:c.jsx(yv,{value:L,children:c.jsx(Nv,{classNames:e,children:c.jsx(Wd,{listId:A,variant:r,className:n,ariaLabel:_["aria-label"],ariaLabelledBy:_["aria-labelledby"],...x,children:t})})})})}Zd.displayName="ListBox";const s_=Object.assign(Da,{Fill:Be.Fill,Mark:Be.Mark}),Ht=Object.assign(Zd,{Section:Yd,Header:$d,Separator:Xd,Empty:Kd,Item:qd,Label:wa,Hint:Oa,Icon:Pa,ItemIndicator:s_}),Qd=a.createContext(null),Kr=a.createContext({}),Jd=a.createContext("bottom"),ef=a.createContext({unstyled:!1});function a_({value:e,children:t}){return c.jsx(Qd.Provider,{value:e,children:t})}function qt(e){const t=a.useContext(Qd);if(!t)throw new Error(`${e} must be inside <Popover>.`);return t}function l_({classNames:e,children:t}){const n=a.useContext(Kr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Kr.Provider,{value:o,children:t})}function Zt(){return a.useContext(Kr)}function i_({value:e,children:t}){return c.jsx(Jd.Provider,{value:e,children:t})}function c_(){return a.useContext(Jd)}function u_({unstyled:e,children:t}){const n=a.useMemo(()=>({unstyled:e}),[e]);return c.jsx(ef.Provider,{value:n,children:t})}function tf(){return a.useContext(ef)}function d_(e,t){if(e===t)return!0;const n=e==null?void 0:e.displayName;if(typeof t=="string")return n===t;const o=t==null?void 0:t.displayName;return o!=null&&n===o}function ge(e,...t){let n=!1;const o=r=>{if(!n){for(const s of a.Children.toArray(r))if(a.isValidElement(s)){if(t.some(l=>d_(s.type,l))){n=!0;return}o(s.props.children)}}};return o(e),n}const f_="dialog";function Zi(e,t){return{"aria-haspopup":f_,"aria-expanded":e,"aria-controls":e?t:void 0}}function m_(e){return`${e}-label`}function p_(e){return`${e}-hint`}function C_({contentRole:e,labelConnected:t,hintConnected:n,labelId:o,hintId:r}){if(e==="dialog"){if(t&&n)return`${o} ${r}`;if(n)return r}}function g_({contentRole:e,labelConnected:t,labelId:n}){if(e==="dialog"&&t)return n}const S_=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function h_(e){const t=e.querySelectorAll(S_);for(const n of t)if(!n.closest("[aria-hidden='true']"))return n;return null}const nf="PopoverArrow";function x_(...e){return t=>{for(const n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Qi(e){return e.type.displayName===nf}function b_(e){const t=a.Children.toArray(e),n=t.find(r=>a.isValidElement(r)&&Qi(r)),o=t.filter(r=>!(a.isValidElement(r)&&Qi(r)));return{customArrow:n,panelChildren:o}}function A_(e,t,n){const[o,r]=a.useState(t),s=e!==void 0,l=s?e:o,u=a.useCallback(d=>{s||r(d),n==null||n(d)},[s,n]);return[l,u]}function v_({children:e,size:t="base",variant:n="default",side:o="bottom",open:r,defaultOpen:s=!1,onOpenChange:l,anchorRef:u,shouldDismiss:d,portalContainer:f}){const[m,p]=A_(r,s,l),C=a.useRef(null),S=a.useRef(null),g=a.useRef(m),x=`popover-${a.useId()}`,A=m_(x),b=p_(x),{labelConnected:L,hintConnected:_}=a.useMemo(()=>({labelConnected:ge(e,"PopoverTitle"),hintConnected:ge(e,"PopoverDescription")}),[e]);return a.useEffect(()=>{if(!m)return;const R=T=>{T.key==="Escape"&&p(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[m,p]),a.useEffect(()=>{if(!m)return;const R=T=>{var O;const E=T.target,I=(u==null?void 0:u.current)??C.current;I!=null&&I.contains(E)||(O=S.current)!=null&&O.contains(E)||d&&!d(E)||p(!1)};return document.addEventListener("pointerdown",R),()=>document.removeEventListener("pointerdown",R)},[u,m,p,d]),a.useEffect(()=>{if(g.current&&!m){const R=(u==null?void 0:u.current)??C.current;R==null||R.focus({preventScroll:!0})}g.current=m},[u,m,C]),{contextValue:a.useMemo(()=>({open:m,setOpen:p,popoverId:x,labelId:A,hintId:b,size:t,variant:n,side:o,labelConnected:L,hintConnected:_,triggerRef:C,anchorRef:u,contentRef:S,portalContainer:f}),[u,_,b,L,A,m,x,f,p,o,t,n])}}const Ba="data-theme",of=`[${Ba}]`;function qr(e){const t=e.getAttribute(Ba);return t==="light"?"light":t?"dark":null}function L_(e){if(typeof document>"u")return!1;if(e){const t=e.closest(of);if(t)return qr(t)==="light"}return qr(document.documentElement)==="light"}function An(e){if(typeof document>"u")return{};const t=(e==null?void 0:e.closest(of))??document.documentElement;return qr(t)!=="light"?{}:t===document.documentElement?{}:{"data-theme":"light"}}function __(e){if(typeof document>"u")return[];const t=new Set,n=[],o=r=>{let s=r;for(;s&&!t.has(s);)t.add(s),n.push(s),s=s.parentElement};return e&&o(e),o(document.documentElement),n}function T_(e,t){if(typeof document>"u")return()=>{};const n=new MutationObserver(t);for(const o of __(e))n.observe(o,{attributes:!0,attributeFilter:[Ba]});return()=>n.disconnect()}function ja(e){return a.useSyncExternalStore(a.useCallback(t=>T_(e,t),[e]),()=>L_(e),()=>!1)}function E_(e){return e?"current"in e?e.current:e:null}function Ma(e,t){const n=E_(t),o=a.useRef(null);if(!e)o.current=null;else if(!n&&o.current===null){const r=typeof document<"u"?document.activeElement:null;o.current=r instanceof HTMLElement?r:null}return n??o.current}function Ct(e){return e||(typeof document>"u"?null:document.body)}function dn(e){return typeof document>"u"||e==null?!1:e!==document.body}function R_(e,t){e.open||(t!=null&&t.contained?e.show():e.showModal())}function rf(e,t,n){if(dn(n)&&n){const o=n.getBoundingClientRect();e.style.position="absolute",e.style.left=`${t.left-o.left+n.scrollLeft}px`,e.style.top=`${t.top-o.top+n.scrollTop}px`;return}e.style.position="fixed",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`}function bt({triggerRef:e,openingRef:t,setOpen:n,disabled:o=!1,onOpened:r,runSqueeze:s=l=>i.animateInteractivePressSqueeze(l)}){if(o||t.current)return;const l=()=>{o||(n(!0),r==null||r())};if(i.prefersReducedMotion()){l();return}const u=e.current;if(!u){l();return}t.current=!0,s(u).then(()=>{t.current=!1,l()})}function At(){return a.useRef(!1)}const I_=8;function y_(e,t,n,o){return Math.max(o,Math.min(e,n-t-o))}function rr(e,t,n,o,r,s){const l=o==="start"?e:o==="end"?e+t-n:e+t/2-n/2;return y_(l,n,r,s)}function N_(e,t,n,o){return e.top-n-t>=o}function w_(e,t,n,o){return e.bottom+n+t<=window.innerHeight-o}function O_(e,t,n,o){return e.left-n-t>=o}function P_(e,t,n,o){return e.right+n+t<=window.innerWidth-o}function D_(e,t,n,o,r){return{left:rr(e.left,e.width,t.width,r,window.innerWidth,o),top:e.top-n-t.height,resolvedSide:"top"}}function k_(e,t,n,o,r){return{left:rr(e.left,e.width,t.width,r,window.innerWidth,o),top:e.bottom+n,resolvedSide:"bottom"}}function B_(e,t,n,o,r){return{left:e.left-n-t.width,top:rr(e.top,e.height,t.height,r,window.innerHeight,o),resolvedSide:"left"}}function j_(e,t,n,o,r){return{left:e.right+n,top:rr(e.top,e.height,t.height,r,window.innerHeight,o),resolvedSide:"right"}}const Ji={top:D_,bottom:k_,left:B_,right:j_},M_={top:(e,t,n,o,r)=>N_(e,n,o,r),bottom:(e,t,n,o,r)=>w_(e,n,o,r),left:(e,t,n,o,r)=>O_(e,t,o,r),right:(e,t,n,o,r)=>P_(e,t,o,r)},F_={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]};function sf(e,t,n,o,r){const s=o,l=I_,u=(r==null?void 0:r.align)??"center",d=F_[n];for(const f of d)if(M_[f](e,t.width,t.height,s,l))return Ji[f](e,t,s,l,u);return Ji[n](e,t,s,l,u)}const af={top:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",bottom:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",left:"right-0 top-1/2 -translate-y-1/2 translate-x-1/2",right:"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"},lf={top:"pb-1",bottom:"pt-1",left:"pr-1",right:"pl-1"},sr=.97;function Rt(){return i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableModalMotion")}function cf(){return{opacity:Rt()?1:0}}function H_(e,t,n){e&&(e.style.opacity="1"),t&&(t.style.opacity="1",t.style.visibility="visible",$.set(t,{scale:1,clearProps:"transform"}),n!=null&&n.focusPanel&&t.focus())}function G_({overlay:e,panel:t,vars:n,panelFrom:o={scale:sr},panelTo:r={scale:1}}){i.killMotion(e,t),$.fromTo(e,{opacity:0},{opacity:1,...n}),i.setWillChangeTransform(t,!0),$.fromTo(t,o,{...r,...n,onComplete:i.clearWillChangeOnComplete(t,n.onComplete)})}function V_({overlay:e,panel:t,vars:n,onComplete:o,panelExit:r={autoAlpha:0,scale:sr}}){i.killMotion(e,t),i.setWillChangeTransform(t,!0);const s=$.timeline({onComplete:()=>{i.setWillChangeTransform(t,!1),o()}});return s.to(e,{opacity:0,...n},0),s.to(t,{...r,...n},0),s}function ar(e){e&&(e.style.opacity="",e.style.visibility="",$.set(e,{scale:1,clearProps:"transform"}))}function z_(e){e.style.opacity="1",e.style.visibility="visible"}function lr({surface:e,vars:t,from:n={scale:sr},to:o={scale:1}}){i.killMotion(e),z_(e),i.setWillChangeTransform(e,!0),$.fromTo(e,n,{...o,...t,onComplete:i.clearWillChangeOnComplete(e,t.onComplete)})}function ir({surface:e,vars:t,onComplete:n,exit:o={}}){i.killMotion(e),i.setWillChangeTransform(e,!0);const r=Number.parseFloat(getComputedStyle(e).opacity),s=Number.isFinite(r)&&r>0?r:1;return $.fromTo(e,{autoAlpha:s},{autoAlpha:0,...o,...t,onComplete:i.clearWillChangeOnComplete(e,n??t.onComplete)})}function U_(e){const t=typeof document<"u"?document.activeElement:null;return!(t instanceof HTMLElement)||t===e||e.contains(t)?null:t}function W_({dialog:e,focusReturn:t,unmount:n}){e!=null&&e.open&&e.close(),n(),t&&document.contains(t)&&t.focus({preventScroll:!0})}function Y_({open:e,side:t,offset:n,align:o,matchAnchorWidth:r,showArrow:s,isGloss:l,forwardedRef:u,contentRef:d,triggerRef:f,anchorRef:m,portalContainer:p}){const C=a.useRef(null),S=a.useRef(null),g=a.useMemo(()=>i.createGlossInteractiveRefCallback(S,l),[l]),[h,x]=a.useState(!1),[A,b]=a.useState(t);e&&!h&&x(!0);const L=a.useCallback(v=>{C.current=v,d.current=v,x_(u)(v)},[d,u]),_=a.useCallback(()=>{const v=(m==null?void 0:m.current)??f.current,R=C.current;if(!v||!R)return;const T=v.getBoundingClientRect();r?R.style.minWidth=`${Math.max(T.width,192)}px`:R.style.minWidth="";const E=sf(T,R.getBoundingClientRect(),t,n,{align:o});b(E.resolvedSide),rf(R,E,p),R.style.transform=""},[o,m,r,n,p,t,f]);return i.usePersistentElShadow(C,!l,i.shadowBase),a.useLayoutEffect(()=>{if(!e||!h)return;_();const v=window.requestAnimationFrame(()=>_()),R=()=>_();window.addEventListener("scroll",R,!0),window.addEventListener("resize",R);const T=C.current,E=typeof document<"u"?Ct(p):null,I=typeof ResizeObserver<"u"?new ResizeObserver(()=>_()):null;return T&&I&&I.observe(T),E&&E!==document.body&&I&&I.observe(E),()=>{window.cancelAnimationFrame(v),window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R),I==null||I.disconnect()}},[e,h,p,_,s,n,o,r]),a.useLayoutEffect(()=>{var E;if(!e||!h)return;const v=C.current,R=f.current;if(!v||!R)return;const T=document.activeElement;T!==R&&!R.contains(T)||(E=h_(v))==null||E.focus({preventScroll:!0})},[e,h,f]),a.useLayoutEffect(()=>{if(!h)return;const v=C.current;if(!v)return;const R=Rt();let T=!1;if(R)return i.killMotion(v),e?ar(v):x(!1),()=>{T=!0};if(i.killMotion(v),e)return lr({surface:v,vars:{...i.motionTooltip(),overwrite:"auto"}}),()=>{T=!0,i.killMotion(v)};const E=ir({surface:v,vars:{...i.motionTooltip(),overwrite:"auto"},onComplete:()=>{T||x(!1)}});return()=>{T=!0,i.killMotion(v),E.kill()}},[e,h]),{panelRef:C,setPanelRef:L,bindGlossPanelRef:g,portalMounted:h,resolvedSide:A}}function $_({alignProp:e,matchAnchorWidth:t}){return e??(t?"start":"center")}const Gn=6,X_={small:"small",base:"base",mid:"mid",large:"large"},K_={small:"xsmall",base:"small",mid:"base",large:"base"},q_={small:"gap-small",base:"gap-base",mid:"gap-mid",large:"gap-large"},Z_="inline-flex shrink-0 border-0 bg-transparent p-0 outline-none focus-ring",Q_="pointer-events-auto z-popover w-max min-w-0 overflow-visible text-left outline-none",J_="relative overflow-visible",eT="gloss-panel gloss-deep relative z-[1] flex min-w-0 origin-center flex-col overflow-hidden text-foreground",tT="gloss-content flex min-w-0 flex-col",nT="relative z-[1] flex min-w-0 flex-col overflow-hidden border-token bg-surface text-foreground animate-shadow",oT="pointer-events-none absolute z-0 size-2 rotate-45",rT="border-0 bg-[var(--color-surface)]",sT="border-token bg-surface",aT="flex shrink-0 flex-col text-left",lT="min-w-0 font-w-mid",iT="min-h-0 min-w-0 text-left";function uf(e,t){return t?q_[e]:!1}function cT({size:e,unstyled:t,contentGap:n,gapPropSet:o}){const r=Ee(e);return t?r.rounded:i.cn(r.rounded,r.panelMin,r.popoverMax,uf(n,o))}function uT({rootSlot:e,slotClass:t,className:n}){return i.cn(Z_,e,t,n)}function dT({resolvedSide:e,showArrow:t,slotClass:n,className:o}){return i.cn(Q_,t&&lf[e],n,o)}function fT({size:e,unstyled:t,slotClass:n}){const o=Ee(e);return i.cn(eT,i.GLOSS_INTERACTIVE_MOTION_CLASS,t?o.rounded:i.cn(o.rounded,o.panelMin,o.popoverMax),n)}function mT({unstyled:e,contentGap:t,gapPropSet:n,slotClass:o}){return i.cn(tT,!e&&uf(t,n),o)}function pT({size:e,unstyled:t,contentGap:n,gapPropSet:o,slotClass:r}){return i.cn(nT,cT({size:e,unstyled:t,contentGap:n,gapPropSet:o}),r)}function CT({isGloss:e,arrowSideClass:t,slotClass:n,className:o}){return i.cn(oT,e?rT:sT,t,n,o)}function gT({size:e,unstyled:t,slotClass:n,className:o}){const r=Ee(e);return i.cn(aT,!t&&r.headerPadding,r.headingGap,n,o)}function ST({size:e,slotClass:t,className:n}){return i.cn(lT,Ee(e).titleClassName,t,n)}function hT({size:e,unstyled:t,slotClass:n,className:o}){return i.cn(iT,!t&&Ee(e).bodyPadding,n,o)}function xT(e){return X_[e]}function bT(e){return K_[e]}const df=a.forwardRef(function({className:t="",children:n,asChild:o=!0,onClick:r,onPointerDown:s,onKeyDown:l,...u},d){const{open:f,setOpen:m,triggerRef:p,popoverId:C}=qt("Popover.Trigger"),S=Zt(),g=At(),h=a.useCallback(v=>{p.current=v,typeof d=="function"?d(v):d&&(d.current=v)},[d,p]),x=a.useCallback(v=>{f||g.current||v.button!==0||(v.preventDefault(),bt({triggerRef:p,openingRef:g,setOpen:()=>m(!0)}))},[f,g,p,m]),A=a.useCallback(v=>{r==null||r(v),!v.defaultPrevented&&f&&m(!1)},[r,f,m]),b=a.useCallback(v=>{l==null||l(v),!v.defaultPrevented&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),f?m(!1):g.current||m(!0))},[l,f,g,m]),L=a.Children.count(n)===1&&a.isValidElement(n)?n:null;if(o&&L){const v=L,R=Zi(f,C);return a.cloneElement(v,yt(v,{...u,className:i.cn(S.root,S.trigger,t),onPointerDown:T=>{x(T),s==null||s(T)},onClick:A,onKeyDown:T=>{b(T)},...R},h,{runBeforeChild:["onPointerDown"]}))}const _=Zi(f,C);return c.jsx("button",{type:"button",ref:h,className:uT({rootSlot:S.root,slotClass:S.trigger,className:t}),..._,onPointerDown:v=>{s==null||s(v),x(v)},onClick:A,onKeyDown:b,...u,children:n})});df.displayName="PopoverTrigger";const Fa=a.forwardRef(function({className:t,...n},o){const r=c_(),{variant:s}=qt("Popover.Arrow"),l=Zt(),u=s==="gloss";return c.jsx("span",{ref:o,"aria-hidden":!0,className:CT({isGloss:u,arrowSideClass:af[r],slotClass:l.arrow,className:t}),...n})});Fa.displayName=nf;const ff=a.forwardRef(function({className:t,children:n,...o},r){const{size:s}=qt("Popover.Header"),{unstyled:l}=tf(),u=Zt();return c.jsx("div",{ref:r,className:gT({size:s,unstyled:l,slotClass:u.header,className:t}),...o,children:n})});ff.displayName="PopoverHeader";const mf=a.forwardRef(function({className:t,children:n,id:o,...r},s){const{labelId:l,size:u}=qt("Popover.Title"),d=Zt();return c.jsx(q,{ref:s,as:"h2",variant:xT(u),id:o??l,className:ST({size:u,slotClass:d.label,className:t}),...r,children:n})});mf.displayName="PopoverTitle";const pf=a.forwardRef(function({className:t,children:n,variant:o,...r},s){const{hintId:l,size:u}=qt("Popover.Description"),d=Zt();return c.jsx(le.Hint,{ref:s,as:"p",id:l,variant:o??bT(u),className:i.cn(d.hint,t),...r,children:n})});pf.displayName="PopoverDescription";const Cf=a.forwardRef(function({className:t,children:n,...o},r){const{size:s}=qt("Popover.Body"),{unstyled:l}=tf(),u=Zt();return c.jsx("div",{ref:r,className:hT({size:s,unstyled:l,slotClass:u.body,className:t}),...o,children:n})});Cf.displayName="PopoverBody";const gf=a.forwardRef(function({className:t="",children:n,showArrow:o=!1,offset:r=Gn,gap:s,matchAnchorWidth:l=!1,align:u,unstyled:d=!1,contentRole:f="dialog",portalContainer:m,...p},C){const{open:S,popoverId:g,size:h,variant:x,side:A,labelConnected:b,hintConnected:L,labelId:_,hintId:v,triggerRef:R,anchorRef:T,contentRef:E,portalContainer:I}=qt("Popover.Content"),O=Zt(),N=x==="gloss",y=$_({alignProp:u,matchAnchorWidth:l}),w=s!==void 0,P=s??"base",{customArrow:k,panelChildren:j}=a.useMemo(()=>b_(n),[n]),{setPanelRef:B,bindGlossPanelRef:D,portalMounted:F,resolvedSide:H}=Y_({open:S,side:A,offset:r,align:y,matchAnchorWidth:l,showArrow:o,isGloss:N,forwardedRef:C,contentRef:E,triggerRef:R,anchorRef:T,portalContainer:m??I});if(!F||typeof document>"u")return null;const U=Ct(m??I);if(!U)return null;const G=An((T==null?void 0:T.current)??R.current),K=C_({contentRole:f,labelConnected:b,hintConnected:L,labelId:_,hintId:v}),V=g_({contentRole:f,labelConnected:b,labelId:_}),oe=c.jsx(i_,{value:H,children:c.jsx(u_,{unstyled:d,children:c.jsx("div",{ref:B,...G,id:g,role:f,"aria-modal":f==="dialog"?"false":void 0,"aria-labelledby":V,"aria-describedby":K,"data-side":H,className:dT({resolvedSide:H,showArrow:o,slotClass:O.content,className:t}),...p,children:c.jsxs("div",{className:i.cn(J_,O.panelRelative),children:[o?k??c.jsx(Fa,{}):null,N?c.jsx("div",{ref:D,className:fT({size:h,unstyled:d,slotClass:O.glossPanel}),children:c.jsx("div",{className:mT({unstyled:d,contentGap:P,gapPropSet:w,slotClass:O.glossContent}),children:j})}):c.jsx("div",{className:pT({size:h,unstyled:d,contentGap:P,gapPropSet:w,slotClass:O.panel}),children:j})]})})})});return Ut.createPortal(oe,U)});gf.displayName="PopoverContent";function Sf({children:e,classNames:t,size:n="base",variant:o="default",side:r="bottom",open:s,defaultOpen:l=!1,onOpenChange:u,anchorRef:d,shouldDismiss:f,portalContainer:m}){const{contextValue:p}=v_({children:e,size:n,variant:o,side:r,open:s,defaultOpen:l,onOpenChange:u,anchorRef:d,shouldDismiss:f,portalContainer:m});return c.jsx(a_,{value:p,children:c.jsx(l_,{classNames:t,children:e})})}Sf.displayName="PopoverRoot";const ke=Object.assign(Sf,{Trigger:df,Content:gf,Header:ff,Title:mf,Description:pf,Body:Cf,Arrow:Fa});function AT(e){return`${e}-label`}function vT(e){return`${e}-listbox`}function LT(e){return{hintId:Ve(e),errorId:ze(e),labelId:AT(e),listId:vT(e)}}function _T(e,t,n){return t&&n?`${e}-opt-${n}`:void 0}function TT(e,t={openList:Se.openList,closeList:Se.closeList}){return e?t.closeList:t.openList}function ET(e,t){return e||(t==="danger"||t==="default"?"default":t)}function hf({className:e,classNames:t,...n}){const o=wt();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}hf.displayName="ComboBoxLabel";function Ha({children:e,status:t,className:n,id:o,...r}){const s=_d(),l=wt(),u=ET(t,s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}Ha.displayName="ComboBoxHint";function Ga({children:e,className:t,id:n,...o}){const r=_d(),s=wt();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Ga.displayName="ComboBoxError";const we="field-control-mobile-no-zoom",RT={small:i.CONTROL_SIZE_LAYOUT.small.controlPad,base:i.CONTROL_SIZE_LAYOUT.base.controlPad,mid:i.CONTROL_SIZE_LAYOUT.mid.controlPad,large:i.CONTROL_SIZE_LAYOUT.large.controlPad},IT={small:i.CONTROL_SIZE_LAYOUT.small.chevronIcon,base:i.CONTROL_SIZE_LAYOUT.base.chevronIcon,mid:i.CONTROL_SIZE_LAYOUT.mid.chevronIcon,large:i.CONTROL_SIZE_LAYOUT.large.chevronIcon},yT="relative z-0 flex min-w-0 items-stretch border-1 text-left overflow-hidden motion-reduce:transition-none",NT=`min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted ${we}`,wT="text-muted",OT="flex shrink-0 origin-center items-center justify-center self-stretch px-small outline-none text-muted hover:text-foreground focus-ring-inset",PT="pointer-events-none",DT="z-popover",kT="gap-0 p-base",BT="overflow-y-auto overflow-x-hidden",jT="cursor-not-allowed opacity-55 shadow-token-base",MT="cursor-pointer";function FT({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function HT(e){return e?i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e)):"rounded-base"}function GT({variant:e,status:t,disabled:n,groupSegment:o,shellHoverMotionClass:r,className:s,slotClass:l}){const u=e==="gloss";return i.cn(yT,(o==null?void 0:o.orientation)==="horizontal"?"flex-1":"w-full",HT(o),FT({variant:e}),i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),u?"":i.fieldShellHoverClass(!n,t,e),r,n?jT:MT,l,s)}function VT({size:e,muted:t,className:n,slotClass:o}){return i.cn(NT,RT[e],t&&wT,we,o,n)}function zT({disabled:e,className:t,slotClass:n}){return i.cn(OT,e&&PT,n,t)}function UT(e){const t=[e.value];return e.filterText&&t.push(e.filterText),typeof e.label=="string"&&t.push(e.label),typeof e.hint=="string"&&t.push(e.hint),t.join(" ").toLowerCase()}function WT(e,t){const n=t.trim().toLowerCase();return n?UT(e).includes(n):!0}function xf(e,t){const n=[];for(const o of e)WT(o,t)&&n.push(o.value);return n}function YT(e){return new Map(e.map(t=>[t.value,t]))}function $T(e){return e?typeof e.label=="string"?e.label:e.filterText?e.filterText:e.value:""}function XT({filteredValues:e,activeValue:t,optionsByValue:n,delta:o}){if(e.length===0)return t;const r=t?e.indexOf(t):-1;let s=r<0?0:r;for(let l=0;l<e.length;l+=1){s=(s+o+e.length)%e.length;const u=e[s],d=n.get(u);if(u&&d&&!d.disabled)return u}return t}function KT(e,t){for(const n of e){const o=t.get(n);if(o&&!o.disabled)return n}return null}function qT(e,t){for(let n=e.length-1;n>=0;n-=1){const o=e[n],r=t.get(o);if(r&&!r.disabled)return o}return null}const ZT=[];function QT({onKeyDown:e,onChange:t,onBlur:n},o){const r=Fn(),{comboBoxId:s,open:l,setOpen:u,value:d,setValue:f,filterQuery:m,setFilterQuery:p,listId:C,activeValue:S,setActiveValue:g,inputRef:h,anchorRef:x,options:A,filteredValues:b,disabled:L,placeholder:_,size:v,status:R,required:T,hintConnected:E,errorConnected:I,hintId:O,errorId:N,formInputRef:y,formOnBlur:w}=r,P=At(),k=a.useRef(null),j=a.useMemo(()=>YT(A),[A]),B=a.useMemo(()=>j.get(d),[j,d]),D=a.useMemo(()=>$T(B),[B]),F=_T(C,l,S),H=je(E?O:void 0,I?N:void 0),U=a.useCallback(()=>{const M=k.current;k.current=null;const W=M??"";p(W);const Y=xf(A,W),Z=Y.indexOf(d);g(Z>=0?d:Y[0]??null),requestAnimationFrame(()=>{const ce=h.current;if(!ce)return;ce.focus();const z=W.length;ce.setSelectionRange(z,z)})},[h,A,g,p,d]),G=a.useCallback(()=>{bt({triggerRef:x,disabled:L,setOpen:u,onOpened:U,openingRef:P})},[x,L,U,P,u]),K=a.useCallback(M=>{const W=XT({filteredValues:b,activeValue:S,optionsByValue:j,delta:M});W&&g(W)},[S,b,j,g]),V=a.useCallback(M=>{var Y;const W=j.get(M);!W||W.disabled||(f(M),u(!1),p(""),(Y=h.current)==null||Y.focus())},[h,j,p,u,f]),oe=a.useCallback(M=>{t==null||t(M),l&&p(M.target.value)},[t,l,p]),J=a.useCallback(M=>{if(e==null||e(M),!(M.defaultPrevented||L)&&!M.nativeEvent.isComposing){if(!l){if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault(),G();return}if(M.key==="Enter"||M.key===" "){M.preventDefault(),G();return}M.key.length===1&&!M.ctrlKey&&!M.metaKey&&!M.altKey&&M.key!=="Tab"&&(M.preventDefault(),k.current=M.key,G());return}if(M.key==="ArrowDown"){M.preventDefault(),K(1);return}if(M.key==="ArrowUp"){M.preventDefault(),K(-1);return}if(M.key==="Enter"){M.preventDefault(),S&&V(S);return}if(M.key==="Home"){M.preventDefault();const W=KT(b,j);W&&g(W);return}if(M.key==="End"){M.preventDefault();const W=qT(b,j);W&&g(W)}}},[S,K,L,b,e,l,G,j,V,g]);a.useEffect(()=>{l||p("")},[l,p]);const ee=a.useCallback(M=>{n==null||n(M),w==null||w()},[w,n]),se=a.useCallback(M=>{ue(o,M),ue(h,M),y&&ue(y,M)},[y,o,h]);return{comboBoxId:s,open:l,disabled:L,placeholder:_,size:v,status:R,required:T,activeOptionId:F,ariaDescribedBy:H,inputValue:l?m:D,isMuted:!l&&!B,setRefs:se,handleChange:oe,handleKeyDown:J,handleBlur:ee}}const Va=a.forwardRef(function({className:t,children:n,groupSegment:o,onPointerEnter:r,onPointerLeave:s,...l},u){const d=mn(),f=gt(),m=wt(),p=Fn(),{open:C,setOpen:S,disabled:g,variant:h,status:x,size:A,anchorRef:b,listId:L}=p,_=At(),v=h==="gloss",R=d!=null&&d.segmented?void 0:o??(f==null?void 0:f.segment),T=i.useFieldShellHoverLift(b,!g&&!v&&R==null),E=i.useGlossFieldShellMotion(b,!g&&v&&R==null),I=a.useCallback(y=>{b.current=y,!g&&v&&E.bindShellRef(y)},[b,g,E,v]),O=a.useCallback(()=>{bt({triggerRef:b,disabled:g,setOpen:S,openingRef:_})},[b,g,S,_]),N=a.useCallback(y=>{g||C||y.button===0&&O()},[g,C,O]);return c.jsx("div",{ref:y=>{ue(u,y),I(y)},role:"combobox","aria-expanded":C,"aria-controls":C?L:void 0,"aria-haspopup":"listbox","aria-disabled":g||void 0,onPointerDown:N,onPointerEnter:y=>{r==null||r(y),!y.defaultPrevented&&(v&&R==null?E.onShellPointerEnter(y):T.onShellPointerEnter(y))},onPointerLeave:y=>{s==null||s(y),v&&R==null?E.onShellPointerLeave(y):T.onShellPointerLeave(y)},onFocusCapture:v&&!g&&R==null?E.onShellFocusIn:void 0,onBlurCapture:v&&!g&&R==null?E.onShellFocusOut:void 0,...g&&v?{"data-gloss-disabled":""}:{},className:GT({variant:h,status:x,disabled:g,groupSegment:R,shellHoverMotionClass:v?E.shellHoverMotionClass:T.shellHoverMotionClass,className:t,slotClass:m.inputGroup}),...l,children:n})});Va.displayName="ComboBoxInputGroup";const za=a.forwardRef(function({className:t,onKeyDown:n,onChange:o,onBlur:r,...s},l){const u=wt(),{comboBoxId:d,open:f,disabled:m,placeholder:p,size:C,status:S,required:g,activeOptionId:h,ariaDescribedBy:x,inputValue:A,isMuted:b,setRefs:L,handleChange:_,handleKeyDown:v,handleBlur:R}=QT({onKeyDown:n,onChange:o,onBlur:r},l);return c.jsx("input",{ref:L,id:d,type:"text","aria-autocomplete":"list","aria-activedescendant":h,"aria-required":g||void 0,"aria-invalid":S==="danger"?!0:void 0,"aria-describedby":x,disabled:m,readOnly:!f,autoComplete:"off",placeholder:p,value:A,onChange:_,onKeyDown:v,onBlur:R,className:VT({size:C,muted:b,className:t,slotClass:u.input}),...s})});za.displayName="ComboBoxInput";const Ua=a.forwardRef(function({className:t,onPointerDown:n,children:o,...r},s){const l=Ie(),u=wt(),{open:d,setOpen:f,setFilterQuery:m,disabled:p,size:C,inputRef:S}=Fn(),g=a.useRef(null),h=Kt(d,g),x=a.useCallback(b=>{h(b),ue(s,b)},[h,s]),A=a.useCallback(b=>{if(n==null||n(b),b.stopPropagation(),!p){if(d){f(!1),m("");return}b.button===0&&(f(!0),requestAnimationFrame(()=>{var L;return(L=S.current)==null?void 0:L.focus()}))}},[p,S,n,d,m,f]);return c.jsx("button",{type:"button",ref:x,tabIndex:-1,disabled:p,"aria-label":TT(d,l),className:zT({disabled:p,className:t,slotClass:u.trigger}),onPointerDown:A,...r,children:o??c.jsx(be.IoChevronDown,{className:i.cn(IT[C],u.triggerIcon),"aria-hidden":!0})})});Ua.displayName="ComboBoxTrigger";const Wa=a.forwardRef(function({children:t,className:n,side:o="bottom",align:r,offset:s=Gn,listBoxProps:l,...u},d){const f=wt(),{open:m,setOpen:p,anchorRef:C,listId:S,labelId:g,labelConnected:h,placeholder:x,menuMaxHeight:A,options:b,filteredValues:L,value:_,setValue:v,activeValue:R,setActiveValue:T,setFilterQuery:E,variant:I,size:O}=Fn(),{className:N,classNames:y,style:w,size:P,...k}=l??{},j=a.useCallback(D=>{const F=Array.isArray(D)?D[0]??"":D;v(F),E(""),p(!1)},[E,p,v]),B=t??(L.length===0?c.jsx(Ht.Empty,{}):L.map(D=>{const F=b.find(H=>H.value===D);return c.jsx(Ht.Item,{value:D,disabled:F.disabled,label:F.label,hint:F.hint,icon:F.icon},D)}));return c.jsx(ke,{open:m,onOpenChange:p,side:o,anchorRef:C,variant:I==="gloss"?"gloss":"default",children:c.jsx(ke.Content,{ref:d,matchAnchorWidth:!0,unstyled:!0,contentRole:void 0,align:r,offset:s,className:i.cn(DT,f.popover,n),...u,children:c.jsx(ke.Body,{className:i.cn(kT,f.popoverBody),children:c.jsx(Ht,{selectionIndicator:!0,size:P??O,...k,listId:S,"aria-labelledby":h?g:void 0,"aria-label":h?void 0:x,value:_,onValueChange:j,activeValue:R,onActiveValueChange:T,classNames:{item:f.listBoxItem,label:f.listBoxLabel,hint:f.listBoxHint,icon:f.listBoxIcon,empty:f.listBoxEmpty,header:f.listBoxHeader,headerText:f.listBoxHeaderText,...y},className:i.cn(BT,f.listBox,N),style:{maxHeight:A,...w},children:B})})})})});Wa.displayName="ComboBoxPopover";function JT({label:e,hint:t,error:n,labelId:o}){const r=wt();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:o,classNames:{root:r.label},children:e}):null,c.jsxs(Va,{children:[c.jsx(za,{}),c.jsx(Ua,{})]}),c.jsx(Wa,{}),t!=null?c.jsx(Ha,{children:t}):null,n!=null?c.jsx(Ga,{children:n}):null]})}function Re({value:e,defaultValue:t,onChange:n}){const o=e!==void 0,[r,s]=a.useState(t),l=o?e:r,u=a.useCallback(d=>{o||s(d),n==null||n(d)},[o,n]);return[l,u,o]}function Ue(e){return a.Children.toArray(e).some(t=>a.isValidElement(t))}function eE({children:e,label:t,hint:n,error:o,id:r,name:s,required:l=!1,status:u="default",size:d="base",options:f=ZT,value:m,defaultValue:p,onValueChange:C,open:S,defaultOpen:g=!1,onOpenChange:h,variant:x,disabled:A=!1,placeholder:b="Select a value",menuMaxHeight:L="min(24rem, 70vh)"}){const _=Ju({name:s,value:m,disabled:A}),v=_.bound,R=_.disabled??A,T=a.useId(),E=gt(),I=x??((E==null?void 0:E.variant)!=null?i.fieldShellVariantFromButtonGroup(E.variant):"default"),O=r??`combobox-${T}`,{hintId:N,errorId:y,labelId:w,listId:P}=LT(O),{isCompound:k,hasLabel:j,hasHint:B,hasError:D}=a.useMemo(()=>{const te=Ue(e);return{isCompound:te,hasLabel:t!=null||te&&ge(e,"Label"),hasHint:n!=null||te&&ge(e,"ComboBoxHint"),hasError:o!=null||te&&ge(e,"ComboBoxError")}},[e,o,n,t]),F=m!==void 0||v,[H,U]=a.useState(p??""),G=v?String(_.value??""):F?m??"":H,K=a.useCallback(te=>{F||U(te),C==null||C(te),v&&_.setValue(te)},[v,_,F,C]),[V,oe]=Re({value:S,defaultValue:g,onChange:h}),[J,ee]=a.useState(""),[se,M]=a.useState(null),W=a.useRef(null),Y=a.useRef(null);a.useEffect(()=>{var te;!V||!se||(te=document.getElementById(`${P}-opt-${se}`))==null||te.scrollIntoView({block:"nearest"})},[se,P,V]);const Z=a.useMemo(()=>xf(f,J),[J,f]),ce=a.useMemo(()=>({comboBoxId:O,hintId:N,errorId:y,labelId:w,labelConnected:j,hintConnected:B,errorConnected:D,required:l,status:u,size:d,errorMessage:o}),[O,o,y,D,B,j,N,l,w,d,u]),z=a.useMemo(()=>({...ce,open:V,setOpen:oe,value:G,setValue:K,filterQuery:J,setFilterQuery:ee,listId:P,activeValue:se,setActiveValue:M,anchorRef:W,inputRef:Y,variant:I,disabled:R,placeholder:b,menuMaxHeight:L,options:f,filteredValues:Z,formInputRef:v?_.ref:void 0,formOnBlur:v?_.onBlur:void 0}),[se,R,ce,J,Z,v,_,P,L,V,f,b,K,G,I]),Q=a.useMemo(()=>({controlId:O,labelId:w,required:l}),[O,l,w]);return{isCompound:k,label:t,hint:n,error:o,children:e,fieldCtx:ce,comboCtx:z,fieldLabelCtx:Q}}function bf({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u,status:d,size:f,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:L,menuMaxHeight:_,name:v,...R}){const T=et(),E=typeof v=="string"?v:void 0,I=E?T==null?void 0:T.getError(E):void 0,O=o??I,N=d==="default"&&I?"danger":d,y=f??(T==null?void 0:T.size)??"base",w=eE({children:e,label:t,hint:n,error:O,id:l,name:v,required:u,status:N,size:y,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:L,menuMaxHeight:_});return c.jsx(Lv,{value:w.fieldCtx,children:c.jsx(vv,{value:w.comboCtx,children:c.jsx(_v,{classNames:s,children:c.jsx(Ge.Provider,{value:w.fieldLabelCtx,children:c.jsx(le,{className:i.cn(r,s==null?void 0:s.root),...R,children:w.isCompound?e:c.jsx(JT,{label:w.label,hint:w.hint,error:w.error,labelId:w.fieldCtx.labelId})})})})})})}bf.displayName="ComboBox";const Af=Object.assign(bf,{Label:hf,InputGroup:Va,Input:za,Trigger:Ua,Popover:Wa,Hint:Ha,Error:Ga}),vf=a.createContext(null),Zr=a.createContext({}),Lf=a.createContext(!1),_f=a.createContext(null),Tf=a.createContext(null);function tE({value:e,children:t}){return c.jsx(vf.Provider,{value:e,children:t})}function nE({classNames:e,children:t}){const n=a.useContext(Zr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Zr.Provider,{value:o,children:t})}function Ef({value:e,children:t}){return c.jsx(Lf.Provider,{value:e,children:t})}function oE({value:e,children:t}){return c.jsx(_f.Provider,{value:e,children:t})}function rE({value:e,children:t}){return c.jsx(Tf.Provider,{value:e,children:t})}function Vn(){const e=a.useContext(vf);if(!e)throw new Error("Dropdown.* components must be inside <Dropdown>.");return e}function Me(){return a.useContext(Zr)}function Rf(){return a.useContext(Lf)}function sE(){return a.useContext(_f)}function If(){const e=a.useContext(Tf);if(!e)throw new Error("DropdownSub.* components must be inside <DropdownSub>.");return e}function aE(e){return e==="vertical"?"vertical":void 0}const lE="box-border shrink-0",iE="my-xsmall h-0 w-full min-w-0 max-w-full border-t-token",cE="mx-xsmall min-h-[1.5rem] w-0 self-stretch border-l-token";function uE(e,t){return i.cn(lE,e==="horizontal"?iE:cE,t)}const Ya=a.forwardRef(function({orientation:t="horizontal",className:n="",...o},r){const s=uE(t,n);return t==="horizontal"?c.jsx("hr",{ref:r,className:s,...o}):c.jsx("div",{ref:r,role:"separator","aria-orientation":aE(t),className:s,...o})});Ya.displayName="Separator";const dE='[role="menuitem"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([disabled]), [role="menuitemradio"]:not([disabled])';function yo(e){return Array.from(e.querySelectorAll(dE)).filter(t=>!t.hasAttribute("disabled"))}function mt(e,t){const n=e[t];n&&n.focus()}function fE(e){return(e.textContent??"").trim().replace(/\s+/g," ")}function yf(e,t,n){if(!Ia(e.key,e))return!1;e.preventDefault();const o=t.map(fE),r=document.activeElement,s=r?t.indexOf(r):-1,l=Na(o,ya(n,e.key),s);return l>=0&&mt(t,l),!0}function mE({open:e,setOpen:t,triggerRef:n,contentRef:o}){const r=a.useRef(or());a.useLayoutEffect(()=>{var u;if(!e)return;const s=o.current;if(!s)return;(u=yo(s)[0])==null||u.focus()},[o,e]),a.useEffect(()=>{if(!e)return;const s=o.current;if(!s)return;const l=r.current,u=d=>{var C;if(d.key==="Escape"){d.preventDefault(),t(!1),(C=n.current)==null||C.focus();return}const f=yo(s);if(f.length===0)return;const m=document.activeElement,p=m?f.indexOf(m):-1;if(d.key==="ArrowDown"){d.preventDefault(),mt(f,p<f.length-1?p+1:0);return}if(d.key==="ArrowUp"){d.preventDefault(),mt(f,p>0?p-1:f.length-1);return}if(d.key==="Home"){d.preventDefault(),mt(f,0);return}if(d.key==="End"){d.preventDefault(),mt(f,f.length-1);return}yf(d,f,l)};return s.addEventListener("keydown",u),()=>s.removeEventListener("keydown",u)},[o,e,t,n])}function pE({subOpen:e,portalMounted:t,panelRef:n,triggerRef:o,setOpen:r}){const s=a.useRef(or());a.useLayoutEffect(()=>{var f;if(!e||!t)return;const l=n.current,u=o.current;if(!l||!u||document.activeElement!==u)return;(f=yo(l)[0])==null||f.focus()},[n,t,e,o]),a.useEffect(()=>{if(!e||!t)return;const l=n.current;if(!l)return;const u=s.current,d=f=>{var S;if(f.key==="Escape"||f.key==="ArrowLeft"){f.preventDefault(),f.stopPropagation(),r(!1),(S=o.current)==null||S.focus();return}const m=yo(l);if(m.length===0)return;const p=document.activeElement,C=p?m.indexOf(p):-1;if(f.key==="ArrowDown"){f.preventDefault(),mt(m,C<m.length-1?C+1:0);return}if(f.key==="ArrowUp"){f.preventDefault(),mt(m,C>0?C-1:m.length-1);return}if(f.key==="Home"){f.preventDefault(),mt(m,0);return}if(f.key==="End"){f.preventDefault(),mt(m,m.length-1);return}yf(f,m,u)};return l.addEventListener("keydown",d),()=>l.removeEventListener("keydown",d)},[n,t,r,e,o])}function CE({subOpen:e,triggerRef:t,menuTriggerRef:n,subPanelRootsRef:o,popoverVariant:r,portalContainer:s}){const l=r==="gloss",u=a.useRef(null),[d,f]=a.useState({top:0,left:0,minW:0}),[m,p]=a.useState(!1);e&&!m&&p(!0);const C=a.useCallback(()=>{const S=t.current;if(!S)return;const g=S.getBoundingClientRect(),h=6,x=Math.max(g.width,160);let A=g.right+h,b=g.top;const L=x;A+L>window.innerWidth-12&&(A=Math.max(12,g.left-L-h));const _=u.current,v=(_==null?void 0:_.offsetHeight)??0;if(v>0&&b+v>window.innerHeight-8&&(b=Math.max(8,window.innerHeight-v-8)),dn(s)&&s){const R=s.getBoundingClientRect();f({top:b-R.top+s.scrollTop,left:A-R.left+s.scrollLeft,minW:x});return}f({top:b,left:A,minW:x})},[s,t]);return a.useLayoutEffect(()=>{if(!e||!m)return;C();const S=window.requestAnimationFrame(()=>C());return()=>window.cancelAnimationFrame(S)},[e,m,C]),a.useEffect(()=>{if(!e||!m)return;const S=()=>C();return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[e,m,C]),a.useLayoutEffect(()=>{const S=u.current,g=o.current;if(!(!m||!S))return g.add(S),()=>{g.delete(S)}},[m,o]),a.useLayoutEffect(()=>{if(!m)return;const S=u.current;if(!S)return;const g=Rt();let h=!1;if(g)return i.killMotion(S),e?ar(S):p(!1),()=>{h=!0};if(i.killMotion(S),e)return lr({surface:S,vars:{...i.motionTooltip(),overwrite:"auto"}}),()=>{h=!0,i.killMotion(S)};const x=ir({surface:S,vars:{...i.motionTooltip(),overwrite:"auto"},onComplete:()=>{h||p(!1)}});return()=>{h=!0,i.killMotion(S),x.kill()}},[e,m]),{isGlossPanel:l,panelRef:u,pos:d,portalMounted:m,menuTriggerRef:n,contained:dn(s)}}const gE="relative inline-flex",ec="inline-flex outline-none focus-ring",SE="z-dropdown",hE="max-h-[min(24rem,70vh)] gap-xsmall overflow-y-auto overflow-x-hidden p-base text-left outline-none",xE="flex min-w-0 flex-col gap-xsmall text-left",bE="px-base text-left",AE="text-muted",vE="relative min-w-0",LE="flex w-full min-w-0 cursor-pointer items-center gap-base rounded-mid px-base py-small text-left outline-none text-base text-foreground focus-ring",_E="min-w-0 flex-1",TE="shrink-0 text-muted icon-base",EE="fixed z-dropdown-sub outline-none",RE="flex max-h-[min(22rem,65vh)] flex-col overflow-y-auto overflow-x-hidden rounded-mid border-token bg-surface p-base text-left shadow-token-mid",IE="gloss-panel gloss-deep flex max-h-[min(22rem,65vh)] min-w-0 origin-center flex-col overflow-hidden rounded-mid text-foreground",yE="gloss-content flex min-h-0 flex-col overflow-y-auto overflow-x-hidden p-base text-left",NE="w-full min-w-0 origin-center rounded-mid px-base py-small text-left no-underline outline-none text-base",wE="cursor-not-allowed bg-transparent text-muted opacity-45 hover:bg-transparent",OE={default:i.cn("text-foreground",i.hoverVariant(),"focus-ring"),danger:i.cn("text-danger",i.hoverVariant("danger"),"focus-ring [--color-focus-ring:var(--color-focus-ring-danger)]"),warning:i.cn("text-warning",i.hoverVariant("warning"),"focus-ring [--color-focus-ring:var(--color-focus-ring-warning)]"),info:i.cn("text-info",i.hoverVariant("info"),"focus-ring [--color-focus-ring:var(--color-focus-ring-info)]"),success:i.cn("text-success",i.hoverVariant("success"),"focus-ring [--color-focus-ring:var(--color-focus-ring-success)]")};function PE({status:e,disabled:t,hasHint:n,showIndicatorSlot:o,hasIcon:r,className:s,slotClass:l}){return i.cn(NE,Bd(n,ye.base.listItemGapX,o,r),!t&&i.cn("cursor-pointer",OE[e]),t&&wE,l,s)}function DE({className:e,slotClass:t}){return i.cn(LE,i.hoverVariant(),t,e)}function kE({isGlossPanel:e,subOpen:t,portalMounted:n,className:o,slotClass:r}){return i.cn(EE,!e&&RE,!t&&n&&"pointer-events-none",r,o)}function BE({slotClassNames:e,classNames:t}){return{root:i.cn(e.itemIndicatorShell,t==null?void 0:t.root,t==null?void 0:t.itemIndicatorShell),fill:i.cn(e.itemIndicatorFill,t==null?void 0:t.fill,t==null?void 0:t.itemIndicatorFill),mark:i.cn(e.itemIndicatorMark,t==null?void 0:t.mark,t==null?void 0:t.itemIndicatorMark)}}function tc(e){return e==null?[]:Array.isArray(e)?[...e]:[e]}function jE(e){return zd(e)}function ME({children:e,href:t,selection:n,value:o,disabled:r=!1,status:s="default"}){const{selected:l,selectItem:u,multiple:d,indicatorMode:f,setOpen:m}=Vn(),p=Rf(),C=a.useMemo(()=>jE(e),[e]),S=C.indicator!=null,g=C.hint!=null,h=C.icon!=null,x=!!t,A=!x&&n!==!1,b=A&&(d||p||S),L=b?f==="multi"?"menuitemcheckbox":"menuitemradio":"menuitem",_=A&&o!=null&&l.has(o),v=a.useMemo(()=>({showIndicatorSlot:b,hasHint:g,hasIcon:h,selected:_,indicatorMode:f,disabled:r,mutedHint:r||s==="default"}),[r,g,h,f,_,b,s]);return{parts:C,selectItem:u,indicatorMode:f,setOpen:m,hasItemIndicator:S,hasHint:g,hasIcon:h,isLink:x,isSelectionItem:A,showIndicatorSlot:b,itemRole:L,isSelected:_,itemCtx:v}}function Nf({className:e,...t}){const n=Me();return c.jsx(Fd,{className:i.cn(n.itemLabel,e),...t})}Nf.displayName="DropdownItemLabel";function wf({className:e,...t}){const n=Me();return c.jsx(Hd,{className:i.cn(n.itemHint,e),...t})}wf.displayName="DropdownItemHint";function Of({className:e,...t}){const n=Me();return c.jsx(Gd,{className:i.cn(n.itemIcon,e),...t})}Of.displayName="DropdownItemIcon";function $a({variant:e="default",size:t="small",check:n,children:o,className:r,classNames:s,...l}){const u=Hn("Dropdown.ItemIndicator"),d=Me();if(!u.showIndicatorSlot)return null;const f=n??u.indicatorMode==="multi";return c.jsx(Vd,{className:i.cn(d.itemIndicator,s==null?void 0:s.itemIndicator,r),...l,children:c.jsx(Be,{variant:e,size:t,selected:u.selected,check:f,classNames:BE({slotClassNames:d,classNames:s}),children:o})})}$a.displayName="DropdownItemIndicator";const FE=a.forwardRef(function({children:t,className:n,value:o,href:r,disabled:s=!1,selection:l,status:u="default",onClick:d,onPointerDown:f,...m},p){const C=Me(),{parts:S,selectItem:g,setOpen:h,hasItemIndicator:x,hasHint:A,hasIcon:b,isLink:L,isSelectionItem:_,showIndicatorSlot:v,itemRole:R,isSelected:T,itemCtx:E}=ME({children:t,href:r,selection:l,value:o,disabled:s,status:u}),I=a.useCallback(P=>{ue(p,P)},[p]),O=PE({status:u,disabled:s,hasHint:A,showIndicatorSlot:v,hasIcon:b,className:n,slotClass:C.item}),N=a.useCallback(P=>{if(f==null||f(P),P.defaultPrevented||s)return;const k=P.currentTarget;!k||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(k)},[s,f]),y=a.useCallback(P=>{if(d==null||d(P),!(P.defaultPrevented||s)){if(!_){h(!1);return}o!=null&&g(o)}},[s,_,d,g,h,o]),w=c.jsxs(c.Fragment,{children:[v&&!x?c.jsx($a,{}):null,S.indicator,S.label,S.hint,S.icon,S.rest]});return L?c.jsx(Xr,{value:E,children:c.jsx("a",{ref:I,role:R,href:s?void 0:r,tabIndex:-1,"aria-disabled":s||void 0,className:O,onClick:y,onPointerDown:N,...m,children:w})}):c.jsx(Xr,{value:E,children:c.jsx("button",{ref:I,type:"button",role:R,disabled:s,tabIndex:-1,"aria-checked":v?T:void 0,className:O,onClick:y,onPointerDown:N,...m,children:w})})}),Pf=a.memo(FE);Pf.displayName="Dropdown.Item";function HE(e){const[t,n]=a.useState(!1),o=a.useRef(null),r=a.useRef(void 0);a.useEffect(()=>{e||n(!1)},[e]);const s=a.useCallback(()=>{window.clearTimeout(r.current),r.current=void 0},[]),l=a.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n(!1)},160)},[]);return{contextValue:a.useMemo(()=>({open:t,setOpen:n,triggerRef:o,scheduleClose:l,cancelClose:s}),[t,l,s])}}const Df=a.forwardRef(function({className:t,children:n,...o},r){const{open:s}=Vn(),l=Me(),{contextValue:u}=HE(s);return c.jsx(rE,{value:u,children:c.jsx("div",{ref:r,className:i.cn(vE,l.sub,t),...o,children:n})})});Df.displayName="Dropdown.Sub";const kf=a.forwardRef(function({className:t,children:n,asChild:o,icon:r,onPointerEnter:s,onPointerLeave:l,onClick:u,onKeyDown:d,...f},m){const{open:p,setOpen:C,triggerRef:S,scheduleClose:g,cancelClose:h}=If(),x=Me(),A=a.useCallback(R=>{s==null||s(R),!R.defaultPrevented&&(h(),C(!0))},[h,s,C]),b=a.useCallback(R=>{l==null||l(R),!R.defaultPrevented&&g()},[l,g]),L=a.useCallback(R=>{u==null||u(R),!R.defaultPrevented&&(h(),C(!0))},[h,u,C]),_=a.useCallback(R=>{if(d==null||d(R),!R.defaultPrevented){if(R.key==="Enter"||R.key===" "||R.key==="ArrowRight"){R.preventDefault(),h(),C(!0);return}R.key==="ArrowLeft"&&p&&(R.preventDefault(),C(!1))}},[h,d,p,C]),v=DE({className:t,slotClass:x.subTrigger});if(o&&a.isValidElement(n)){const R=n;return a.cloneElement(R,{...f,ref:(T=>{ue(m,T),ue(S,T),R.props.ref&&ue(R.props.ref,T)}),className:i.cn(R.props.className,v),onPointerEnter:T=>{var E,I;(I=(E=R.props).onPointerEnter)==null||I.call(E,T),A(T)},onPointerLeave:T=>{var E,I;(I=(E=R.props).onPointerLeave)==null||I.call(E,T),b(T)},onClick:T=>{var E,I;(I=(E=R.props).onClick)==null||I.call(E,T),L(T)},onKeyDown:T=>{var E,I;(I=(E=R.props).onKeyDown)==null||I.call(E,T),_(T)},role:"menuitem","aria-expanded":p,"aria-haspopup":"menu"})}return c.jsxs("div",{ref:R=>{ue(m,R),ue(S,R)},role:"menuitem",tabIndex:-1,"aria-expanded":p,"aria-haspopup":"menu",className:v,onPointerEnter:A,onPointerLeave:b,onClick:L,onKeyDown:_,...f,children:[c.jsx("span",{className:i.cn(_E,x.subTriggerLabelWrap),children:n}),r!==void 0?r:c.jsx(be.IoChevronForward,{className:i.cn(TE,x.subTriggerChevron),"aria-hidden":!0})]})});kf.displayName="Dropdown.SubTrigger";const Bf=a.forwardRef(function({children:t,className:n,style:o,onPointerEnter:r,onPointerLeave:s,portalContainer:l,...u},d){const{open:f,triggerRef:m,scheduleClose:p,cancelClose:C,setOpen:S}=If(),{subPanelRootsRef:g,triggerRef:h,popoverVariant:x,portalContainer:A}=Vn(),b=Me(),L=CE({subOpen:f,triggerRef:m,menuTriggerRef:h,subPanelRootsRef:g,popoverVariant:x,portalContainer:l??A});pE({subOpen:f,portalMounted:L.portalMounted,panelRef:L.panelRef,triggerRef:m,setOpen:S});const _=a.useCallback(I=>{r==null||r(I),!I.defaultPrevented&&C()},[C,r]),v=a.useCallback(I=>{s==null||s(I),!I.defaultPrevented&&p()},[s,p]);if(!L.portalMounted)return null;const R=An(h.current),T=c.jsx("div",{ref:I=>{ue(d,I),ue(L.panelRef,I)},...R,role:"menu",className:kE({isGlossPanel:L.isGlossPanel,subOpen:f,portalMounted:L.portalMounted,className:n,slotClass:b.subContent}),style:{position:L.contained?"absolute":"fixed",top:L.pos.top,left:L.pos.left,minWidth:L.pos.minW,...o},...u,onPointerEnter:_,onPointerLeave:v,children:L.isGlossPanel?c.jsx("div",{className:i.cn(IE,b.subContentGlossPanel),children:c.jsx("div",{className:i.cn(yE,b.subContentGlossContent),children:t})}):t}),E=typeof document<"u"?Ct(l??A):null;return E?Ut.createPortal(T,E):null});Bf.displayName="Dropdown.SubContent";const jf=a.forwardRef(function({children:t,className:n,asChild:o,onClick:r,onPointerDown:s,onKeyDown:l,...u},d){const{open:f,setOpen:m,triggerRef:p,contentId:C}=Vn(),S=Me(),g=At(),h=a.useCallback(b=>{f||g.current||b.button!==0||(b.preventDefault(),bt({triggerRef:p,openingRef:g,setOpen:()=>m(!0)}))},[f,g,p,m]),x=a.useCallback(b=>{r==null||r(b),!b.defaultPrevented&&f&&m(!1)},[r,f,m]),A=a.useCallback(b=>{l==null||l(b),!b.defaultPrevented&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f?m(!1):g.current||m(!0))},[l,f,g,m]);if(o&&a.isValidElement(t)){const b=t;return a.cloneElement(b,yt(b,{...u,className:i.cn(ec,S.trigger,n),onPointerDown:L=>{h(L),s==null||s(L)},onClick:x,onKeyDown:A,"aria-expanded":f,"aria-haspopup":"menu","aria-controls":f?C:void 0},$e(d,p),{runBeforeChild:["onPointerDown"]}))}return c.jsx("button",{type:"button",ref:b=>{ue(d,b),ue(p,b)},className:i.cn(ec,S.trigger,n),"aria-expanded":f,"aria-haspopup":"menu","aria-controls":f?C:void 0,onPointerDown:b=>{s==null||s(b),h(b)},onClick:x,onKeyDown:A,...u,children:t})});jf.displayName="Dropdown.Trigger";const Mf=a.forwardRef(function({children:t,className:n,bodyClassName:o,variant:r,side:s="bottom",align:l,offset:u=Gn,portalContainer:d,...f},m){const{open:p,setOpen:C,triggerRef:S,contentRef:g,contentId:h,subPanelRootsRef:x,popoverVariant:A,portalContainer:b}=Vn(),L=Me(),_=r??A,v=a.useCallback(R=>{for(const T of x.current)if(T.contains(R))return!1;return!0},[x]);return mE({open:p,setOpen:C,triggerRef:S,contentRef:g}),c.jsx(ke,{open:p,onOpenChange:C,side:s,variant:_,anchorRef:S,shouldDismiss:v,portalContainer:d??b,children:c.jsx(ke.Content,{ref:R=>{ue(m,R),ue(g,R)},matchAnchorWidth:!0,unstyled:!0,contentRole:void 0,align:l,offset:u,id:h,className:i.cn(SE,L.popover,n),...f,children:c.jsx(ke.Body,{role:"menu",className:i.cn(hE,L.popoverBody,o),children:t})})})});Mf.displayName="Dropdown.Popover";const Ff=a.forwardRef(function({className:t,children:n,selectionIndicator:o,...r},s){const l=Rf(),u=Me(),d=o!==void 0?o:l,[f,m]=a.useState(),p=a.useCallback(C=>{m(C)},[]);return c.jsx(Ef,{value:d,children:c.jsx(oE,{value:p,children:c.jsx("div",{ref:s,role:"group","aria-labelledby":f,className:i.cn(xE,u.group,t),...r,children:n})})})});Ff.displayName="Dropdown.Group";const Hf=a.forwardRef(function({className:t,children:n,id:o,...r},s){const l=a.useId(),u=o??l,d=sE(),f=Me();return a.useLayoutEffect(()=>(d==null||d(u),()=>d==null?void 0:d(void 0)),[u,d]),c.jsx("div",{ref:s,id:u,className:i.cn(bE,f.label,t),...r,children:c.jsx(q,{as:"span",variant:"small",className:AE,children:n})})});Hf.displayName="Dropdown.Label";function Gf({className:e,...t}){const n=Me();return c.jsx(Ya,{className:i.cn(n.separator,e),...t})}Gf.displayName="Dropdown.Separator";function GE({open:e,defaultOpen:t=!1,onOpenChange:n,multiple:o=!1,value:r,defaultValue:s,onValueChange:l,closeOnSelect:u,popoverVariant:d="default",portalContainer:f}){const m=e!==void 0,[p,C]=a.useState(t),S=m?e:p,g=a.useRef(null),h=a.useRef(null),x=a.useRef(null);x.current||(x.current=new Set);const A=a.useId(),b=a.useCallback(w=>{m||C(w),n==null||n(w),w||requestAnimationFrame(()=>{var P;(P=g.current)==null||P.focus({preventScroll:!0})})},[m,n]),L=r!==void 0,[_,v]=a.useState(()=>tc(s)),R=L?tc(r):_,T=a.useMemo(()=>new Set(R),[R]),E=a.useRef(R);E.current=R;const I=a.useCallback(w=>{L||v(w),l==null||l(o?w:w[0]??"")},[L,o,l]),O=a.useCallback(w=>{const P=ka(E.current,w,o);E.current=P,I(P),(u??!o)&&b(!1)},[u,o,b,I]),N=o?"multi":"radio";return{contextValue:a.useMemo(()=>({open:S,setOpen:b,multiple:o,selected:T,selectItem:O,indicatorMode:N,closeOnSelect:u??!o,popoverVariant:d,triggerRef:g,contentRef:h,contentId:A,subPanelRootsRef:x,portalContainer:f}),[S,b,o,T,O,N,u,d,A,f,x])}}function Vf({children:e,className:t,classNames:n,open:o,defaultOpen:r,onOpenChange:s,multiple:l,value:u,defaultValue:d,onValueChange:f,selectionIndicator:m=!1,closeOnSelect:p,popoverVariant:C,portalContainer:S,...g}){const{contextValue:h}=GE({open:o,defaultOpen:r,onOpenChange:s,multiple:l,value:u,defaultValue:d,onValueChange:f,closeOnSelect:p,popoverVariant:C,portalContainer:S});return c.jsx(tE,{value:h,children:c.jsx(nE,{classNames:n,children:c.jsx(Ef,{value:m,children:c.jsx("div",{className:i.cn(gE,n==null?void 0:n.root,t),...g,children:e})})})})}Vf.displayName="Dropdown";const VE=Object.assign($a,{Fill:Be.Fill,Mark:Be.Mark}),Gt=Object.assign(Vf,{Trigger:jf,Popover:Mf,Group:Ff,Label:Hf,Separator:Gf,Item:Pf,ItemLabel:Nf,ItemHint:wf,ItemIcon:Of,ItemIndicator:VE,Sub:Df,SubTrigger:kf,SubContent:Bf}),Xa=a.createContext(null),Qr=a.createContext({});function zE({value:e,children:t}){return c.jsx(Xa.Provider,{value:e,children:t})}function UE({classNames:e,children:t}){const n=a.useContext(Qr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Qr.Provider,{value:o,children:t})}function zf(){const e=a.useContext(Xa);if(!e)throw new Error("Input compound parts must be used inside <Input>.");return e}function WE(){return a.useContext(Xa)}function vt(){return a.useContext(Qr)}function YE(e){return i.killMotion(e),new Promise(t=>{$.to(e,{scale:.94,y:"-0.5rem",autoAlpha:0,...i.motionInteractive(),overwrite:"auto",onComplete:()=>{i.killMotion(e),t()}})})}function $E({shellRef:e,blocked:t,variant:n,groupSegment:o,onPointerDown:r}){const s=n==="gloss",l=i.useFieldShellHoverLift(e,!t&&!s&&o==null),u=i.useGlossFieldShellMotion(e,!t&&s&&o==null),d=a.useCallback(m=>{e.current=m,!t&&s&&u.bindShellRef(m)},[t,u,s,e]),f=a.useCallback(m=>{if(r==null||r(m),m.defaultPrevented||t||s||o!=null)return;const p=e.current;!p||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(p)},[t,o,s,r,e]);return{isGloss:s,setShellRef:d,handleShellPointerDown:f,shellPointerDown:s&&!t?u.onShellPointerDown:f,shellPointerEnter:s&&!t?u.onShellPointerEnter:l.onShellPointerEnter,shellPointerLeave:s&&!t?u.onShellPointerLeave:l.onShellPointerLeave,shellFocusCapture:s&&!t?u.onShellFocusIn:void 0,shellBlurCapture:s&&!t?u.onShellFocusOut:void 0,shellHoverMotionClass:s?u.shellHoverMotionClass:l.shellHoverMotionClass,glossDisabledAttr:t&&s?{"data-gloss-disabled":""}:{}}}function XE(e,t){const n=new DataTransfer;t.forEach(o=>n.items.add(o)),e.files=n.files}function KE(e=Se.showPassword){return e}function qE(e=Se.hidePassword){return e}function ZE(e=Se.removeFile){return e}const QE="bg-primary-tint",JE="flex items-stretch overflow-hidden",eR="relative",tR=`min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted ${we}`,nR=`absolute inset-0 cursor-pointer opacity-0 disabled:cursor-not-allowed ${we}`,oR="pointer-events-none size-12 shrink-0 text-muted",rR="flex size-9 shrink-0 items-center justify-center rounded-base bg-surface text-muted border-token",sR="icon-mid shrink-0",aR="icon-mid shrink-0",nc="shrink-0",lR="pointer-events-none max-w-[18rem] text-center text-muted",oc="size-9 shrink-0 rounded-base border-token object-cover",iR="flex min-w-0 items-center gap-base",cR="flex h-full min-w-0 flex-1 items-center gap-base",rc="min-w-0 flex-1 truncate",uR="relative z-10 flex size-8 shrink-0 items-center justify-center rounded-base text-danger outline-none",dR="flex self-stretch shrink-0 items-stretch border-l-token",fR="relative z-10 flex h-full items-center justify-center text-muted outline-none hover:text-foreground focus-ring-inset",mR="border-r-token",pR="border-l-token",CR={small:i.affixSlotClass("small"),base:i.affixSlotClass("base"),mid:i.affixSlotClass("mid"),large:i.affixSlotClass("large")},gR={small:i.CONTROL_SIZE_LAYOUT.small.controlPad,base:i.CONTROL_SIZE_LAYOUT.base.controlPad,mid:i.CONTROL_SIZE_LAYOUT.mid.controlPad,large:i.CONTROL_SIZE_LAYOUT.large.controlPad},Uf={small:{icon:"icon-small",pad:"px-xsmall"},base:{icon:"icon-base",pad:"px-small"},mid:{icon:"icon-mid",pad:"px-base"},large:{icon:"icon-large",pad:"px-base"}};function Wf(e="default"){return QE}function SR({side:e,status:t,size:n,slotClass:o}){return i.cn(CR[n],Wf(t),e==="prefix"?mR:pR,o)}function hR({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function xR(e){return e!=null?i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e),"relative focus-within:z-[2]"):"rounded-base"}function bR({variant:e,status:t,blocked:n,groupSegment:o,fileListEmpty:r,shellSurface:s,shellFileEmptySurface:l,shellHoverMotionClass:u,className:d,slotClass:f}){const m=e==="gloss";return i.cn(JE,m&&eR,(o==null?void 0:o.orientation)==="horizontal"?"min-w-0 flex-1":"w-full",r?"min-h-[7.25rem]":i.cn(m?"":"border-1"),xR(o),l??s,i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),!m&&i.fieldShellHoverClass(!n,t,e),u,n&&"cursor-not-allowed opacity-55 shadow-token-base",f,d)}function AR(e){return i.cn("relative flex min-h-[6.5rem] min-w-0 flex-1 flex-col items-center justify-center gap-mid px-xlarge py-2xlarge",e)}function vR({multipleFiles:e,slotClass:t}){return i.cn("relative min-w-0 flex-1 px-xlarge py-base",e?"flex flex-col gap-base":"flex h-full items-center gap-mid",t)}function LR({size:e,disabled:t,slotClass:n}){const o=Uf[e];return i.cn(fR,i.TEXT_COLOR_TRANSITION,i.affixToggleMinWClass(e),o.pad,t?"cursor-not-allowed opacity-45":"cursor-pointer",n)}function _R({disabled:e,slotClass:t}){return i.cn(uR,i.TEXT_COLOR_TRANSITION,i.hoverVariant("danger"),"focus-ring",e&&"pointer-events-none opacity-40",t)}function sc({side:e,status:t,controlSize:n,children:o}){const r=vt();return c.jsx("span",{className:SR({side:e,status:t,size:n,slotClass:e==="prefix"?r.prefix:r.suffix}),children:o})}function TR({status:e,controlSize:t,visible:n,disabled:o,onToggle:r}){const s=Ie(),l=vt(),u=Uf[t];return c.jsx("span",{className:i.cn(dR,Wf(e)),children:c.jsx("button",{type:"button",disabled:o,"aria-label":n?qE(s.hidePassword):KE(s.showPassword),"aria-pressed":n,onClick:d=>{d.preventDefault(),d.stopPropagation(),r()},onPointerDown:d=>d.stopPropagation(),className:LR({size:t,disabled:o,slotClass:l.passwordToggle}),children:n?c.jsx(be.IoEyeOff,{className:i.cn(nc,u.icon),"aria-hidden":!0}):c.jsx(be.IoEye,{className:i.cn(nc,u.icon),"aria-hidden":!0})})})}function ac({className:e}){const t=vt();return c.jsx("span",{className:i.cn(rR,t.fileGlyph,e),"aria-hidden":!0,children:c.jsx(be.IoFolderOpen,{className:sR,"aria-hidden":!0})})}function lc({disabled:e,onRemove:t}){const n=ZE(St("removeFile")),o=vt();return c.jsx("button",{type:"button",disabled:e,title:n,"aria-label":n,onClick:r=>{r.preventDefault(),r.stopPropagation(),t(r)},onPointerDown:r=>r.stopPropagation(),className:_R({disabled:e,slotClass:o.fileRemove}),children:c.jsx(be.IoClose,{className:aR,"aria-hidden":!0})})}const Ka=a.forwardRef(function({variant:t="default",status:n,size:o,inputType:r="text",placeholder:s,prefix:l,suffix:u,id:d,disabled:f,readOnly:m,className:p="",groupSegment:C,onPointerDown:S,onChange:g,onBlur:h,"aria-describedby":x,name:A,value:b,...L},_){const v=ia({name:typeof A=="string"?A:void 0,value:b,onChange:g,onBlur:h,disabled:f,readOnly:m,type:r}),R=v.name??A,T=v.bound?v.value:b,E=v.onChange,I=v.onBlur,O=v.disabled??f,N=v.readOnly??m,y=v.ref,w=WE(),P=et(),k=vt(),j=mn(),B=gt(),D=a.useId(),F=d??(w==null?void 0:w.inputId)??D,H=n??(w==null?void 0:w.status)??"default",U=o??(w==null?void 0:w.size)??(P==null?void 0:P.size)??((B==null?void 0:B.buttonSize)??"base"),G=(w==null?void 0:w.required)??!1,K=(w==null?void 0:w.hintConnected)??!1,V=(w==null?void 0:w.errorConnected)??!1,oe=w==null?void 0:w.hintId,J=w==null?void 0:w.errorId,ee=x??je(K?oe:void 0,V?J:void 0),se=j!=null&&j.segmented?void 0:C??(B==null?void 0:B.segment),M=a.useRef(null),W=a.useRef(null),Y=a.useCallback(ie=>{W.current=ie,y(ie),typeof _=="function"?_(ie):_&&(_.current=ie)},[_,y]),Z=!!(O||N),ce=t==="gloss",z=$E({shellRef:M,blocked:Z,variant:t,groupSegment:se,onPointerDown:S}),Q=r==="file",te=r==="password",[me,Ae]=a.useState(!1),[he,X]=a.useState([]);a.useEffect(()=>{te||Ae(!1)},[te]);const re=a.useMemo(()=>he.map(ie=>({file:ie,previewUrl:ie.type.startsWith("image/")?URL.createObjectURL(ie):null})),[he]);a.useEffect(()=>{const ie=re.map(xe=>xe.previewUrl).filter(xe=>xe!=null);return()=>{for(const xe of ie)URL.revokeObjectURL(xe)}},[re]),a.useEffect(()=>{if(!Q)return;const ie=W.current,xe=ie==null?void 0:ie.form;if(!xe)return;const Je=()=>X([]);return xe.addEventListener("reset",Je),()=>xe.removeEventListener("reset",Je)},[Q]);const pe=a.useCallback(ie=>{const xe=ie.target.files;X(xe?Array.from(xe):[]),E==null||E(ie)},[E]),fe=a.useCallback((ie,xe)=>{if(Z)return;const Je=()=>{X(Ir=>{const oo=Ir.filter(yr=>yr!==ie),Bt=W.current;return Bt&&XE(Bt,oo),Bt&&(g==null||g({target:Bt,currentTarget:Bt})),oo})};if(!xe||i.prefersReducedMotion()){Je();return}YE(xe).then(Je)},[Z,g]),Le=ie=>xe=>{const Je=xe.currentTarget.closest("[data-file-row]");fe(ie,Je instanceof HTMLElement?Je:null)},_t=he.length>1,lt=Q&&he.length===0,Qe=!Q,de=hR({variant:t}),_e=lt?i.cn(de,!ce&&"border-2 border-dashed"):null;return c.jsxs("div",{ref:z.setShellRef,"data-slot":"input-shell",role:"presentation",onPointerDown:z.shellPointerDown,onPointerEnter:z.shellPointerEnter,onPointerLeave:z.shellPointerLeave,onFocusCapture:z.shellFocusCapture,onBlurCapture:z.shellBlurCapture,...z.glossDisabledAttr,className:bR({variant:t,status:H,blocked:Z,groupSegment:se,fileListEmpty:lt,shellSurface:de,shellFileEmptySurface:_e,shellHoverMotionClass:z.shellHoverMotionClass,className:p,slotClass:k.shell}),children:[Qe&&l!=null?c.jsx(sc,{side:"prefix",status:H,controlSize:U,children:l}):null,Q?c.jsxs("div",{className:lt?AR(k.fileArea):vR({multipleFiles:_t,slotClass:k.fileArea}),children:[lt?c.jsxs(c.Fragment,{children:[c.jsx(be.IoFolderOpen,{className:i.cn(oR,k.fileEmpty),"aria-hidden":!0}),c.jsx(q,{as:"span",variant:"base",className:i.cn(lR,k.fileEmpty),children:s??"Select file"})]}):_t?re.map(({file:ie,previewUrl:xe})=>c.jsxs("div",{"data-file-row":"",className:i.cn(iR,k.fileRow),children:[xe?c.jsx("img",{src:xe,alt:"",className:i.cn(oc,k.filePreview)}):c.jsx(ac,{}),c.jsx(q,{as:"span",variant:"base",className:rc,children:ie.name}),Z?null:c.jsx(lc,{onRemove:Le(ie)})]},`${ie.name}-${ie.size}-${ie.lastModified}`)):c.jsxs("div",{"data-file-row":"",className:i.cn(cR,k.fileRow),children:[re[0].previewUrl?c.jsx("img",{src:re[0].previewUrl,alt:"",className:i.cn(oc,k.filePreview)}):c.jsx(ac,{}),c.jsx(q,{as:"span",variant:"base",className:rc,children:re[0].file.name}),Z?null:c.jsx(lc,{onRemove:Le(re[0].file)})]}),c.jsx("input",{ref:Y,id:F,name:R,type:"file",disabled:O,readOnly:N,onChange:pe,onBlur:I,"aria-required":G||void 0,"aria-invalid":v["aria-invalid"]??(H==="danger"?!0:void 0),"aria-describedby":ee,className:nR,...L})]}):c.jsx("input",{ref:Y,id:F,name:R,type:te?me?"text":"password":r,disabled:O,readOnly:N,placeholder:s,value:T,onChange:E,onBlur:I,"aria-required":G||void 0,"aria-invalid":v["aria-invalid"]??(H==="danger"?!0:void 0),"aria-describedby":ee,className:i.cn(tR,gR[U],k.control,we),...L}),Qe&&u!=null?c.jsx(sc,{side:"suffix",status:H,controlSize:U,children:u}):null,Qe&&te?c.jsx(TR,{status:H,controlSize:U,visible:me,disabled:f,onToggle:()=>Ae(ie=>!ie)}):null]})});Ka.displayName="InputControl";function Yf({className:e,classNames:t,...n}){const o=vt();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}Yf.displayName="InputLabel";function qa({children:e,status:t,className:n,id:o,...r}){const s=zf(),l=vt(),u=t??(s.status==="danger"||s.status==="default"?"default":s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}qa.displayName="InputHint";function Za({children:e,className:t,id:n,...o}){const r=zf(),s=vt();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Za.displayName="InputError";function ER({label:e,hint:t,error:n,inputId:o,labelId:r,size:s,status:l,controlProps:u}){const d=vt();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:r,classNames:{root:d.label},children:e}):null,c.jsx(Ka,{id:o,size:s,status:l,...u}),t!=null?c.jsx(qa,{children:t}):null,n!=null?c.jsx(Za,{children:n}):null]})}function RR({children:e,label:t,hint:n,error:o,id:r,required:s=!1,status:l="default",size:u="base"}){const d=a.useId(),f=r??`input-${d}`,m=Ve(f),p=ze(f),C=`${f}-label`,{isCompound:S,hasHint:g,hasError:h}=a.useMemo(()=>{const b=Ue(e);return{isCompound:b,hasHint:n!=null||b&&ge(e,"InputHint"),hasError:o!=null||b&&ge(e,"InputError")}},[e,o,n]),x=a.useMemo(()=>({inputId:f,hintId:m,errorId:p,labelId:C,hintConnected:g,errorConnected:h,required:s,status:l,size:u}),[p,h,g,m,f,s,C,u,l]),A=a.useMemo(()=>({controlId:f,labelId:C,required:s}),[f,s,C]);return{fieldCtx:x,fieldLabelCtx:A,isCompound:S,inputId:f,label:t,hint:n,error:o,status:l,size:u}}function IR({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u=!1,status:d="default",size:f="base",...m}){const p=et(),C=typeof m.name=="string"?m.name:void 0,S=C?p==null?void 0:p.getError(C):void 0,g=o??S,h=d==="default"&&S?"danger":d,x=f??(p==null?void 0:p.size)??"base",A=RR({children:e,label:t,hint:n,error:g,id:l,required:u,status:h,size:x}),b=A.isCompound?e:c.jsx(ER,{label:A.label,hint:A.hint,error:A.error,inputId:A.inputId,labelId:A.fieldCtx.labelId,size:A.size,status:A.status,controlProps:m});return c.jsx(zE,{value:A.fieldCtx,children:c.jsx(UE,{classNames:s,children:c.jsx(Ge.Provider,{value:A.fieldLabelCtx,children:c.jsx(le,{className:i.cn(s==null?void 0:s.root,r),children:b})})})})}const $f=Object.assign(IR,{Label:Yf,Control:Ka,Hint:qa,Error:Za});function yR(e,t=Se.openSearch){return e??t}function NR(e,t,n=Se.search){return e??(t?String(t):n)}function wR(e=Se.clearField){return e}const OR="absolute inset-0 z-[2] m-0 cursor-pointer border-0 bg-transparent p-0 outline-none focus-ring-inset rounded-[inherit]",PR="pointer-events-none absolute inset-y-0 z-[1] flex items-center justify-center text-muted",DR="shrink-0",kR="box-border min-h-0 w-full border-0 bg-transparent text-foreground outline-none placeholder:text-muted [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none disabled:cursor-not-allowed disabled:opacity-100",BR="relative z-[2] opacity-100",jR="pointer-events-none absolute inset-0 opacity-0",MR="absolute top-1/2 z-[3] flex -translate-y-1/2 items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground outline-none focus-ring-inset cursor-pointer",FR="shrink-0",HR="relative box-border inline-block overflow-hidden text-left",GR="gloss-control border-0",VR="border-1 border-token",zR="rounded-full",UR="cursor-text",WR="cursor-pointer",YR="pointer-events-none opacity-55",$R={small:"--radius-small",base:"--radius-base",mid:"--radius-mid",large:"--radius-large"},XR={small:"small",base:"base",mid:"mid",large:"large"},KR={small:.875,base:1,mid:1.125,large:1.25},qR={small:"rounded-small",base:"rounded-base",mid:"rounded-mid",large:"rounded-large"},ZR={small:"w-control-small",base:"w-control-base",mid:"w-control-mid",large:"w-control-large"},QR={small:8,base:12,mid:16,large:20},JR={small:14,base:16,mid:20,large:20},eI={small:20,base:24,mid:28,large:32},tI={small:240,base:280,mid:320,large:360};function ao(e){const t=i.CONTROL_SIZE_LAYOUT[e];return{defaultExpandedW:tI[e],iconBox:JR[e],padX:QR[e],iconClass:t.icon,controlPad:t.controlPad,shellWCollapsed:ZR[e],clearTap:eI[e],clearIconClass:t.chevronIcon,textGapClear:e==="small"?4:6}}const nI={small:ao("small"),base:ao("base"),mid:ao("mid"),large:ao("large")};function Xf(e){return nI[e]}function oI(e,t){const n=/^([\d.]+)rem$/i.exec(e);if(n)return Number.parseFloat(n[1])*t;const o=/^([\d.]+)px$/i.exec(e);if(o)return Number.parseFloat(o[1])}function rI(e,t=16){const n=XR[e];if(typeof document<"u"){const o=getComputedStyle(document.documentElement).getPropertyValue($R[n]).trim(),r=oI(o,t);if(r!=null)return r}return t*.5*KR[n]}function sI(e){return i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e))}function aI({size:e,variant:t,expanded:n,blocked:o,isGloss:r,groupSegment:s,shellHoverMotionClass:l,standardMotionClass:u,className:d,slotRoot:f}){const m=Xf(e),p=t==="gloss"?"default":t;return i.cn(s?sI(s):n?qR[e]:i.cn(zR,m.shellWCollapsed),HR,r?GR:i.cn(VR,i.FIELD_SHELL_VARIANT_BG_CLASS[p]),i.FIELD_SHELL_TRANSITION_CLASS,i.FIELD_SHELL_FOCUS_CLASS,r?l:i.fieldShellHoverClass(!o,"default",p),!r&&!o&&u,n?UR:"",!n&&!o?WR:"",o?YR:"",f,d)}function lI(e){return i.cn(PR,e)}function iI(e){return i.cn(DR,e)}function cI({controlPad:e,expanded:t,slotInput:n}){return i.cn(kR,e,we,t?BR:jR,n)}function uI(e){return i.cn(MR,i.TEXT_COLOR_TRANSITION,i.hoverVariant(),e)}function dI(e){return i.cn(FR,e)}function fI({disabled:e}){return c.jsx(Dn,{color:"neutral",disabled:e})}function mI({bindIconRef:e,layout:t,className:n}){return c.jsx("span",{ref:e,className:lI(n),style:{width:t.iconBox},"aria-hidden":!0,children:c.jsx(be.IoSearch,{className:iI(t.iconClass),"aria-hidden":!0})})}function pI({inputRef:e,id:t,disabled:n,readOnly:o,placeholder:r,value:s,defaultValue:l,onChange:u,onBlur:d,onKeyDown:f,expanded:m,ariaLabel:p,layout:C,paddingStyle:S,className:g,rest:h}){return c.jsx("input",{ref:e,id:t,type:"search",disabled:n,readOnly:o,placeholder:r,value:s,defaultValue:l,onChange:u,onBlur:d,onKeyDown:f,tabIndex:m?0:-1,"aria-label":p,className:cI({controlPad:C.controlPad,expanded:m,slotInput:g}),style:S,...h})}function CI({layout:e,onClick:t,className:n}){const o=St("clearField");return c.jsx("button",{type:"button","aria-label":wR(o),onClick:t,onPointerDown:r=>r.stopPropagation(),className:uI(n),style:{right:e.padX,width:e.clearTap,height:e.clearTap},children:c.jsx(be.IoClose,{className:dI(e.clearIconClass),"aria-hidden":!0})})}function gI({size:e,expanded:t,blocked:n,isGloss:o,groupSegment:r,layout:s,targetW:l}){const u=a.useRef(null),d=a.useRef(null),f=a.useRef(null),m=a.useRef(!1),p=a.useRef(t),C=a.useRef(t),S=i.readControlHeightPx(e),g=a.useCallback(()=>t?i.shadowBase():i.shadowNone(),[t]),h=i.useSecondLevelShadow(u,!n&&!o&&r==null,{resolveIdle:g,idleSyncKey:t}),x=i.useGlossFieldShellMotion(u,!n&&o&&r==null),A=a.useCallback(y=>{u.current=y,!n&&o&&r==null&&x.bindShellRef(y)},[n,x,r,o]),b=a.useCallback(y=>y.offsetWidth-y.clientWidth,[]),L=a.useCallback((y,w)=>(y-w-s.iconBox)/2,[s.iconBox]),_=`calc(50% - ${s.iconBox/2}px)`,v=a.useCallback(y=>{if(d.current=y,y&&!y.hasAttribute("data-search-icon-init")){y.setAttribute("data-search-icon-init","");const w=C.current;y.style.left=w?`${s.padX}px`:_}},[_,s.padX]),R=a.useCallback(y=>{const w=u.current,P=d.current;!w||!P||(y?w.style.width=`${l}px`:w.style.removeProperty("width"),w.style.removeProperty("height"),w.style.removeProperty("borderRadius"),P.style.left=y?`${s.padX}px`:_)},[_,s.padX,l]),T=a.useCallback(y=>{const w=u.current,P=d.current;if(!w||!P)return;if(i.prefersReducedMotion()){R(y);return}i.killMotion(w),i.killMotion(P),w.style.removeProperty("borderRadius");const k=rI(e);if(y){w.style.width=`${S}px`,w.style.borderRadius=`${S/2}px`;const F=(w.clientWidth-s.iconBox)/2;P.style.left=`${F}px`;const H=i.motionInteractive();$.timeline({onComplete:()=>{w.style.removeProperty("borderRadius")}}).to(w,{width:l,borderRadius:k,...H,overwrite:"auto"},0).to(P,{left:s.padX,...H,overwrite:"auto"},0);return}const j=b(w),B=L(S,j);P.style.left=`${s.padX}px`;const D=i.motionInteractive();$.timeline({onComplete:()=>{w.style.removeProperty("width"),w.style.removeProperty("borderRadius"),P.style.left=_}}).to(w,{width:S,borderRadius:S/2,...D,overwrite:"auto"},0).to(P,{left:B,...D,overwrite:"auto"},0)},[R,S,L,_,s.iconBox,s.padX,b,e,l]);a.useLayoutEffect(()=>{if(!m.current){m.current=!0,R(t),p.current=t;return}p.current!==t&&(p.current=t,T(t))},[R,t,T]);const E=a.useCallback(()=>{if(n||t)return;const y=u.current;if(!y||i.prefersReducedMotion()){f.current=Promise.resolve();return}f.current=o&&r==null?i.animateGlossInteractivePressSqueeze(y):i.animateInteractivePressSqueeze(y).then(()=>{})},[n,t,r,o]),I=a.useCallback(async()=>{await(f.current??Promise.resolve()),f.current=null},[]),O=o&&r==null?x.onShellPointerEnter:h.onPointerEnter,N=o&&r==null?x.onShellPointerLeave:h.onPointerLeave;return{rootRef:u,bindRootRef:A,bindIconRef:v,beginPressSqueeze:E,awaitPressSqueeze:I,handlePointerEnter:O,handlePointerLeave:N,onShellFocusIn:o&&r==null?x.onShellFocusIn:void 0,onShellFocusOut:o&&r==null?x.onShellFocusOut:void 0,shellHoverMotionClass:x.shellHoverMotionClass,standardMotionClass:h.motionClass}}function SI({size:e="base",variant:t,expandedWidth:n,defaultExpanded:o=!1,expanded:r,onExpandedChange:s,collapseOnBlur:l=!0,disabled:u,readOnly:d,placeholder:f="Search…",value:m,defaultValue:p,onChange:C,onBlur:S,onKeyDown:g,id:h,"aria-label":x,ripple:A=!1,groupSegment:b,className:L="",classNames:_,forwardedRef:v}){const R=Ie(),T=mn(),E=gt(),I=T!=null&&T.segmented?void 0:b??(E==null?void 0:E.segment),O=t??((E==null?void 0:E.variant)!=null?i.fieldShellVariantFromButtonGroup(E.variant):"default"),N=a.useId(),y=h??N,[w,P]=Re({value:r,defaultValue:o,onChange:s}),k=a.useRef(null),j=m!==void 0,[B,D]=a.useState(()=>p!=null&&String(p).trim().length>0||m!=null&&String(m).trim().length>0);a.useEffect(()=>{j&&D(String(m??"").trim().length>0)},[j,m]);const F=a.useCallback(de=>{k.current=de,ue(v,de)},[v]),H=!!(u||d),U=Xf(e),G=n??U.defaultExpandedW,K=O==="gloss",{rootRef:V,bindRootRef:oe,bindIconRef:J,beginPressSqueeze:ee,awaitPressSqueeze:se,handlePointerEnter:M,handlePointerLeave:W,onShellFocusIn:Y,onShellFocusOut:Z,shellHoverMotionClass:ce,standardMotionClass:z}=gI({size:e,expanded:w,blocked:H,isGloss:K,groupSegment:I,layout:U,targetW:G}),Q=a.useCallback(de=>{C==null||C(de),j||D(de.target.value.trim().length>0)},[j,C]),te=a.useCallback(de=>{var xe;if(de.preventDefault(),de.stopPropagation(),H)return;const _e=k.current;if(!_e)return;j||D(!1);const ie=(xe=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:xe.set;ie==null||ie.call(_e,""),_e.dispatchEvent(new Event("input",{bubbles:!0})),C==null||C({target:_e,currentTarget:_e}),requestAnimationFrame(()=>_e.focus())},[H,j,C]),me=a.useCallback(()=>{requestAnimationFrame(()=>{var de;return(de=k.current)==null?void 0:de.focus()})},[]),Ae=a.useCallback(async()=>{H||w||(await se(),P(!0),me())},[se,H,w,me,P]),he=a.useCallback(de=>{ee()},[ee]),X=a.useCallback(de=>{H||(de.preventDefault(),Ae())},[H,Ae]),re=a.useCallback(de=>{S==null||S(de),!(!l||H)&&window.setTimeout(()=>{const _e=V.current;if(!(_e!=null&&_e.contains(document.activeElement))){const ie=k.current;((ie==null?void 0:ie.value)??"").trim().length===0&&P(!1)}},0)},[H,l,S,V,P]),pe=a.useCallback(de=>{H||(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),Ae())},[H,Ae]),fe=a.useCallback(de=>{var _e;g==null||g(de),!de.defaultPrevented&&de.key==="Escape"&&l&&(((_e=k.current)==null?void 0:_e.value)??"").length===0&&(de.stopPropagation(),P(!1),requestAnimationFrame(()=>{var ie,xe;(xe=(ie=V.current)==null?void 0:ie.querySelector("[data-search-expand]"))==null||xe.focus()}))},[l,g,V,P]),Le=U.padX+U.iconBox+6,_t=w&&B&&!H,lt=U.padX+(_t?U.clearTap+U.textGapClear:0),Qe=aI({size:e,variant:O,expanded:w,blocked:H,isGloss:K,groupSegment:I,shellHoverMotionClass:ce,standardMotionClass:z,className:L,slotRoot:_==null?void 0:_.root});return{size:e,variant:O,expanded:w,blocked:H,isGloss:K,groupSegment:I,layout:U,ripple:A,inputId:y,placeholder:f,valueProp:m,defaultValue:p,disabled:u,readOnly:d,classNames:_,showClear:_t,rootClass:Qe,collapseA11yLabel:yR(x,R.openSearch),inputAriaLabel:NR(x,f,R.search),inputPaddingStyle:w?{paddingLeft:Le,paddingRight:lt}:void 0,setInputRef:F,handleInputChange:Q,handleClearClick:te,handleRootPointerDown:he,handleRootClick:X,handleInputBlur:re,handleRootKeyDown:pe,handleInputKeyDown:fe,bindRootRef:oe,bindIconRef:J,handlePointerEnter:M,handlePointerLeave:W,onShellFocusIn:Y,onShellFocusOut:Z}}const Qa=a.forwardRef(function({className:t="",size:n,variant:o,expandedWidth:r,defaultExpanded:s,expanded:l,onExpandedChange:u,collapseOnBlur:d,disabled:f,readOnly:m,placeholder:p,value:C,defaultValue:S,onChange:g,onBlur:h,onKeyDown:x,id:A,"aria-label":b,ripple:L,groupSegment:_,classNames:v,...R},T){var I,O,N,y;const E=SI({className:t,size:n,variant:o,expandedWidth:r,defaultExpanded:s,expanded:l,onExpandedChange:u,collapseOnBlur:d,disabled:f,readOnly:m,placeholder:p,value:C,defaultValue:S,onChange:g,onBlur:h,onKeyDown:x,id:A,"aria-label":b,ripple:L,groupSegment:_,classNames:v,forwardedRef:T});return c.jsxs("div",{ref:E.bindRootRef,role:"search","data-search-expanded":E.expanded?"":void 0,onFocusCapture:E.onShellFocusIn,onBlurCapture:E.onShellFocusOut,className:E.rootClass,onPointerDown:E.handleRootPointerDown,onPointerEnter:E.handlePointerEnter,onPointerLeave:E.handlePointerLeave,children:[E.expanded?null:c.jsx("button",{type:"button","data-search-expand":"",className:i.cn(OR,(I=E.classNames)==null?void 0:I.expandTrigger),tabIndex:E.blocked?-1:0,disabled:E.blocked,"aria-expanded":!1,"aria-controls":E.inputId,"aria-label":E.collapseA11yLabel,onClick:E.handleRootClick,onKeyDown:E.handleRootKeyDown}),E.ripple?c.jsx(fI,{disabled:E.blocked}):null,c.jsx(mI,{bindIconRef:E.bindIconRef,layout:E.layout,className:(O=E.classNames)==null?void 0:O.icon}),c.jsx(pI,{inputRef:E.setInputRef,id:E.inputId,disabled:E.disabled,readOnly:E.readOnly,placeholder:E.placeholder,value:E.valueProp,defaultValue:E.defaultValue,onChange:E.handleInputChange,onBlur:E.handleInputBlur,onKeyDown:E.handleInputKeyDown,expanded:E.expanded,ariaLabel:E.inputAriaLabel,layout:E.layout,paddingStyle:E.inputPaddingStyle,className:(N=E.classNames)==null?void 0:N.input,rest:R}),E.showClear?c.jsx(CI,{layout:E.layout,onClick:E.handleClearClick,className:(y=E.classNames)==null?void 0:y.clear}):null]})});Qa.displayName="SearchInput";function Ja(e){const t=[];return a.Children.forEach(e,n=>{if(a.isValidElement(n)){if(n.type===a.Fragment){const{children:o}=n.props;t.push(...Ja(o));return}t.push(n)}}),t}function Kf(e){return e.type===Vt||e.type===$f.Control||e.type===Af||e.type===Qa||e.type===Gt||e.type.displayName==="ButtonGroupText"}function qf(e,t){return t<=1?"only":e===0?"first":e===t-1?"last":"middle"}function Zf(e,t){return{orientation:e,position:t}}function hI(e){return e.reduce((t,n)=>t+(Kf(n)?1:0),0)}function xI({children:e,orientation:t="horizontal",segmented:n=!1,buttonSize:o="base",variant:r="default"}){const s=a.useMemo(()=>Ja(e),[e]),l=a.useMemo(()=>hI(s),[s]),u=a.useMemo(()=>({segmented:n}),[n]);return{flat:s,segmentCount:l,layoutValue:u,orientation:t,segmented:n,buttonSize:o,variant:r}}function bI({orientation:e}){const t=nu();return c.jsx("span",{...Av(),className:i.buttonGroupSeparatorClass(e,t.separator)})}const Qf=a.forwardRef(function({children:t,className:n="",classNames:o,orientation:r="horizontal",segmented:s=!1,buttonSize:l="base",variant:u="default",...d},f){const{flat:m,segmentCount:p,layoutValue:C}=xI({children:t,orientation:r,segmented:s,buttonSize:l,variant:u});let S=-1;return c.jsx(Gh,{value:C,children:c.jsx(Vh,{classNames:o,children:c.jsx("div",{ref:f,role:bv,className:i.buttonGroupRootClass({orientation:r,segmented:s,variant:u,className:i.cn(o==null?void 0:o.root,n)}),...d,children:m.map((g,h)=>{if(!Kf(g))return c.jsx(a.Fragment,{children:g},g.key??`bg-wrap-${h}`);if(s)return c.jsx(a.Fragment,{children:g},g.key??`bg-item-${h}`);S+=1;const x=qf(S,p),A=Zf(r,x);return c.jsxs(a.Fragment,{children:[c.jsx(tu,{segment:A,buttonSize:l,variant:u,children:g}),u!=="gloss"&&x!=="last"&&x!=="only"?c.jsx(bI,{orientation:r}):null]},g.key??`bg-seg-${h}`)})})})})});Qf.displayName="ButtonGroup";const Jf=a.forwardRef(function({children:t,className:n="",buttonSize:o,groupSegment:r,...s},l){const u=mn(),d=gt(),f=nu(),m=o??(d==null?void 0:d.buttonSize)??"base",p=u!=null&&u.segmented?void 0:r??(d==null?void 0:d.segment),C=d==null?void 0:d.variant;return c.jsx("span",{ref:l,...s,className:i.buttonGroupTextClass({groupSegment:p,groupVariant:C,buttonSize:m,className:i.cn(f.text,n)}),children:c.jsx(q,{variant:i.BUTTON_GROUP_TEXT_VARIANT[m],inheritColor:!0,as:"span",className:i.cn(i.BUTTON_GROUP_TEXT_LABEL_CLASS,f.textLabel),children:t})})});Jf.displayName="ButtonGroupText";const AI=Object.assign(Qf,{Text:Jf}),em=a.createContext(null),tm=a.createContext(null),Jr=a.createContext({});function vI({value:e,children:t}){return c.jsx(em.Provider,{value:e,children:t})}function LI(){return a.useContext(em)}function _I({classNames:e,children:t}){const n=a.useContext(Jr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Jr.Provider,{value:o,children:t})}function vn(){return a.useContext(Jr)}function zn(){return a.useContext(tm)}function TI({value:e,children:t}){return c.jsx(tm.Provider,{value:e,children:t})}function EI(e){return Array.from(e.querySelectorAll("[data-toggle-button-value]:not([disabled])")).filter(t=>t instanceof HTMLButtonElement)}function RI(e,t,n,o){if(e)return n!=null?n===t?0:-1:t===o?0:-1}function II(e,t,n,o){if(o===0)return null;const r=t==="horizontal";switch(e){case"ArrowRight":return r?n<0?0:(n+1)%o:null;case"ArrowLeft":return r?n<0?o-1:(n-1+o)%o:null;case"ArrowDown":return r?null:n<0?0:(n+1)%o;case"ArrowUp":return r?null:n<0?o-1:(n-1+o)%o;default:return null}}function yI(e){return e?-1:0}function NI({disabled:e,isSingle:t,orientation:n,onKeyDown:o,select:r}){return s=>{if(o==null||o(s),s.defaultPrevented||e||!t)return;const l=EI(s.currentTarget);if(l.length===0)return;const u=l.findIndex(p=>p===document.activeElement),d=II(s.key,n,u,l.length);if(d==null)return;s.preventDefault();const f=l[d];f.focus();const m=f.dataset.toggleButtonValue;m&&r(m)}}const nm="data-selection-fill",el="data-selection-fill-ready";function om(e,t){i.killMotion(e),e.setAttribute(el,""),e.dataset.pressed=t?"true":"false",$.set(e,{scale:t?1:0,autoAlpha:t?1:0})}function wI(e,t){return n=>{e.current=n,n&&!n.hasAttribute(el)&&om(n,t)}}function ic(e,t,n=i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableToggleButtonFill")){if(i.killMotion(e),e.setAttribute(el,""),e.dataset.pressed=t?"true":"false",n){$.set(e,{scale:t?1:0,autoAlpha:t?1:0});return}const o=i.motionSelectionFill();t?(i.setWillChangeTransform(e,!0),$.fromTo(e,{scale:0,autoAlpha:0},{scale:1,autoAlpha:1,...o,overwrite:"auto",onComplete:i.clearWillChangeOnComplete(e)})):(i.setWillChangeTransform(e,!0),$.to(e,{scale:0,autoAlpha:0,...o,overwrite:"auto",onComplete:i.clearWillChangeOnComplete(e)}))}function rm(e,t,n){const o=n==null?void 0:n.deferFillFromPressRef,r=n==null?void 0:n.onFillStart,s=a.useRef(e),l=a.useRef(void 0),u=i.usePrefersReducedMotion(),[d,f]=a.useState(e),m=a.useMemo(()=>wI(t,s.current),[t]),p=a.useCallback(C=>{const S=t.current;S&&l.current!==C&&(l.current=C,f(C),r==null||r(C),ic(S,C,u))},[t,r,u]);return a.useLayoutEffect(()=>{const C=t.current;if(C){if(l.current===void 0){l.current=e,f(e),om(C,e);return}l.current!==e&&(o!=null&&o.current||(l.current=e,f(e),r==null||r(e),ic(C,e,u)))}},[o,r,e,t,u]),{animateTo:p,bindFillRef:m,displayPressed:d}}function OI({disabled:e,variant:t,groupSegment:n,forwardedRef:o,pressed:r,onFillStart:s,onPointerEnter:l,onPointerLeave:u,onPointerDown:d}){const f=a.useRef(null),m=a.useRef(!1),p=a.useRef(null),C=a.useRef(!1),{animateTo:S,bindFillRef:g,displayPressed:h}=rm(r,f,{deferFillFromPressRef:m,onFillStart:s}),x=a.useCallback(()=>{m.current=!1,p.current=null,C.current=!1},[]),A=a.useCallback(()=>{const I=p.current;I!==null&&(p.current=null,m.current=!1,S(I))},[S]),b=a.useCallback(()=>{C.current=!0,A()},[A]),L=i.usePrefersReducedMotion(),_=!e&&!L,v=Uo({isGloss:t==="gloss",enabled:!e,hasHoverShadow:t!=="gloss",useContentRef:!!n,forwardedRef:o,onPointerEnter:l,onPointerLeave:u,onPointerDown:d,onPressReleaseStart:_?b:void 0}),R=a.useCallback(I=>{_&&(m.current=!0,C.current=!1,p.current=null),v.handlePointerDown(I)},[v,_]),T=a.useCallback(I=>{v.handlePointerLeave(I),x()},[x,v]),E=a.useCallback(I=>{if(!_){S(I);return}p.current=I,C.current&&A()},[S,A,_]);return{setRefs:v.setRefs,contentMotionRef:v.contentMotionRef,handlePointerEnter:v.handlePointerEnter,handlePointerLeave:T,handlePointerDown:R,bindFillRef:g,queueFillOnClick:E,displayPressed:h}}const sm=new Set(["ToggleButtonContent","ToggleButtonFill","ToggleButtonLabel","ToggleButtonIconStart","ToggleButtonIconEnd","ToggleButtonText"]);function am(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function PI(e){return am(e,t=>t!=null&&sm.has(t))}function cc(e,t){return am(e,n=>n===t)}function DI(e){if(e==null||e===!1)return!1;if(typeof e=="string"||typeof e=="number")return!0;const t=a.Children.toArray(e).filter(r=>r!=null);if(t.length!==1)return!1;const n=t[0];if(typeof n=="string"||typeof n=="number")return!0;if(!a.isValidElement(n))return!1;const o=n.type.displayName;return o==null||!sm.has(o)}const kI={default:"border-token bg-surface text-foreground",outline:"bg-transparent border-token text-foreground",ghost:"bg-transparent border-token border-transparent text-foreground",gloss:"border-0 bg-transparent text-foreground"};function BI(e){return e==="outline"||e==="ghost"?"transparent-hover":"default"}function jI(e){return e==="outline"||e==="ghost"?"group-hover/toggle:bg-transparent-hover":"group-hover/toggle:bg-default-hover"}const MI="group/toggle relative inline-flex origin-center items-center justify-center overflow-hidden outline-none text-foreground focus-ring",FI="gloss-btn",HI="bg-transparent",GI="cursor-not-allowed opacity-50",VI="cursor-pointer",zI="pointer-events-none absolute -inset-px z-0 origin-center motion-reduce:transition-none",UI="relative z-[1] inline-flex w-full min-w-0 items-center justify-center gap-xsmall",WI="origin-center",YI="inline-flex shrink-0 items-center justify-center [&_svg]:size-full",$I="inline-flex w-full min-w-0 items-center gap-xsmall",XI="min-w-0 shrink",KI={small:"small",base:"base",mid:"mid",large:"large"};function qI({slotClass:e,className:t}){return i.cn($I,e,t)}function ZI(e,t){return i.cn(XI,e,t)}function QI(e){return kI[e]}function JI({fillColor:e,pressed:t,variant:n,roundingClass:o,slotClass:r}){return i.cn(zI,e,i.SURFACE_COLOR_TRANSITION,t?`group-hover/toggle:${e}/80`:jI(n),o,r)}function lm(e,t){return i.cn(YI,i.CONTROL_SIZE_LAYOUT[e].icon,t)}function ey({variant:e,pressed:t,disabled:n,size:o,groupSegment:r,slotClass:s,className:l}){const u=e==="gloss",d=r?i.buttonGroupRoundingClasses(r):i.CONTROL_SIZE_LAYOUT[o].rounded,f=r?i.buttonGroupSegmentSurfaceClasses(r):"";return i.cn(MI,u?i.cn(FI,!r&&i.GLOSS_INTERACTIVE_MOTION_CLASS):i.cn(!r&&i.SHADOW_LIFT_MOTION_CLASS),!u&&!t&&!n&&i.hoverVariant(BI(e)),!u&&QI(e),t&&HI,n?GI:VI,i.buttonRootClass(o,!0),d,f,s,l)}function ty({groupSegment:e,slotClass:t}){return i.cn(UI,e&&WI,t)}function ny(e,t){return e?i.buttonGroupRoundingClasses(e):i.CONTROL_SIZE_LAYOUT[t].rounded}const tl=a.forwardRef(function({className:t="",...n},o){const r=zn(),s=vn();return r?c.jsx("span",{ref:o??r.bindFillRef,"aria-hidden":!0,className:JI({fillColor:r.fillColor,pressed:r.pressed,variant:r.variant,roundingClass:r.roundingClass,slotClass:i.cn(s.fill,t)}),...n,[nm]:"","data-pressed":r.pressed?"true":"false"}):null});tl.displayName="ToggleButtonFill";const No=a.forwardRef(function({className:t="",children:n,...o},r){const s=zn(),l=vn();return c.jsx("span",{ref:r??(s==null?void 0:s.contentMotionRef),className:ty({groupSegment:s==null?void 0:s.groupSegment,slotClass:i.cn(l.content,t)}),...o,children:n})});No.displayName="ToggleButtonContent";const im=a.forwardRef(function({className:t="",children:n,...o},r){const s=vn();return c.jsx("span",{ref:r,className:qI({slotClass:s.label,className:t}),...o,children:n})});im.displayName="ToggleButtonLabel";function nl({className:e="",children:t,...n}){const o=zn(),r=vn(),s=(o==null?void 0:o.size)??"base";return c.jsx("span",{className:lm(s,i.cn(r.icon,e)),"aria-hidden":!0,...n,children:t})}nl.displayName="ToggleButtonIconStart";function ol({className:e="",children:t,...n}){const o=zn(),r=vn(),s=(o==null?void 0:o.size)??"base";return c.jsx("span",{className:lm(s,i.cn(r.icon,e)),"aria-hidden":!0,...n,children:t})}ol.displayName="ToggleButtonIconEnd";function rl({className:e="",children:t,...n}){const o=zn(),r=vn(),s=(o==null?void 0:o.size)??"base";return c.jsx(q,{variant:KI[s],as:"span",inheritColor:!0,className:ZI(r.text,e),...n,children:t})}rl.displayName="ToggleButtonText";function oy({icon:e,iconPosition:t="start",children:n}){const r=DI(n)?c.jsx(rl,{children:n}):n,s=e==null?null:t==="end"?c.jsx(ol,{children:e}):c.jsx(nl,{children:e});return c.jsxs(c.Fragment,{children:[t==="start"?s:null,r,t==="end"?s:null]})}function ry({inGroup:e,isSingleGroup:t}){return e&&t?"radio":void 0}function sy({inGroup:e,isSingleGroup:t,pressed:n}){return!e||!t?n:void 0}function ay({inGroup:e,isSingleGroup:t,pressed:n}){return e&&t?n:void 0}function ly({value:e,groupSegment:t,pressed:n,defaultPressed:o=!1,onPressedChange:r,onFillStart:s,variant:l,fillColor:u="bg-primary-tint",size:d,disabled:f=!1,className:m,classNames:p,children:C,onClick:S}){const g=LI(),h=gt(),x=t??(h==null?void 0:h.segment),A=g!=null&&e!=null,b=(g==null?void 0:g.type)==="single",L=d??(g==null?void 0:g.size)??(h==null?void 0:h.buttonSize)??"base",_=l??(g==null?void 0:g.variant)??"default",v=f||!!(g!=null&&g.disabled),[R,T]=Re({value:A?void 0:n,defaultValue:!!(!A&&o)}),E=A?g.isSelected(e):R,I=A?n!==void 0?!!n:E:n!==void 0?!!n:R,O=ny(x,L),N=a.useMemo(()=>PI(C),[C]),y=N?void 0:m,w=a.useCallback((P,k)=>{if(S==null||S(P),P.defaultPrevented||v)return;if(A&&e!=null){const B=g.type==="single"?!0:!g.isSelected(e);g.select(e),k(B);return}const j=!I;k(j),T(j),r==null||r(j)},[v,g,A,e,S,r,I,T]);return{itemValue:e,groupCtx:g,groupSegment:x,inGroup:A,isSingleGroup:b,size:L,variant:_,disabled:v,pressed:I,onFillStart:s,fillColor:u,classNames:p,roundingClass:O,role:ry({inGroup:A,isSingleGroup:b}),ariaPressed:sy({inGroup:A,isSingleGroup:b,pressed:I}),ariaChecked:ay({inGroup:A,isSingleGroup:b,pressed:I}),tabIndex:A&&b?g.tabIndexFor(e):void 0,isCompound:N,contentLayoutClass:y,children:C,handleClick:w}}const cm=a.forwardRef(function({className:t,classNames:n,value:o,groupSegment:r,pressed:s,defaultPressed:l,onPressedChange:u,onFillStart:d,variant:f,fillColor:m,size:p,type:C="button",icon:S,iconPosition:g,disabled:h,children:x,onClick:A,onPointerDown:b,onPointerEnter:L,onPointerLeave:_,...v},R){var w,P;const T=ly({value:o,groupSegment:r,pressed:s,defaultPressed:l,onPressedChange:u,onFillStart:d,variant:f,fillColor:m,size:p,disabled:h,className:t,classNames:n,children:x,onClick:A}),E=OI({disabled:T.disabled,variant:T.variant,groupSegment:T.groupSegment,pressed:T.pressed,onFillStart:T.onFillStart,forwardedRef:R,onPointerEnter:L,onPointerLeave:_,onPointerDown:b}),I=ey({variant:T.variant,pressed:E.displayPressed,disabled:T.disabled,size:T.size,groupSegment:T.groupSegment,slotClass:(w=T.classNames)==null?void 0:w.root,className:t}),O={size:T.size,variant:T.variant,groupSegment:T.groupSegment,contentMotionRef:E.contentMotionRef,bindFillRef:E.bindFillRef,fillColor:T.fillColor,pressed:E.displayPressed,roundingClass:T.roundingClass},{hasCompoundFill:N,hasCompoundContent:y}=a.useMemo(()=>({hasCompoundFill:cc(x,"ToggleButtonFill"),hasCompoundContent:cc(x,"ToggleButtonContent")}),[x]);return c.jsx(TI,{value:O,children:c.jsx(_I,{classNames:T.classNames,children:c.jsxs("button",{ref:E.setRefs,type:C,disabled:T.disabled,"data-toggle-button-value":T.itemValue,role:T.role,"aria-pressed":T.ariaPressed,"aria-checked":T.ariaChecked,tabIndex:T.tabIndex,className:I,onPointerEnter:E.handlePointerEnter,onPointerLeave:E.handlePointerLeave,onPointerDown:E.handlePointerDown,onClick:k=>T.handleClick(k,E.queueFillOnClick),...v,children:[N?null:c.jsx(tl,{}),T.isCompound?y?x:c.jsx(No,{children:x}):c.jsx(No,{className:i.cn((P=T.classNames)==null?void 0:P.content,T.contentLayoutClass),children:c.jsx(oy,{icon:S,iconPosition:g,children:T.children})})]})})})});cm.displayName="ToggleButtonRoot";const um=Object.assign(cm,{Content:No,Fill:tl,Label:im,IconStart:nl,IconEnd:ol,Text:rl});function sl(e){return e.type===um}function iy(e){return e.reduce((t,n)=>t+(sl(n)?1:0),0)}function cy(e){return e.reduce((t,n)=>{if(!sl(n))return t;const o=n.props.value;return typeof o=="string"&&t.push(o),t},[])}function uc(e){return e==null?[]:Array.isArray(e)?e:[e]}function dc(e){if(e!=null)return Array.isArray(e)?e[0]:e}function uy(e,t,n,o){return e==="single"?n===t:o.includes(t)}function dy(e,t,n,o){return e==="single"?n===t?null:{kind:"single",value:t}:{kind:"multiple",value:o.includes(t)?o.filter(s=>s!==t):[...o,t]}}const es=a.createContext({});function fy({classNames:e,children:t}){const n=a.useContext(es),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(es.Provider,{value:o,children:t})}function my(){return a.useContext(es)}function py({orientation:e}){const t=my();return c.jsx("span",{"aria-hidden":!0,className:i.buttonGroupSeparatorClass(e,t.separator)})}function Cy({children:e,type:t="multiple",disabled:n=!1,size:o="base",variant:r="default",value:s,defaultValue:l,onValueChange:u,onKeyDown:d,orientation:f="horizontal"}){const m=t==="single",p=s!==void 0,[C,S]=a.useState(()=>dc(l)),[g,h]=a.useState(()=>uc(l)),x=m?p?dc(s):C:void 0,A=a.useMemo(()=>m?[]:p?uc(s):g,[g,p,m,s]),b=a.useRef(A);b.current=A;const L=a.useCallback(N=>uy(t,N,x,A),[A,x,t]),_=a.useCallback(N=>{if(n)return;if(m){const w=dy(t,N,x,A);if(w==null||w.kind!=="single")return;p||S(w.value),u==null||u(w.value);return}const y=ka(b.current,N,!0);b.current=y,p||h(y),u==null||u(y)},[n,p,m,A,u,x,t]),v=a.useMemo(()=>Ja(e),[e]),R=a.useMemo(()=>iy(v),[v]),T=a.useMemo(()=>cy(v)[0],[v]),E=a.useCallback(N=>RI(m,N,x,T),[T,m,x]),I=a.useMemo(()=>({type:t,disabled:n,size:o,variant:r,isSelected:L,select:_,tabIndexFor:E}),[n,L,_,o,E,t,r]),O=a.useMemo(()=>NI({disabled:n,isSingle:m,orientation:f,onKeyDown:d,select:_}),[n,m,d,f,_]);return{flat:v,segmentCount:R,contextValue:I,handleKeyDown:O,isSingle:m}}const dm=a.forwardRef(function(t,n){const{children:o,className:r="",classNames:s,orientation:l="horizontal",segmented:u=!1,disabled:d=!1,size:f="base",variant:m="default",type:p="multiple",value:C,defaultValue:S,onValueChange:g,onKeyDown:h,...x}=t,{flat:A,segmentCount:b,contextValue:L,handleKeyDown:_,isSingle:v}=Cy(t);let R=-1;return c.jsx(vI,{value:L,children:c.jsx(fy,{classNames:s,children:c.jsx("div",{ref:n,role:"toolbar",tabIndex:yI(d),"aria-orientation":l,"aria-disabled":d||void 0,className:i.buttonGroupRootClass({orientation:l,segmented:u,variant:m,className:i.cn(s==null?void 0:s.root,r)}),...v?{onKeyDown:_}:{},...x,children:A.map((T,E)=>{if(!sl(T))return c.jsx(a.Fragment,{children:T},T.key??`tbg-wrap-${E}`);if(u)return c.jsx(a.Fragment,{children:T},T.key??`tbg-item-${E}`);R+=1;const I=qf(R,b),O=Zf(l,I);return c.jsxs(a.Fragment,{children:[c.jsx(tu,{segment:O,buttonSize:f,children:T}),m!=="gloss"&&I!=="last"&&I!=="only"?c.jsx(py,{orientation:l}):null]},T.key??`tbg-seg-${E}`)})})})})});dm.displayName="ToggleButtonGroup";const gy=dm,fm=a.createContext(null),ts=a.createContext({}),al=a.createContext(null);function Sy({value:e,children:t}){return c.jsx(fm.Provider,{value:e,children:t})}function Lt(){const e=a.useContext(fm);if(!e)throw new Error("AlertDialog.* components must be used inside <AlertDialog>.");return e}function hy({classNames:e,children:t}){const n=a.useContext(ts),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ts.Provider,{value:o,children:t})}function Xe(){return a.useContext(ts)}function xy({value:e,children:t}){return c.jsx(al.Provider,{value:e,children:t})}function by(e){const t=a.useContext(al);if(!t)throw new Error(`${e} must be used inside <AlertDialog.Header>.`);return t}function ll(){return a.useContext(al)}const Ay="alertdialog",vy="dialog";function Ly(e,t){return e?t:void 0}function _y(e,t){return e?t:void 0}function fc(e){return{"aria-haspopup":vy,"aria-expanded":e}}function Ty(){return{"aria-hidden":!0}}function Ey(e){return"primary"}function Ry(e){switch(e){case"danger":case"success":case"info":case"warning":return e;default:return"default"}}function cr(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function Iy(e){return cr(e,t=>t==="AlertDialogTitle")}function yy(e){return cr(e,t=>t==="AlertDialogDescription")}function mm(e){return cr(e,t=>t==="AlertDialogIndicator")}function pm(e){return cr(e,t=>t==="AlertDialogClose")}function Cm(e,t){return Js(e,t)}function gm(e,t){return ea(e,t)}function Ny(e,t,n,o){return o?!0:n===null?!1:n!==void 0?!0:Cm(e,t)&&gm(e,t)!==null}function wy(e,t,n,o,r,s=mm(r),l=pm(r)){return{hasIndicator:Ny(e,t,n,s),hasTitle:Iy(r),hasDescription:yy(r),hasAction:!1,hasClose:l||o}}function Sm(e,t){return a.Children.map(e,n=>{if(!a.isValidElement(n))return n;if(n.type===Vt){const o=n.props;return a.cloneElement(n,{size:o.size??t})}if(n.type===a.Fragment){const o=n;return a.cloneElement(o,{key:o.key??void 0},Sm(o.props.children,t))}return n})}function il({open:e,gloss:t=!1,contained:n=!1,onOpenChange:o,dismissOnBackdrop:r=!1,enableContainedEscape:s=!1,focusOnOpen:l=!0,getPanelOpen:u,getPanelExit:d,preparePanel:f,panelMotionKey:m}){const[p,C]=a.useState(!1),S=a.useRef(null),g=a.useRef(null),h=a.useRef(null),x=a.useRef(null),A=a.useRef(null),b=a.useRef(!1),L=a.useRef(u),_=a.useRef(d),v=a.useRef(f);L.current=u,_.current=d,v.current=f;const R=e||p,T=a.useMemo(()=>i.createGlossInteractiveRefCallback(x,t),[t]);a.useLayoutEffect(()=>{e&&(b.current=!1,C(!0))},[e]),a.useEffect(()=>{if(!R||n)return;const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[R,n]),a.useEffect(()=>{if(!e||!n||!s||!o)return;const I=O=>{O.key==="Escape"&&(O.preventDefault(),o(!1))};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,n,s,o]),a.useLayoutEffect(()=>{var j;if(e||!p)return;const I=g.current,O=h.current;let N=!1;const y=()=>{N||(W_({dialog:S.current,focusReturn:A.current,unmount:()=>C(!1)}),A.current=null)};if(b.current){b.current=!1,y();return}if(!I||!O||Rt()){y();return}i.killMotion(I,O);const w={...i.motionModal(),overwrite:"auto"},P=(j=_.current)==null?void 0:j.call(_,O),k=V_({overlay:I,panel:O,vars:w,onComplete:y,...P?{panelExit:P}:{}});return()=>{N=!0,k.kill(),i.killMotion(I,O)}},[e,p,m]),a.useLayoutEffect(()=>{var w,P;if(!e)return;const I=S.current;I&&!I.open&&(A.current=U_(I),R_(I,{contained:n}));const O=g.current,N=h.current;if(!O||!N)return;if(Rt()){H_(O,N,{focusPanel:l});return}(w=v.current)==null||w.call(v,N);const y=(P=L.current)==null?void 0:P.call(L,N);G_({overlay:O,panel:N,vars:{...i.motionModal(),overwrite:"auto"},...y?{panelFrom:y.from,panelTo:y.to}:{}}),l&&N.focus()},[e,n,l,m]);const E=a.useCallback(I=>{!r||!o||I.target===I.currentTarget&&o(!1)},[r,o]);return{mounted:p,showPortal:R,dialogRef:S,overlayRef:g,panelRef:h,skipCloseAnimRef:b,bindGlossPanelRef:T,handleBackdropPointerDown:E}}function Oy({open:e,variant:t,contained:n=!1}){const o=il({open:e,gloss:t==="gloss",contained:n});return{mounted:o.mounted,showPortal:o.showPortal,dialogRef:o.dialogRef,overlayRef:o.overlayRef,panelRef:o.panelRef,bindGlossPanelRef:o.bindGlossPanelRef}}const Py="flex min-h-0 flex-1 flex-col text-left";function lo(e){const t=zo[e];return{rounded:t.rounded,panelMax:t.panelMax,maxHeight:t.maxHeight,headerGap:t.headerGap,headerPadding:t.headerPadding,bodyPadding:t.bodyPadding,footerPadding:t.footerPadding,headingGap:t.headingGap,titleVariant:t.titleVariant,titleClassName:t.titleClassName,descVariant:t.descVariant,descClassName:t.descClassName,bodyVariant:t.bodyVariant,footerButtonSize:t.footerButtonSize,closeButtonSize:t.closeButtonSize}}const Dy={small:lo("small"),base:lo("base"),mid:lo("mid"),large:lo("large")},ky="m-0 flex h-full w-full max-h-none max-w-none items-center justify-center border-0 bg-transparent p-large open:flex [&::backdrop]:bg-transparent",By="fixed inset-0 z-dialog",jy="absolute inset-0 z-dialog";function My(e){return i.cn(e?jy:By,ky)}const Fy="overlay-backdrop",Hy="overlay-backdrop-scrim",Gy="relative z-10 w-full outline-none",Vy="flex min-h-0 flex-col overflow-hidden border-token bg-surface text-left text-foreground shadow-token-large",zy="gloss-panel gloss-deep flex min-h-0 w-full flex-col text-foreground",Uy="flex shrink-0 items-start",Wy="flex min-w-0 flex-1 flex-col text-left",Yy="min-w-0",$y="min-h-0 flex-1 overflow-y-auto py-small",Xy="flex shrink-0 flex-wrap items-center justify-end gap-base",Ky="shrink-0",mc="outline-none focus-ring",hm="gloss-content";function xm(){return cf()}function bm(e,t){return i.cn("absolute inset-0",e?Fy:Hy,t)}function qy({variant:e,sizePreset:t,className:n,slotClass:o}){const r=e==="gloss";return i.cn(Gy,t.panelMax,t.rounded,!r&&Vy,!r&&t.maxHeight,o,n)}function Zy({maxHeight:e,rounded:t,slotClass:n}){return i.cn(zy,t,e,n)}function Am(e,t=!1){return i.cn(Py,t&&hm,e)}function Qy(e,t){return i.cn($y,e,t)}function Jy(e){return Ee(e).footerButtonSize}const eN="flex min-h-0 flex-1 flex-col text-left";function io(e){const t=zo[e];return{rounded:t.rounded,panelMax:t.panelMax,maxHeight:t.maxHeight,headerGap:t.alertHeaderGap,headerPadding:t.headerPadding,bodyPadding:t.bodyPadding,footerPadding:t.footerPadding,iconClass:t.iconClass,titleVariant:t.alertTitleVariant,titleClassName:t.titleClassName,descVariant:t.descVariant,descClassName:t.descClassName,bodyVariant:t.bodyVariant,footerButtonSize:t.footerButtonSize,closeButtonSize:t.closeButtonSize}}const tN={small:io("small"),base:io("base"),mid:io("mid"),large:io("large")},nN="m-0 flex h-full w-full max-h-none max-w-none items-center justify-center border-0 bg-transparent p-large open:flex [&::backdrop]:bg-transparent",oN="fixed inset-0 z-dialog",rN="absolute inset-0 z-dialog";function sN(e){return i.cn(e?rN:oN,nN)}const aN="relative z-10 w-full outline-none",lN="flex min-h-0 flex-col overflow-hidden text-left",iN="gloss-panel gloss-deep flex min-h-0 w-full flex-col text-left text-foreground",cN="gloss-content",uN="shrink-0",pc="outline-none focus-ring",dN="shrink-0 [&_svg]:block",fN="shrink-0",mN="contents",pN="font-w-mid",CN="min-h-0 flex-1 overflow-y-auto py-small",gN="flex shrink-0 flex-wrap items-center justify-end gap-base";function SN(e){return i.cn(Lu(e,"default"),"shadow-token-large")}function hN(e,t){return bm(e,t)}function xN(){return xm()}function bN(e,t){return i.cn(CN,e,"text-left",t)}function vm(e){return i.cn(eN,e)}function AN({variant:e,sizePreset:t,className:n,slotClass:o}){const r=e==="gloss";return i.cn(aN,t.panelMax,t.rounded,!r&&lN,!r&&t.maxHeight,!r&&SN(e),o,n)}function vN({maxHeight:e,rounded:t,slotClass:n}){return i.cn(iN,t,e,n)}function LN(e){return _u(e)}function Lm(e){return Ee(e).footerButtonSize}function cl({className:e,...t}){const n=Xe();return c.jsx("div",{className:vm(i.cn(n.content,e)),...t})}cl.displayName="AlertDialogContent";const ul=a.forwardRef(function({className:t,onClick:n,size:o,...r},s){const{onOpenChange:l,sizePreset:u}=Lt(),d=ll(),f=Xe();return c.jsx(Cn,{ref:s,variant:"secondary",size:o??u.closeButtonSize,className:i.cn(uN,d&&fu(d.gridSlots),f.close,t),onClick:m=>{n==null||n(m),m.defaultPrevented||l(!1)},...r})});ul.displayName="AlertDialogClose";function dl({className:e,children:t,...n}){const{variant:o,status:r,sizePreset:s,gridSlots:l,headerIcon:u}=by("AlertDialog.Indicator"),d=Xe();if(t===null)return null;const f=gm(o,r),m=t!==void 0?t:u!==void 0?u:Cm(o,r)&&f!==null?c.jsx(f,{"aria-hidden":!0,className:s.iconClass}):null;return m===null?null:c.jsx("span",{className:i.cn(dN,LN(r),Ft(l),d.indicator,e),...n,children:m})}dl.displayName="AlertDialogIndicator";function _m({icon:e,showClose:t=!0,className:n,children:o,...r}){const{variant:s,status:l,sizePreset:u}=Lt(),d=Xe(),{gridSlots:f,compoundHasIndicator:m,compoundHasClose:p}=a.useMemo(()=>{const h=mm(o),x=pm(o);return{compoundHasIndicator:h,compoundHasClose:x,gridSlots:wy(s,l,e,t,o,h,x)}},[o,e,t,l,s]),C=a.useMemo(()=>({variant:s,status:l,sizePreset:u,gridSlots:f,headerIcon:e}),[f,e,u,l,s]),S=f.hasIndicator&&!m,g=t&&!p;return c.jsx(xy,{value:C,children:c.jsxs("div",{className:i.cn(fN,u.headerPadding,gn(f,u.headerGap),d.header,n),...r,children:[S?c.jsx(dl,{}):null,o,g?c.jsx(ul,{}):null]})})}_m.displayName="AlertDialogHeader";const Tm=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,setHasTitle:l,sizePreset:u}=Lt(),d=ll(),f=Xe();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"h2",variant:u.titleVariant,id:n??s,className:i.cn(pN,u.titleClassName,d&&Sn(d.gridSlots),f.title,t),...o})});Tm.displayName="AlertDialogTitle";function Em({className:e,id:t,...n}){const{descriptionId:o,setHasDescription:r,sizePreset:s}=Lt(),l=ll(),u=Xe();return a.useLayoutEffect(()=>(r(!0),()=>r(!1)),[r]),c.jsx(q,{as:"p",variant:s.descVariant,id:t??o,className:i.cn(s.descClassName,l&&kn(l.gridSlots),u.description,e),...n})}Em.displayName="AlertDialogDescription";function Rm({className:e,...t}){const n=Xe();return c.jsx("div",{className:i.cn(mN,n.headingBlock,e),...t})}Rm.displayName="AlertDialogHeadingBlock";function Im({className:e,children:t,...n}){const{sizePreset:o}=Lt(),r=Xe();return c.jsx("div",{className:bN(o.bodyPadding,i.cn(r.body,e)),...n,children:c.jsx(q,{variant:o.bodyVariant,as:"div",children:t})})}Im.displayName="AlertDialogBody";function ym({className:e,children:t,...n}){const{footerButtonSize:o,sizePreset:r}=Lt(),s=Xe(),l=a.useMemo(()=>Sm(t,o),[t,o]);return c.jsx("div",{className:i.cn(gN,r.footerPadding,s.footer,e),...n,children:l})}ym.displayName="AlertDialogFooter";const Nm=a.forwardRef(function({children:t,asChild:n,className:o,onClick:r,onPointerDown:s,...l},u){const{open:d,onOpenChange:f}=Lt(),m=Xe(),p=a.useRef(null),C=At(),S=a.useCallback(A=>{p.current=A,ue(u,A)},[u]),g=a.useCallback(A=>{var b;d||C.current||A.button!==0||(A.preventDefault(),(b=p.current)==null||b.focus({preventScroll:!0}),bt({triggerRef:p,openingRef:C,setOpen:()=>f(!0)}))},[d,C,f]),h=a.useCallback(A=>{r==null||r(A),!A.defaultPrevented&&!d&&!C.current&&f(!0)},[r,d,C,f]);if(n&&a.isValidElement(t)){const A=a.Children.count(t)===1?t:null;if(A){const b=A;return a.cloneElement(b,yt(b,{...l,className:i.cn(pc,m.trigger,o),onPointerDown:L=>{g(L),s==null||s(L)},onClick:h,...fc(d)},$e(L=>{p.current=L},u),{runBeforeChild:["onPointerDown"]}))}}const x=fc(d);return c.jsx("button",{type:"button",ref:S,...x,className:i.cn(pc,m.trigger,o),onPointerDown:A=>{s==null||s(A),g(A)},onClick:h,...l,children:t})});Nm.displayName="AlertDialog.Trigger";function wm({className:e,themeAnchor:t,portalContainer:n,children:o}){const{open:r,titleId:s,descriptionId:l,hasTitle:u,hasDescription:d,variant:f,sizePreset:m,closeOnEscape:p,onOpenChange:C,portalContainer:S}=Lt(),g=Ct(n??S),h=dn(g),x=Oy({open:r,variant:f,contained:h}),A=Ma(r,t??null),b=ja(A),L=An(A);return typeof document>"u"||!x.showPortal||!g?null:Ut.createPortal(c.jsx(_N,{className:e,variant:f,sizePreset:m,portalTheme:L,lightUi:b,titleId:s,descriptionId:l,hasTitle:u,hasDescription:d,closeOnEscape:p,onOpenChange:C,dialogRef:x.dialogRef,overlayRef:x.overlayRef,panelRef:x.panelRef,bindGlossPanelRef:x.bindGlossPanelRef,contained:h,children:o}),g)}wm.displayName="AlertDialog.Panel";function _N({children:e,className:t,variant:n,sizePreset:o,portalTheme:r,lightUi:s,titleId:l,descriptionId:u,hasTitle:d,hasDescription:f,closeOnEscape:m,onOpenChange:p,dialogRef:C,overlayRef:S,panelRef:g,bindGlossPanelRef:h,contained:x=!1}){const A=n==="gloss",b=Xe();return c.jsxs("dialog",{...r,ref:C,role:Ay,onCancel:L=>{L.preventDefault(),m&&p(!1)},"aria-labelledby":_y(d,l),"aria-describedby":Ly(f,u),className:i.cn(sN(x),b.dialog),children:[c.jsx("div",{ref:S,className:hN(s,b.overlay),style:xN(),...Ty()}),c.jsx("div",{ref:g,tabIndex:-1,className:AN({variant:n,sizePreset:o,className:t,slotClass:b.panel}),children:A?c.jsx("div",{ref:h,className:vN({maxHeight:o.maxHeight,rounded:o.rounded,slotClass:b.glossPanel}),children:c.jsx("div",{className:vm(i.cn(cN,b.glossContent)),children:e})}):c.jsx(cl,{children:e})})]})}function TN({open:e,defaultOpen:t=!1,onOpenChange:n,status:o,variant:r="default",size:s="base",closeOnEscape:l=!0,portalContainer:u}){const[d,f]=Re({value:e,defaultValue:t,onChange:n}),m=a.useId(),p=a.useId(),[C,S]=a.useState(!1),[g,h]=a.useState(!1),x=a.useCallback(R=>{S(R)},[]),A=a.useCallback(R=>{h(R)},[]),b=Zs(r),L=Qs(o),_=tN[s];return{contextValue:{open:d,titleId:m,descriptionId:p,hasTitle:C,setHasTitle:x,hasDescription:g,setHasDescription:A,onOpenChange:f,closeOnEscape:l,variant:b,status:L,size:s,sizePreset:_,footerButtonSize:Lm(s),portalContainer:u}}}function Om({open:e,defaultOpen:t=!1,onOpenChange:n,children:o,status:r,variant:s="default",size:l="base",closeOnEscape:u=!0,classNames:d,portalContainer:f}){const m=TN({open:e,defaultOpen:t,onOpenChange:n,status:r,variant:s,size:l,closeOnEscape:u,portalContainer:f});return c.jsx(hy,{classNames:d,children:c.jsx(Sy,{value:m.contextValue,children:o})})}Om.displayName="AlertDialog";const EN=Object.assign(Om,{Trigger:Nm,Panel:wm,Content:cl,Header:_m,Indicator:dl,HeadingBlock:Rm,Title:Tm,Description:Em,Body:Im,Footer:ym,Close:ul}),Pm=a.createContext(null),ns=a.createContext({});function RN({value:e,children:t}){return c.jsx(Pm.Provider,{value:e,children:t})}function IN({classNames:e,children:t}){const n=a.useContext(ns),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ns.Provider,{value:o,children:t})}function nt(){const e=a.useContext(Pm);if(!e)throw new Error("Dialog.* components must be used inside <Dialog>.");return e}function ot(){return a.useContext(ns)}function yN({open:e,onOpenChange:t,variant:n,dismissOnBackdrop:o=!0,contained:r=!1}){const s=il({open:e,gloss:n==="gloss",contained:r,onOpenChange:t,dismissOnBackdrop:o,enableContainedEscape:!0});return{mounted:s.mounted,showPortal:s.showPortal,dialogRef:s.dialogRef,overlayRef:s.overlayRef,panelRef:s.panelRef,bindGlossPanelRef:s.bindGlossPanelRef,handleBackdropPointerDown:s.handleBackdropPointerDown}}function Dm(e,t){return a.Children.map(e,n=>{if(!a.isValidElement(n))return n;if(n.type===Vt){const o=n.props;return a.cloneElement(n,{size:o.size??t})}if(n.type===a.Fragment){const o=n;return a.cloneElement(o,{key:o.key??void 0},Dm(o.props.children,t))}return n})}function NN(e){const{footerButtonSize:t}=nt();return a.useMemo(()=>Dm(e,t),[e,t])}const fl=a.forwardRef(function({className:t,...n},o){const r=ot();return c.jsx("div",{ref:o,className:Am(i.cn(r.content,t)),...n})});fl.displayName="DialogContent";const km=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=nt(),s=ot();return c.jsx("div",{ref:o,className:i.cn(Uy,r.headerGap,r.headerPadding,s.header,t),...n})});km.displayName="DialogHeader";const Bm=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,setHasTitle:l,sizePreset:u}=nt(),d=ot();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"h2",variant:u.titleVariant,id:n??s,className:i.cn(Yy,u.titleClassName,d.title,t),...o})});Bm.displayName="DialogTitle";const jm=a.forwardRef(function({className:t,id:n,...o},r){const{descriptionId:s,setHasDescription:l,sizePreset:u}=nt(),d=ot();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"p",variant:u.descVariant,id:n??s,className:i.cn(u.descClassName,d.description,t),...o})});jm.displayName="DialogDescription";function Mm({className:e,...t}){const{sizePreset:n}=nt(),o=ot();return c.jsx("div",{className:i.cn(Wy,n.headingGap,o.headingBlock,e),...t})}Mm.displayName="DialogHeadingBlock";const Fm=a.forwardRef(function({className:t,onClick:n,size:o,"aria-label":r,...s},l){const{onOpenChange:u,sizePreset:d}=nt(),f=ot();return c.jsx(Cn,{ref:l,variant:"secondary",size:o??d.closeButtonSize,"aria-label":r,className:i.cn(Ky,f.close,t),onClick:m=>{n==null||n(m),m.defaultPrevented||u(!1)},...s})});Fm.displayName="DialogClose";const Hm=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=nt(),s=ot();return c.jsx("div",{ref:o,className:Qy(r.bodyPadding,i.cn(s.body,t)),...n})});Hm.displayName="DialogBody";const Gm=a.forwardRef(function({className:t,children:n,...o},r){const{sizePreset:s}=nt(),l=ot(),u=NN(n);return c.jsx("div",{ref:r,className:i.cn(Xy,s.footerPadding,l.footer,t),...o,children:u})});Gm.displayName="DialogFooter";const Vm=a.forwardRef(function({children:t,asChild:n,className:o,onClick:r,onPointerDown:s,...l},u){const{open:d,onOpenChange:f}=nt(),m=ot(),p=a.useRef(null),C=At(),S=a.useCallback(x=>{p.current=x,ue(u,x)},[u]),g=a.useCallback(x=>{var A;d||C.current||x.button!==0||(x.preventDefault(),(A=p.current)==null||A.focus({preventScroll:!0}),bt({triggerRef:p,openingRef:C,setOpen:()=>f(!0)}))},[d,C,p,f]),h=a.useCallback(x=>{r==null||r(x),!x.defaultPrevented&&!d&&!C.current&&f(!0)},[r,d,C,f]);if(n&&a.isValidElement(t)){const x=a.Children.count(t)===1?t:null;if(x){const A=x;return a.cloneElement(A,yt(A,{...l,className:i.cn(mc,m.trigger,o),onPointerDown:b=>{g(b),s==null||s(b)},onClick:h,"aria-haspopup":"dialog","aria-expanded":d},$e(b=>{p.current=b},u),{runBeforeChild:["onPointerDown"]}))}}return c.jsx("button",{type:"button",ref:S,"aria-haspopup":"dialog","aria-expanded":d,className:i.cn(mc,m.trigger,o),onPointerDown:x=>{s==null||s(x),g(x)},onClick:h,...l,children:t})});Vm.displayName="Dialog.Trigger";const zm=a.forwardRef(function({variant:t="default",dismissOnBackdrop:n=!0,className:o,style:r,themeAnchor:s,portalContainer:l,children:u,...d},f){const{open:m,onOpenChange:p,titleId:C,descriptionId:S,hasTitle:g,hasDescription:h,sizePreset:x,portalContainer:A}=nt(),b=Ct(l??A),L=dn(b),_=yN({open:m,onOpenChange:p,variant:t,dismissOnBackdrop:n,contained:L}),v=Ma(m,s??null),R=ja(v),T=An(v);return typeof document>"u"||!_.showPortal||!b?null:Ut.createPortal(c.jsx(wN,{className:o,style:r,variant:t,sizePreset:x,portalTheme:T,lightUi:R,titleId:C,descriptionId:S,hasTitle:g,hasDescription:h,dialogRef:_.dialogRef,overlayRef:_.overlayRef,panelRef:_.panelRef,panelForwardedRef:f,panelRest:d,bindGlossPanelRef:_.bindGlossPanelRef,onBackdropMouseDown:_.handleBackdropPointerDown,onDialogClose:()=>p(!1),onDialogCancel:E=>{E.preventDefault(),p(!1)},contained:L,children:u}),b)});zm.displayName="Dialog.Panel";function wN({children:e,className:t,style:n,variant:o,sizePreset:r,portalTheme:s,lightUi:l,titleId:u,descriptionId:d,hasTitle:f,hasDescription:m,dialogRef:p,overlayRef:C,panelRef:S,panelForwardedRef:g,panelRest:h,bindGlossPanelRef:x,onBackdropMouseDown:A,onDialogClose:b,onDialogCancel:L,contained:_=!1}){const v=o==="gloss",R=ot();return c.jsxs("dialog",{...s,ref:p,onClose:b,onCancel:L,"aria-labelledby":f?u:void 0,"aria-describedby":m?d:void 0,className:i.cn(My(_),R.dialog),children:[c.jsx("div",{ref:C,className:bm(l,R.overlay),style:xm(),"aria-hidden":!0,onMouseDown:A}),c.jsx("div",{ref:$e(S,g),tabIndex:-1,className:qy({variant:o,sizePreset:r,className:t,slotClass:R.panel}),style:n,...h,children:v?c.jsx("div",{ref:x,className:Zy({maxHeight:r.maxHeight,rounded:r.rounded,slotClass:R.glossPanel}),children:c.jsx("div",{className:Am(i.cn(hm,R.glossContent),!0),children:e})}):c.jsx(fl,{children:e})})]})}function ON({open:e,defaultOpen:t=!1,onOpenChange:n,size:o="base",portalContainer:r}){const[s,l]=Re({value:e,defaultValue:t,onChange:n}),u=a.useId(),d=a.useId(),[f,m]=a.useState(!1),[p,C]=a.useState(!1),S=a.useCallback(A=>{m(A)},[]),g=a.useCallback(A=>{C(A)},[]),h=Dy[o];return{contextValue:{open:s,titleId:u,descriptionId:d,hasTitle:f,setHasTitle:S,hasDescription:p,setHasDescription:g,onOpenChange:l,size:o,sizePreset:h,footerButtonSize:Jy(o),portalContainer:r}}}function Um({open:e,defaultOpen:t=!1,onOpenChange:n,size:o="base",children:r,classNames:s,portalContainer:l}){const u=ON({open:e,defaultOpen:t,onOpenChange:n,size:o,portalContainer:l});return c.jsx(RN,{value:u.contextValue,children:c.jsx(IN,{classNames:s,children:r})})}Um.displayName="Dialog";const PN=Object.assign(Um,{Trigger:Vm,Panel:zm,Content:fl,Header:km,HeadingBlock:Mm,Title:Bm,Description:jm,Close:Fm,Body:Hm,Footer:Gm}),Cc="sr-only absolute m-0 h-px w-px overflow-hidden whitespace-nowrap border-0 p-0";function DN(e){return e==="danger"||e==="warning"?"alert":"status"}function kN(e,t=Se.toastNotifications){return pn(t,{placement:e})}function Wm(e,t){const n=[];return typeof e=="string"&&e.trim()?n.push(e.trim()):typeof e=="number"&&n.push(String(e)),typeof t=="string"&&t.trim()?n.push(t.trim()):typeof t=="number"&&n.push(String(t)),n.join(". ")}function BN(e,t){return Wm(e,t)||void 0}const ml=a.createContext(null),Ym=a.createContext(null),os=a.createContext({});function $m({classNames:e,children:t}){const n=a.useContext(os),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(os.Provider,{value:o,children:t})}function jN({value:e,children:t}){return c.jsx(Ym.Provider,{value:e,children:t})}function Xm(){const e=a.useContext(ml);if(!e)throw new Error("Components Toast must be used inside <Toast.Provider>.");return e}function Un(){const e=a.useContext(Ym);if(!e)throw new Error("Toast.* must be inside <Toast>.");return e}function Ot(){return a.useContext(os)}const Km="Loading";function MN(e=Km){return{role:"status","aria-live":"polite","aria-label":e}}function qm(){return{"aria-hidden":!0}}const FN={small:{icon:i.CONTROL_SIZE_LAYOUT.small.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.small.spinnerBorder},base:{icon:i.CONTROL_SIZE_LAYOUT.base.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.base.spinnerBorder},mid:{icon:i.CONTROL_SIZE_LAYOUT.mid.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.mid.spinnerBorder},large:{icon:i.CONTROL_SIZE_LAYOUT.large.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.large.spinnerBorder}},HN={primary:"text-primary",foreground:"text-foreground",muted:"text-muted",secondary:"text-primary",danger:"text-danger",success:"text-success",info:"text-info",warning:"text-warning"},GN="inline-flex shrink-0 items-center justify-center",VN="box-border inline-block rounded-full border-current border-t-transparent animate-spin motion-reduce:animate-none",zN="flex items-end",UN="block shrink-0 rounded-full origin-bottom",ur={small:{dotClass:"size-[calc(var(--icon-size-xsmall)*0.45)]",dotSizeVar:"calc(var(--icon-size-xsmall) * 0.45)",gapClass:"gap-[calc(var(--space-xsmall)*0.75)]",jumpPx:5,scalePeak:1.25},base:{dotClass:"size-[calc(var(--icon-size-xsmall)*0.6)]",dotSizeVar:"calc(var(--icon-size-xsmall) * 0.6)",gapClass:"gap-xsmall",jumpPx:7,scalePeak:1.3},mid:{dotClass:"size-[calc(var(--icon-size-xsmall)*0.75)]",dotSizeVar:"calc(var(--icon-size-xsmall) * 0.75)",gapClass:"gap-xsmall",jumpPx:9,scalePeak:1.35},large:{dotClass:"size-[calc(var(--icon-size-small)*0.75)]",dotSizeVar:"calc(var(--icon-size-small) * 0.75)",gapClass:"gap-small",jumpPx:12,scalePeak:1.4}},WN={primary:"bg-primary",foreground:"bg-foreground",muted:"bg-muted-foreground",secondary:"bg-primary",danger:"bg-danger",success:"bg-success",info:"bg-info",warning:"bg-warning"};function YN(e,t,n){const o=FN[e];return i.cn(VN,o.icon,o.border,HN[t],n)}function $N(e,t){const n=ur[e];return i.cn(zN,n.gapClass,t)}function XN(e,t,n){return i.cn(UN,ur[e].dotClass,WN[t],n)}function KN(e){const{jumpPx:t,dotSizeVar:n}=ur[e];return{height:`calc(${n} + ${t}px)`}}const qN=3;function ZN(e,t){const{jumpPx:n,scalePeak:o}=ur[t],{staggerSec:r,halfCycleSec:s,easeUp:l,easeDown:u,enabled:d}=i.motionLoadingDots();for(const f of e)i.killMotion(f),$.set(f,{y:0,scale:1,transformOrigin:"50% 100%"});return d?e.map((f,m)=>$.to(f,{keyframes:[{y:-n,scale:o,duration:s,ease:l},{y:0,scale:1,duration:s,ease:u}],repeat:-1,delay:r*m,transformOrigin:"50% 100%"})):[]}function QN(e,t){const n=a.useSyncExternalStore(i.subscribeMotionConfig,i.getMotionConfigRevision,i.getMotionConfigRevision),o=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const r=e.current;if(!r)return;const s=Array.from(r.querySelectorAll("[data-loading-dot]")).slice(0,qN);if(s.length===0)return;let l=[];return o||(l=ZN(s,t)),()=>{for(const u of l)u.kill();for(const u of s)i.killMotion(u)}},[t,e,n,o])}const JN=[0,1,2];function Zm({size:e,color:t,className:n}){return c.jsx("span",{...qm(),className:YN(e,t,n)})}function Qm({size:e,color:t,className:n,dotClassName:o}){const r=a.useRef(null);return QN(r,e),c.jsx("span",{ref:r,className:$N(e,n),style:KN(e),...qm(),children:JN.map(s=>c.jsx("span",{"data-loading-dot":!0,className:XN(e,t,o)},s))})}Qm.displayName="LoadingDots";Zm.displayName="LoadingSpinner";const pl=a.forwardRef(function({type:t="spinner",size:n="base",color:o="primary",label:r=Km,className:s="",classNames:l,...u},d){return c.jsx("span",{ref:d,...MN(r),className:i.cn(GN,l==null?void 0:l.root,s),...u,children:t==="dots"?c.jsx(Qm,{size:n,color:o,className:l==null?void 0:l.dots,dotClassName:l==null?void 0:l.dot}):c.jsx(Zm,{size:n,color:o,className:l==null?void 0:l.spinner})})});pl.displayName="Loading";const ew="bg-surface border-token text-foreground",Jm={default:"text-primary",success:"text-success",danger:"text-danger",info:"text-info",warning:"text-warning"},ep="contents",tw="font-w-mid";function nw(e){return i.cn(tw,e!=="default"?Jm[e]:"")}const ow="text-muted",rw="-mx-xsmall",sw="inline-flex shrink-0 items-center justify-center";function aw(e,t,n){return i.cn(sw,t,Jm[e],n)}const lw={default:"primary",success:"success",danger:"danger",info:"info",warning:"warning"},iw="fixed z-toast pointer-events-none",cw="relative grid",uw="pointer-events-none absolute",dw={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"};function fw(e){return dw[e]}function mw(e){return lw[e]}function pw({variant:e,size:t,gridSlots:n,slotClass:o,className:r}){const s=e==="gloss",l=pt(t);return i.cn(gn(n,l.gridGap),`w-full ${l.shellPadding}`,s?i.cn("gloss-panel gloss-deep border-0 text-foreground",i.GLOSS_INTERACTIVE_MOTION_CLASS):i.cn("shadow-token-mid",ew),o,r)}function Cw({placement:e,slotClass:t}){return i.cn(iw,fw(e),t)}function gw(e){return i.cn(cw,e)}function Sw(e){return i.cn(uw,e)}const Cl=a.forwardRef(function({className:t,children:n,...o},r){const{status:s,loading:l,gridSlots:u,sizePreset:d}=Un(),f=Ot(),m=aw(s,d.iconSvgClass);if(n!==void 0)return c.jsx("span",{ref:r,className:i.cn(m,Ft(u),f.indicator,t),...o,children:n});if(l)return c.jsx("span",{ref:r,className:i.cn(m,Ft(u),f.indicator,t),...o,children:c.jsx(pl,{size:d.loadingSize,color:mw(s)})});if(s==="default")return null;const p=qs[s];return p?c.jsx("span",{ref:r,className:i.cn(m,Ft(u),f.indicator,t),...o,children:c.jsx(p,{"aria-hidden":!0})}):null});Cl.displayName="ToastIndicator";const tp=a.forwardRef(function({className:t,...n},o){const r=Ot();return c.jsx("div",{ref:o,className:i.cn(ep,r.message,t),...n})});tp.displayName="ToastMessage";const np=a.forwardRef(function({className:t,...n},o){const r=Ot();return c.jsx("div",{ref:o,className:i.cn(ep,r.content,t),...n})});np.displayName="ToastContent";const gl=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,gridSlots:l,sizePreset:u,status:d}=Un(),f=Ot();return c.jsx(q,{ref:r,as:"div",variant:u.titleVariant,id:n??s,className:i.cn(nw(d),Sn(l),f.title,t),...o})});gl.displayName="ToastTitle";const Sl=a.forwardRef(function({className:t,id:n,...o},r){const{descriptionId:s,gridSlots:l,sizePreset:u}=Un(),d=Ot();return c.jsx(q,{ref:r,as:"div",variant:u.descVariant,id:n??s,className:i.cn(ow,kn(l),d.description,t),...o})});Sl.displayName="ToastDescription";const hl=a.forwardRef(function({className:t,...n},o){const{gridSlots:r}=Un(),s=Ot();return c.jsx("div",{ref:o,className:i.cn(Bn(r),s.action,t),...n})});hl.displayName="ToastAction";const xl=a.forwardRef(function({className:t,onClick:n,"aria-label":o,...r},s){const{dismiss:l,gridSlots:u}=Un(),d=Ot();return c.jsx(Cn,{ref:s,size:"small",variant:"ghost","aria-label":o,className:i.cn(rw,fu(u),d.close,t),onClick:f=>{n==null||n(f),f.defaultPrevented||l()},...r})});xl.displayName="ToastClose";function hw({gridSlots:e,title:t,description:n,action:o,onClose:r}){return c.jsxs(c.Fragment,{children:[e.hasIndicator?c.jsx(Cl,{}):null,t!=null?c.jsx(gl,{children:t}):null,n!=null?c.jsx(Sl,{children:n}):null,o!=null?c.jsx(hl,{children:o}):null,r!=null?c.jsx(xl,{}):null]})}const rs=8,xw=.04,ho=3,ss=4e3,co=24;function bw(e,t){if(e<=0||t<=0)return 0;const n=Math.min(t-1,ho-1)*rs;return e+n}function Aw(){return`toast-${Math.random().toString(36).slice(2)}`}function Wn(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function vw(e){return Wn(e,t=>t==="ToastTitle")}function Lw(e){return Wn(e,t=>t==="ToastDescription")}function _w(e){return Wn(e,t=>t==="ToastIndicator")}function Tw(e){return Wn(e,t=>t==="ToastAction")}function Ew(e){return Wn(e,t=>t==="ToastClose")}function Rw(e,t,n,o){return n?o:t?!0:e!=="default"}function Iw(e,t,n,o,r,s,l,u){const d=t!=null||vw(u),f=n!=null||Lw(u);return{hasIndicator:Rw(e,s,l,_w(u)),hasTitle:d,hasDescription:f,hasAction:l?Tw(u):o!=null,hasClose:l?Ew(u):r!=null}}function yw({status:e="default",size:t,title:n,description:o,action:r,loading:s=!1,onClose:l,children:u}){const d=a.useId(),f=`${d}-title`,m=`${d}-description`,p=!!u,C=Ms(t),S=pt(C),g=a.useMemo(()=>Iw(e,n,o,r,l,s,p,u),[r,u,o,p,s,l,e,n]),h=a.useMemo(()=>({status:e,size:C,sizePreset:S,titleId:f,descriptionId:m,loading:s,dismiss:l??(()=>{}),gridSlots:g}),[m,g,s,l,C,S,e,f]);return{isCompound:p,titleId:f,size:C,itemCtx:h,gridSlots:g}}function Nw({entry:e,reverseIdx:t,total:n,isTop:o,isDismissing:r,onDismiss:s,onRemoveFinal:l,onHeightChange:u,providerClassNames:d}){const f=a.useRef(null),m=a.useRef(null),p=a.useRef(null),C=a.useRef(!1),S=i.usePrefersReducedMotion(),g=Math.min(t,ho-1),h=1-g*xw,x=o?g*rs:-g*rs,A=t>=ho?0:1;a.useLayoutEffect(()=>{const v=p.current;if(!v)return;const R=S||!i.isMotionFeatureEnabled("enableToastStack"),T=!C.current;if(C.current=!0,i.killMotion(v),R){$.set(v,{y:x,scale:h,autoAlpha:A});return}T&&e.variant!=="gloss"?$.fromTo(v,{opacity:0},{opacity:A,...i.motionInteractive(),overwrite:"auto"}):(i.setWillChangeTransform(v,!0),$.to(v,{y:x,scale:h,autoAlpha:A,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(v)}))},[e.variant,x,S,A,h]),a.useLayoutEffect(()=>{const v=m.current;if(!v)return;u(e.id,v.offsetHeight);const R=new ResizeObserver(()=>{u(e.id,v.offsetHeight)});return R.observe(v),()=>R.disconnect()},[e.id,u]),a.useLayoutEffect(()=>{const v=f.current;if(!v)return;if(Rt()){ar(v);return}const R=o?-co:co;lr({surface:v,vars:{...i.motionInteractive(),overwrite:"auto"},from:{y:R,scale:sr},to:{y:0,scale:1}})},[o]),a.useEffect(()=>{if(!r)return;const v=f.current;if(!v)return;if(Rt()){l(e.id);return}const R=o?-co:co;i.killMotion(v),ir({surface:v,vars:{...i.motionToastDismiss(),overwrite:"auto"},exit:{y:R},onComplete:()=>l(e.id)})},[r,o,e.id,l]),a.useEffect(()=>{if(e.timeout===0||r||e.loading)return;let v=e.timeout,R=Date.now(),T,E=!1;const I=()=>{T!=null&&(window.clearTimeout(T),T=void 0)},O=()=>{I(),R=Date.now(),T=window.setTimeout(()=>s(e.id),v)},N=()=>{E||R==null||(E=!0,v=Math.max(0,v-(Date.now()-R)),R=null,I())},y=()=>{if(E){if(E=!1,v<=0){s(e.id);return}O()}};O();const w=p.current,P=()=>N(),k=()=>y(),j=()=>N(),B=D=>{w&&D.relatedTarget instanceof Node&&w.contains(D.relatedTarget)||y()};return w==null||w.addEventListener("pointerenter",P),w==null||w.addEventListener("pointerleave",k),w==null||w.addEventListener("focusin",j),w==null||w.addEventListener("focusout",B),()=>{I(),w==null||w.removeEventListener("pointerenter",P),w==null||w.removeEventListener("pointerleave",k),w==null||w.removeEventListener("focusin",j),w==null||w.removeEventListener("focusout",B)}},[e.id,e.timeout,r,e.loading,s]);const b=a.useCallback(()=>s(e.id),[e.id,s]),L=t<n,_={...d,...e.classNames};return c.jsx("div",{ref:p,"aria-hidden":!L||void 0,style:{gridColumn:1,gridRow:1,transformOrigin:o?"top center":"bottom center",zIndex:ho+1-t,pointerEvents:t===0?"auto":"none"},children:c.jsx("div",{ref:f,children:c.jsx($m,{classNames:_,children:c.jsx(bl,{ref:m,status:e.status,variant:e.variant,size:e.size,title:e.title,description:e.description,action:e.action,loading:e.loading,onClose:b})})})})}function ww(e,t){if(t<=0)return;const n=i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableToastStack");if(i.killMotion(e),n){e.style.height=`${t}px`;return}$.to(e,{height:t,...i.motionInteractive(),overwrite:"auto"})}function Ow({placement:e,sorted:t,dismissingIds:n,onDismiss:o,onRemoveFinal:r,classNames:s,defaultSize:l="base"}){var A,b;const u=e.startsWith("top"),d=St("toastNotifications"),f=a.useRef(null);f.current||(f.current=new Map);const m=a.useRef(null),p=a.useRef(null),C=a.useRef(0),S=a.useRef({frontId:(A=t[0])==null?void 0:A.id,count:t.length});S.current={frontId:(b=t[0])==null?void 0:b.id,count:t.length};const g=i.usePrefersReducedMotion(),h=a.useCallback(()=>{const L=m.current;if(!L)return;const{frontId:_,count:v}=S.current,R=_!=null?f.current.get(_)??0:0,T=bw(R,v),E=T>0?T:C.current;T>0&&(C.current=T),ww(L,E)},[]),x=a.useCallback((L,_)=>{f.current.get(L)!==_&&(f.current.set(L,_),L===S.current.frontId&&h())},[h]);return a.useLayoutEffect(()=>{const L=new Set(t.map(_=>_.id));for(const _ of f.current.keys())L.has(_)||f.current.delete(_);h()},[t,h]),a.useLayoutEffect(()=>{const L=p.current;L&&$.set(L,{opacity:0})},[]),a.useLayoutEffect(()=>{var R;const L=p.current;if(!L)return;const _=g,v=t.length===1&&n.has(((R=t[0])==null?void 0:R.id)??"");if(i.killMotion(L),_){$.set(L,{opacity:v?0:1});return}v?$.to(L,{opacity:0,...i.motionToastDismiss(),overwrite:"auto"}):$.to(L,{opacity:1,...i.motionInteractive(),overwrite:"auto"})},[t,n,g]),c.jsxs("div",{role:"region","aria-label":kN(e,d),className:Cw({placement:e,slotClass:s==null?void 0:s.viewport}),style:{width:ah(t,l)},children:[c.jsx("div",{ref:p,"aria-hidden":!0,className:Sw(s==null?void 0:s.scrim),style:{[u?"top":"bottom"]:`calc(-1 * ${ft(dt.offsetY)})`,left:`calc(-1 * ${ft(dt.insetX)})`,right:`calc(-1 * ${ft(dt.insetX)})`,height:ft(dt.height),background:ft(u?dt.gradientTop:dt.gradientBottom),maskImage:ft(dt.mask),WebkitMaskImage:ft(dt.mask)}}),c.jsx("div",{ref:m,className:gw(s==null?void 0:s.stack),style:{alignItems:u?"start":"end"},children:t.map((L,_)=>c.jsx(Nw,{entry:L,reverseIdx:_,total:t.length,isTop:u,isDismissing:n.has(L.id),onDismiss:o,onRemoveFinal:r,onHeightChange:x,providerClassNames:s},L.id))})]})}function Pw({defaultPlacement:e="bottom-center",defaultVariant:t="default",defaultSize:n="base",classNames:o}){const[r,s]=a.useState([]),[l,u]=a.useState(new Set),[d,f]=a.useState({text:"",assertive:!1,nonce:0}),m=a.useRef(0),p=a.useRef(0),C=a.useRef(r);C.current=r;const S=a.useCallback(v=>{const R=Wm(v.title,v.description);if(!R)return;const T=DN(v.status)==="alert";f({text:"",assertive:T,nonce:++p.current}),requestAnimationFrame(()=>{f({text:R,assertive:T,nonce:++p.current})})},[]),g=a.useCallback(v=>{const R=v.id??Aw(),T={id:R,status:v.status??"default",variant:v.variant??t,size:v.size??n,title:v.title,description:v.description,action:v.action,timeout:v.timeout??ss,placement:v.placement??e,createdAt:++m.current,loading:v.loading??!1,classNames:{...o,...v.classNames}};return s(E=>[...E,T]),S(T),R},[S,e,n,t,o]),h=a.useCallback((v,R)=>{const T=C.current.find(I=>I.id===v);if(!T)return;const E={...T,...R};s(I=>I.map(O=>O.id===v?E:O)),(R.title!==void 0||R.description!==void 0||R.status!==void 0||R.loading===!1)&&S(E)},[S]),x=a.useCallback(v=>{u(R=>new Set([...R,v]))},[]),A=a.useCallback(v=>{s(R=>R.filter(T=>T.id!==v)),u(R=>{const T=new Set(R);return T.delete(v),T})},[]),b=a.useMemo(()=>[...new Set(r.map(v=>v.placement))],[r]),L=a.useMemo(()=>({add:g,update:h,dismiss:x}),[g,x,h]),_=a.useCallback(v=>r.filter(R=>R.placement===v).toSorted((R,T)=>T.createdAt-R.createdAt),[r]);return{toasts:r,dismissingIds:l,placements:b,ctx:L,sortedByPlacement:_,dismiss:x,removeFinal:A,providerClassNames:o,defaultSize:n,liveAnnouncement:d}}function Dw({announcement:e}){const t=e.assertive?"":e.text,n=e.assertive?e.text:"";return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:Cc,"aria-live":"polite","aria-atomic":"true","aria-relevant":"additions text",children:t}),c.jsx("div",{className:Cc,"aria-live":"assertive","aria-atomic":"true","aria-relevant":"additions text",children:n})]})}function kw({children:e,defaultPlacement:t="bottom-center",defaultVariant:n="default",defaultSize:o="base",portalContainer:r,classNames:s}){const l=Pw({defaultPlacement:t,defaultVariant:n,defaultSize:o,classNames:s});return c.jsxs(ml.Provider,{value:l.ctx,children:[e,c.jsx(Dw,{announcement:l.liveAnnouncement}),typeof document<"u"&&l.placements.map(u=>{const d=Ct(r);return d?Ut.createPortal(c.jsx(Ow,{placement:u,sorted:l.sortedByPlacement(u),dismissingIds:l.dismissingIds,onDismiss:l.dismiss,onRemoveFinal:l.removeFinal,classNames:s,defaultSize:l.defaultSize}),d,u):null})]})}const bl=a.forwardRef(function({status:t="default",variant:n="default",size:o="base",title:r,description:s,action:l,loading:u=!1,onClose:d,className:f,classNames:m,children:p,onPointerOver:C,onPointerOut:S,...g},h){const x=yw({status:t,size:o,title:r,description:s,action:l,loading:u,onClose:d,children:p}),A=n==="gloss",b=a.useRef(null),L=a.useMemo(()=>i.createGlossInteractiveRefCallback(b,A),[A]),_=a.useCallback(w=>{L(w),b.current=w,typeof h=="function"?h(w):h&&(h.current=w)},[L,h]),v=i.useGlossInteractiveHandlers(b,A),R=Ot(),T=x.gridSlots.hasTitle,{"aria-label":E,"aria-labelledby":I,...O}=g,N=T?x.titleId:void 0,y=T?void 0:E??BN(r,s);return c.jsx(jN,{value:x.itemCtx,children:c.jsx($m,{classNames:m,children:c.jsx("div",{ref:_,role:"group","aria-labelledby":N,"aria-label":y,className:pw({variant:n,size:x.size,gridSlots:x.gridSlots,slotClass:R.root,className:f}),onPointerOver:w=>{C==null||C(w),!w.defaultPrevented&&A&&v.onPointerOver(w)},onPointerOut:w=>{S==null||S(w),A&&v.onPointerOut(w)},...O,children:x.isCompound?p:c.jsx(hw,{gridSlots:x.gridSlots,title:r,description:s,action:l,onClose:d})})})})});bl.displayName="ToastRoot";function Bw(){const e=Xm(),t=a.useCallback(s=>e.add(s),[e]),n=a.useCallback(s=>(l,u)=>e.add({...u,status:s,title:l}),[e]),o=a.useCallback((s,l)=>{const u=e.add({status:"default",title:l.loading??"Loading…",timeout:0,loading:!0,placement:l.placement,classNames:l.classNames});return s.then(d=>{const f=typeof l.success=="function"?l.success(d):l.success;e.update(u,{status:"success",title:f,loading:!1,timeout:l.timeout??ss})},d=>{const f=l.error==null?"An error occurred":typeof l.error=="function"?l.error(d):l.error;e.update(u,{status:"danger",title:f,loading:!1,timeout:l.timeout??ss})}),u},[e]);return{toast:{show:t,success:n("success"),danger:n("danger"),info:n("info"),warning:n("warning"),promise:o,dismiss:e.dismiss}}}const op=Object.assign(bl,{Provider:kw,Message:tp,Indicator:Cl,Content:np,Title:gl,Description:Sl,Action:hl,Close:xl}),rp=a.createContext(null),as=a.createContext({});function sp({value:e,children:t}){return c.jsx(rp.Provider,{value:e,children:t})}function jw({classNames:e,children:t}){const n=a.useContext(as),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(as.Provider,{value:o,children:t})}function Ke(){const e=a.useContext(rp);if(!e)throw new Error("Drawer.* components must be used inside <Drawer>.");return e}function We(){return a.useContext(as)}function Mw(e,t=Se){switch(e){case"bottom":return t.drawerDragDownToClose;case"top":return t.drawerDragUpToClose;case"left":return t.drawerDragLeftToClose;case"right":return t.drawerDragRightToClose}}function Fw(e){return e==="Enter"||e===" "}function Hw(e){return e.displayName}function ap(e,t){return a.Children.map(e,n=>{if(!a.isValidElement(n))return n;if(n.type===Vt){const o=n.props;return a.cloneElement(n,{size:o.size??t})}if(n.type===a.Fragment){const o=n;return a.cloneElement(o,{key:o.key??void 0},ap(o.props.children,t))}return n})}function Gw(e){let t=!0;const n=[];let o=[];const r=()=>{if(o.length===0)return;const s=o;o=[],n.push({kind:"content",children:s})};return a.Children.forEach(e,s=>{if(!a.isValidElement(s)){o.push(s);return}const l=Hw(s.type);if(l==="DrawerBackdrop"){s.props.isDismissable===!1&&(t=!1);return}if(l==="DrawerHandle"){r(),n.push({kind:"handle",node:s});return}o.push(s)}),r(),{backdropIsDismissable:t,panelSegments:n}}function Vw(e,t){return t==="left"||t==="right"?e.offsetWidth:e.offsetHeight}function lp(e,t){const n=Vw(e,t);switch(t){case"left":return{x:-n,y:0};case"right":return{x:n,y:0};case"top":return{x:0,y:-n};case"bottom":return{x:0,y:n}}}function zw(){return{x:0,y:0}}function Uw(e,t){return lp(e,t)}function Ww(e){$.set(e,{xPercent:0,yPercent:0,x:0,y:0})}function Yw(e,t){return{from:lp(e,t),to:zw()}}function $w({open:e,onOpenChange:t,variant:n,placement:o,backdropIsDismissable:r,contained:s=!1}){const l=il({open:e,gloss:n==="gloss",contained:s,onOpenChange:t,dismissOnBackdrop:r,enableContainedEscape:!0,panelMotionKey:o,preparePanel:Ww,getPanelOpen:u=>Yw(u,o),getPanelExit:u=>Uw(u,o)});return{showPortal:l.showPortal,mounted:l.mounted,dialogRef:l.dialogRef,overlayRef:l.overlayRef,panelRef:l.panelRef,skipCloseAnimRef:l.skipCloseAnimRef,bindGlossPanelRef:l.bindGlossPanelRef,handleBackdropMouseDown:l.handleBackdropPointerDown}}const Xw={left:"left-0 top-0 h-full",right:"right-0 top-0 h-full",bottom:"bottom-0 inset-x-0 w-full",top:"top-0 inset-x-0 w-full"},Kw={default:{horizontal:"max-w-[min(100vw,24rem)] w-full",vertical:"max-h-[90dvh]"},mid:{horizontal:"w-[50vw] max-w-full",vertical:"max-h-[50dvh]"},full:{horizontal:"w-screen",vertical:"h-dvh"}},qw={small:{left:"rounded-r-small",right:"rounded-l-small",bottom:"rounded-t-small",top:"rounded-b-small"},base:{left:"rounded-r-base",right:"rounded-l-base",bottom:"rounded-t-base",top:"rounded-b-base"},mid:{left:"rounded-r-mid",right:"rounded-l-mid",bottom:"rounded-t-mid",top:"rounded-b-mid"},large:{left:"rounded-r-large",right:"rounded-l-large",bottom:"rounded-t-large",top:"rounded-b-large"}},Zw={bottom:"pt-mid",top:"pb-mid",left:"pr-mid",right:"pl-mid"};function uo(e){const t=zo[e];return{rounded:t.rounded,headerGap:t.headerGap,headerPadding:t.headerPadding,bodyPadding:t.bodyPadding,footerPadding:t.footerPadding,headingGap:t.headingGap,titleVariant:t.titleVariant,titleClassName:t.titleClassName,descVariant:t.descVariant,descClassName:t.descClassName,bodyVariant:t.bodyVariant,footerButtonSize:t.footerButtonSize,closeButtonSize:t.closeButtonSize}}const Qw={small:uo("small"),base:uo("base"),mid:uo("mid"),large:uo("large")},Jw="flex min-h-0 flex-1 flex-col text-left",eO="m-0 h-full w-full max-h-none max-w-none border-0 bg-transparent p-0 open:block [&::backdrop]:bg-transparent",tO="fixed inset-0 z-dialog",nO="absolute inset-0 z-dialog";function oO(e){return i.cn(e?nO:tO,eO)}const rO="overlay-backdrop",sO="overlay-backdrop-scrim",aO="absolute z-10 flex flex-col outline-none overflow-hidden",lO="border-token bg-surface text-foreground shadow-token-large",iO="gloss-panel gloss-deep flex min-h-0 flex-1 flex-col text-foreground",cO="gloss-content flex min-h-0 min-w-0 flex-1 flex-col",uO="flex shrink-0 items-start text-left",dO="flex min-w-0 flex-1 flex-col text-left",fO="min-w-0",mO="min-h-0 flex-1 overflow-y-auto",pO="flex shrink-0 flex-wrap items-center justify-end gap-base",CO="shrink-0",gc="outline-none focus-ring",gO="flex touch-none select-none shrink-0 items-center justify-center cursor-grab active:cursor-grabbing box-content outline-none focus-ring",SO="h-1 w-10",hO="h-10 w-1",xO="rounded-full bg-tertiary";function bO(e,t){const n=Kw[t];return e==="left"||e==="right"?n.horizontal:n.vertical}function ip(e,t,n){if(n!=="full")return qw[t][e]}function AO(){return cf()}function vO({lightUi:e,dismissable:t,slotClass:n}){return i.cn("absolute inset-0",e?rO:sO,t?"cursor-pointer":"cursor-default",n)}function LO({variant:e,placement:t,extent:n,size:o,className:r,slotClass:s}){return i.cn(aO,e!=="gloss"&&lO,Xw[t],bO(t,n),ip(t,o,n),s,r)}function _O({placement:e,extent:t,size:n,slotClass:o}){return i.cn(iO,ip(e,n,t),o)}function TO(e){return i.cn(Jw,e)}function EO(e){return i.cn(cO,e)}function RO(e,t){return i.cn(mO,e,t)}function IO({placement:e,slotClass:t,className:n}){const o=e==="left"||e==="right";return i.cn(gO,o?"self-stretch w-xsmall":"h-xsmall w-full",Zw[e],t,n)}function yO({placement:e,slotClass:t}){const n=e==="left"||e==="right";return i.cn(xO,n?hO:SO,t)}function NO(e){return Ee(e).footerButtonSize}const wO=.38,Sc=.45;function OO(e,t){return e==="left"?-t.offsetWidth:e==="right"?t.offsetWidth:e==="top"?-t.offsetHeight:t.offsetHeight}function PO(e){return e==="left"||e==="right"?"x":"y"}function DO(e,t,n){$.set(e,{[t]:n})}function kO(e,t){return 1-Math.min(Math.abs(e)/Math.abs(t),1)}function BO(e,t,n,o,r,s){return{onPointerDown:a.useCallback(u=>{const d=e.current,f=t.current;if(!d||i.prefersReducedMotion())return;const m=PO(n),p=m==="x",C=p?u.clientX:u.clientY;let S=C,g=performance.now(),h=0;const x=OO(n,d),A=u.currentTarget;A.setPointerCapture(u.pointerId),i.killMotion(d,f),d.style.willChange="transform";const b=_=>{if(_.pointerId!==u.pointerId)return;const v=p?_.clientX:_.clientY,R=v-C,T=performance.now(),E=T-g;E>0&&(h=(v-S)/E),S=v,g=T;const O=(n==="left"||n==="top"?-1:1)>0?Math.max(0,R):Math.min(0,R);DO(d,m,O),f&&$.set(f,{opacity:kO(O,x)})},L=_=>{if(_.pointerId!==u.pointerId)return;A.releasePointerCapture(u.pointerId),A.removeEventListener("pointermove",b),A.removeEventListener("pointerup",L),A.removeEventListener("pointercancel",L);const R=(p?_.clientX:_.clientY)-C,T=Math.abs(R)/Math.abs(x),E=n==="right"||n==="bottom"?h>Sc:h<-Sc,I={...i.motionInteractive(),overwrite:"auto"};if(T>=wO||E){i.killMotion(d,f);const O=$.timeline({onComplete:()=>{d.style.willChange="",s&&(s.current=!0),o()}});O.fromTo(d,{[m]:R},{[m]:x,...I},0),f&&O.to(f,{opacity:0,...I},0)}else{i.killMotion(d,f);const O=$.timeline({onComplete:()=>{d.style.willChange="",$.set(d,{clearProps:m}),f&&$.set(f,{opacity:1})}});O.fromTo(d,{[m]:R},{[m]:0,...I},0),f&&O.to(f,{opacity:1,...I},0)}};A.addEventListener("pointermove",b),A.addEventListener("pointerup",L),A.addEventListener("pointercancel",L)},[r,o,t,e,n,s])}}function cp(e){return null}cp.displayName="DrawerBackdrop";const wo=a.forwardRef(function({className:t,...n},o){const r=We();return c.jsx("div",{ref:o,className:TO(i.cn(r.content,t)),...n})});wo.displayName="DrawerContent";function jO({segment:e,variant:t}){const n=We();return e.kind==="handle"?e.node:t==="gloss"?c.jsx("div",{className:EO(n.glossContent),children:c.jsx(wo,{children:e.children})}):c.jsx(wo,{children:e.children})}function up({className:e,onPointerDown:t,onKeyDown:n,...o}){const{onOpenChange:r,placement:s,overlayRef:l,panelRef:u,skipCloseAnimRef:d}=Ke(),f=We(),m=Ie(),p=()=>r(!1),{onPointerDown:C}=BO(u,l,s,p,!1,d);return c.jsx("div",{role:"button",tabIndex:0,"aria-label":Mw(s,m),className:IO({placement:s,slotClass:f.handle,className:e}),onPointerDown:S=>{t==null||t(S),C(S)},onKeyDown:S=>{n==null||n(S),!S.defaultPrevented&&Fw(S.key)&&(S.preventDefault(),p())},...o,children:c.jsx("span",{"aria-hidden":!0,className:yO({placement:s,slotClass:f.handleGrip})})})}up.displayName="DrawerHandle";const dp=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=Ke(),s=We();return c.jsx("div",{ref:o,className:i.cn(uO,r.headerGap,r.headerPadding,s.header,t),...n})});dp.displayName="DrawerHeader";function fp({className:e,...t}){const{sizePreset:n}=Ke(),o=We();return c.jsx("div",{className:i.cn(dO,n.headingGap,o.headingBlock,e),...t})}fp.displayName="DrawerHeadingBlock";const mp=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,setHasTitle:l,sizePreset:u}=Ke(),d=We();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"h2",variant:u.titleVariant,id:n??s,className:i.cn(fO,u.titleClassName,d.title,t),...o})});mp.displayName="DrawerTitle";function pp({className:e,id:t,...n}){const{descriptionId:o,setHasDescription:r,sizePreset:s}=Ke(),l=We();return a.useLayoutEffect(()=>(r(!0),()=>r(!1)),[r]),c.jsx(q,{as:"p",variant:s.descVariant,id:t??o,className:i.cn(s.descClassName,l.description,e),...n})}pp.displayName="DrawerDescription";const Cp=a.forwardRef(function({className:t,onClick:n,size:o,"aria-label":r,...s},l){const{onOpenChange:u,sizePreset:d}=Ke(),f=We();return c.jsx(Cn,{ref:l,variant:"secondary",size:o??d.closeButtonSize,"aria-label":r,className:i.cn(CO,f.close,t),onClick:m=>{n==null||n(m),m.defaultPrevented||u(!1)},...s})});Cp.displayName="DrawerClose";const gp=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=Ke(),s=We();return c.jsx("div",{ref:o,className:RO(r.bodyPadding,i.cn(s.body,t)),...n})});gp.displayName="DrawerBody";const Sp=a.forwardRef(function({className:t,children:n,...o},r){const{sizePreset:s,footerButtonSize:l}=Ke(),u=We(),d=a.useMemo(()=>ap(n,l),[n,l]);return c.jsx("div",{ref:r,className:i.cn(pO,s.footerPadding,u.footer,t),...o,children:d})});Sp.displayName="DrawerFooter";const hp=a.forwardRef(function({children:t,asChild:n,className:o,onClick:r,onPointerDown:s,...l},u){const{open:d,onOpenChange:f}=Ke(),m=We(),p=a.useRef(null),C=At(),S=a.useCallback(x=>{p.current=x,ue(u,x)},[u]),g=a.useCallback(x=>{var A;d||C.current||x.button!==0||(x.preventDefault(),(A=p.current)==null||A.focus({preventScroll:!0}),bt({triggerRef:p,openingRef:C,setOpen:()=>f(!0)}))},[d,C,p,f]),h=a.useCallback(x=>{r==null||r(x),!x.defaultPrevented&&!d&&!C.current&&f(!0)},[r,d,C,f]);if(n&&a.isValidElement(t)){const x=a.Children.count(t)===1?t:null;if(x){const A=x;return a.cloneElement(A,yt(A,{...l,className:i.cn(gc,m.trigger,o),onPointerDown:b=>{g(b),s==null||s(b)},onClick:h,"aria-haspopup":"dialog","aria-expanded":d},$e(b=>{p.current=b},u),{runBeforeChild:["onPointerDown"]}))}}return c.jsx("button",{type:"button",ref:S,"aria-haspopup":"dialog","aria-expanded":d,className:i.cn(gc,m.trigger,o),onPointerDown:x=>{s==null||s(x),g(x)},onClick:h,...l,children:t})});hp.displayName="Drawer.Trigger";const xp=a.forwardRef(function({extent:t="default",variant:n="default",className:o,style:r,themeAnchor:s,portalContainer:l,children:u,...d},f){const m=Ke(),{open:p,onOpenChange:C,placement:S,portalContainer:g}=m,{backdropIsDismissable:h,panelSegments:x}=a.useMemo(()=>Gw(u),[u]),A=Ct(l??g),b=dn(A),L=$w({open:p,onOpenChange:C,variant:n,placement:S,backdropIsDismissable:h,contained:b}),_=Ma(p,s??null),v=ja(_),R=An(_),T=a.useMemo(()=>({...m,overlayRef:L.overlayRef,panelRef:L.panelRef,skipCloseAnimRef:L.skipCloseAnimRef}),[m,L.overlayRef,L.panelRef,L.skipCloseAnimRef]);return typeof document>"u"||!L.showPortal||!A?null:Ut.createPortal(c.jsx(sp,{value:T,children:c.jsx(MO,{className:o,style:r,variant:n,placement:S,extent:t,portalTheme:R,lightUi:v,titleId:m.titleId,descriptionId:m.descriptionId,hasTitle:m.hasTitle,hasDescription:m.hasDescription,backdropIsDismissable:h,panelSegments:x,dialogRef:L.dialogRef,overlayRef:L.overlayRef,panelRef:L.panelRef,panelForwardedRef:f,panelRest:d,bindGlossPanelRef:L.bindGlossPanelRef,onBackdropMouseDown:L.handleBackdropMouseDown,onDialogClose:()=>C(!1),onDialogCancel:E=>{E.preventDefault(),C(!1)},contained:b})}),A)});xp.displayName="Drawer.Panel";function MO({className:e,style:t,variant:n,placement:o,extent:r,portalTheme:s,lightUi:l,titleId:u,descriptionId:d,hasTitle:f,hasDescription:m,backdropIsDismissable:p,panelSegments:C,dialogRef:S,overlayRef:g,panelRef:h,panelForwardedRef:x,panelRest:A,bindGlossPanelRef:b,onBackdropMouseDown:L,onDialogClose:_,onDialogCancel:v,contained:R=!1}){const T=We(),{size:E}=Ke(),I=C.map((O,N)=>c.jsx(jO,{segment:O,variant:n},O.kind==="handle"?`handle-${N}`:`content-${N}`));return c.jsxs("dialog",{...s,ref:S,onClose:_,onCancel:v,"aria-labelledby":f?u:void 0,"aria-describedby":m?d:void 0,className:i.cn(oO(R),T.dialog),children:[c.jsx("div",{ref:g,className:vO({lightUi:l,dismissable:p,slotClass:T.overlay}),style:AO(),"aria-hidden":!0,onMouseDown:L}),c.jsx("div",{ref:$e(h,x),tabIndex:-1,className:LO({variant:n,placement:o,extent:r,size:E,className:e,slotClass:T.panel}),style:t,...A,children:n==="gloss"?c.jsx("div",{ref:b,className:_O({placement:o,extent:r,size:E,slotClass:T.glossPanel}),children:I}):I})]})}const FO="right";function HO({open:e,defaultOpen:t=!1,onOpenChange:n,placement:o=FO,size:r="base",portalContainer:s}){const[l,u]=Re({value:e,defaultValue:t,onChange:n}),d=a.useId(),f=a.useId(),[m,p]=a.useState(!1),[C,S]=a.useState(!1),g=a.useRef(null),h=a.useRef(null),x=a.useRef(!1),A=a.useCallback(v=>{p(v)},[]),b=a.useCallback(v=>{S(v)},[]),L=Qw[r];return{contextValue:{open:l,titleId:d,descriptionId:f,hasTitle:m,setHasTitle:A,hasDescription:C,setHasDescription:b,onOpenChange:u,placement:o,size:r,sizePreset:L,footerButtonSize:NO(r),overlayRef:g,panelRef:h,skipCloseAnimRef:x,portalContainer:s}}}function bp({open:e,defaultOpen:t=!1,onOpenChange:n,placement:o="right",size:r="base",children:s,classNames:l,portalContainer:u}){const d=HO({open:e,defaultOpen:t,onOpenChange:n,placement:o,size:r,portalContainer:u});return c.jsx(sp,{value:d.contextValue,children:c.jsx(jw,{classNames:l,children:s})})}bp.displayName="Drawer";const GO=Object.assign(bp,{Trigger:hp,Panel:xp,Backdrop:cp,Handle:up,Content:wo,Header:dp,HeadingBlock:fp,Title:mp,Description:pp,Close:Cp,Body:gp,Footer:Sp});function VO({forwardedRef:e,onPointerEnter:t,onPointerLeave:n,onPointerDown:o}){const r=a.useRef(null),s=a.useCallback(f=>{r.current=f,ue(e,f)},[e]),{handlePointerEnter:l,handlePointerLeave:u,handlePointerDown:d}=xt({isDisabled:!1,enabled:!0,textMotionRef:r,hoverLift:!0,onPointerEnter:t,onPointerLeave:n,onPointerDown:o});return{setAnchorRef:s,handlePointerEnter:l,handlePointerLeave:u,handlePointerDown:d}}const ls=a.createContext({});function zO({classNames:e,children:t}){const n=a.useContext(ls),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ls.Provider,{value:o,children:t})}function Al(){return a.useContext(ls)}const UO=!0,WO=!0,YO="group/link inline-flex max-w-full min-w-0 items-center gap-xsmall rounded-mid no-underline outline-none w-fit text-primary focus-ring",$O="min-w-0 truncate font-w-mid",XO="underline decoration-current/70 underline-offset-[0.2em]",KO="text-muted group-hover/link:text-primary group-focus-visible/link:text-primary",qO="text-primary",ZO="rotate-[-45deg]",QO={small:"small",base:"base",mid:"mid",large:"large"},Ap={small:"icon-small",base:"icon-base",mid:"icon-mid",large:"icon-large"};function vp({slotClass:e,className:t}){return i.cn(YO,e,t)}function JO({underline:e,slotClass:t}){return i.cn($O,e&&XO,t)}function e0({size:e,muted:t,slotClass:n}){return i.cn(i.TEXT_COLOR_TRANSITION,Ap[e],"[&_svg]:size-full",t?KO:qO,n)}function t0(e){return i.cn(Ap[e],ZO)}function hc({size:e}){return c.jsx(be.IoArrowForward,{"aria-hidden":UO,className:t0(e)})}function xc({children:e,size:t,muted:n=!1,slotClass:o}){return c.jsx("span",{className:e0({size:t,muted:n,slotClass:o}),"aria-hidden":WO,children:e})}function Lp({size:e,underline:t,textVariant:n,textChildren:o,startIcon:r,endIcon:s,startIconMuted:l,endIconMuted:u,usesDefaultAtStart:d,usesDefaultAtEnd:f}){const m=Al(),p=r??(d?c.jsx(hc,{size:e}):null),C=s??(f?c.jsx(hc,{size:e}):null);return c.jsxs(c.Fragment,{children:[p?c.jsx(xc,{size:e,muted:l,slotClass:m.iconStart,children:p}):null,c.jsx(q,{as:"span",variant:n,inheritColor:!0,className:JO({underline:t,slotClass:m.text}),children:o}),C?c.jsx(xc,{size:e,muted:u,slotClass:m.iconEnd,children:C}):null]})}function n0({href:e,size:t,underline:n,textVariant:o,textChildren:r,startIcon:s,endIcon:l,startIconMuted:u,endIconMuted:d,usesDefaultAtStart:f,usesDefaultAtEnd:m,className:p="",setAnchorRef:C,handlePointerEnter:S,handlePointerLeave:g,handlePointerDown:h,...x}){const A=Al();return c.jsx("a",{ref:C,href:e,className:vp({slotClass:A.root,className:p}),onPointerEnter:S,onPointerLeave:g,onPointerDown:h,...x,children:c.jsx(Lp,{size:t,underline:n,textVariant:o,textChildren:r,startIcon:s,endIcon:l,startIconMuted:u,endIconMuted:d,usesDefaultAtStart:f,usesDefaultAtEnd:m})})}function _p(e){return null}_p.displayName="Link.Icon";const Tp="Link.Icon";function Ep(e){if(a.isValidElement(e))return e.type.displayName}function Rp(e){return a.Children.toArray(e).some(t=>{if(!a.isValidElement(t))return!1;if(Ep(t)===Tp)return!0;const n=t.props.children;return n!=null&&Rp(n)})}function o0(e){const t=e.children!==void 0&&e.children!==null;return{node:t?e.children:"default",muted:!t}}function r0(e){const t=[];let n,o;return a.Children.forEach(e,r=>{if(a.isValidElement(r)&&Ep(r)===Tp){const s=r.props,l=o0(s);(s.position??"end")==="start"?n=l:o=l;return}t.push(r)}),{textChildren:t.length===1?t[0]:a.createElement(a.Fragment,null,...t),startIcon:n,endIcon:o}}function bc(e,t,n,o){return e?{node:e.node==="default"?null:e.node,muted:e.muted}:{node:null,muted:!1}}function s0({icon:e,showDefaultIcon:t=!1,defaultIconPosition:n="end"}){const o=t&&e==null;return{usesDefaultIcon:o,defaultIconAtStart:o&&n==="start",defaultIconAtEnd:o&&n==="end"}}function a0({icon:e,iconPosition:t="start",showDefaultIcon:n,defaultIconPosition:o,children:r}){var u,d;if(r!=null&&Rp(r)){const f=r0(r),m=bc(f.startIcon),p=bc(f.endIcon);return{textChildren:f.textChildren,startIcon:m.node,endIcon:p.node,startIconMuted:m.muted,endIconMuted:p.muted,usesDefaultAtStart:((u=f.startIcon)==null?void 0:u.node)==="default",usesDefaultAtEnd:((d=f.endIcon)==null?void 0:d.node)==="default"}}const l=s0({icon:e,showDefaultIcon:n,defaultIconPosition:o});return{textChildren:r??null,startIcon:e!=null&&t==="start"?e:null,endIcon:e!=null&&t==="end"?e:null,startIconMuted:l.defaultIconAtStart,endIconMuted:l.defaultIconAtEnd,usesDefaultAtStart:l.defaultIconAtStart,usesDefaultAtEnd:l.defaultIconAtEnd}}function l0({size:e="base",underline:t=!1,icon:n,iconPosition:o="start",showDefaultIcon:r=!1,defaultIconPosition:s="end",children:l}){const u=a0({icon:n,iconPosition:o,showDefaultIcon:r,defaultIconPosition:s,children:l});return{size:e,underline:t,textVariant:QO[e],...u}}const Ip=a.forwardRef(function({href:t,asChild:n=!1,children:o,className:r="",size:s,underline:l,icon:u,iconPosition:d,showDefaultIcon:f,defaultIconPosition:m,onPointerEnter:p,onPointerLeave:C,onPointerDown:S,...g},h){const x=n&&a.isValidElement(o)&&a.Children.count(o)===1?o:null,A=x?x.props.children:o,b=l0({size:s,underline:l,icon:u,iconPosition:d,showDefaultIcon:f,defaultIconPosition:m,children:A}),L=VO({forwardedRef:h,onPointerEnter:p,onPointerLeave:C,onPointerDown:S}),_=Al(),v={size:b.size,underline:b.underline,textVariant:b.textVariant,textChildren:b.textChildren,startIcon:b.startIcon,endIcon:b.endIcon,startIconMuted:b.startIconMuted,endIconMuted:b.endIconMuted,usesDefaultAtStart:b.usesDefaultAtStart,usesDefaultAtEnd:b.usesDefaultAtEnd};return x?a.cloneElement(x,yt(x,{...g,...t!=null?{href:t}:{},className:vp({slotClass:_.root,className:r}),onPointerEnter:L.handlePointerEnter,onPointerLeave:L.handlePointerLeave,onPointerDown:L.handlePointerDown,children:c.jsx(Lp,{...v})},L.setAnchorRef)):c.jsx(n0,{href:t,className:r,setAnchorRef:L.setAnchorRef,handlePointerEnter:L.handlePointerEnter,handlePointerLeave:L.handlePointerLeave,handlePointerDown:L.handlePointerDown,...v,...g})});Ip.displayName="Link";const yp=a.forwardRef(function({classNames:t,...n},o){return c.jsx(zO,{classNames:t,children:c.jsx(Ip,{ref:o,...n})})});yp.displayName="Link";const i0=Object.assign(yp,{Icon:_p}),vl=a.createContext(null),is=a.createContext({});function c0({value:e,children:t}){return c.jsx(vl.Provider,{value:e,children:t})}function u0({classNames:e,children:t}){const n=a.useContext(is),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(is.Provider,{value:o,children:t})}function Np(){const e=a.useContext(vl);if(!e)throw new Error("TextArea compound parts must be inside <TextArea>.");return e}function d0(){return a.useContext(vl)}function Yn(){return a.useContext(is)}function f0(e=Se.resizeHeight){return e}function m0({shellRef:e,blocked:t,variant:n,resizable:o,onPointerDown:r}){const s=n==="gloss",l=i.useFieldShellHoverLift(e,!t&&!s),u=i.useGlossFieldShellMotion(e,!t&&s),d=a.useCallback(m=>{e.current=m,m&&!o&&m.style.removeProperty("height"),!t&&s&&u.bindShellRef(m)},[t,u,s,o,e]),f=a.useCallback(m=>{if(r==null||r(m),m.defaultPrevented||t)return;const p=m.target;if(p instanceof HTMLElement&&p.closest("[data-textarea-resize-handle]"))return;const C=e.current;if(!(!C||i.prefersReducedMotion())){if(s){u.onShellPointerDown();return}i.animateInteractivePressSqueeze(C)}},[t,u,s,r,e]);return{isGloss:s,setShellRef:d,shellPointerDown:f,shellPointerEnter:s?u.onShellPointerEnter:l.onShellPointerEnter,shellPointerLeave:s?u.onShellPointerLeave:l.onShellPointerLeave,shellFocusCapture:s?u.onShellFocusIn:void 0,shellBlurCapture:s?u.onShellFocusOut:void 0,glossShellHoverMotionClass:u.shellHoverMotionClass,standardShellHoverMotionClass:l.shellHoverMotionClass}}const p0={small:"min-h-control-small",base:"min-h-control-base",mid:"min-h-control-mid",large:"min-h-control-large"},C0="flex flex-col items-stretch",g0=`box-border block min-h-0 w-full flex-1 resize-none overflow-auto bg-transparent font-inherit text-foreground outline-none placeholder:text-muted appearance-none [field-sizing:content] ${we}`,S0="absolute bottom-[length:calc(var(--border-width)*2)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*9)] origin-bottom-right rotate-[135deg] bg-muted-foreground",h0="absolute bottom-[length:calc(var(--border-width)*6)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*6)] origin-bottom-right rotate-[135deg] bg-muted-foreground",x0="relative block size-[length:var(--size-scale-small)] shrink-0",b0="absolute bottom-0 right-0 z-[2] m-0 flex touch-none select-none appearance-none border-0 bg-transparent items-end justify-end p-xsmall outline-none focus-ring-inset",A0="cursor-not-allowed opacity-45",v0="cursor-ns-resize";function L0(e){return i.CONTROL_SIZE_LAYOUT[e].controlPad}function _0({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function T0({variant:e,status:t,blocked:n,size:o,shellSurface:r,glossShellHoverMotionClass:s,standardShellHoverMotionClass:l,slotClass:u,className:d}){const f=e==="gloss";return i.cn("relative w-full overflow-hidden rounded-base border-1",C0,f&&"relative",p0[o],r,i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),f?s:i.fieldShellHoverClass(!n,t,e),!f&&l,n?"cursor-not-allowed opacity-55 shadow-token-base":"",u,d)}function E0({size:e,resizable:t,slotClass:n}){return i.cn(g0,t&&"pr-large",L0(e),n,we)}function R0({disabled:e,slotClass:t}){return i.cn(b0,e?A0:v0,t)}const Or=640,Ac=16;function I0(e,t,n,o){const r=a.useCallback(d=>{const f=e.current;f&&(d!=null?f.style.height=`${d}px`:f.style.removeProperty("height"))},[e]),s=a.useCallback(d=>{const f=e.current;if(!f)return;const m=i.readControlHeightPx(o),p=f.getBoundingClientRect().height,C=Math.min(Or,Math.max(m,p+d));r(C)},[r,e,o]),l=a.useCallback(d=>{if(n||!t)return;d.preventDefault(),d.stopPropagation();const f=e.current,m=d.currentTarget;if(!f)return;const p=d.clientY,C=f.getBoundingClientRect().height,S=i.readControlHeightPx(o);m.setPointerCapture(d.pointerId);const g=x=>{if(x.pointerId!==d.pointerId)return;const A=Math.min(Or,Math.max(S,C+(x.clientY-p)));r(A)},h=x=>{x.pointerId===d.pointerId&&(m.releasePointerCapture(d.pointerId),m.removeEventListener("pointermove",g),m.removeEventListener("pointerup",h),m.removeEventListener("pointercancel",h))};m.addEventListener("pointermove",g),m.addEventListener("pointerup",h),m.addEventListener("pointercancel",h)},[n,t,r,e,o]),u=a.useCallback(d=>{if(!(n||!t)){if(d.key==="ArrowDown"){d.preventDefault(),s(Ac);return}if(d.key==="ArrowUp"){d.preventDefault(),s(-Ac);return}if(d.key==="Home"){d.preventDefault(),r(i.readControlHeightPx(o));return}d.key==="End"&&(d.preventDefault(),r(Or))}},[s,n,t,r,o]);return{onResizePointerDown:l,onResizeKeyDown:u}}function y0(){return c.jsxs("span",{"aria-hidden":!0,className:x0,children:[c.jsx("span",{className:S0}),c.jsx("span",{className:h0})]})}function N0({disabled:e,className:t,onPointerDown:n,onKeyDown:o}){const r=f0(St("resizeHeight"));return c.jsx("button",{type:"button","data-textarea-resize-handle":!0,"aria-label":r,disabled:e,onPointerDown:n,onKeyDown:o,className:R0({disabled:e,slotClass:t}),children:c.jsx(y0,{})})}const Ll=a.forwardRef(function({variant:t="default",status:n,size:o,rows:r=1,resizable:s=!0,placeholder:l,id:u,disabled:d,readOnly:f,className:m,onPointerDown:p,"aria-describedby":C,...S},g){const h=d0(),x=Yn(),A=a.useId(),b=u??(h==null?void 0:h.textareaId)??A,L=n??(h==null?void 0:h.status)??"default",_=o??(h==null?void 0:h.size)??"base",v=(h==null?void 0:h.required)??!1,R=(h==null?void 0:h.hintConnected)??!1,T=(h==null?void 0:h.errorConnected)??!1,E=h==null?void 0:h.hintId,I=h==null?void 0:h.errorId,O=C??je(R?E:void 0,T?I:void 0),N=a.useRef(null),y=a.useRef(null),w=a.useCallback(F=>{y.current=F,typeof g=="function"?g(F):g&&(g.current=F)},[g]),P=!!(d||f),k=_0({variant:t}),j=m0({shellRef:N,blocked:P,variant:t,resizable:s,onPointerDown:p}),{onResizePointerDown:B,onResizeKeyDown:D}=I0(N,s,P,_);return c.jsxs("div",{ref:j.setShellRef,"data-slot":"textarea-shell",onPointerDown:j.shellPointerDown,onPointerEnter:j.shellPointerEnter,onPointerLeave:j.shellPointerLeave,onFocusCapture:j.shellFocusCapture,onBlurCapture:j.shellBlurCapture,className:T0({variant:t,status:L,blocked:P,size:_,shellSurface:k,glossShellHoverMotionClass:j.glossShellHoverMotionClass,standardShellHoverMotionClass:j.standardShellHoverMotionClass,slotClass:x.shell,className:m}),children:[c.jsx("textarea",{ref:w,id:b,rows:r,disabled:d,readOnly:f,placeholder:l,"aria-required":v||void 0,"aria-invalid":L==="danger"?!0:void 0,"aria-describedby":O,className:E0({size:_,resizable:s,slotClass:x.control}),...S}),s?c.jsx(N0,{disabled:P,className:x.resizeHandle,onPointerDown:B,onKeyDown:D}):null]})});Ll.displayName="TextAreaControl";function wp({className:e,classNames:t,...n}){const o=Yn();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}wp.displayName="TextAreaLabel";function _l({children:e,status:t,className:n,id:o,...r}){const s=Np(),l=Yn(),u=t??(s.status==="danger"||s.status==="default"?"default":s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}_l.displayName="TextAreaHint";function Tl({children:e,className:t,id:n,...o}){const r=Np(),s=Yn();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Tl.displayName="TextAreaError";function w0({label:e,hint:t,error:n,textareaId:o,labelId:r,size:s,status:l,controlProps:u}){const d=Yn();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:r,classNames:{root:d.label},children:e}):null,c.jsx(Ll,{id:o,size:s,status:l,...u}),t!=null?c.jsx(_l,{children:t}):null,n!=null?c.jsx(Tl,{children:n}):null]})}function O0({children:e,label:t,hint:n,error:o,id:r,required:s=!1,status:l="default",size:u="base"}){const d=a.useId(),f=r??`textarea-${d}`,m=Ve(f),p=ze(f),C=`${f}-label`,{isCompound:S,hasHint:g,hasError:h}=a.useMemo(()=>{const b=Ue(e);return{isCompound:b,hasHint:n!=null||b&&ge(e,"TextAreaHint"),hasError:o!=null||b&&ge(e,"TextAreaError")}},[e,o,n]),x=a.useMemo(()=>({textareaId:f,hintId:m,errorId:p,labelId:C,hintConnected:g,errorConnected:h,required:s,status:l,size:u}),[p,h,g,m,s,C,u,l,f]),A=a.useMemo(()=>({controlId:f,labelId:C,required:s}),[s,C,f]);return{fieldCtx:x,fieldLabelCtx:A,isCompound:S,textareaId:f,label:t,hint:n,error:o,status:l,size:u}}function Op({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u=!1,status:d="default",size:f="base",...m}){const p=O0({children:e,label:t,hint:n,error:o,id:l,required:u,status:d,size:f}),C=p.isCompound?e:c.jsx(w0,{label:p.label,hint:p.hint,error:p.error,textareaId:p.textareaId,labelId:p.fieldCtx.labelId,size:p.size,status:p.status,controlProps:m});return c.jsx(c0,{value:p.fieldCtx,children:c.jsx(u0,{classNames:s,children:c.jsx(Ge.Provider,{value:p.fieldLabelCtx,children:c.jsx(le,{className:i.cn(s==null?void 0:s.root,r),children:C})})})})}Op.displayName="TextArea";const P0=Object.assign(Op,{Label:wp,Control:Ll,Hint:_l,Error:Tl}),Pp=a.createContext(null),Dp=a.createContext(null),cs=a.createContext({});function D0({value:e,children:t}){return c.jsx(Pp.Provider,{value:e,children:t})}function dr(){const e=a.useContext(Pp);if(!e)throw new Error("Select.* must be inside <Select>.");return e}function k0({value:e,children:t}){return c.jsx(Dp.Provider,{value:e,children:t})}function kp(){const e=a.useContext(Dp);if(!e)throw new Error("Select compound-parts must be inside <Select>.");return e}function B0({classNames:e,children:t}){const n=a.useContext(cs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(cs.Provider,{value:o,children:t})}function Pt(){return a.useContext(cs)}function j0(e){return new Map(e.map(t=>[t.value,t]))}function M0(e){return e.map(t=>t.value)}function F0({optionValues:e,activeValue:t,optionsByValue:n,delta:o}){if(e.length===0)return t;const r=t?e.indexOf(t):-1;let s=r<0?0:r;for(let l=0;l<e.length;l+=1){s=(s+o+e.length)%e.length;const u=e[s],d=n.get(u);if(u&&d&&!d.disabled)return u}return t}function H0(e,t){for(const n of e){const o=t.get(n);if(o&&!o.disabled)return n}return null}function G0(e,t){for(let n=e.length-1;n>=0;n-=1){const o=e[n],r=t.get(o);if(r&&!r.disabled)return o}return null}function V0(e){return e?typeof e.label=="string"?e.label.trim():e.value:""}function z0(e,t){return e.map(n=>V0(t.get(n)))}function U0(e,t){return e||(t==="danger"||t==="default"?"default":t)}const W0=[];function Bp({className:e,classNames:t,...n}){const o=Pt();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}Bp.displayName="SelectLabel";function El({children:e,status:t,className:n,id:o,...r}){const s=kp(),l=Pt(),u=U0(t,s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}El.displayName="SelectHint";function Rl({children:e,className:t,id:n,...o}){const r=kp(),s=Pt();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e??r.errorMessage})}Rl.displayName="Select.Error";const Y0={small:i.CONTROL_SIZE_LAYOUT.small.controlPad,base:i.CONTROL_SIZE_LAYOUT.base.controlPad,mid:i.CONTROL_SIZE_LAYOUT.mid.controlPad,large:i.CONTROL_SIZE_LAYOUT.large.controlPad},$0={small:i.CONTROL_SIZE_LAYOUT.small.chevronIcon,base:i.CONTROL_SIZE_LAYOUT.base.chevronIcon,mid:i.CONTROL_SIZE_LAYOUT.mid.chevronIcon,large:i.CONTROL_SIZE_LAYOUT.large.chevronIcon},X0="relative z-0 flex min-w-0 items-stretch border-1 text-left overflow-hidden motion-reduce:transition-none",K0="min-w-0 flex-1 truncate bg-transparent text-left text-foreground outline-none",q0="text-muted",Z0="flex shrink-0 origin-center items-center justify-center self-stretch px-small outline-none text-muted hover:text-foreground focus-ring-inset",Q0="pointer-events-none",J0="z-popover",eP="gap-0 p-base",tP="overflow-y-auto overflow-x-hidden",nP="cursor-not-allowed opacity-55 shadow-token-base",oP="cursor-pointer";function rP({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function sP(e){return e?i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e)):"rounded-base"}function aP({variant:e,status:t,disabled:n,groupSegment:o,shellHoverMotionClass:r,className:s,slotClass:l}){const u=e==="gloss";return i.cn(X0,(o==null?void 0:o.orientation)==="horizontal"?"flex-1":"w-full",sP(o),rP({variant:e}),i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),u?"":i.fieldShellHoverClass(!n,t,e),r,n?nP:oP,l,s)}function lP({size:e,muted:t,className:n,slotClass:o}){return i.cn(K0,Y0[e],t&&q0,o,n)}function iP({disabled:e,className:t,slotClass:n}){return i.cn(Z0,e&&Q0,n,t)}function cP(e){return`${e}-label`}function uP(e){return`${e}-listbox`}function dP(e){return{hintId:Ve(e),errorId:ze(e),labelId:cP(e),listId:uP(e)}}function fP(e,t,n){return t&&n?`${e}-opt-${n}`:void 0}function mP(e,t={openList:Se.openList,closeList:Se.closeList}){return e?t.closeList:t.openList}const Il=a.forwardRef(function({className:t,children:n,groupSegment:o,onPointerEnter:r,onPointerLeave:s,...l},u){const d=mn(),f=gt(),m=Pt(),p=dr(),{open:C,setOpen:S,disabled:g,variant:h,status:x,anchorRef:A,listId:b,valueRef:L,value:_,optionValues:v,setActiveValue:R,activeValue:T,required:E,hintConnected:I,errorConnected:O,hintId:N,errorId:y,labelId:w,labelConnected:P,placeholder:k}=p,{"aria-label":j,"aria-labelledby":B,...D}=l,F=fP(b,C,T),H=je(I?N:void 0,O?y:void 0),U=B??(P?w:void 0),G=j??(U?void 0:k||void 0),K=At(),V=h==="gloss",oe=d!=null&&d.segmented?void 0:o??(f==null?void 0:f.segment),J=i.useFieldShellHoverLift(A,!g&&!V&&oe==null),ee=i.useGlossFieldShellMotion(A,!g&&V&&oe==null),se=a.useCallback(Z=>{A.current=Z,!g&&V&&ee.bindShellRef(Z)},[A,g,ee,V]),M=a.useCallback(()=>{const Z=v.indexOf(_);R(Z>=0?_:v[0]??null),requestAnimationFrame(()=>{var ce;return(ce=L.current)==null?void 0:ce.focus()})},[v,R,_,L]),W=a.useCallback(()=>{bt({triggerRef:A,disabled:g,setOpen:S,onOpened:M,openingRef:K})},[A,g,M,S,K]),Y=a.useCallback(Z=>{g||C||Z.button===0&&W()},[g,C,W]);return c.jsx("div",{ref:$e(u,se),role:"combobox","aria-expanded":C,"aria-controls":C?b:void 0,"aria-haspopup":"listbox","aria-activedescendant":C?F:void 0,"aria-labelledby":U,"aria-label":G,"aria-required":E||void 0,"aria-invalid":x==="danger"?!0:void 0,"aria-describedby":H,"aria-disabled":g||void 0,tabIndex:-1,onPointerDown:Y,onPointerEnter:Z=>{r==null||r(Z),!Z.defaultPrevented&&(V&&oe==null?ee.onShellPointerEnter(Z):J.onShellPointerEnter(Z))},onPointerLeave:Z=>{s==null||s(Z),V&&oe==null?ee.onShellPointerLeave(Z):J.onShellPointerLeave(Z)},onFocusCapture:V&&!g&&oe==null?ee.onShellFocusIn:void 0,onBlurCapture:V&&!g&&oe==null?ee.onShellFocusOut:void 0,...g&&V?{"data-gloss-disabled":""}:{},className:aP({variant:h,status:x,disabled:g,groupSegment:oe,shellHoverMotionClass:V?ee.shellHoverMotionClass:J.shellHoverMotionClass,className:t,slotClass:m.triggerGroup}),...D,children:n})});Il.displayName="SelectTriggerGroup";const yl=a.forwardRef(function({className:t,onKeyDown:n,onBlur:o,children:r,placeholder:s,...l},u){const d=Pt(),f=dr(),{selectId:m,open:p,setOpen:C,value:S,setValue:g,activeValue:h,setActiveValue:x,valueRef:A,anchorRef:b,options:L,optionValues:_,disabled:v,placeholder:R,size:T,formValueRef:E,formOnBlur:I}=f,O=s??R,N=a.useRef(or()),y=At(),w=a.useMemo(()=>j0(L),[L]),P=a.useMemo(()=>w.get(S),[w,S]),k=a.useCallback(()=>{const G=_.indexOf(S);x(G>=0?S:_[0]??null),requestAnimationFrame(()=>{var K;return(K=A.current)==null?void 0:K.focus()})},[_,x,S,A]),j=a.useCallback(()=>{bt({triggerRef:b,disabled:v,setOpen:C,onOpened:k,openingRef:y})},[b,v,k,C,y]),B=a.useCallback(G=>{const K=F0({optionValues:_,activeValue:h,optionsByValue:w,delta:G});K&&x(K)},[h,_,w,x]),D=a.useCallback(G=>{var V;const K=w.get(G);!K||K.disabled||(g(G),C(!1),(V=A.current)==null||V.focus())},[w,C,g,A]),F=a.useCallback(G=>{if(n==null||n(G),!(G.defaultPrevented||v)){if(!p){if(G.key==="ArrowDown"||G.key==="ArrowUp"){G.preventDefault(),j();return}if(G.key==="Enter"||G.key===" "){G.preventDefault(),j();return}return}if(G.key==="ArrowDown"){G.preventDefault(),B(1);return}if(G.key==="ArrowUp"){G.preventDefault(),B(-1);return}if(G.key==="Enter"||G.key===" "){G.preventDefault(),h&&D(h);return}if(G.key==="Escape"){G.preventDefault(),C(!1);return}if(G.key==="Home"){G.preventDefault();const K=H0(_,w);K&&x(K);return}if(G.key==="End"){G.preventDefault();const K=G0(_,w);K&&x(K);return}if(Ia(G.key,G)){G.preventDefault();const K=z0(_,w),V=h?_.indexOf(h):-1,oe=Na(K,ya(N.current,G.key),V);if(oe<0)return;const J=_[oe],ee=J?w.get(J):void 0;J&&ee&&!ee.disabled&&x(J)}}},[h,B,v,n,p,j,_,w,D,x,C]),H=a.useCallback(G=>{o==null||o(G),I==null||I()},[I,o]),U=r??(P?P.label:O);return c.jsx("button",{ref:$e(u,A,E),id:m,type:"button",disabled:v,className:lP({size:T,muted:!P,className:t,slotClass:d.value}),onKeyDown:F,onBlur:H,...l,children:U})});yl.displayName="SelectValue";const Nl=a.forwardRef(function({className:t,onPointerDown:n,children:o,...r},s){const l=Ie(),u=Pt(),{open:d,setOpen:f,disabled:m,size:p,valueRef:C}=dr(),S=a.useRef(null),g=Kt(d,S),h=a.useCallback(A=>{g(A),typeof s=="function"?s(A):s&&(s.current=A)},[g,s]),x=a.useCallback(A=>{if(n==null||n(A),A.stopPropagation(),!m){if(d){f(!1);return}A.button===0&&(f(!0),requestAnimationFrame(()=>{var b;return(b=C.current)==null?void 0:b.focus()}))}},[m,n,d,f,C]);return c.jsx("button",{type:"button",ref:h,tabIndex:-1,disabled:m,"aria-label":mP(d,l),className:iP({disabled:m,className:t,slotClass:u.trigger}),onPointerDown:x,...r,children:o??c.jsx(be.IoChevronDown,{className:i.cn($0[p],u.triggerIcon),"aria-hidden":!0})})});Nl.displayName="SelectTrigger";const wl=a.forwardRef(function({children:t,className:n,side:o="bottom",align:r,offset:s=Gn,listBoxProps:l,...u},d){const f=Pt(),{open:m,setOpen:p,anchorRef:C,listId:S,labelId:g,labelConnected:h,placeholder:x,menuMaxHeight:A,options:b,optionValues:L,value:_,setValue:v,activeValue:R,setActiveValue:T,variant:E,size:I}=dr(),{className:O,classNames:N,style:y,size:w,...P}=l??{},k=a.useCallback(B=>{const D=Array.isArray(B)?B[0]??"":B;v(D),p(!1)},[p,v]),j=t??(L.length===0?c.jsx(Ht.Empty,{}):L.map(B=>{const D=b.find(F=>F.value===B);return c.jsx(Ht.Item,{value:B,disabled:D.disabled,label:D.label,hint:D.hint,icon:D.icon},B)}));return c.jsx(ke,{open:m,onOpenChange:p,side:o,anchorRef:C,variant:E==="gloss"?"gloss":"default",children:c.jsx(ke.Content,{ref:d,matchAnchorWidth:!0,unstyled:!0,contentRole:void 0,align:r,offset:s,className:i.cn(J0,f.popover,n),...u,children:c.jsx(ke.Body,{className:i.cn(eP,f.popoverBody),children:c.jsx(Ht,{selectionIndicator:!0,size:w??I,...P,listId:S,"aria-labelledby":h?g:void 0,"aria-label":h?void 0:x,value:_,onValueChange:k,activeValue:R,onActiveValueChange:T,classNames:{item:f.listBoxItem,label:f.listBoxLabel,hint:f.listBoxHint,icon:f.listBoxIcon,empty:f.listBoxEmpty,header:f.listBoxHeader,headerText:f.listBoxHeaderText,...N},className:i.cn(tP,f.listBox,O),style:{maxHeight:A,...y},children:j})})})})});wl.displayName="SelectPopover";function pP({label:e,hint:t,error:n,labelId:o}){const r=Pt();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:o,classNames:{root:r.label},children:e}):null,c.jsxs(Il,{children:[c.jsx(yl,{}),c.jsx(Nl,{})]}),c.jsx(wl,{}),t!=null?c.jsx(El,{children:t}):null,n!=null?c.jsx(Rl,{children:n}):null]})}function CP({children:e,label:t,hint:n,error:o,id:r,name:s,required:l=!1,status:u="default",size:d="base",options:f=W0,value:m,defaultValue:p,onValueChange:C,open:S,defaultOpen:g=!1,onOpenChange:h,variant:x,disabled:A=!1,placeholder:b="Select a value",menuMaxHeight:L="min(24rem, 70vh)"}){const _=Ju({name:s,value:m,disabled:A}),v=_.bound,R=_.disabled??A,T=a.useId(),E=gt(),I=x??((E==null?void 0:E.variant)!=null?i.fieldShellVariantFromButtonGroup(E.variant):"default"),O=r??`select-${T}`,{hintId:N,errorId:y,labelId:w,listId:P}=dP(O),{isCompound:k,hasLabel:j,hasHint:B,hasError:D}=a.useMemo(()=>{const z=Ue(e);return{isCompound:z,hasLabel:t!=null||z&&ge(e,"Label"),hasHint:n!=null||z&&ge(e,"SelectHint"),hasError:o!=null||z&&ge(e,"SelectError")}},[e,o,n,t]),F=m!==void 0||v,[H,U]=a.useState(p??""),G=v?String(_.value??""):F?m??"":H,K=a.useCallback(z=>{F||U(z),C==null||C(z),v&&_.setValue(z)},[v,_,F,C]),[V,oe]=Re({value:S,defaultValue:g,onChange:h}),[J,ee]=a.useState(null),se=a.useRef(null),M=a.useRef(null),W=a.useMemo(()=>M0(f),[f]);a.useEffect(()=>{var z;!V||!J||(z=document.getElementById(`${P}-opt-${J}`))==null||z.scrollIntoView({block:"nearest"})},[J,P,V]);const Y=a.useMemo(()=>({selectId:O,hintId:N,errorId:y,labelId:w,labelConnected:j,hintConnected:B,errorConnected:D,required:l,status:u,size:d,errorMessage:o}),[O,o,y,D,B,j,N,l,w,d,u]),Z=a.useMemo(()=>({...Y,open:V,setOpen:oe,value:G,setValue:K,listId:P,activeValue:J,setActiveValue:ee,anchorRef:se,valueRef:M,variant:I,disabled:R,placeholder:b,menuMaxHeight:L,options:f,optionValues:W,formValueRef:v?_.ref:void 0,formOnBlur:v?_.onBlur:void 0}),[J,R,Y,v,_,P,L,V,W,f,b,K,G,I]),ce=a.useMemo(()=>({controlId:O,labelId:w,required:l}),[O,l,w]);return{isCompound:k,label:t,hint:n,error:o,children:e,fieldCtx:Y,selectCtx:Z,fieldLabelCtx:ce}}function jp({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u,status:d,size:f,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:L,menuMaxHeight:_,name:v,...R}){const T=et(),E=typeof v=="string"?v:void 0,I=E?T==null?void 0:T.getError(E):void 0,O=o??I,N=d==="default"&&I?"danger":d,y=f??(T==null?void 0:T.size)??"base",w=CP({children:e,label:t,hint:n,error:O,id:l,name:v,required:u,status:N,size:y,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:L,menuMaxHeight:_});return c.jsx(k0,{value:w.fieldCtx,children:c.jsx(D0,{value:w.selectCtx,children:c.jsx(B0,{classNames:s,children:c.jsx(Ge.Provider,{value:w.fieldLabelCtx,children:c.jsx(le,{className:i.cn(r,s==null?void 0:s.root),...R,children:w.isCompound?e:c.jsx(pP,{label:w.label,hint:w.hint,error:w.error,labelId:w.fieldCtx.labelId})})})})})})}jp.displayName="Select";const gP=Object.assign(jp,{Label:Bp,TriggerGroup:Il,Value:yl,Trigger:Nl,Popover:wl,Hint:El,Error:Rl}),Mp=a.createContext(null),us=a.createContext({});function vc({value:e,children:t}){return c.jsx(Mp.Provider,{value:e,children:t})}function Lc({classNames:e,children:t}){const n=a.useContext(us),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(us.Provider,{value:o,children:t})}function Qt(){const e=a.useContext(Mp);if(!e)throw new Error("Checkbox.* parts must be used inside <Checkbox>.");return e}function Jt(){return a.useContext(us)}function SP(){const e=Qt(),t=a.useRef(null),n=a.useRef(!0),o=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{const r=t.current;if(!r)return;if(o){i.killMotion(r),r.style.opacity=e.isDisabled?"0.48":"1";return}if(n.current){n.current=!1,r.style.opacity=e.isDisabled?"0.48":"1";return}i.killMotion(r);const s=Number.parseFloat(getComputedStyle(r).opacity),l=Number.isFinite(s)?s:1;$.fromTo(r,{autoAlpha:l},{autoAlpha:e.isDisabled?.48:1,...i.motionInteractive(),overwrite:"auto"})},[e.isDisabled,o]),t}function hP({isDisabled:e,enableTextMotion:t,textMotionRef:n,onPointerDown:o}){return xt({isDisabled:e,enabled:t,textMotionRef:n,onPointerDown:o})}function xP(e){return e==="default"?"default":e}function bP({slotClassNames:e,classNames:t,className:n}){return{root:i.cn(e.indicator,t==null?void 0:t.root,t==null?void 0:t.indicator,n),fill:i.cn(e.indicatorFill,t==null?void 0:t.fill,t==null?void 0:t.indicatorFill),mark:i.cn(e.indicatorMark,t==null?void 0:t.mark,t==null?void 0:t.indicatorMark)}}function AP(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;const s=r.props;if(s.htmlFor!=null){t=!0;return}n(s.children)}};return n(e),t}function vP(e){return!/\bflex-col\b/.test(e??"")}const $n=ye,LP="absolute m-[-1px] h-px w-px overflow-hidden border-0 p-0 opacity-0 [clip:rect(0,0,0,0)]",_P="absolute inset-0 z-[2] m-0 h-full w-full cursor-pointer opacity-0",TP="relative inline-flex shrink-0 items-center justify-center",EP="relative inline-flex items-center justify-center has-focus-ring";function RP(e){return i.cn(EP,Ye[e])}const IP="min-w-0",yP="cursor-pointer",NP="inline-flex flex-wrap items-center gap-x-xsmall gap-y-0 font-w-mid",wP="min-w-0",OP="origin-center",Fp="text-muted",Hp="text-danger",PP="text-danger",Gp="text-muted",Vp="text-muted",DP="origin-center",kP="min-w-0 font-w-mid",BP="relative cursor-pointer select-none rounded-small text-left",jP="cursor-not-allowed",MP="m-0 min-w-0 border-0 p-0",FP="contents";function HP(){return er()}function GP(e,t,n){return i.cn(BP,Ea(e,t),n)}function zp(){return tr()}function Oo(e){return nr(e)}function Up(e){return Ra(e)}const Ol=a.forwardRef(function({className:t,children:n,...o},r){const s=Qt(),l=Jt(),u=SP();return c.jsx("span",{ref:r,className:i.cn(TP,HP(),l.control,t),...o,children:c.jsxs("span",{ref:u,className:i.cn(RP(s.size),l.controlTrack),children:[c.jsx("input",{ref:s.inputProps.inputRef,id:s.inputId,type:"checkbox",className:s.isCompound?i.cn(_P,l.input):i.cn(LP,l.input),disabled:s.isDisabled,name:s.inputProps.name,value:s.inputProps.value,required:s.inputProps.required,form:s.inputProps.form,autoFocus:s.inputProps.autoFocus,tabIndex:s.inputProps.tabIndex,readOnly:s.inputProps.readOnly,onBlur:s.inputProps.onBlur,onFocus:s.inputProps.onFocus,"aria-invalid":s.inputProps.ariaInvalid,"aria-describedby":je(s.hintConnected?s.hintId:void 0,s.errorConnected?s.errorId:void 0),"aria-labelledby":s.labelConnected?s.labelId:void 0,"aria-label":s.labelConnected?void 0:s.accessibleName,...s.isControlled?{checked:s.mergedChecked,onChange:s.onChange}:{defaultChecked:s.inputProps.defaultChecked,onChange:s.onChange}}),n??c.jsx(Pl,{})]})})});Ol.displayName="CheckboxControl";function Pl({children:e,className:t,classNames:n,size:o,...r}){const s=Qt(),l=Jt();return c.jsx(Be,{variant:xP(s.variant),size:o??s.size,selected:s.mergedChecked,icon:s.icon??void 0,check:!0,classNames:bP({slotClassNames:l,classNames:n,className:t}),...r,children:e})}Pl.displayName="CheckboxIndicator";const Wp=a.forwardRef(function({className:t,children:n,...o},r){const s=Qt(),l=Jt(),u=i.cn(FP,s.isCompound&&IP,l.content,t);return s.isCompound&&!AP(n)?c.jsx("label",{ref:r,htmlFor:s.inputId,id:s.labelId,className:i.cn(u,!s.isDisabled&&yP),...o,children:n}):c.jsx("div",{ref:r,className:u,...o,children:n})});Wp.displayName="CheckboxContent";function Yp({children:e,className:t,required:n,id:o,...r}){const s=Qt(),l=Jt(),u=ca(),d=n??(u==null?void 0:u.required)??!1,f=$n[s.size];return c.jsxs("span",{id:o,ref:m=>{s.isCompound&&s.useInlineCompoundMotion&&(s.textMotionRef.current=m)},className:i.cn(NP,s.isCompound&&zp(),s.isCompound&&(s.hasCompoundHint||s.hasCompoundError)&&wP,s.isCompound&&s.useInlineCompoundMotion&&OP,l.label,t),...r,children:[c.jsx(q,{as:"span",variant:f.title,inheritColor:!0,className:i.cn(s.isDisabled&&Fp,!s.isDisabled&&s.status==="danger"&&Hp,l.labelText),children:e}),d?c.jsx("span",{className:i.cn(PP,l.requiredMark),"aria-hidden":!0,children:"*"}):null]})}Yp.displayName="CheckboxLabel";function $p({children:e,className:t,variant:n,...o}){const r=Qt(),s=Jt();return c.jsx(le.Hint,{as:"span",id:r.hintId,variant:n??$n[r.size].desc,className:i.cn(r.isCompound&&Oo(2),r.isDisabled&&Gp,s.hint,t),...o,children:e})}$p.displayName="CheckboxHint";function Xp({children:e,className:t,...n}){const o=Qt(),r=Jt();return c.jsx(le.Error,{as:"span",id:o.errorId,variant:$n[o.size].desc,className:i.cn(o.isCompound&&Oo(Up(o.hasCompoundHint)),o.isDisabled&&Vp,r.error,t),...n,children:e})}Xp.displayName="CheckboxError";function VP({label:e,hint:t,error:n,hasHint:o,hasError:r,secondaryLines:s,textColRef:l,size:u,isDisabled:d,status:f,hintId:m,errorId:p}){const C=Jt(),S=$n[u];return c.jsxs(c.Fragment,{children:[c.jsx(Ol,{}),c.jsx("span",{ref:l,className:i.cn(zp(),!s&&DP,C.simpleLabelWrap,C.label),children:c.jsx(q,{as:"span",variant:S.title,inheritColor:!0,className:i.cn(kP,d&&Fp,!d&&f&&Hp,C.simpleLabelText,C.labelText),children:e})}),o?c.jsx(le.Hint,{as:"span",id:m,variant:S.desc,className:i.cn(Oo(2),d&&Gp,C.hint),children:t}):null,r?c.jsx(le.Error,{as:"span",id:p,variant:S.desc,className:i.cn(Oo(Up(o)),d&&Vp,C.error),children:n}):null]})}function zP(e,t){return e??`checkbox-${t}`}function UP(e){return Ve(e)}function WP(e){return ze(e)}function YP(e){return`${e}-label`}function $P({size:e="base",variant:t="default",status:n="default",icon:o,disabled:r,checked:s,defaultChecked:l,onChange:u,id:d,name:f,value:m,required:p,form:C,autoFocus:S,tabIndex:g,readOnly:h,onBlur:x,onFocus:A,"aria-label":b,label:L,hint:_,error:v},R,T){const E=tv(),I=m!=null?String(m):void 0,O=(E==null?void 0:E.selection)==="single"&&E!=null&&I!=null,N=ia({name:f,value:s,onChange:u,onBlur:x,disabled:r,readOnly:h,type:"checkbox"}),y=N.bound&&E==null,w=a.useId(),P=zP(d,w),k=UP(P),j=WP(P),B=YP(P),D=s!==void 0,F=O?E.selectedValue===I:void 0,H=y?!!N.checked:void 0,U=D?s:H!==void 0?H:F!==void 0?F:void 0,[G,K,V]=Re({value:U,defaultValue:!!(!(O||D||y)&&l)}),oe=!!(r??(E==null?void 0:E.disabled)??N.disabled),{isCompound:J,hasCompoundLabel:ee,hasCompoundHint:se,hasCompoundError:M}=a.useMemo(()=>{const fe=Ue(R);return{isCompound:fe,hasCompoundLabel:fe&&ge(R,"Label"),hasCompoundHint:fe?ge(R,"CheckboxHint"):!1,hasCompoundError:fe?ge(R,"CheckboxError"):!1}},[R]),W=J&&vP(T),Y=!oe&&(!J||W),Z=$n[e],ce=n==="danger",z=_!=null,Q=v!=null,te=J?(se?1:0)+(M?1:0):(z?1:0)+(Q?1:0),me=a.useRef(null),Ae=a.useCallback(fe=>{const Le=fe.target.checked;if(!V&&!O&&!y&&K(Le),u==null||u(fe),!fe.defaultPrevented){if(O){E.selectSingleValue(I,Le);return}y&&N.onChange(fe)}},[y,N,E,O,V,u,I,K]),he=a.useCallback(fe=>{x==null||x(fe),y&&N.onBlur(fe)},[y,N,x]),X=p??(O&&E.required?E.claimRequiredAnchor():void 0),re=a.useMemo(()=>({inputId:P,hintId:k,errorId:j,labelId:B,size:e,variant:t,mergedChecked:G,isDisabled:oe,isControlled:V,isCompound:J,hasCompoundHint:se,hasCompoundError:M,hintConnected:J?se:z,errorConnected:J?M:Q,labelConnected:ee,accessibleName:b,useInlineCompoundMotion:W,textMotionRef:me,status:n,icon:o,onChange:Ae,inputProps:{name:N.name??f,value:m,defaultChecked:!V&&!y?l:void 0,required:X,form:C,autoFocus:S,tabIndex:g,readOnly:N.readOnly??h,onBlur:he,onFocus:A,inputRef:y?N.ref:void 0,ariaInvalid:y?N["aria-invalid"]:void 0}}),[b,o,n,l,C,N,y,S,j,he,Ae,k,M,se,ee,Q,z,P,J,V,oe,B,G,f,A,X,h,e,g,W,m,t]),pe=a.useMemo(()=>({controlId:P,labelId:B,required:!!p}),[P,B,p]);return{contextValue:re,fieldLabelContext:pe,isCompound:J,isDisabled:oe,mergedChecked:G,enableTextMotion:Y,textColRef:me,secondaryLines:te,sz:Z,hasHint:z,hasError:Q,label:L,hint:_,error:v,hintId:k,errorId:j,status:n,isDanger:ce}}const Kp=a.forwardRef(function({children:t,label:n,hint:o,error:r,size:s,variant:l,status:u,icon:d,disabled:f,checked:m,defaultChecked:p,onChange:C,id:S,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:L,readOnly:_,onBlur:v,onFocus:R,className:T,classNames:E,onPointerDown:I,"aria-label":O,...N},y){const w=et(),P=typeof g=="string"?g:void 0,k=P?w==null?void 0:w.getError(P):void 0,D=$P({size:s,variant:l,status:k?"danger":u??"default",icon:d,disabled:f,checked:m,defaultChecked:p,onChange:C,id:S,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:L,readOnly:_,onBlur:v,onFocus:R,"aria-label":O,label:n,hint:o,error:r??k},t,T),{handlePointerDown:F}=hP({isDisabled:D.isDisabled,enableTextMotion:D.enableTextMotion,textMotionRef:D.textColRef,onPointerDown:I}),H=i.cn(GP(D.secondaryLines,D.sz.gridGap,T),D.isDisabled&&jP,E==null?void 0:E.root);return D.isCompound?c.jsx(vc,{value:D.contextValue,children:c.jsx(Lc,{classNames:E,children:c.jsx(Ge.Provider,{value:D.fieldLabelContext,children:c.jsx("fieldset",{ref:y,"aria-labelledby":D.contextValue.labelConnected?D.contextValue.labelId:void 0,"data-checked":D.mergedChecked?!0:void 0,className:i.cn(H,MP),onPointerDown:F,...N,children:t})})})}):c.jsx(vc,{value:D.contextValue,children:c.jsx(Lc,{classNames:E,children:c.jsx("label",{ref:y,htmlFor:D.contextValue.inputId,"data-checked":D.mergedChecked?!0:void 0,className:H,...N,onPointerDown:F,children:c.jsx(VP,{label:D.label,hint:D.hint,error:D.error,hasHint:D.hasHint,hasError:D.hasError,secondaryLines:D.secondaryLines,textColRef:D.textColRef,size:D.contextValue.size,isDisabled:D.isDisabled,status:D.isDanger,hintId:D.hintId,errorId:D.errorId})})})})});Kp.displayName="CheckboxRoot";const XP=Object.assign(Pl,{Fill:Be.Fill,Mark:Be.Mark}),KP=Object.assign(Kp,{Control:Ol,Indicator:XP,Content:Wp,Label:Yp,Hint:$p,Error:Xp});function qp(){return{"aria-hidden":!0}}const qP="gloss-indicator size-full min-h-0 min-w-0 origin-center border-0",ZP="size-full min-h-0 min-w-0 origin-center border border-primary bg-surface",QP="pointer-events-none z-[2] flex items-center justify-center",JP="inline-flex shrink-0 items-center justify-center [&_svg]:size-full";function eD({gloss:e,size:t,className:n,slotRoot:o}){return e?i.cn($r,Ye[t],qP,o,n):i.cn($r,Ye[t],ZP,o,n)}function tD(e){return e?"text-foreground":"text-primary"}function nD({gloss:e,className:t,slotRoot:n}){return i.cn(QP,tD(e),n,t)}function oD(e,t){return i.cn(JP,_a[e],t)}function Zp({size:e="base",gloss:t=!1,shellRef:n,className:o,classNames:r,children:s,...l}){return c.jsx("span",{ref:n,className:eD({gloss:t,size:e,className:o,slotRoot:r==null?void 0:r.root}),...qp(),...l,children:s})}Zp.displayName="SelectionThumb";function Qp({size:e="base",gloss:t=!1,iconRef:n,className:o,classNames:r,children:s,style:l,...u}){return c.jsx("span",{ref:n,...qp(),className:nD({gloss:t,className:o,slotRoot:r==null?void 0:r.root}),style:l,...u,children:c.jsx("span",{className:oD(e,r==null?void 0:r.icon),children:s})})}Qp.displayName="SelectionThumbIcon";const On=Object.assign(Zp,{Icon:Qp}),Jp=a.createContext(null),ds=a.createContext({});function rD({value:e,children:t}){return c.jsx(Jp.Provider,{value:e,children:t})}function sD({classNames:e,children:t}){const n=a.useContext(ds),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ds.Provider,{value:o,children:t})}function en(){const e=a.useContext(Jp);if(!e)throw new Error("Radio.* parts must be used inside <Radio>.");return e}function tn(){return a.useContext(ds)}function aD(){const e=en(),t=a.useRef(null),n=a.useRef(!0),o=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{const r=t.current;if(!r)return;if(o){i.killMotion(r),r.style.opacity=e.isDisabled?"0.48":"1";return}if(n.current){n.current=!1,r.style.opacity=e.isDisabled?"0.48":"1";return}i.killMotion(r);const s=Number.parseFloat(getComputedStyle(r).opacity),l=Number.isFinite(s)?s:1;$.fromTo(r,{autoAlpha:l},{autoAlpha:e.isDisabled?.48:1,...i.motionInteractive(),overwrite:"auto"})},[e.isDisabled,o]),t}function lD({isDisabled:e,enableTextMotion:t,textMotionRef:n,onPointerDown:o}){return xt({isDisabled:e,enabled:t,textMotionRef:n,onPointerDown:o})}function iD(e,t){return e??`radio-${t}`}function cD(e){return Ve(e)}function uD(e){return ze(e)}function dD(e,t){if(!t)return e!=null?String(e):"Option"}function fD({slotClassNames:e,classNames:t,className:n}){return{root:i.cn(e.indicator,t==null?void 0:t.root,t==null?void 0:t.indicator,n),fill:i.cn(e.indicatorFill,t==null?void 0:t.fill,t==null?void 0:t.indicatorFill),mark:i.cn(e.indicatorMark,t==null?void 0:t.mark,t==null?void 0:t.indicatorMark)}}function mD(e){return!/\bflex-col\b/.test(e??"")}const Xn=ye,pD="absolute m-[-1px] h-px w-px overflow-hidden border-0 p-0 opacity-0 [clip:rect(0,0,0,0)]",CD="relative inline-flex shrink-0 items-center justify-center has-focus-ring";function gD(e){return i.cn(CD,Ye[e])}const SD="relative inline-flex items-center justify-center",hD="min-w-0",xD="inline-flex flex-wrap items-center gap-x-xsmall gap-y-0",bD="min-w-0",AD="origin-center",eC="text-muted",tC="text-danger",vD="text-danger",nC="text-muted",oC="text-muted",LD="origin-center",_D="min-w-0",TD="relative cursor-pointer select-none rounded-small text-left",ED="cursor-not-allowed",RD="contents";function ID(){return er()}function yD(e,t,n){return i.cn(TD,Ea(e,t),n)}function rC(){return tr()}function Po(e){return nr(e)}function sC(e){return Ra(e)}const Dl=a.forwardRef(function({className:t,children:n,...o},r){const s=en(),l=tn(),u=aD();return c.jsxs("span",{ref:r,className:i.cn(gD(s.size),ID(),l.control,t),...o,children:[c.jsx("input",{id:s.inputId,type:"radio",className:i.cn(pD,l.input),checked:s.mergedChecked,disabled:s.isDisabled,name:s.inputName,value:s.inputProps.value,required:s.inputProps.required,form:s.inputProps.form,autoFocus:s.inputProps.autoFocus,tabIndex:s.inputProps.tabIndex,readOnly:s.inputProps.readOnly,onBlur:s.inputProps.onBlur,onFocus:s.inputProps.onFocus,"aria-describedby":je(s.hintConnected?s.hintId:void 0,s.errorConnected?s.errorId:void 0),"aria-label":dD(s.inputProps.value,s.hasLabel),onChange:s.onChange,onClick:s.onActivate}),c.jsx("span",{ref:u,className:i.cn(SD,l.controlTrack),children:n??c.jsx(kl,{})})]})});Dl.displayName="RadioControl";function kl({children:e,className:t,classNames:n,size:o,...r}){const s=en(),l=tn();return c.jsx(Be,{size:o??s.size,variant:s.variant,selected:s.mergedChecked,dot:!0,classNames:fD({slotClassNames:l,classNames:n,className:t}),...r,children:e})}kl.displayName="RadioIndicator";const aC=a.forwardRef(function({className:t,children:n,...o},r){const s=en(),l=tn();return c.jsx("div",{ref:r,className:i.cn(RD,s.isCompound&&hD,l.content,t),...o,children:n})});aC.displayName="RadioContent";function lC({children:e,className:t,required:n,...o}){const r=en(),s=tn(),l=ca(),u=n??(l==null?void 0:l.required)??!1,d=Xn[r.size];return c.jsxs("span",{ref:f=>{r.isCompound&&r.useInlineCompoundMotion&&(r.textMotionRef.current=f)},className:i.cn(xD,r.isCompound&&rC(),r.isCompound&&(r.hasCompoundHint||r.hasCompoundError)&&bD,r.isCompound&&r.useInlineCompoundMotion&&AD,s.label,t),...o,children:[c.jsx(q,{as:"span",variant:d.title,inheritColor:!0,className:i.cn(r.isDisabled&&eC,!r.isDisabled&&r.danger&&tC,s.labelText),children:e}),u?c.jsx("span",{className:i.cn(vD,s.requiredMark),"aria-hidden":!0,children:"*"}):null]})}lC.displayName="RadioLabel";function iC({children:e,className:t,variant:n,...o}){const r=en(),s=tn();return c.jsx(le.Hint,{as:"span",id:r.hintId,variant:n??Xn[r.size].desc,className:i.cn(r.isCompound&&Po(2),r.isDisabled&&nC,s.hint,t),...o,children:e})}iC.displayName="RadioHint";function cC({children:e,className:t,...n}){const o=en(),r=tn();return c.jsx(le.Error,{as:"span",id:o.errorId,variant:Xn[o.size].desc,className:i.cn(o.isCompound&&Po(sC(o.hasCompoundHint)),o.isDisabled&&oC,r.error,t),...n,children:e})}cC.displayName="RadioError";function ND({label:e,hint:t,error:n,hasHint:o,hasError:r,secondaryLines:s,textColRef:l,size:u,isDisabled:d,danger:f,hintId:m,errorId:p}){const C=tn(),S=Xn[u];return c.jsxs(c.Fragment,{children:[c.jsx(Dl,{}),c.jsx("span",{ref:l,className:i.cn(rC(),!s&&LD,C.simpleLabelWrap,C.label),children:c.jsx(q,{as:"span",variant:S.title,inheritColor:!0,className:i.cn(_D,d&&eC,!d&&f&&tC,C.simpleLabelText,C.labelText),children:e})}),o?c.jsx(le.Hint,{as:"span",id:m,variant:S.desc,className:i.cn(Po(2),d&&nC,C.hint),children:t}):null,r?c.jsx(le.Error,{as:"span",id:p,variant:S.desc,className:i.cn(Po(sC(o)),d&&oC,C.error),children:n}):null]})}function wD({size:e="base",variant:t="default",danger:n=!1,disabled:o,checked:r,defaultChecked:s,onChange:l,id:u,name:d,value:f,required:m,form:p,autoFocus:C,tabIndex:S,readOnly:g,onBlur:h,onFocus:x,label:A,hint:b,error:L},_,v,R){const T=fv(),E=f!=null?String(f):void 0,I=T!=null&&E!=null,O=a.useId(),N=iD(u,O),y=cD(N),w=uD(N),P=r!==void 0,k=I?T.selectedValue===E:void 0,j=P?r:k!==void 0?k:void 0,[B,D,F]=Re({value:j,defaultValue:!!(!(I||P)&&s)}),H=d??(T==null?void 0:T.name),U=!!(o??(T==null?void 0:T.disabled)),{isCompound:G,hasCompoundLabel:K,hasCompoundHint:V,hasCompoundError:oe}=a.useMemo(()=>{const he=Ue(_);return{isCompound:he,hasCompoundLabel:he?ge(_,"RadioLabel"):!1,hasCompoundHint:he?ge(_,"RadioHint"):!1,hasCompoundError:he?ge(_,"RadioError"):!1}},[_]),J=G?K:!!A,ee=G&&mD(v),se=!U&&(!G||ee),M=Xn[e],W=b!=null,Y=L!=null,Z=G?(V?1:0)+(oe?1:0):(W?1:0)+(Y?1:0),ce=a.useRef(null),z=a.useCallback(he=>{!P&&!I&&D(he.target.checked),l==null||l(he),!he.defaultPrevented&&I&&he.target.checked&&E!=null&&T.selectValue(E)},[T,I,P,l,E,D]),Q=!U&&!g&&!m&&!(I&&T.required),te=m??(I&&T.required?T.claimRequiredAnchor():void 0),me=a.useCallback(he=>{if(R==null||R(he),!(he.defaultPrevented||!Q||!B)){if(he.preventDefault(),I){T.selectValue(void 0);return}P||D(!1)}},[Q,T,I,P,B,R,D]);return{contextValue:a.useMemo(()=>({inputId:N,hintId:y,errorId:w,size:e,variant:t,mergedChecked:B,isDisabled:U,isControlled:F,isCompound:G,hasCompoundHint:V,hasCompoundError:oe,hintConnected:G?V:W,errorConnected:G?oe:Y,hasLabel:J,useInlineCompoundMotion:ee,textMotionRef:ce,danger:n,inputName:H,onChange:z,onActivate:me,inputProps:{value:f,defaultChecked:F?void 0:s,required:te,form:p,autoFocus:C,tabIndex:S,readOnly:g,onBlur:h,onFocus:x}}),[n,s,p,C,w,z,me,oe,V,Y,W,J,y,N,H,G,ee,F,U,B,h,x,te,g,e,S,f,t]),isCompound:G,isDisabled:U,mergedChecked:B,enableTextMotion:se,textColRef:ce,secondaryLines:Z,sz:M,hasHint:W,hasError:Y,label:A,hint:b,error:L,hintId:y,errorId:w,danger:n}}const uC=a.forwardRef(function({children:t,label:n,hint:o,error:r,size:s,variant:l,danger:u,disabled:d,checked:f,defaultChecked:m,onChange:p,id:C,name:S,value:g,required:h,form:x,autoFocus:A,tabIndex:b,readOnly:L,onBlur:_,onFocus:v,className:R,classNames:T,onPointerDown:E,onClick:I,...O},N){const y=wD({size:s,variant:l,danger:u,disabled:d,checked:f,defaultChecked:m,onChange:p,id:C,name:S,value:g,required:h,form:x,autoFocus:A,tabIndex:b,readOnly:L,onBlur:_,onFocus:v,label:n,hint:o,error:r},t,R,I),{handlePointerDown:w}=lD({isDisabled:y.isDisabled,enableTextMotion:y.enableTextMotion,textMotionRef:y.textColRef,onPointerDown:E}),P=i.cn(yD(y.secondaryLines,y.sz.gridGap,R),y.isDisabled&&ED,T==null?void 0:T.root);return c.jsx(rD,{value:y.contextValue,children:c.jsx(sD,{classNames:T,children:c.jsx("label",{ref:N,"data-selected":y.mergedChecked?!0:void 0,className:P,...O,onPointerDown:w,children:y.isCompound?t:c.jsx(ND,{label:y.label,hint:y.hint,error:y.error,hasHint:y.hasHint,hasError:y.hasError,secondaryLines:y.secondaryLines,textColRef:y.textColRef,size:y.contextValue.size,isDisabled:y.isDisabled,danger:y.danger,hintId:y.hintId,errorId:y.errorId})})})})});uC.displayName="RadioRoot";const OD=Object.assign(kl,{Fill:Be.Fill,Mark:Be.Mark}),PD=Object.assign(uC,{Control:Dl,Indicator:OD,Content:aC,Label:lC,Hint:iC,Error:cC});function DD(e){return!/\bflex-col\b/.test(e??"")}function kD(e,t){return a.Children.map(e,n=>a.isValidElement(n)&&n.type.displayName==="SwitchControl"?a.cloneElement(n,{...t,...n.props}):n)}function BD(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;const s=r.type.displayName;if(s==="SwitchLabel"||s==="SwitchContent"){t=!0;return}n(r.props.children)}};return n(e),t}function jD(e,t,n,o,r){return e?(o?1:0)+(r?1:0):(t?1:0)+(n?1:0)}function MD(e){let t=null;const n=[];for(const o of a.Children.toArray(e)){if(a.isValidElement(o)&&o.type.displayName==="SwitchTrack"){t==null&&(t=o);continue}n.push(o)}return n.length===0?{track:t,content:null}:n.length===1?{track:t,content:n[0]}:{track:t,content:n}}function FD(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;if(r.type.displayName==="SwitchThumb"){t=!0;return}n(r.props.children)}};return n(e),t}const _c={small:He("small"),base:He("base"),mid:He("mid"),large:He("large")};function HD(e,t){if(e==null)return _c[t];if(typeof e=="number")return e;const n=e.trim(),o=/^([\d.]+)px$/i.exec(n);if(o)return Number.parseFloat(o[1]);const r=/^([\d.]+)rem$/i.exec(n);if(r&&typeof document<"u"){const s=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return Number.parseFloat(r[1])*s}return _c[t]}function GD(e,t){const n=e.getBoundingClientRect().width,o=t.getBoundingClientRect().width;return Math.max(0,n-o)}const fo={small:"h-[var(--selection-indicator-small)] min-h-[var(--selection-indicator-small)] w-[calc(2*var(--selection-indicator-small))] min-w-[calc(2*var(--selection-indicator-small))]",base:"h-[var(--selection-indicator-base)] min-h-[var(--selection-indicator-base)] w-[calc(2*var(--selection-indicator-base))] min-w-[calc(2*var(--selection-indicator-base))]",mid:"h-[var(--selection-indicator-mid)] min-h-[var(--selection-indicator-mid)] w-[calc(2*var(--selection-indicator-mid))] min-w-[calc(2*var(--selection-indicator-mid))]",large:"h-[var(--selection-indicator-large)] min-h-[var(--selection-indicator-large)] w-[calc(2*var(--selection-indicator-large))] min-w-[calc(2*var(--selection-indicator-large))]"},Ln={small:{track:fo.small,travelPx:He("small"),title:ye.small.title,desc:ye.small.desc,gap:ye.small.gridGap},base:{track:fo.base,travelPx:He("base"),title:ye.base.title,desc:ye.base.desc,gap:ye.base.gridGap},mid:{track:fo.mid,travelPx:He("mid"),title:ye.mid.title,desc:ye.mid.desc,gap:ye.mid.gridGap},large:{track:fo.large,travelPx:He("large"),title:ye.large.title,desc:ye.large.desc,gap:ye.large.gridGap}};function VD({isDisabled:e,enableTextMotion:t,textMotionRef:n,onPointerDown:o}){return xt({isDisabled:!!e,enabled:t,textMotionRef:n,onPointerDown:o})}function zD({checked:e,disabled:t,size:n,thickness:o,squeezeToken:r,trackRef:s,trackFillRef:l,thumbRef:u,thumbShellRef:d,iconOffRef:f,iconOnRef:m}){const C=i.usePrefersReducedMotion()||!i.isMotionFeatureEnabled("enableSwitchThumb"),S=HD(o,n),g=a.useRef(S),h=a.useRef(!0),x=a.useRef(!0),A=a.useCallback((b,L)=>{const _=u.current;if(!_)return;const v=b?L:0;if(C||x.current){x.current=!1,i.killMotion(_),_.style.transform=`translate(${v}px, 0)`;return}i.killMotion(_),i.setWillChangeTransform(_,!0),$.to(_,{x:v,...i.motionSwitchThumb(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(_)})},[C,u]);a.useLayoutEffect(()=>{g.current=S,A(e,g.current)},[e,S,A]),a.useLayoutEffect(()=>{const b=s.current,L=d.current;if(!b||!L)return;const _=()=>{g.current=GD(b,L),A(e,g.current)};_();const v=new ResizeObserver(_);return v.observe(b),v.observe(L),()=>v.disconnect()},[e,n,A,o,S,s,d]),a.useEffect(()=>{const b=[l.current,u.current,d.current,f.current,m.current,s.current];return()=>{for(const L of b)L&&i.killMotion(L)}},[f,m,u,d,l,s]),a.useLayoutEffect(()=>{const b=l.current;if(b){if(C){i.killMotion(b),b.style.opacity=e?"1":"0";return}if(h.current){h.current=!1,i.killMotion(b),b.style.opacity=e?"1":"0";return}i.killMotion(b),e?$.fromTo(b,{autoAlpha:0},{autoAlpha:1,...i.motionInteractive(),overwrite:"auto"}):$.to(b,{autoAlpha:0,...i.motionInteractive(),overwrite:"auto"})}},[e,C,l]),a.useLayoutEffect(()=>{if(!(!f.current&&!m.current)){if(C){f.current&&(i.killMotion(f.current),f.current.style.opacity=e?"0":"1"),m.current&&(i.killMotion(m.current),m.current.style.opacity=e?"1":"0");return}f.current&&(i.killMotion(f.current),e?$.to(f.current,{autoAlpha:0,scale:.88,...i.motionInteractive(),overwrite:"auto"}):$.fromTo(f.current,{autoAlpha:0,scale:.88},{autoAlpha:1,scale:1,...i.motionInteractive(),overwrite:"auto"})),m.current&&(i.killMotion(m.current),e?$.fromTo(m.current,{autoAlpha:0,scale:.88},{autoAlpha:1,scale:1,...i.motionInteractive(),overwrite:"auto"}):$.to(m.current,{autoAlpha:0,scale:.88,...i.motionInteractive(),overwrite:"auto"}))}},[e,f,m,C]),a.useLayoutEffect(()=>{const b=s.current;b&&(i.killMotion(b),b.style.opacity=t?"0.48":"1")},[t,s]),a.useLayoutEffect(()=>{if(r===0||C)return;const b=d.current;b&&i.animateInteractivePressSqueeze(b)},[C,r,d])}const Bl=a.createContext(null),fs=a.createContext({}),dC=a.createContext(null);function UD({value:e,children:t}){return c.jsx(Bl.Provider,{value:e,children:t})}function fr(){const e=a.useContext(Bl);if(!e)throw new Error("Switch components must be inside <Switch>.");return e}function WD(){return a.useContext(Bl)}function YD({classNames:e,children:t}){const n=a.useContext(fs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(fs.Provider,{value:o,children:t})}function rt(){return a.useContext(fs)}function $D({value:e,children:t}){return c.jsx(dC.Provider,{value:e,children:t})}function jl(){const e=a.useContext(dC);if(!e)throw new Error("Switch.Track, Switch.Fill, Switch.Thumb, Switch.Icon must be inside <Switch.Track>");return e}function XD(e,t,n){return e??n??`switch-${t}`}function KD(e){return Ve(e)}function qD(e){return ze(e)}function ZD(e){return e?void 0:"Switch"}const Ml=a.createContext(null),ms=a.createContext({}),fC=a.createContext(null);function QD({value:e,children:t}){return c.jsx(Ml.Provider,{value:e,children:t})}function mr(){const e=a.useContext(Ml);if(!e)throw new Error("Slider components must be inside <Slider>.");return e}function JD(){return a.useContext(Ml)}function ek({classNames:e,children:t}){const n=a.useContext(ms),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ms.Provider,{value:o,children:t})}function qe(){return a.useContext(ms)}function tk({value:e,children:t}){return c.jsx(fC.Provider,{value:e,children:t})}function Kn(){const e=a.useContext(fC);if(!e)throw new Error("Slider.Rail, Slider.Fill, Slider.Thumb, Slider.Icon must be inside Slider.Track");return e}function Fl(e,t){return i.cn(e==="horizontal"?"w-full":"w-auto items-center",t)}function qn(e){return typeof e=="number"?`${e}px`:e}const Tc={small:He("small"),base:He("base"),mid:He("mid"),large:He("large")};function fn(e,t,n){return Math.min(n,Math.max(t,e))}function mC(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function pC(e,t,n){return n<=t?0:(e-t)/(n-t)}function ps(e,t,n,o,r){if(o<=0)return mC(e,t,n);if(o<=r)return 50;const s=r/2,l=o-r;return(s+pC(e,t,n)*l)/o*100}function Pr(e,t,n,o,r){return o<=r?o/2:r/2+pC(e,t,n)*(o-r)}function nk(e,t,n,o,r,s,l){if(e<=0)return{start:0,end:mC(s,n,o)};const u=t/2;if(r){const f=Pr(l[0],n,o,e,t),m=Pr(l[1],n,o,e,t);return{start:Math.max(0,f-u)/e*100,end:Math.min(e,m+u)/e*100}}const d=Pr(s,n,o,e,t);return{start:0,end:Math.min(e,d+u)/e*100}}function ok(e,t){const n=e.end-e.start;return t==="horizontal"?{left:`${e.start}%`,width:`${n}%`}:{bottom:`${e.start}%`,height:`${n}%`}}function rk(e,t,n,o){if(o<=0)return fn(e,t,n);const r=Math.round((e-t)/o);return fn(t+r*o,t,n)}function sk(e,t){if(t.length===0)return e;let n=t[0],o=Math.abs(e-n);for(const r of t){const s=Math.abs(e-r);s<o&&(o=s,n=r)}return n}function ak(e,t,n){if(e!=null&&e.length)return[...new Set(e.map(o=>fn(o,t,n)))].toSorted((o,r)=>o-r)}function Cs(e,t,n,o,r,s,l){const u=o==="horizontal"?n.width:n.height,d=l/2,f=u-l;if(f<=0)return r;const m=fn(o==="horizontal"?(e-n.left-d)/f:1-(t-n.top-d)/f,0,1);return r+m*(s-r)}function lk(e,t,n){const o=t.findIndex(r=>r===e);if(o>=0){const r=t[o+n];return r!==void 0?r:e}return n>0?t.find(r=>r>e)??t[t.length-1]:[...t].reverse().find(r=>r<e)??t[0]}function ik(e,t,n,o){const r=new Set(["ArrowRight","ArrowUp","PageUp"]),s=new Set(["ArrowLeft","ArrowDown","PageDown"]);if(e!=null&&e.length)return n==="Home"?"home":n==="End"?"end":r.has(n)?"mark-next":s.has(n)?"mark-prev":0;const l=t>0?t*10:10;return n==="Home"?"home":n==="End"?"end":n==="PageUp"?l:n==="PageDown"?-l:n==="ArrowRight"||n==="ArrowUp"?t:n==="ArrowLeft"||n==="ArrowDown"?-t:0}function ck(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function xo(e,t){const n=t==="horizontal"?e.width:e.height,o=t==="horizontal"?e.height:e.width;return{trackSpanPx:n,thumbSpanPx:o}}function CC(e,t){if(e==null)return Tc[t];if(typeof e=="number")return e;const n=e.trim(),o=/^([\d.]+)px$/i.exec(n);if(o)return Number.parseFloat(o[1]);const r=/^([\d.]+)rem$/i.exec(n);if(r&&typeof document<"u"){const s=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return Number.parseFloat(r[1])*s}return Tc[t]}function uk(e,t){return e===t?!0:e==null||t==null?!1:e.valueLabel===t.valueLabel&&e.min===t.min&&e.max===t.max&&e.range===t.range&&e.singleValue===t.singleValue&&e.rangeValue[0]===t.rangeValue[0]&&e.rangeValue[1]===t.rangeValue[1]&&e.label===t.label}function dk(e){let t=!1;const n=[];for(const o of a.Children.toArray(e)){if(!a.isValidElement(o)){n.push(o);continue}const r=o.type.displayName;(r==="SliderRail"||r==="SliderFill"||r==="SliderThumb"||r==="SliderIcon")&&(t=!0),n.push(o)}return t?{body:n,hasCompoundParts:!0}:{body:null,hasCompoundParts:!1}}function fk(e,t){if(e==null)return t;const n=a.Children.toArray(e);if(n.length===0)return t;if(n.length===1&&a.isValidElement(n[0])&&n[0].type.displayName==="SliderIcon"){const{children:r,className:s,...l}=n[0].props,u=r??t;return u==null?t:s||Object.keys(l).length>0?a.createElement("span",{className:s,...l},u):u}return e}const mk="flex items-baseline justify-between gap-xsmall",pk="w-full",Ck="min-w-[8rem]",gk="tabular-nums text-muted",Sk={small:"h-[var(--selection-indicator-small)] min-h-[var(--selection-indicator-small)]",base:"h-[var(--selection-indicator-base)] min-h-[var(--selection-indicator-base)]",mid:"h-[var(--selection-indicator-mid)] min-h-[var(--selection-indicator-mid)]",large:"h-[var(--selection-indicator-large)] min-h-[var(--selection-indicator-large)]"},hk={small:"w-[var(--selection-indicator-small)] min-w-[var(--selection-indicator-small)]",base:"w-[var(--selection-indicator-base)] min-w-[var(--selection-indicator-base)]",mid:"w-[var(--selection-indicator-mid)] min-w-[var(--selection-indicator-mid)]",large:"w-[var(--selection-indicator-large)] min-w-[var(--selection-indicator-large)]"},xk="pointer-events-none absolute inset-0 overflow-hidden",bk="bg-primary-tint",Ak="gloss-indicator border-0",vk="overflow-hidden",Lk="opacity-48",_k="absolute rounded-[inherit]",Tk="bg-primary",Ek="bg-primary-tint",Rk="z-[1]",Ik="inset-y-0",yk="inset-x-0",Nk="relative touch-none select-none",wk="w-full",Ok="h-48",Pk="pointer-events-none absolute z-[1] size-1 rounded-[var(--selection-indicator-radius-xsmall)] bg-primary/30",Dk="absolute box-border flex shrink-0 origin-center items-center justify-center m-0 appearance-none border-0 bg-transparent p-0 focus-ring",kk="top-0 h-full w-auto -translate-x-1/2 aspect-square",Bk="left-0 w-full h-auto -translate-y-1/2 aspect-square",jk="cursor-not-allowed",Mk="cursor-grab active:cursor-grabbing",Fk="z-[2]",Hk="z-[3]";function Gk({orientation:e,slotClass:t,className:n}){return i.cn(Fl(e,n),t)}function Vk({size:e,disabled:t,gloss:n=!1,slotClass:o,className:r}){return i.cn(xk,Ye[e],!n&&bk,t&&Lk,o,r)}function zk({isHorizontal:e,gloss:t=!1,slotClass:n,className:o}){return i.cn(_k,e?Ik:yk,t?Ek:Tk,t&&Rk,n,o)}function gC({isHorizontal:e,size:t,thickness:n,gloss:o=!1,slotClass:r,className:s}){return i.cn(Nk,e?wk:Ok,n==null&&(e?Sk[t]:hk[t]),o&&Ye[t],o&&vk,o&&Ak,r,s)}function Uk({size:e,orientation:t,disabled:n,active:o,slotClass:r,className:s}){return i.cn(Dk,Ye[e],t==="horizontal"?kk:Bk,n?jk:Mk,o?Hk:Fk,r,s)}function Wk(e,t){return t==="horizontal"?{left:`${e}%`}:{top:`${100-e}%`}}function Yk(e,t){return t==="horizontal"?{left:`${e}%`,top:"50%",transform:"translate(-50%, -50%)"}:{bottom:`${e}%`,left:"50%",top:"auto",transform:"translate(-50%, 50%)"}}function $k({isHorizontal:e,thickness:t}){if(t==null)return;const n=qn(t);return e?{height:n,minHeight:n}:{width:n,minWidth:n}}function Xk({children:e,className:t,orientation:n="horizontal",...o}){return c.jsx("div",{className:i.cn(mk,n==="horizontal"?pk:Ck,t),...o,children:e})}function Kk({children:e,fallback:t,className:n,...o}){const r=e??t;return r==null?null:c.jsx(q,{as:"span",variant:"base",className:i.cn(gk,n),...o,children:r})}function qk({label:e,labelClassName:t,showValue:n,valueText:o,hint:r,hintId:s,error:l,errorId:u,Header:d,Value:f,track:m}){const p=e!=null||n||o!=null;return c.jsxs(c.Fragment,{children:[p?c.jsxs(d,{children:[e!=null?c.jsx(ve,{classNames:t?{root:t}:void 0,children:e}):null,o!=null?c.jsx(f,{children:o}):n?c.jsx(f,{}):null]}):null,m,r!=null?c.jsx(le.Hint,{id:s,children:r}):null,l!=null?c.jsx(le.Error,{id:u,children:l}):null]})}function Zk(e){const t=a.useRef(null);return a.useLayoutEffect(()=>{const n=t.current;n&&(i.killMotion(n),n.style.opacity=e?"0.48":"1")},[e]),t}function Qk({disabled:e,onPointerDown:t}){const n=a.useRef(null),o=i.usePrefersReducedMotion();a.useEffect(()=>{const s=n.current;return()=>{s&&i.killMotion(s)}},[]);const r=a.useCallback(s=>{if(t(s),s.defaultPrevented||e||o)return;const l=n.current;l&&i.animateInteractivePressSqueeze(l)},[e,t,o]);return{squeezeRef:n,handlePointerDown:r}}function Jk(e){a.useEffect(()=>{const t=e.current;return()=>{t&&i.killMotion(t)}},[e])}function eB(e,t,n){i.killMotion(e),e.style.left=t.left??"",e.style.width=t.width??"",e.style.bottom=t.bottom??"",e.style.height=t.height??"",n==="horizontal"?(e.style.bottom="",e.style.height=""):(e.style.left="",e.style.width="")}const yn=a.forwardRef(function({size:t,icon:n,gloss:o=!1,thumbClassName:r,className:s,style:l,percent:u,orientation:d,disabled:f,active:m,ariaValueNow:p,ariaValueMin:C,ariaValueMax:S,ariaValueText:g,ariaLabel:h,ariaLabelledBy:x,ariaDescribedBy:A,onPointerDown:b,onKeyDown:L,..._},v){const R=qe(),T=Zk(f),{squeezeRef:E,handlePointerDown:I}=Qk({disabled:f,onPointerDown:b});return c.jsx("button",{ref:$e(E,v),type:"button",role:"slider",...x!=null?{"aria-labelledby":x}:h!=null?{"aria-label":h}:{},...A!=null?{"aria-describedby":A}:{},"aria-valuemin":C,"aria-valuemax":S,"aria-valuenow":p,"aria-valuetext":g,"aria-orientation":d,disabled:f,tabIndex:f?-1:0,className:Uk({size:t,orientation:d,disabled:f,active:m,slotClass:i.cn(R.thumb,s)}),style:{...Wk(u,d),...l},onPointerDown:I,onKeyDown:L,..._,children:c.jsx(On,{size:t,gloss:o,shellRef:T,className:i.cn(R.thumbShell,r),children:n!=null?c.jsx(On.Icon,{size:t,gloss:o,children:n}):null})})});yn.displayName="SliderThumbButton";function SC(){const e=Kn(),t=qe();return e.markItems.length?c.jsx(c.Fragment,{children:e.markItems.map(n=>c.jsx("span",{"aria-hidden":!0,className:i.cn(Pk,e.markSlotClass,t.mark),style:Yk(n.percent,e.orientation)},n.value))}):null}SC.displayName="SliderTrackMarks";function Hl({className:e,...t}){const n=Kn(),o=qe();return c.jsx("span",{ref:n.fillRef,className:i.cn(n.fillClassResolved,o.fill,e),...t})}Hl.displayName="SliderFill";function Gl({className:e,children:t,...n}){const o=Kn(),r=qe();return c.jsx("div",{className:i.cn(o.railClass,r.rail,e),"aria-hidden":!0,...n,children:t??c.jsxs(c.Fragment,{children:[c.jsx(Hl,{}),c.jsx(SC,{})]})})}Gl.displayName="SliderRail";function tB({kind:e,icon:t,className:n,style:o,forwardedRef:r,...s}){const l=Kn();return e==="start"?c.jsx(yn,{ref:r,size:l.size,icon:t,gloss:l.gloss,thumbClassName:l.thumbClassName,className:n,style:o,percent:l.thumbPercent("start"),orientation:l.orientation,disabled:l.disabled,active:l.activeThumb==="start",ariaValueNow:l.rangeValue[0],ariaValueMin:l.min,ariaValueMax:l.rangeValue[1],ariaValueText:l.formatValue(l.rangeValue[0]),...l.resolveThumbA11y("start"),onPointerDown:l.onThumbPointerDown("start"),onKeyDown:l.onThumbKeyDown("start"),...s}):e==="end"?c.jsx(yn,{ref:r,size:l.size,icon:t,gloss:l.gloss,thumbClassName:l.thumbClassName,className:n,style:o,percent:l.thumbPercent("end"),orientation:l.orientation,disabled:l.disabled,active:l.activeThumb==="end",ariaValueNow:l.rangeValue[1],ariaValueMin:l.rangeValue[0],ariaValueMax:l.max,ariaValueText:l.formatValue(l.rangeValue[1]),...l.resolveThumbA11y("end"),onPointerDown:l.onThumbPointerDown("end"),onKeyDown:l.onThumbKeyDown("end"),...s}):c.jsx(yn,{ref:r,size:l.size,icon:t,gloss:l.gloss,thumbClassName:l.thumbClassName,className:n,style:o,percent:l.thumbPercent("single"),orientation:l.orientation,disabled:l.disabled,active:l.activeThumb==="single",ariaValueNow:l.singleValue,ariaValueMin:l.min,ariaValueMax:l.max,ariaValueText:l.formatValue(l.singleValue),...l.resolveThumbA11y("single"),onPointerDown:l.onThumbPointerDown("single"),onKeyDown:l.onThumbKeyDown("single"),...s})}const Nn=a.forwardRef(function({thumb:t="single",children:n,className:o,style:r,...s},l){const u=Kn();return c.jsx(tB,{kind:t,icon:u.resolveThumbIcon(n),className:o,style:r,forwardedRef:l,...s})});Nn.displayName="SliderThumb";const wn=a.forwardRef(function({children:t,className:n,...o},r){return c.jsx("span",{ref:r,className:n,...o,children:t})});wn.displayName="SliderIcon";function nB({range:e,icon:t}){return c.jsxs(c.Fragment,{children:[c.jsx(Gl,{}),e?c.jsxs(c.Fragment,{children:[c.jsx(Nn,{thumb:"start",children:t!=null?c.jsx(wn,{children:t}):null}),c.jsx(Nn,{thumb:"end",children:t!=null?c.jsx(wn,{children:t}):null})]}):c.jsx(Nn,{thumb:"single",children:t!=null?c.jsx(wn,{children:t}):null})]})}function oB(e){return`${e}-label`}function rB({kind:e,explicitLabel:t,labelConnected:n,labelId:o,hintConnected:r,hintId:s,errorConnected:l,errorId:u}){const d=je(r?s:void 0,l?u:void 0);return t?e==="start"?{ariaLabel:`${t}, minimum`,ariaLabelledBy:void 0,ariaDescribedBy:d}:e==="end"?{ariaLabel:`${t}, maximum`,ariaLabelledBy:void 0,ariaDescribedBy:d}:{ariaLabel:t,ariaLabelledBy:void 0,ariaDescribedBy:d}:e==="start"?{ariaLabel:"Minimum range",ariaLabelledBy:void 0,ariaDescribedBy:d}:e==="end"?{ariaLabel:"Maximum range",ariaLabelledBy:void 0,ariaDescribedBy:d}:n&&o?{ariaLabel:void 0,ariaLabelledBy:o,ariaDescribedBy:d}:{ariaLabel:t??"Value",ariaLabelledBy:void 0,ariaDescribedBy:d}}function sB(e,t){const{orientation:n,size:o="base",thickness:r,min:s=0,max:l=100,step:u=1,marks:d,formatValue:f=ck,icon:m,gloss:p=!1,thumbClassName:C,disabled:S=!1,className:g,style:h,classNames:x,ariaLabel:A,range:b=!1,children:L,onPointerDown:_,value:v,defaultValue:R,onValueChange:T,...E}=e,I=JD(),O=qe(),N=a.useMemo(()=>({...O,...x}),[O,x]),y=n??(I==null?void 0:I.orientation)??"horizontal",w=I==null?void 0:I.labelId,P=(I==null?void 0:I.labelConnected)??!1,k=A,j=a.useCallback(ne=>rB({kind:ne,explicitLabel:k,labelConnected:P,labelId:w,hintConnected:(I==null?void 0:I.hintConnected)??!1,hintId:(I==null?void 0:I.hintId)??"",errorConnected:(I==null?void 0:I.errorConnected)??!1,errorId:(I==null?void 0:I.errorId)??""}),[k,I==null?void 0:I.errorConnected,I==null?void 0:I.errorId,I==null?void 0:I.hintConnected,I==null?void 0:I.hintId,P,w]),B=a.useRef(null),D=a.useRef(null),[F,H]=a.useState(0),U=a.useMemo(()=>CC(r,o),[r,o]),[G,K]=a.useState(U),V=a.useRef(null),[oe,J]=a.useState(null),ee=a.useMemo(()=>ak(d,s,l),[d,s,l]),se=a.useCallback(ne=>{const ae=fn(ne,s,l);return ee!=null&&ee.length?sk(ae,ee):rk(ae,s,l,u)},[ee,s,l,u]),[M,W]=Re({value:b?void 0:e.value,defaultValue:(b?void 0:e.defaultValue)??s}),[Y,Z]=Re({value:b?e.value:void 0,defaultValue:(b?e.defaultValue:void 0)??[s,l]}),ce=b?void 0:e.onValueChange,z=b?e.onValueChange:void 0,Q=a.useCallback(ne=>{const ae=se(ne);ae!==M&&(W(ae),ce==null||ce(ae))},[ce,W,M,se]),te=a.useCallback(ne=>{let[ae,Ce]=ne.map(se);ae>Ce&&([ae,Ce]=[Ce,ae]);const[Te,Oe]=Y;ae===Te&&Ce===Oe||(Z([ae,Ce]),z==null||z([ae,Ce]))},[z,Y,Z,se]),me=a.useCallback((ne=M,ae=Y)=>{const Ce=B.current,Te=D.current;if(!Ce||!Te)return;const Oe=Ce.getBoundingClientRect(),{trackSpanPx:it,thumbSpanPx:Fe}=xo(Oe,y);H(ut=>ut===it?ut:it),Fe>0&&K(ut=>ut===Fe?ut:Fe);const ct=nk(it,Fe>0?Fe:U,s,l,b,ne,ae);eB(Te,ok(ct,y),y)},[U,l,s,y,b,Y,M]);a.useLayoutEffect(()=>{me()},[me]),a.useEffect(()=>{const ne=B.current;if(!ne)return;const ae=new ResizeObserver(()=>me());return ae.observe(ne),()=>ae.disconnect()},[y,me]),Jk(D);const Ae=a.useCallback((ne,ae,Ce)=>{const Te=B.current;if(!Te||S)return;const Oe=Te.getBoundingClientRect(),{thumbSpanPx:it}=xo(Oe,y),Fe=Cs(ne,ae,Oe,y,s,l,it>0?it:U);if(b){const[ct,ut]=Y;if(Ce==="start"){const Rn=se(Math.min(Fe,ut));te([Rn,ut]),me(M,[Rn,ut])}else if(Ce==="end"){const Rn=se(Math.max(Fe,ct));te([ct,Rn]),me(M,[ct,Rn])}}else{const ct=se(Fe);Q(Fe),me(ct,Y)}},[S,te,Q,U,l,s,y,b,Y,M,se,me]),he=a.useCallback((ne,ae)=>{const Ce=B.current;if(!Ce)return"start";const Te=Ce.getBoundingClientRect(),{thumbSpanPx:Oe}=xo(Te,y),it=Cs(ne,ae,Te,y,s,l,Oe>0?Oe:U),[Fe,ct]=Y;return Math.abs(it-Fe)<=Math.abs(it-ct)?"start":"end"},[U,l,s,y,Y]);a.useEffect(()=>{const ne=Ce=>{const Te=V.current;Te&&Ae(Ce.clientX,Ce.clientY,Te)},ae=()=>{V.current=null,J(null)};return window.addEventListener("pointermove",ne),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),()=>{window.removeEventListener("pointermove",ne),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae)}},[Ae]);const X=a.useCallback(ne=>{if(_==null||_(ne),ne.defaultPrevented||S||ne.button!==0)return;ne.preventDefault();const ae=b?he(ne.clientX,ne.clientY):"single";V.current=ae,J(ae),Ae(ne.clientX,ne.clientY,ae)},[S,_,he,b,Ae]),re=a.useCallback(ne=>ae=>{S||ae.button!==0||(ae.preventDefault(),ae.stopPropagation(),V.current=ne,J(ne),ae.currentTarget.setPointerCapture(ae.pointerId))},[S]),pe=a.useCallback((ne,ae)=>{if(b){const[Ce,Te]=Y;te(ne==="start"?[Ce+ae,Te]:[Ce,Te+ae])}else Q(M+ae)},[te,Q,b,Y,M]),fe=a.useCallback(ne=>ae=>{if(S)return;const Ce=ik(ee,u,ae.key);if(Ce===0)return;ae.preventDefault();const Te=ne==="start"?Y[0]:ne==="end"?Y[1]:M;if(Ce==="home"){b?te(ne==="start"?[s,Y[1]]:[Y[0],s]):Q(s);return}if(Ce==="end"){b?te(ne==="start"?[l,Y[1]]:[Y[0],l]):Q(l);return}if(Ce==="mark-next"||Ce==="mark-prev"){if(!(ee!=null&&ee.length))return;const Oe=lk(Te,ee,Ce==="mark-next"?1:-1);b?te(ne==="start"?[Oe,Y[1]]:[Y[0],Oe]):Q(Oe);return}typeof Ce=="number"&&Ce!==0&&pe(ne,Ce)},[S,te,Q,ee,l,s,pe,y,b,Y,M,u]),Le=a.useCallback(ne=>{const ae=ne==="start"?Y[0]:ne==="end"?Y[1]:M;return ps(ae,s,l,F,G)},[l,s,Y,M,G,F]),_t=a.useCallback(ne=>fk(ne,m),[m]),lt=a.useMemo(()=>{if(b){const[ne,ae]=Y;return`${f(ne)} — ${f(ae)}`}return f(M)},[f,b,Y,M]),Qe=I==null?void 0:I.setDisplay;a.useLayoutEffect(()=>{Qe==null||Qe({valueLabel:lt,min:s,max:l,range:b,singleValue:M,rangeValue:Y,label:k})},[k,l,s,b,Y,Qe,M,lt]);const de=y==="horizontal",_e=zk({isHorizontal:de,gloss:p,slotClass:N.fill}),ie=Vk({size:o,disabled:S,gloss:p,slotClass:N.rail}),xe=a.useMemo(()=>(ee??[]).map(ne=>({value:ne,percent:ps(ne,s,l,F,G)})),[ee,l,s,G,F]),Je=a.useCallback(ne=>{B.current=ne,typeof t=="function"?t(ne):t&&(t.current=ne)},[t]),Ir=a.useMemo(()=>({fillRef:D,fillClassResolved:_e,railClass:ie,markSlotClass:N.mark,markItems:xe,size:o,orientation:y,disabled:S,icon:m,range:b,gloss:p,thumbClassName:C,activeThumb:oe,singleValue:M,rangeValue:Y,min:s,max:l,formatValue:f,thumbPercent:Le,resolveThumbIcon:_t,resolveThumbA11y:j,onThumbPointerDown:re,onThumbKeyDown:fe}),[oe,S,_e,f,p,m,xe,l,s,fe,re,y,ie,b,Y,j,_t,M,o,N.mark,C,Le]),{body:oo,hasCompoundParts:Bt}=a.useMemo(()=>dk(L),[L]),yr=a.useMemo(()=>({...$k({isHorizontal:de,thickness:r}),...h}),[de,h,r]),th=gC({isHorizontal:de,size:o,thickness:r,gloss:p,slotClass:N.track,className:g});return{setTrackRef:Je,trackHitClass:th,trackCrossStyle:yr,trackRest:E,handleTrackPointerDown:X,trackContextValue:Ir,compoundBody:oo,hasCompoundParts:Bt,range:b,icon:m}}function aB({label:e,showValue:t,valueText:n,hint:o,error:r,hintId:s,errorId:l,trackProps:u}){const d=qe();return qk({label:e,labelClassName:d.label,showValue:t,valueText:n,hint:o,hintId:s,error:r,errorId:l,Header:Vl,Value:zl,track:c.jsx(Ul,{...u})})}function hC({className:e,classNames:t,...n}){const o=qe();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}hC.displayName="SliderLabel";function Vl({children:e,className:t,...n}){const{orientation:o}=mr(),r=qe();return c.jsx(Xk,{orientation:o,className:i.cn(r.header,t),...n,children:e})}Vl.displayName="Slider.Header";function zl({children:e,className:t,...n}){const{display:o}=mr(),r=qe();return c.jsx(Kk,{fallback:o==null?void 0:o.valueLabel,className:i.cn(r.value,t),...n,children:e})}zl.displayName="Slider.Value";function xC({children:e,className:t,id:n,...o}){const r=mr(),s=qe();return c.jsx(le.Hint,{id:n??r.hintId,className:i.cn(s.hint,t),...o,children:e})}xC.displayName="Slider.Hint";function bC({children:e,className:t,id:n,...o}){const r=mr(),s=qe();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}bC.displayName="Slider.Error";const Ul=a.forwardRef(function(t,n){const o=sB(t,n);return c.jsx("div",{...o.trackRest,ref:o.setTrackRef,role:"presentation",className:o.trackHitClass,style:o.trackCrossStyle,onPointerDown:o.handleTrackPointerDown,children:c.jsx(tk,{value:o.trackContextValue,children:o.hasCompoundParts?o.compoundBody:c.jsx(nB,{range:o.range,icon:o.icon})})})});Ul.displayName="SliderTrack";function lB({children:e,id:t,orientation:n="horizontal",label:o,showValue:r,valueText:s,hint:l,error:u,range:d,value:f,defaultValue:m,onValueChange:p,min:C,max:S,step:g,marks:h,size:x,thickness:A,formatValue:b,icon:L,disabled:_,ariaLabel:v,gloss:R,thumbClassName:T}){const E=a.useId(),I=t??`slider-${E}`,O=Ve(I),N=ze(I),y=oB(I),[w,P]=a.useState(null),k=a.useCallback(K=>{P(V=>uk(V,K)?V:K)},[]),{isCompound:j,hasLabel:B,hasHint:D,hasError:F}=a.useMemo(()=>{const K=Ue(e);return{isCompound:K,hasLabel:o!=null||K&&ge(e,"Label"),hasHint:l!=null||K&&ge(e,"Slider.Hint"),hasError:u!=null||K&&ge(e,"Slider.Error")}},[e,u,l,o]),H=a.useMemo(()=>({sliderId:I,labelId:y,hintId:O,errorId:N,hintConnected:D,errorConnected:F,labelConnected:B,orientation:n,display:w,setDisplay:k}),[w,N,F,D,B,O,y,n,k,I]),U=a.useMemo(()=>({labelId:y,required:!1}),[y]);return{sliderId:I,isCompound:j,fieldCtx:H,fieldLabelCtx:U,trackProps:{range:d,value:f,defaultValue:m,onValueChange:p,min:C,max:S,step:g,marks:h,size:x,thickness:A,formatValue:b,icon:L,disabled:_,ariaLabel:v,gloss:R,thumbClassName:T,orientation:n},label:o,showValue:r,valueText:s,hint:l,error:u,hasHint:D,hasError:F,hintId:O,errorId:N}}function AC({children:e,className:t,classNames:n,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,range:m,value:p,defaultValue:C,onValueChange:S,min:g,max:h,step:x,marks:A,size:b,thickness:L,formatValue:_,icon:v,disabled:R,ariaLabel:T,gloss:E,thumbClassName:I,...O}){const N=lB({children:e,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,range:m,value:p,defaultValue:C,onValueChange:S,min:g,max:h,step:x,marks:A,size:b,thickness:L,formatValue:_,icon:v,disabled:R,ariaLabel:T,gloss:E,thumbClassName:I}),y=N.isCompound?e:c.jsx(aB,{label:N.label,showValue:N.showValue,valueText:N.valueText,hint:N.hint,error:N.error,hintId:N.hasHint?N.hintId:void 0,errorId:N.hasError?N.errorId:void 0,trackProps:N.trackProps});return c.jsx(QD,{value:N.fieldCtx,children:c.jsx(ek,{classNames:n,children:c.jsx(Ge.Provider,{value:N.fieldLabelCtx,children:c.jsx(le,{id:N.sliderId,className:Gk({orientation:N.fieldCtx.orientation,slotClass:n==null?void 0:n.root,className:t}),...O,children:y})})})})}AC.displayName="Slider";const iB=Object.assign(AC,{Header:Vl,Label:hC,Value:zl,Hint:xC,Error:bC,Track:Ul,Rail:Gl,Fill:Hl,Thumb:Nn,Icon:wn}),cB="absolute m-[-1px] h-px w-px overflow-hidden border-0 p-0 opacity-0 [clip:rect(0,0,0,0)]",uB="relative inline-flex shrink-0 items-center justify-center has-focus-ring";function dB(e){return i.cn(uB,Ye[e])}const fB="min-w-0",mB="contents",pB="inline-flex flex-wrap items-center gap-x-xsmall gap-y-0",CB="min-w-0",gB="origin-center",SB="font-w-mid",vC="text-muted",LC="text-muted",_C="text-muted",hB="origin-center",xB="min-w-0 font-w-mid",bB="relative cursor-pointer select-none rounded-small text-left",AB="cursor-not-allowed",vB="inline-grid grid-cols-[auto] grid-rows-[auto]",LB="relative box-border inline-flex shrink-0",_B="gloss-indicator border-0",TB="bg-primary-tint",EB="pointer-events-none absolute inset-0 rounded-[inherit]",RB="z-[1]",IB="bg-primary",yB="bg-primary-tint",NB="absolute inset-y-0 left-0 aspect-square h-full w-auto flex",wB="z-[2]",OB="absolute inset-0 flex items-center justify-center";function pr(e){return e==="left"?"left":"right"}function TC(e){return er(pr(e))}function EC(e){return tr(pr(e))}function Do(e,t){return nr(e,pr(t))}function PB(e){return Ra(e)}function DB({hasTextColumn:e,secondaryLines:t,gap:n,labelPosition:o,slotClass:r,className:s}){return i.cn(bB,e?Ea(t,n,pr(o),"inline-grid"):vB,r,s)}function kB({size:e,thickness:t,gloss:n,slotClass:o,className:r}){return i.cn(LB,Ye[e],t==null&&Ln[e].track,n?_B:TB,o,r)}function BB(e){if(e==null)return;const t=qn(e);return{height:t,minHeight:t,width:`calc(2 * (${t}))`,minWidth:`calc(2 * (${t}))`}}function jB(e){if(e)return{background:e}}function ko({size:e,thickness:t,checked:n=!1,disabled:o,color:r,gloss:s=!1,squeezeToken:l=0,iconOff:u,iconOn:d,className:f,classNames:m,children:p,...C}){const S=rt(),g=a.useMemo(()=>({...S,...m}),[S,m]),h=a.useRef(null),x=a.useRef(null),A=a.useRef(null),b=a.useRef(null),L=a.useRef(null),_=a.useRef(null);zD({checked:n,disabled:o,size:e,thickness:t,squeezeToken:l,trackRef:h,trackFillRef:x,thumbRef:A,thumbShellRef:b,iconOffRef:L,iconOnRef:_});const v=a.useMemo(()=>({checked:n,disabled:o,size:e,color:r,gloss:s,trackFillRef:x,thumbRef:A,thumbShellRef:b,iconOffRef:L,iconOnRef:_}),[n,r,o,s,e]),R=c.jsxs(c.Fragment,{children:[c.jsx(Cr,{}),c.jsxs(Wl,{children:[u!=null?c.jsx(Bo,{when:"off",children:u}):null,d!=null?c.jsx(Bo,{when:"on",children:d}):null]})]});return c.jsx($D,{value:v,children:c.jsx("span",{ref:h,className:kB({size:e,thickness:t,gloss:s,slotClass:g.track,className:f}),style:BB(t),"aria-hidden":!0,...C,children:p??R})})}ko.displayName="SwitchTrack";function Cr({className:e,style:t,...n}){const o=jl(),r=rt(),s=jB(o.color);return c.jsx("span",{ref:o.trackFillRef,"aria-hidden":!0,className:i.cn(EB,o.gloss&&RB,!o.color&&(o.gloss?yB:IB),r.fill,e),style:{opacity:0,...s,...t},...n})}Cr.displayName="SwitchFill";function Wl({className:e,children:t,...n}){const o=jl(),r=rt();return c.jsx("span",{ref:o.thumbRef,className:i.cn(NB,o.gloss&&wB,r.thumb,e),...n,children:c.jsx(On,{size:o.size,gloss:o.gloss,shellRef:o.thumbShellRef,className:r.thumbShell,children:t})})}Wl.displayName="SwitchThumb";function Bo({when:e,children:t,className:n,...o}){const r=jl(),s=rt(),l=e==="off"?r.iconOffRef:r.iconOnRef,u=e==="off"?!r.checked:r.checked;return c.jsx(On.Icon,{iconRef:l,size:r.size,gloss:r.gloss,className:i.cn(OB,s.icon,n),style:{opacity:u?1:0},...o,children:t})}Bo.displayName="SwitchIcon";const Yl=a.forwardRef(function({size:t,iconOff:n,iconOn:o,color:r,gloss:s=!1,thickness:l,className:u,classNames:d,disabled:f,checked:m,defaultChecked:p,onChange:C,id:S,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:L,readOnly:_,onBlur:v,onFocus:R,onPointerDown:T,children:E,...I},O){const N=WD(),y=rt(),w=a.useMemo(()=>({...y,...d}),[d,y]),P=a.useId(),k=XD(S,P,N==null?void 0:N.switchId),j=(N==null?void 0:N.hintId)??`${k}-hint`,B=(N==null?void 0:N.errorId)??`${k}-error`,D=t??(N==null?void 0:N.size)??"base",[F,H,U]=Re({value:m,defaultValue:!!p}),[G,K]=a.useState(0),V=a.useCallback(Z=>{const ce=Z.target.checked;U||H(ce),C==null||C(Z)},[U,C,H]),oe=a.useCallback(Z=>{T==null||T(Z),!(Z.defaultPrevented||f)&&(K(ce=>ce+1),N==null||N.setSqueezeToken(ce=>ce+1))},[f,N,T]),{"aria-label":J,...ee}=I,se={size:D,thickness:l,checked:F,disabled:f,color:r,gloss:s,squeezeToken:G,iconOff:n,iconOn:o,classNames:{track:w.track,fill:w.fill,thumb:w.thumb,thumbShell:w.thumbShell,icon:w.icon}},{compoundTrack:M,hasThumbChild:W}=a.useMemo(()=>{const{track:Z}=MD(E);return{compoundTrack:Z,hasThumbChild:E!=null&&FD(E)}},[E]);let Y;return M!=null?Y=a.isValidElement(M)?a.cloneElement(M,se):M:W?Y=c.jsxs(ko,{...se,children:[c.jsx(Cr,{}),E]}):E!=null?Y=E:Y=c.jsx(ko,{...se}),c.jsxs("span",{className:i.cn(dB(D),N!=null?TC(N.labelPosition):void 0,w.control,u),children:[c.jsx("input",{ref:O,id:k,type:"checkbox",role:"switch","aria-checked":F,className:i.cn(cB,w.input),disabled:f,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:L,readOnly:_??(U&&C===void 0),onBlur:v,onFocus:R,"aria-describedby":je(N!=null&&N.hintConnected?j:void 0,N!=null&&N.errorConnected?B:void 0),"aria-label":J??ZD((N==null?void 0:N.hasTextColumn)??!1),onPointerDown:oe,...U?{checked:F,onChange:V}:{defaultChecked:p,onChange:V},...ee}),Y]})});Yl.displayName="SwitchControl";const RC=a.forwardRef(function({className:t,children:n,...o},r){const s=fr(),l=rt();return c.jsx("div",{ref:r,className:i.cn(mB,s.isCompound&&fB,l.content,t),...o,children:n})});RC.displayName="SwitchContent";function IC({children:e,className:t,...n}){const o=fr(),r=rt(),s=Ln[o.size];return c.jsx("span",{ref:l=>{o.isCompound&&o.useInlineCompoundMotion&&(o.textMotionRef.current=l)},className:i.cn(pB,o.isCompound&&EC(o.labelPosition),o.isCompound&&(o.hasCompoundHint||o.hasCompoundError)&&CB,o.isCompound&&o.useInlineCompoundMotion&&gB,r.label,t),...n,children:c.jsx(q,{as:"span",variant:s.title,inheritColor:!0,className:i.cn(SB,o.disabled&&vC,r.labelText),children:e})})}IC.displayName="SwitchLabel";function yC({children:e,className:t,variant:n,...o}){const r=fr(),s=rt();return c.jsx(le.Hint,{as:"span",id:r.hintId,variant:n??Ln[r.size].desc,className:i.cn(r.isCompound&&Do(2,r.labelPosition),r.disabled&&LC,s.hint,t),...o,children:e})}yC.displayName="Switch.Hint";function NC({children:e,className:t,...n}){const o=fr(),r=rt();return c.jsx(le.Error,{as:"span",id:o.errorId,variant:Ln[o.size].desc,className:i.cn(o.isCompound&&Do(PB(o.hasCompoundHint),o.labelPosition),o.disabled&&_C,r.error,t),...n,children:e})}NC.displayName="Switch.Error";function MB({label:e,hint:t,error:n,hasTextColumn:o,hasHint:r,hasError:s,secondaryLines:l,textColRef:u,size:d,disabled:f,labelPosition:m,hintId:p,errorId:C,controlProps:S}){const g=rt(),h=Ln[d];return c.jsxs(c.Fragment,{children:[c.jsx(Yl,{size:d,disabled:f,className:TC(m),...S}),o?c.jsxs(c.Fragment,{children:[c.jsx("span",{ref:u,className:i.cn(EC(m),!l&&hB,g.simpleLabelWrap,g.label),children:c.jsx(q,{as:"span",variant:h.title,inheritColor:!0,className:i.cn(xB,f&&vC,g.simpleLabelText,g.labelText),children:e})}),r?c.jsx(le.Hint,{as:"span",id:p,variant:h.desc,className:i.cn(Do(2,m),f&&LC,g.hint),children:t}):null,s?c.jsx(le.Error,{as:"span",id:C,variant:h.desc,className:i.cn(Do(r?3:2,m),f&&_C,g.error),children:n}):null]}):null]})}function FB({children:e,label:t,hint:n,error:o,labelPosition:r="right",size:s="base",disabled:l,className:u,...d}){const m=`switch-${a.useId()}`,p=KD(m),C=qD(m),[,S]=a.useState(0),{isCompound:g,hasCompoundHint:h,hasCompoundError:x,hasCompoundLabel:A}=a.useMemo(()=>{const y=Ue(e);return{isCompound:y,hasCompoundHint:y?ge(e,"Switch.Hint"):!1,hasCompoundError:y?ge(e,"Switch.Error"):!1,hasCompoundLabel:y?BD(e):!1}},[e]),b=g&&DD(u),L=n!=null,_=o!=null,v=jD(g,L,_,h,x),R=g?A:t!=null,T=l,E=!T&&R&&(!g||b),I=a.useRef(null),O=Ln[s];return{fieldCtx:a.useMemo(()=>({switchId:m,hintId:p,errorId:C,size:s,labelPosition:r,disabled:T,isCompound:g,hasCompoundHint:h,hasCompoundError:x,hasTextColumn:R,hintConnected:g?h:L,errorConnected:g?x:_,useInlineCompoundMotion:b,textMotionRef:I,setSqueezeToken:S}),[T,h,x,L,_,R,p,C,g,r,s,m,b]),isCompound:g,hasTextColumn:R,secondaryLines:v,sz:O,label:t,hint:n,error:o,hasHint:L,hasError:_,hintId:p,errorId:C,disabled:T,enableTextMotion:E,textColRef:I,labelPosition:r,controlRest:d}}const wC=a.forwardRef(function({children:t,label:n,hint:o,error:r,labelPosition:s="right",size:l="base",disabled:u,className:d,classNames:f,onPointerDown:m,...p},C){const S=FB({children:t,label:n,hint:o,error:r,labelPosition:s,size:l,disabled:u,className:d,...p}),{handlePointerDown:g}=VD({isDisabled:S.disabled,enableTextMotion:S.enableTextMotion,textMotionRef:S.textColRef,onPointerDown:m}),h=i.cn(DB({hasTextColumn:S.hasTextColumn,secondaryLines:S.secondaryLines,gap:S.sz.gap,labelPosition:S.labelPosition,slotClass:f==null?void 0:f.root,className:d}),S.disabled&&AB);return c.jsx(UD,{value:S.fieldCtx,children:c.jsx(YD,{classNames:f,children:c.jsx("label",{ref:C,className:h,onPointerDown:g,children:S.isCompound?kD(t,S.controlRest):c.jsx(MB,{label:S.label,hint:S.hint,error:S.error,hasTextColumn:S.hasTextColumn,hasHint:S.hasHint,hasError:S.hasError,secondaryLines:S.secondaryLines,textColRef:S.textColRef,size:S.fieldCtx.size,disabled:S.disabled,labelPosition:S.labelPosition,hintId:S.hintId,errorId:S.errorId,controlProps:S.controlRest})})})})});wC.displayName="SwitchRoot";const HB=Object.assign(wC,{Control:Yl,Track:ko,Fill:Cr,Thumb:Wl,Icon:Bo,Content:RC,Label:IC,Hint:yC,Error:NC}),OC=a.createContext(null),gs=a.createContext({});function GB({classNames:e,children:t}){const n=a.useContext(gs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(gs.Provider,{value:o,children:t})}function gr(){const e=a.useContext(OC);if(!e)throw new Error("Components Tabs must be inside <Tabs>.");return e}function $l(){return a.useContext(gs)}function PC(e,t){return`${e}-tab-${t}`}function DC(e,t){return`${e}-panel-${t}`}function VB({isSelected:e,isDisabled:t,panelId:n}){return{"aria-selected":e,"aria-controls":n,tabIndex:e?0:-1,disabled:t}}function zB({isSelected:e,tabId:t}){return{"aria-labelledby":t,hidden:!e,tabIndex:e?0:-1}}function kC(e){return Array.from(e.querySelectorAll('[role="tab"]:not([disabled])')).filter(t=>t instanceof HTMLButtonElement)}function UB(e,t){const n=kC(e);if(n.length===0)return null;const o=n[Math.max(0,Math.min(t,n.length-1))];return o.focus(),o}const WB={default:"",outline:"bg-transparent border-token rounded-mid p-xsmall",secondary:"bg-secondary border-token rounded-mid p-xsmall",gloss:"border-0 p-small"},YB={default:"bg-primary",outline:"bg-secondary",secondary:"bg-tertiary",gloss:"bg-tertiary"};function $B({orientation:e,slotClass:t,className:n}){return i.cn("flex min-w-0 text-left",e==="horizontal"?"flex-col gap-large":"flex-row gap-large",t,n)}function XB({orientation:e,variant:t,slotClass:n,className:o}){const r=t==="gloss",s=t==="outline"||t==="secondary"||t==="gloss";return i.cn("relative box-border min-w-0 w-fit",e==="horizontal"?i.cn("flex flex-row flex-wrap gap-xsmall",s?"items-center":"items-stretch border-b-token"):i.cn("flex flex-col gap-xsmall",s?"items-start":"items-stretch border-l-token"),r&&"gloss-panel rounded-mid text-foreground",WB[t],n,o)}function KB({variant:e,slotClass:t}){return i.cn("pointer-events-none absolute z-0 motion-reduce:transition-none",e==="default"?"rounded-full":"rounded-mid",YB[e],t)}function qB({size:e,variant:t,isSelected:n,isDisabled:o,slotClass:r,className:s}){const l=i.CONTROL_SIZE_LAYOUT[e],u=t==="outline"||t==="secondary"||t==="gloss";return i.cn("relative z-[1] m-0 inline-flex shrink-0 appearance-none items-center justify-center border-0 bg-transparent outline-none",l.padX,l.padY,u&&"rounded-mid","focus-ring-inset",o?"cursor-not-allowed opacity-45":"cursor-pointer",n?"text-primary":"text-muted hover:text-primary",!n&&!o&&i.TEXT_COLOR_TRANSITION,r,s)}const ZB="relative z-[1] shrink-0";function QB(e){return i.cn("inline-flex origin-center items-center gap-xsmall",e)}function JB(e){return i.CONTROL_SIZE_LAYOUT[e].controlText}function ej({slotClass:e,className:t}){return i.cn("min-w-0 outline-none focus-ring-inset",e,t)}function tj(e){const t=getComputedStyle(e);return{borderTop:Number.parseFloat(t.borderTopWidth)||0,borderLeft:Number.parseFloat(t.borderLeftWidth)||0}}function nj(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),{borderTop:r,borderLeft:s}=tj(e),l=n.left+s,u=n.top+r;return{left:o.left-l+e.scrollLeft,top:o.top-u+e.scrollTop,width:o.width,height:o.height}}function oj(e,t,n,o){const r=e.getBoundingClientRect(),s=t.getBoundingClientRect(),l=s.left-r.left+e.scrollLeft,u=s.top-r.top+e.scrollTop,d=s.width,f=s.height;return o==="default"?n==="horizontal"?{left:l,top:u+f-2,width:d,height:2}:{left:l,top:u,width:2,height:f}:nj(e,t)}function rj(e,t){e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}function sj(e){$.set(e,{x:0,y:0,scaleX:1,scaleY:1,transformOrigin:"0 0"})}function aj(e,t){const n=Number($.getProperty(e,"x"))||0,o=Number($.getProperty(e,"y"))||0,r=Number($.getProperty(e,"scaleX"))||1,s=Number($.getProperty(e,"scaleY"))||1;return{left:t.left+n,top:t.top+o,width:t.width*r,height:t.height*s}}function lj(e,t,n,o,r,s,l){const u=a.useRef(!0),d=a.useRef(null),f=i.usePrefersReducedMotion(),m=a.useCallback(()=>{var R;const p=e.current,C=t.current,S=(R=s.current)==null?void 0:R.get(n);if(!p||!C||!S){C&&(C.style.opacity="0");return}const g=oj(p,S,o,r),h=f||!i.isMotionFeatureEnabled("enableTabsIndicator");C.style.opacity="1";const x=d.current,A=x?aj(C,x):g;if(i.killMotion(C),rj(C,g),d.current=g,h||u.current){sj(C);return}const b=A.left-g.left,L=A.top-g.top,_=g.width>0?A.width/g.width:1,v=g.height>0?A.height/g.height:1;i.setWillChangeTransform(C,!0),$.fromTo(C,{x:b,y:L,scaleX:_,scaleY:v,transformOrigin:"0 0"},{x:0,y:0,scaleX:1,scaleY:1,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(C)})},[n,t,e,o,f,s,r]);a.useLayoutEffect(()=>{m(),u.current=!1},[m]),a.useLayoutEffect(()=>{var S;const p=e.current;if(!p||typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>m());C.observe(p);for(const g of((S=s.current)==null?void 0:S.values())??[])C.observe(g);return()=>C.disconnect()},[n,l,e,s,m])}function ij({motionRef:e,isDisabled:t,isSelected:n,onPointerEnter:o,onPointerLeave:r,onPointerDown:s}){return xt({isDisabled:!!t,enabled:!t&&!n,textMotionRef:e,hoverLift:!0,onPointerEnter:o,onPointerLeave:r,onPointerDown:s})}const BC=a.forwardRef(function({value:t,children:n,asChild:o,className:r,disabled:s,onClick:l,onPointerDown:u,onPointerEnter:d,onPointerLeave:f,...m},p){const{value:C,setValue:S,size:g,variant:h,baseId:x,disabled:A,tabElementsRef:b,notifyTabLayout:L}=gr(),_=$l(),v=a.useRef(null),R=C===t,T=A||s,E=PC(x,t),I=DC(x,t),O=VB({isSelected:R,isDisabled:T,panelId:I}),N=a.useCallback(B=>{B?b.current.set(t,B):b.current.delete(t),L(),typeof p=="function"?p(B):p&&(p.current=B)},[L,p,b,t]);a.useLayoutEffect(()=>{const B=b.current;return()=>{B.delete(t),L()}},[L,b,t]);const y=a.useCallback(B=>{l==null||l(B),!(B.defaultPrevented||T)&&S(t)},[T,l,S,t]),{handlePointerEnter:w,handlePointerLeave:P,handlePointerDown:k}=ij({motionRef:v,isDisabled:T,isSelected:R,onPointerEnter:d,onPointerLeave:f,onPointerDown:u}),j=qB({size:g,variant:h,isSelected:R,isDisabled:T,slotClass:_.tab,className:r});if(o&&a.isValidElement(n)){const B=n;return a.cloneElement(B,{...m,role:"tab",id:E,"data-tab-value":t,"aria-selected":O["aria-selected"],"aria-controls":O["aria-controls"],tabIndex:O.tabIndex,disabled:T||B.props.disabled,ref:D=>{N(D),B.props.ref&&ue(B.props.ref,D)},className:i.cn(B.props.className,ZB,r),onClick:D=>{var F,H;(H=(F=B.props).onClick)==null||H.call(F,D),y(D)},onPointerEnter:D=>{var F,H;(H=(F=B.props).onPointerEnter)==null||H.call(F,D),w(D)},onPointerLeave:D=>{var F,H;(H=(F=B.props).onPointerLeave)==null||H.call(F,D),P(D)},onPointerDown:D=>{var F,H;(H=(F=B.props).onPointerDown)==null||H.call(F,D),k(D)}})}return c.jsx("button",{ref:N,type:"button",role:"tab",id:E,"data-tab-value":t,"aria-selected":O["aria-selected"],"aria-controls":O["aria-controls"],tabIndex:O.tabIndex,disabled:O.disabled,className:j,onClick:y,onPointerEnter:w,onPointerLeave:P,onPointerDown:k,...m,children:c.jsx(q,{as:"span",inheritColor:!0,ref:v,variant:JB(g),className:QB(_.tabText),children:n})})});BC.displayName="TabsTab";const jC=a.forwardRef(function({value:t,children:n,className:o,...r},s){const{value:l,baseId:u}=gr(),d=$l(),f=l===t,m=PC(u,t),p=DC(u,t),C=zB({isSelected:f,tabId:m});return c.jsx("div",{ref:s,role:"tabpanel",id:p,"aria-labelledby":C["aria-labelledby"],hidden:C.hidden,tabIndex:C.tabIndex,className:ej({slotClass:d.panel,className:o}),...r,children:n})});jC.displayName="TabsPanel";const MC=a.forwardRef(function({className:t,children:n,onKeyDown:o,...r},s){const{value:l,setValue:u,orientation:d,variant:f,disabled:m,tabElementsRef:p,layoutEpoch:C}=gr(),S=$l(),g=a.useRef(null),h=a.useRef(null),x=f==="gloss",A=i.useMergedGlossPanelRef(s,x),b=a.useCallback(_=>{A(_),g.current=_},[A]);lj(g,h,l,d,f,p,C);const L=a.useCallback(_=>{if(o==null||o(_),_.defaultPrevented||m)return;const v=g.current;if(!v)return;const R=kC(v);if(R.length===0)return;const T=R.findIndex(y=>y===document.activeElement),E=d==="horizontal";let I=null;switch(_.key){case"ArrowRight":E&&(I=T<0?0:(T+1)%R.length);break;case"ArrowLeft":E&&(I=T<0?R.length-1:(T-1+R.length)%R.length);break;case"ArrowDown":E||(I=T<0?0:(T+1)%R.length);break;case"ArrowUp":E||(I=T<0?R.length-1:(T-1+R.length)%R.length);break;case"Home":I=0;break;case"End":I=R.length-1;break;default:return}if(I==null)return;_.preventDefault();const O=UB(v,I),N=O==null?void 0:O.dataset.tabValue;N&&u(N)},[m,o,d,u]);return c.jsxs("div",{ref:b,role:"tablist","aria-orientation":d,"aria-disabled":m||void 0,className:XB({orientation:d,variant:f,slotClass:S.list,className:t}),onKeyDown:L,...r,children:[c.jsx("span",{ref:h,"aria-hidden":!0,className:KB({variant:f,slotClass:S.indicator}),style:{left:0,top:0,width:0,height:0,opacity:0}}),n]})});MC.displayName="TabsList";function cj({value:e,defaultValue:t,onValueChange:n,orientation:o="horizontal",size:r="base",variant:s="default",disabled:l=!1}){const u=a.useId(),[d,f]=Re({value:e,defaultValue:t??""}),m=a.useRef(null);m.current||(m.current=new Map);const[p,C]=a.useState(0),S=a.useCallback(x=>{f(x),n==null||n(x)},[n,f]),g=a.useCallback(()=>{C(x=>x+1)},[]);return{contextValue:a.useMemo(()=>({value:d,setValue:S,orientation:o,size:r,variant:s,baseId:u,disabled:l,tabElementsRef:m,layoutEpoch:p,notifyTabLayout:g}),[d,S,o,r,s,u,l,m,p,g])}}const FC=a.forwardRef(function({children:t,className:n,classNames:o,value:r,defaultValue:s,onValueChange:l,orientation:u="horizontal",size:d="base",variant:f="default",disabled:m=!1,...p},C){const{contextValue:S}=cj({value:r,defaultValue:s,onValueChange:l,orientation:u,size:d,variant:f,disabled:m});return c.jsx(OC.Provider,{value:S,children:c.jsx(GB,{classNames:o,children:c.jsx("div",{ref:C,className:$B({orientation:S.orientation,slotClass:o==null?void 0:o.root,className:n}),"data-orientation":S.orientation,...p,children:t})})})});FC.displayName="Tabs";const uj=Object.assign(FC,{List:MC,Tab:BC,Panel:jC}),Xl=a.createContext(null),Ss=a.createContext({});function dj({value:e,children:t}){return c.jsx(Xl.Provider,{value:e,children:t})}function fj({classNames:e,children:t}){const n=a.useContext(Ss),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ss.Provider,{value:o,children:t})}function Sr(){const e=a.useContext(Xl);if(!e)throw new Error("Meter.* components must be inside <Meter>.");return e}function mj(){return a.useContext(Xl)}function nn(){return a.useContext(Ss)}function pj({fillTargetStyle:e,isHorizontal:t}){const n=a.useRef(null),o=a.useRef(!0),r=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{const s=n.current;if(s){if(r||o.current){o.current=!1,i.killMotion(s),s.style.width=e.width!=null?String(e.width):"",s.style.height=e.height!=null?String(e.height):"";return}i.killMotion(s),$.to(s,{...t?{width:e.width}:{height:e.height},...i.motionInteractive(),overwrite:"auto"})}},[e.height,e.width,t,r]),a.useEffect(()=>{const s=n.current;return()=>{s&&i.killMotion(s)}},[]),{fillRef:n}}const Cj={small:"h-small",base:"h-base",mid:"h-mid",large:"h-large"},gj={small:"w-small",base:"w-base",mid:"w-mid",large:"w-large"},Sj="relative overflow-hidden rounded-full bg-primary-tint",hj="w-full",xj="h-48",bj="absolute rounded-full",Aj="inset-y-0 left-0",vj="inset-x-0 bottom-0",Lj="bg-primary",_j="flex items-baseline justify-between gap-xsmall",Tj="w-full",Ej="min-w-[8rem]",Rj="tabular-nums text-muted";function Ij({orientation:e,slotClass:t,className:n}){return i.cn(Fl(e),t,n)}function yj({orientation:e,slotClass:t,className:n}){return i.cn(_j,e==="horizontal"?Tj:Ej,t,n)}function Nj({slotClass:e,className:t}){return i.cn(Rj,e,t)}function wj({isHorizontal:e,size:t,thickness:n,slotClass:o,className:r}){return i.cn(Sj,e?hj:xj,n==null&&(e?Cj[t]:gj[t]),o,r)}function Oj({isHorizontal:e,hasCustomColor:t,slotClass:n}){return i.cn(bj,e?Aj:vj,!t&&Lj,n)}function Pj({isHorizontal:e,thickness:t}){if(t==null)return;const n=qn(t);return e?{height:n}:{width:n}}function Dj(e){if(e)return{background:e}}function kj({isHorizontal:e,percent:t}){return e?{width:`${t}%`,height:"100%"}:{width:"100%",height:`${t}%`}}function Bj({isHorizontal:e,percent:t,fillColorStyle:n}){return{width:e?`${t}%`:"100%",height:e?"100%":`${t}%`,...n}}function HC(e,t,n){return Math.min(n,Math.max(t,e))}function jj(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function Mj(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Fj(e,t){return e===t?!0:e==null||t==null?!1:e.clampedValue===t.clampedValue&&e.statusText===t.statusText&&e.min===t.min&&e.max===t.max}function GC(e){return`${e}-label`}function Hj({clampedValue:e,min:t,max:n,statusText:o,labelConnected:r,labelId:s,ariaDescribedBy:l}){return{"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-valuetext":o,"aria-labelledby":r?s:void 0,"aria-describedby":l,"aria-label":r?void 0:o}}function Gj({ariaDescribedByProp:e,hintConnected:t,hintId:n,errorConnected:o,errorId:r}){return e??je(t?n:void 0,o?r:void 0)}function Vj({value:e,min:t=0,max:n=100,size:o="base",thickness:r,color:s,formatValue:l=Mj,orientation:u,"aria-describedby":d}){const f=mj(),m=u??(f==null?void 0:f.orientation)??"horizontal",p=f==null?void 0:f.meterId,C=p!=null?GC(p):void 0,S=(f==null?void 0:f.labelConnected)??!1,g=(f==null?void 0:f.hintConnected)??!1,h=(f==null?void 0:f.errorConnected)??!1,x=a.useMemo(()=>HC(e,t,n),[n,t,e]),A=a.useMemo(()=>jj(x,t,n),[x,n,t]),b=m==="horizontal",L=a.useMemo(()=>l(x),[x,l]),_=Gj({ariaDescribedByProp:d,hintConnected:g,hintId:f==null?void 0:f.hintId,errorConnected:h,errorId:f==null?void 0:f.errorId}),v=Hj({clampedValue:x,min:t,max:n,statusText:L,labelConnected:S,labelId:C,ariaDescribedBy:_}),R=a.useMemo(()=>Pj({isHorizontal:b,thickness:r}),[b,r]),T=a.useMemo(()=>Dj(s),[s]),E=a.useMemo(()=>kj({isHorizontal:b,percent:A}),[b,A]),I=a.useMemo(()=>Bj({isHorizontal:b,percent:A,fillColorStyle:T}),[T,b,A]),O=f==null?void 0:f.setDisplay;return a.useLayoutEffect(()=>{O==null||O({clampedValue:x,statusText:L,min:t,max:n})},[x,n,t,O,L]),{size:o,thickness:r,color:s,isHorizontal:b,percent:A,aria:v,trackCrossStyle:R,fillColorStyle:T,fillTargetStyle:E,fillInitialStyle:I}}function zj({label:e,showValue:t,valueText:n,hint:o,error:r,trackProps:s}){const l=nn(),u=e!=null||t||n!=null;return c.jsxs(c.Fragment,{children:[u?c.jsxs(Kl,{children:[e!=null?c.jsx(ve,{classNames:{root:l.label},children:e}):null,n!=null?c.jsx(jo,{children:n}):t?c.jsx(jo,{}):null]}):null,s.value!=null?c.jsx(Ql,{...s,value:s.value}):null,o!=null?c.jsx(ql,{children:o}):null,r!=null?c.jsx(Zl,{children:r}):null]})}function VC({className:e,classNames:t,...n}){const o=nn();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}VC.displayName="MeterLabel";function Kl({children:e,className:t,...n}){const{orientation:o}=Sr(),r=nn();return c.jsx("div",{className:yj({orientation:o,slotClass:r.header,className:t}),...n,children:e})}Kl.displayName="Meter.Header";function jo({children:e,className:t,...n}){const{display:o}=Sr(),r=nn(),s=e??(o==null?void 0:o.statusText);return s==null?null:c.jsx(q,{as:"span",variant:"base",className:Nj({slotClass:r.value,className:t}),...n,children:s})}jo.displayName="Meter.Value";function ql({children:e,className:t,id:n,...o}){const r=Sr(),s=nn();return c.jsx(le.Hint,{id:n??r.hintId,className:i.cn(s.hint,t),...o,children:e})}ql.displayName="Meter.Hint";function Zl({children:e,className:t,id:n,...o}){const r=Sr(),s=nn();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Zl.displayName="Meter.Error";const Ql=a.forwardRef(function({value:t,min:n,max:o,size:r,thickness:s,color:l,formatValue:u,orientation:d,className:f,"aria-describedby":m,...p},C){const S=nn(),{size:g,isHorizontal:h,aria:x,trackCrossStyle:A,fillTargetStyle:b,fillInitialStyle:L}=Vj({value:t,min:n,max:o,size:r,thickness:s,color:l,formatValue:u,orientation:d,"aria-describedby":m}),{fillRef:_}=pj({fillTargetStyle:b,isHorizontal:h});return c.jsx("div",{ref:C,role:"meter","aria-valuenow":x["aria-valuenow"],"aria-valuemin":x["aria-valuemin"],"aria-valuemax":x["aria-valuemax"],"aria-valuetext":x["aria-valuetext"],"aria-labelledby":x["aria-labelledby"],"aria-describedby":x["aria-describedby"],"aria-label":x["aria-label"],className:wj({isHorizontal:h,size:g??"base",thickness:s,slotClass:S.track,className:f}),style:A,...p,children:c.jsx("span",{ref:_,"aria-hidden":!0,className:Oj({isHorizontal:h,hasCustomColor:!!l,slotClass:S.fill}),style:L})})});Ql.displayName="Meter.Track";function Uj({children:e,id:t,orientation:n="horizontal",label:o,showValue:r,valueText:s,hint:l,error:u,value:d,min:f,max:m,size:p,thickness:C,color:S,formatValue:g}){const h=a.useId(),x=t??`meter-${h}`,A=Ve(x),b=ze(x),L=GC(x),[_,v]=a.useState(null),R=a.useCallback(P=>{v(k=>Fj(k,P)?k:P)},[]),{isCompound:T,hasLabel:E,hasHint:I,hasError:O}=a.useMemo(()=>{const P=Ue(e);return{isCompound:P,hasLabel:o!=null||P&&ge(e,"Label"),hasHint:l!=null||P&&ge(e,"Meter.Hint"),hasError:u!=null||P&&ge(e,"Meter.Error")}},[e,u,l,o]),N=a.useMemo(()=>({meterId:x,hintId:A,errorId:b,hintConnected:I,errorConnected:O,labelConnected:E,orientation:n,display:_,setDisplay:R}),[_,b,O,I,E,A,x,n,R]),y=a.useMemo(()=>({labelId:L}),[L]);return{meterId:x,isCompound:T,fieldCtx:N,fieldLabelCtx:y,trackProps:{value:d,min:f,max:m,size:p,thickness:C,color:S,formatValue:g,orientation:n},label:o,showValue:r,valueText:s,hint:l,error:u}}function zC({children:e,className:t,classNames:n,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,min:p,max:C,size:S,thickness:g,color:h,formatValue:x,...A}){const b=Uj({children:e,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,min:p,max:C,size:S,thickness:g,color:h,formatValue:x}),L=b.isCompound?e:c.jsx(zj,{label:b.label,showValue:b.showValue,valueText:b.valueText,hint:b.hint,error:b.error,trackProps:b.trackProps});return c.jsx(dj,{value:b.fieldCtx,children:c.jsx(fj,{classNames:n,children:c.jsx(Ge.Provider,{value:b.fieldLabelCtx,children:c.jsx(le,{id:b.meterId,className:Ij({orientation:b.fieldCtx.orientation,slotClass:n==null?void 0:n.root,className:t}),...A,children:L})})})})}zC.displayName="Meter";const Wj=Object.assign(zC,{Header:Kl,Label:VC,Value:jo,Hint:ql,Error:Zl,Track:Ql}),Jl=a.createContext(null),hs=a.createContext({});function Yj({value:e,children:t}){return c.jsx(Jl.Provider,{value:e,children:t})}function $j({classNames:e,children:t}){const n=a.useContext(hs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(hs.Provider,{value:o,children:t})}function hr(){const e=a.useContext(Jl);if(!e)throw new Error("ProgressBar.* components must be inside <ProgressBar>.");return e}function Xj(){return a.useContext(Jl)}function on(){return a.useContext(hs)}function Kj(e){return Number.isNaN(e)?0:Math.min(1,Math.max(0,e))}function qj({indeterminate:e,percent:t,isHorizontal:n}){const o=a.useRef(null),r=a.useRef(!0),s=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{if(e)return;const l=o.current;if(!l)return;const u=Kj(t/100),d=n?"left center":"bottom center",f=n?{scaleX:u,scaleY:1,x:0,y:0}:{scaleX:1,scaleY:u,x:0,y:0};l.style.width="100%",l.style.height="100%";const m=()=>{i.killMotion(l),$.set(l,{...f,transformOrigin:d})};if(s||!i.isMotionFeatureEnabled("enableProgressFill")||r.current){r.current=!1,m();return}r.current=!1,i.killMotion(l),i.setWillChangeTransform(l,!0),$.to(l,{...f,transformOrigin:d,...i.motionProgressFill(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(l)})},[e,n,t,s]),a.useLayoutEffect(()=>{if(!e)return;const l=o.current,u=l==null?void 0:l.parentElement;if(!l||!u)return;if(i.killMotion(l),s||!i.isMotionFeatureEnabled("enableProgressFill")){$.set(l,{clearProps:"transform"});return}const d=()=>{const m=n?u.offsetWidth:u.offsetHeight,p=n?l.offsetWidth:l.offsetHeight;m<=0||p<=0||(i.killMotion(l),i.setWillChangeTransform(l,!0),$.fromTo(l,n?{x:-p}:{y:p},{...n?{x:m}:{y:-m},...i.motionProgressIndeterminate(),repeat:-1,overwrite:"auto"}))};if(d(),typeof ResizeObserver>"u")return;const f=new ResizeObserver(()=>d());return f.observe(u),f.observe(l),()=>f.disconnect()},[e,n,s]),a.useEffect(()=>{const l=o.current;return()=>{l&&i.killMotion(l)}},[]),{fillRef:o,reduceMotion:s}}const Zj={small:"h-small",base:"h-base",mid:"h-mid",large:"h-large"},Qj={small:"w-small",base:"w-base",mid:"w-mid",large:"w-large"},Jj="relative overflow-hidden rounded-full bg-primary-tint",eM="w-full",tM="h-48",nM="absolute rounded-full",oM="inset-y-0 left-0",rM="inset-x-0 bottom-0",UC="bg-primary",sM="absolute rounded-full",aM="inset-y-0 left-0 w-1/4",lM="inset-x-0 bottom-0 h-1/4",iM="left-1/4 w-1/2",cM="bottom-1/4 h-1/2",uM="flex items-baseline justify-between gap-xsmall",dM="w-full",fM="min-w-[8rem]",mM="tabular-nums text-muted";function pM({orientation:e,slotClass:t,className:n}){return i.cn(Fl(e),t,n)}function CM({orientation:e,slotClass:t,className:n}){return i.cn(uM,e==="horizontal"?dM:fM,t,n)}function gM({slotClass:e,className:t}){return i.cn(mM,e,t)}function SM({isHorizontal:e,size:t,thickness:n,slotClass:o,className:r}){return i.cn(Jj,e?eM:tM,n==null&&(e?Zj[t]:Qj[t]),o,r)}function hM({isHorizontal:e,hasCustomColor:t,slotClass:n}){return i.cn(nM,e?oM:rM,!t&&UC,n)}function xM({isHorizontal:e,hasCustomColor:t,reduceMotion:n,slotClass:o}){return i.cn(sM,e?aM:lM,!t&&UC,n&&(e?iM:cM),o)}function bM({isHorizontal:e,thickness:t}){if(t==null)return;const n=qn(t);return e?{height:n}:{width:n}}function AM(e){if(e)return{background:e}}function vM({isHorizontal:e,fillColorStyle:t}){return{width:"100%",height:"100%",transformOrigin:e?"left center":"bottom center",...t}}function LM(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function _M(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function TM(e,t){return e===t?!0:e==null||t==null?!1:e.clampedValue===t.clampedValue&&e.statusText===t.statusText&&e.min===t.min&&e.max===t.max&&e.indeterminate===t.indeterminate}const EM="Loading…";function WC(e){return`${e}-label`}function RM({clampedValue:e,min:t,max:n,statusText:o,indeterminate:r,labelId:s,ariaDescribedBy:l}){return{"aria-valuenow":r?void 0:e,"aria-valuemin":r?void 0:t,"aria-valuemax":r?void 0:n,"aria-valuetext":o,"aria-busy":r||void 0,"aria-labelledby":s,"aria-describedby":l,"aria-label":s==null?o:void 0}}function IM({ariaDescribedByProp:e,hintConnected:t,hintId:n,errorConnected:o,errorId:r}){return e??je(t?n:void 0,o?r:void 0)}function yM({value:e=0,indeterminate:t=!1,min:n=0,max:o=100,size:r="base",thickness:s,color:l,formatValue:u=_M,orientation:d,"aria-describedby":f}){const m=Xj(),p=d??(m==null?void 0:m.orientation)??"horizontal",C=m==null?void 0:m.progressId,S=C!=null?WC(C):void 0,g=(m==null?void 0:m.hintConnected)??!1,h=(m==null?void 0:m.errorConnected)??!1,x=a.useMemo(()=>HC(e,n,o),[o,n,e]),A=a.useMemo(()=>LM(x,n,o),[x,o,n]),b=p==="horizontal",L=a.useMemo(()=>t?EM:u(x),[x,u,t]),_=IM({ariaDescribedByProp:f,hintConnected:g,hintId:m==null?void 0:m.hintId,errorConnected:h,errorId:m==null?void 0:m.errorId}),v=RM({clampedValue:x,min:n,max:o,statusText:L,indeterminate:t,labelId:S,ariaDescribedBy:_}),R=a.useMemo(()=>bM({isHorizontal:b,thickness:s}),[b,s]),T=a.useMemo(()=>AM(l),[l]),E=m==null?void 0:m.setDisplay;return a.useLayoutEffect(()=>{E==null||E({clampedValue:x,statusText:L,min:n,max:o,indeterminate:t})},[x,t,o,n,E,L]),{size:r,thickness:s,color:l,indeterminate:t,isHorizontal:b,percent:A,aria:v,trackCrossStyle:R,fillColorStyle:T}}function NM({label:e,showValue:t,valueText:n,hint:o,error:r,trackProps:s}){const l=on(),u=e!=null||t||n!=null;return c.jsxs(c.Fragment,{children:[u?c.jsxs(ei,{children:[e!=null?c.jsx(ve,{classNames:{root:l.label},children:e}):null,n!=null?c.jsx(Mo,{children:n}):t?c.jsx(Mo,{}):null]}):null,c.jsx(oi,{...s}),o!=null?c.jsx(ti,{children:o}):null,r!=null?c.jsx(ni,{children:r}):null]})}function YC({className:e,classNames:t,...n}){const o=on();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}YC.displayName="ProgressBarLabel";function ei({children:e,className:t,...n}){const{orientation:o}=hr(),r=on();return c.jsx("div",{className:CM({orientation:o,slotClass:r.header,className:t}),...n,children:e})}ei.displayName="ProgressBar.Header";function Mo({children:e,className:t,...n}){const{display:o}=hr(),r=on(),s=e??(o==null?void 0:o.statusText);return s==null?null:c.jsx(q,{as:"span",variant:"base",className:gM({slotClass:r.value,className:t}),...n,children:s})}Mo.displayName="ProgressBar.Value";function ti({children:e,className:t,id:n,...o}){const r=hr(),s=on();return c.jsx(le.Hint,{id:n??r.hintId,className:i.cn(s.hint,t),...o,children:e})}ti.displayName="ProgressBar.Hint";function ni({children:e,className:t,id:n,...o}){const r=hr(),s=on();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}ni.displayName="ProgressBar.Error";const oi=a.forwardRef(function({value:t,indeterminate:n,min:o,max:r,size:s,thickness:l,color:u,formatValue:d,orientation:f,className:m,"aria-describedby":p,...C},S){const g=on(),{size:h,indeterminate:x,isHorizontal:A,aria:b,trackCrossStyle:L,fillColorStyle:_,percent:v}=yM({value:t,indeterminate:n,min:o,max:r,size:s,thickness:l,color:u,formatValue:d,orientation:f,"aria-describedby":p}),{fillRef:R,reduceMotion:T}=qj({indeterminate:x,percent:v,isHorizontal:A});return c.jsx("div",{ref:S,role:"progressbar","aria-valuenow":b["aria-valuenow"],"aria-valuemin":b["aria-valuemin"],"aria-valuemax":b["aria-valuemax"],"aria-valuetext":b["aria-valuetext"],"aria-busy":b["aria-busy"],"aria-labelledby":b["aria-labelledby"],"aria-describedby":b["aria-describedby"],"aria-label":b["aria-label"],className:SM({isHorizontal:A,size:h??"base",thickness:l,slotClass:g.track,className:m}),style:L,...C,children:x?c.jsx("span",{ref:R,"aria-hidden":!0,className:xM({isHorizontal:A,hasCustomColor:!!u,reduceMotion:T,slotClass:g.indeterminateFill}),style:_}):c.jsx("span",{ref:R,"aria-hidden":!0,className:hM({isHorizontal:A,hasCustomColor:!!u,slotClass:g.fill}),style:vM({isHorizontal:A,fillColorStyle:_})})})});oi.displayName="ProgressBar.Track";function wM({children:e,id:t,orientation:n="horizontal",label:o,showValue:r,valueText:s,hint:l,error:u,value:d,indeterminate:f,min:m,max:p,size:C,thickness:S,color:g,formatValue:h}){const x=a.useId(),A=t??`progress-${x}`,b=Ve(A),L=ze(A),_=WC(A),[v,R]=a.useState(null),T=a.useCallback(P=>{R(k=>TM(k,P)?k:P)},[]),{isCompound:E,hasHint:I,hasError:O}=a.useMemo(()=>{const P=Ue(e);return{isCompound:P,hasHint:l!=null||P&&ge(e,"ProgressBar.Hint"),hasError:u!=null||P&&ge(e,"ProgressBar.Error")}},[e,u,l]),N=a.useMemo(()=>({progressId:A,hintId:b,errorId:L,hintConnected:I,errorConnected:O,orientation:n,display:v,setDisplay:T}),[v,L,O,I,b,n,A,T]),y=a.useMemo(()=>({labelId:_}),[_]);return{progressId:A,isCompound:E,fieldCtx:N,fieldLabelCtx:y,trackProps:{value:d,indeterminate:f,min:m,max:p,size:C,thickness:S,color:g,formatValue:h,orientation:n},label:o,showValue:r,valueText:s,hint:l,error:u}}function $C({children:e,className:t,classNames:n,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,indeterminate:p,min:C,max:S,size:g,thickness:h,color:x,formatValue:A,...b}){const L=wM({children:e,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,indeterminate:p,min:C,max:S,size:g,thickness:h,color:x,formatValue:A}),_=L.isCompound?e:c.jsx(NM,{label:L.label,showValue:L.showValue,valueText:L.valueText,hint:L.hint,error:L.error,trackProps:L.trackProps});return c.jsx(Yj,{value:L.fieldCtx,children:c.jsx($j,{classNames:n,children:c.jsx(Ge.Provider,{value:L.fieldLabelCtx,children:c.jsx(le,{id:L.progressId,className:pM({orientation:L.fieldCtx.orientation,slotClass:n==null?void 0:n.root,className:t}),...b,children:_})})})})}$C.displayName="ProgressBar";const OM=Object.assign($C,{Header:ei,Label:YC,Value:Mo,Hint:ti,Error:ni,Track:oi});function PM({pressable:e,isGloss:t,onPress:n,onClick:o,onKeyDown:r,onPointerDown:s,onPointerOver:l,onPointerOut:u,forwardedRef:d}){const f=a.useRef(null),m=a.useRef(!1),p=e&&t,C=a.useMemo(()=>i.createGlossInteractiveRefCallback(f,t),[t]),S=a.useCallback(v=>{C(v),f.current=v,ue(d,v)},[C,d]),g=i.useGlossInteractiveHandlers(f,p,{pointerInsideRef:m}),h=i.useSecondLevelShadowContainer(f,e&&!t,{pointerInsideRef:m});a.useEffect(()=>{if(e)return;const v=f.current;v&&i.killMotion(v),m.current=!1},[e]);const x=a.useCallback(v=>{if(s==null||s(v),!e||v.defaultPrevented||i.prefersReducedMotion())return;const R=f.current;if(R){if(t){i.animateGlossInteractivePressSqueeze(R,m.current);return}i.animateInteractivePressSqueeze(R,{pointerInside:m.current,shadow:h.shadow})}},[t,s,e,h.shadow]),A=a.useCallback(v=>{o==null||o(v),!(!e||v.defaultPrevented)&&(n==null||n(v))},[o,n,e]),b=a.useCallback(v=>{r==null||r(v)},[r]),L=a.useCallback(v=>{l==null||l(v),!(!e||v.defaultPrevented)&&(t?g.onPointerOver(v):h.onPointerOver(v))},[g,t,l,e,h]),_=a.useCallback(v=>{u==null||u(v),e&&(t?g.onPointerOut(v):h.onPointerOut(v))},[g,t,u,e,h]);return{setRootRef:S,pressableLiftMotionClass:h.motionClass,handlePointerDown:x,handleClick:A,handleKeyDown:b,onPointerOver:L,onPointerOut:_,onPointerDownProp:s,onClickProp:o,onKeyDownProp:r}}function DM(){return"h3"}const kM={default:"bg-surface border-token",outline:"bg-transparent border-token",secondary:"bg-secondary border-token"},BM="shadow-token-base",jM="gloss-panel flex min-w-0 flex-col text-foreground outline-none",MM="gloss-content flex min-w-0 flex-1 flex-col",FM="flex min-w-0 flex-col overflow-hidden text-foreground outline-none",HM="relative cursor-pointer focus-ring",mo="w-full border-0 p-0 text-left",GM="relative flex min-w-0 flex-1 flex-col",VM="flex shrink-0 flex-col text-left",zM="flex min-w-0 flex-1 flex-col text-left",UM="min-w-0",WM="min-w-0",YM="min-w-0 text-muted",$M="mt-auto border-t-token text-muted";function XM(e,t){return i.cn(jM,Ee(e).rounded,i.SURFACE_COLOR_TRANSITION,t)}function KM(e){return e?i.cn(i.GLOSS_INTERACTIVE_MOTION_CLASS,"cursor-pointer focus-ring"):""}function qM(e,t,n,o,r){return i.cn(FM,Ee(o).rounded,t&&i.cn(HM,n),i.SURFACE_COLOR_TRANSITION,kM[e],!t&&BM,r)}function ZM(e,t){const n=Ee(e);return i.cn(VM,n.headerPadding,n.headingGap,t)}function QM(e,t){return i.cn(zM,Ee(e).headingGap,t)}function JM(e,t){return i.cn(UM,Ee(e).bodyPadding,t)}function eF(e,t){return i.cn($M,Ee(e).footerPadding,t)}const xs=a.createContext({classNames:{},size:"base"});function tF({classNames:e,size:t,children:n}){const o=a.useContext(xs),r=Yc(t),s=a.useMemo(()=>({classNames:{...o.classNames,...e},size:r}),[e,o.classNames,r]);return c.jsx(xs.Provider,{value:s,children:n})}function XC(){return a.useContext(xs)}function rn(){return XC().classNames}function _n(){return XC().size}function nF({className:e="",...t}){const n=rn(),o=_n();return c.jsx("div",{className:ZM(o,i.cn(n.header,e)),...t})}function oF({className:e="",...t}){const n=rn(),o=_n();return c.jsx("div",{className:QM(o,i.cn(n.headingBlock,e)),...t})}function rF({className:e="",...t}){const n=rn(),o=_n();return c.jsx("div",{className:JM(o,i.cn(n.body,e)),...t})}const KC=a.forwardRef(function({className:t="",...n},o){const r=rn(),s=_n();return c.jsx(q,{ref:o,as:DM(),variant:Ee(s).titleVariant,className:i.cn(WM,Ee(s).titleClassName,r.title,t),...n})}),qC=a.forwardRef(function({className:t="",...n},o){const r=rn(),s=_n();return c.jsx(q,{ref:o,as:"p",variant:Ee(s).descVariant,className:i.cn(YM,r.description,t),...n})});function sF({className:e="",...t}){const n=rn(),o=_n();return c.jsx("div",{className:eF(o,i.cn(n.footer,e)),...t})}function aF({pressable:e,isGloss:t,renderAsButton:n,glossPanelClass:o,rootClassName:r,setRootRef:s,rest:l,children:u,onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C}){const S=rn();if(t){const g=c.jsx("div",{className:i.cn(MM,S.glossContent),children:u});return e?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,o,KM(e)),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:g}):n?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,o),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:g}):c.jsx("div",{...l,ref:s,className:o,onPointerOver:d,onPointerOut:f,children:g})}return e?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,r),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:c.jsx("div",{className:i.cn(GM,S.content),children:u})}):n?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,r),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:u}):c.jsx("div",{...l,ref:s,className:r,onPointerOver:d,onPointerOut:f,children:u})}KC.displayName="CardTitle";qC.displayName="CardDescription";function lF(e,t){return e||t}function iF(e){return!!(e.onClick||e.onKeyDown||e.onPointerDown)}function cF({variant:e="default",size:t,pressable:n=!1,onClick:o,onKeyDown:r,onPointerDown:s}){const l=Yc(t),u=e==="gloss",d=n&&u,f=lF(n,iF({onClick:o,onKeyDown:r,onPointerDown:s}));return{variant:e,size:l,pressable:n,isGloss:u,glossPressable:d,renderAsButton:f}}const ZC=a.forwardRef(function({className:t="",variant:n="default",size:o="base",pressable:r=!1,classNames:s,onPress:l,onPointerOver:u,onPointerOut:d,onPointerDown:f,onClick:m,onKeyDown:p,children:C,...S},g){const h=cF({variant:n,size:o,pressable:r,onClick:m,onKeyDown:p,onPointerDown:f}),x=PM({pressable:r,isGloss:h.isGloss,onPress:l,onClick:m,onKeyDown:p,onPointerDown:f,onPointerOver:u,onPointerOut:d,forwardedRef:g}),A=XM(h.size,i.cn(s==null?void 0:s.root,t)),b=h.isGloss?"":qM(h.variant,r,x.pressableLiftMotionClass,h.size,i.cn(s==null?void 0:s.root,t));return c.jsx(tF,{classNames:s,size:h.size,children:c.jsx(aF,{pressable:r,isGloss:h.isGloss,renderAsButton:h.renderAsButton,glossPanelClass:A,rootClassName:b,setRootRef:x.setRootRef,rest:S,onPointerOver:x.onPointerOver,onPointerOut:x.onPointerOut,onPointerDown:r?x.handlePointerDown:x.onPointerDownProp,onClick:r?x.handleClick:x.onClickProp,onKeyDown:r?x.handleKeyDown:x.onKeyDownProp,children:C})})});ZC.displayName="Card";const uF=Object.assign(ZC,{Header:nF,HeadingBlock:oF,Title:KC,Description:qC,Body:rF,Footer:sF}),QC=a.createContext(null),JC=a.createContext("top"),bs=a.createContext(null),As=a.createContext({});function dF({classNames:e,children:t}){const n=a.useContext(As),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(As.Provider,{value:o,children:t})}function Dt(){return a.useContext(As)}function ri(e){const t=a.useContext(QC);if(!t)throw new Error(`${e} must be used inside <Tooltip>.`);return t}function fF(){return a.useContext(JC)}function si(e){const t=a.useContext(bs);if(!t)throw new Error(`${e} must be inside <Tooltip.Panel> or <Tooltip.Content>.`);return t}function mF(e,t,n){return n?e?e.split(/\s+/).includes(t)?e:`${e} ${t}`:t:e}function Ec(e,t){return{onPointerEnter:n=>{var o,r;(o=e.onPointerEnter)==null||o.call(e,n),(r=t==null?void 0:t.onPointerEnter)==null||r.call(t,n)},onPointerLeave:n=>{var o,r;(o=e.onPointerLeave)==null||o.call(e,n),(r=t==null?void 0:t.onPointerLeave)==null||r.call(t,n)},onFocus:n=>{var o,r;(o=e.onFocus)==null||o.call(e,n),(r=t==null?void 0:t.onFocus)==null||r.call(t,n)},onBlur:n=>{var o,r;(o=e.onBlur)==null||o.call(e,n),(r=t==null?void 0:t.onBlur)==null||r.call(t,n)}}}const pF=new Set(["TooltipIndicator","TooltipIcon","TooltipTitle","TooltipDescription","TooltipMessage"]);function xr(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function CF(e){return xr(e,t=>t!=null&&pF.has(t))}function gF(e){return xr(e,t=>t==="TooltipTitle")}function SF(e){return xr(e,t=>t==="TooltipDescription")}function hF(e){return xr(e,t=>t==="TooltipIndicator"||t==="TooltipIcon")}function eg(e,t){for(const n of a.Children.toArray(e)){if(!a.isValidElement(n))continue;const o=n.type.displayName;(o==="TooltipIndicator"||o==="TooltipIcon")&&t(n.props),eg(n.props.children,t)}}function xF(e,t,n,o){return n===!1||o===null?!1:o!==void 0||t!=null?!0:e!=="default"}function bF(e,t,n,o){if(!hF(e))return!1;let r=!1;return eg(e,s=>{xF(t,n,s.showIcon??o,s.children)&&(r=!0)}),r}function AF(e,t,n,o,r){return n===!1?!1:o?bF(r,e,t,n):t!=null?!0:e!=="default"}function vF({status:e,icon:t,showIcon:n,title:o,description:r,isCompound:s,children:l}){const u=o!=null||(s?gF(l):l!=null&&r==null),d=r!=null||s&&SF(l);return{hasIndicator:AF(e,t,n,s,l),hasTitle:u,hasDescription:d,hasAction:!1,hasClose:!1}}function Rc(e){return e.type.displayName==="TooltipArrow"}function LF({open:e,portalMounted:t,setPortalMounted:n,tipRef:o}){a.useLayoutEffect(()=>{if(!t)return;const r=o.current;if(!r)return;const s=Rt();let l=!1;if(s)return i.killMotion(r),e?ar(r):n(!1),()=>{l=!0};if(i.killMotion(r),e)return lr({surface:r,vars:{...i.motionTooltip(),overwrite:"auto"}}),()=>{l=!0,i.killMotion(r)};const u=ir({surface:r,vars:{...i.motionTooltip(),overwrite:"auto"},onComplete:()=>{l||n(!1)}});return()=>{l=!0,i.killMotion(r),u.kill()}},[e,t,n,o])}const _F=8,TF={default:"border-token bg-surface text-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground",gloss:""},tg={small:"max-w-component-xsmall p-small",base:"max-w-component-small p-base",mid:"max-w-component-base p-mid",large:"max-w-component-mid p-large"},EF={small:"xsmall",base:"small",mid:"base",large:"mid"},RF={small:"xsmall",base:"xsmall",mid:"small",large:"base"},IF={small:"icon-small",base:"icon-base",mid:"icon-mid",large:"icon-large"},yF={small:"[&_svg]:icon-small",base:"[&_svg]:icon-base",mid:"[&_svg]:icon-mid",large:"[&_svg]:icon-large"},ai={default:"text-primary",danger:i.SEMANTIC_STATUS_TEXT.danger,success:i.SEMANTIC_STATUS_TEXT.success,info:i.SEMANTIC_STATUS_TEXT.info,warning:i.SEMANTIC_STATUS_TEXT.warning},ng={small:"gap-x-xsmall gap-y-0",base:"gap-x-small gap-y-xsmall",mid:"gap-x-base gap-y-xsmall",large:"gap-x-mid gap-y-small"},NF="inline-flex shrink-0 outline-none focus-ring",wF="inline-flex shrink-0 [&_svg]:shrink-0",OF="font-w-mid",PF="text-muted",DF="pointer-events-none absolute z-0 size-2 rotate-45",kF="border-0 bg-[var(--color-surface)]",BF={default:"bg-surface",outline:"bg-transparent",secondary:"bg-secondary"},jF="pointer-events-none z-tooltip w-max min-w-0 overflow-visible text-left outline-none",MF="relative overflow-visible",FF="gloss-panel gloss-deep relative z-[1] w-max min-w-0 origin-center overflow-hidden rounded-mid text-left text-foreground",HF="gloss-content",GF="contents",VF="relative z-[1] w-max min-w-0 rounded-mid text-left animate-shadow";function zF(e){return i.cn(OF,e!=="default"?ai[e]:"")}function UF(e,t,n){return i.cn(wF,ai[e],t,n)}function WF({size:e,slotClass:t,className:n}){return i.cn(FF,i.GLOSS_INTERACTIVE_MOTION_CLASS,tg[e],t,n)}function YF({gridSlots:e,size:t,slotClass:n}){return i.cn(gn(e,ng[t]),HF,n)}function $F({variant:e,size:t,gridSlots:n,slotClass:o,className:r}){return e==="gloss"?WF({size:t,slotClass:o,className:r}):i.cn(gn(n,ng[t]),VF,TF[e],tg[t],o,r)}function XF({variant:e,resolvedSide:t,slotClass:n,className:o}){const r=e==="gloss";return i.cn(DF,r?kF:BF[e],af[t],n,o)}function KF({resolvedSide:e,showArrow:t,slotClass:n,className:o}){return i.cn(jF,t&&lf[e],n,o)}function qF({status:e,size:t,showIcon:n,icon:o,children:r,iconClass:s}){if(r===null)return null;if(r!==void 0)return r;if(n===!1)return null;if(o!=null)return o;if(e==="default")return null;const l=qs[e];return c.jsx(l,{"aria-hidden":!0,className:i.cn("shrink-0",IF[t],ai[e],s)})}function ZF(e,t,n,o){return t!=null||n!=null?c.jsxs(c.Fragment,{children:[o.hasIndicator?c.jsx(cn,{}):null,t!=null?c.jsx(Fo,{children:t}):null,n!=null?c.jsx(li,{children:n}):null]}):e==null?null:typeof e=="string"||typeof e=="number"?c.jsxs(c.Fragment,{children:[o.hasIndicator?c.jsx(cn,{}):null,c.jsx(Fo,{children:e})]}):a.isValidElement(e)?c.jsxs(c.Fragment,{children:[o.hasIndicator?c.jsx(cn,{}):null,c.jsx("div",{className:Sn(o),children:e})]}):e}function cn({className:e,children:t,showIcon:n,...o}){const r=Dt(),{status:s,size:l,icon:u,showIcon:d,gridSlots:f}=si("Tooltip.Indicator"),m=qF({status:s,size:l,showIcon:n??d,icon:u,children:t,iconClass:r.icon});return m==null?null:c.jsx("span",{className:i.cn(UF(s,r.indicator,e),yF[l],Ft(f)),...o,children:m})}cn.displayName="TooltipIndicator";function og(e){return c.jsx(cn,{...e})}og.displayName="TooltipIcon";function rg({className:e,...t}){const n=Dt();return c.jsx("div",{className:i.cn(GF,n.message,e),...t})}rg.displayName="TooltipMessage";function Fo({className:e,...t}){const n=Dt(),{size:o,status:r,gridSlots:s}=si("Tooltip.Title");return c.jsx(q,{as:"div",variant:EF[o],className:i.cn(zF(r),Sn(s),n.title,e),...t})}Fo.displayName="TooltipTitle";function li({className:e,...t}){const n=Dt(),{size:o,gridSlots:r}=si("Tooltip.Description");return c.jsx(q,{as:"div",variant:RF[o],className:i.cn(PF,kn(r),n.description,e),...t})}li.displayName="TooltipDescription";function ii({variant:e="default",status:t="default",size:n="base",icon:o,showIcon:r,title:s,description:l,className:u,children:d,glossPanelRef:f,...m}){const p=Dt(),C=e==="gloss",S=d!=null&&CF(d),g=a.useMemo(()=>vF({status:t,icon:o,showIcon:r,title:s,description:l,isCompound:S,children:d}),[d,l,o,S,r,t,s]),h=a.useMemo(()=>({variant:e,status:t,size:n,icon:o,showIcon:r,gridSlots:g}),[g,o,r,n,t,e]),x=S?d:ZF(d,s,l,g),A=$F({variant:e,size:n,gridSlots:g,slotClass:C?i.cn(p.panel,p.glossPanel):p.panel,className:u});return C?c.jsx(bs.Provider,{value:h,children:c.jsx("div",{ref:f,className:A,...m,children:c.jsx("div",{className:YF({gridSlots:g,size:n,slotClass:p.glossContent}),children:x})})}):c.jsx(bs.Provider,{value:h,children:c.jsx("div",{className:A,...m,children:x})})}ii.displayName="TooltipPanel";const sg=a.forwardRef(function({asChild:t=!0,className:n,children:o,onPointerEnter:r,onPointerLeave:s,onFocus:l,onBlur:u,...d},f){const m=Dt(),{scheduleShow:p,hide:C,tooltipId:S,open:g,triggerRef:h}=ri("Tooltip.Trigger"),x=a.useMemo(()=>({onPointerEnter:()=>p(),onPointerLeave:()=>C(),onFocus:()=>p(),onBlur:()=>C()}),[C,p]),A=a.useCallback(L=>{h.current=L,typeof f=="function"?f(L):f&&(f.current=L)},[f,h]),b=a.Children.count(o)===1&&a.isValidElement(o)?o:null;if(t&&b){const L=b,_=L.props["aria-describedby"];return a.cloneElement(L,yt(L,{...d,...Ec(x,{onPointerEnter:r,onPointerLeave:s,onFocus:l,onBlur:u}),className:i.cn(m.root,m.trigger,n),"aria-describedby":mF(_,S,g)},A))}return c.jsx("span",{ref:A,className:i.cn(NF,m.root,m.trigger,n),"aria-describedby":g?S:void 0,tabIndex:d.tabIndex??0,...Ec(x,{onPointerEnter:r,onPointerLeave:s,onFocus:l,onBlur:u}),...d,children:o})});sg.displayName="TooltipTrigger";function ci({className:e,...t}){const n=Dt(),o=fF(),{variant:r}=ri("Tooltip.Arrow");return c.jsx("span",{"aria-hidden":!0,className:XF({variant:r,resolvedSide:o,slotClass:n.arrow,className:e}),...t})}ci.displayName="TooltipArrow";const ag=a.forwardRef(function({className:t,children:n,showArrow:o=!1,offset:r=_F,portalContainer:s,...l},u){const d=Dt(),{open:f,tooltipId:m,variant:p,status:C,size:S,side:g,icon:h,showIcon:x,triggerRef:A,portalContainer:b}=ri("Tooltip.Content"),L=a.useRef(null),_=a.useRef(null),v=p==="gloss",R=a.useMemo(()=>i.createGlossInteractiveRefCallback(_,v),[v]),[T,E]=a.useState(!1),[I,O]=a.useState(g);f&&!T&&E(!0);const N=a.useCallback(H=>{L.current=H,ue(u,H)},[u]),y=a.Children.toArray(n),w=y.find(H=>a.isValidElement(H)&&Rc(H)),P=y.filter(H=>!(a.isValidElement(H)&&Rc(H))),k=a.useCallback(()=>{const H=A.current,U=L.current;if(!H||!U)return;const G=sf(H.getBoundingClientRect(),U.getBoundingClientRect(),g,r);O(G.resolvedSide),rf(U,G,s??b),U.style.transform=""},[r,b,s,g,A]);if(i.usePersistentElShadow(L,!v,i.shadowBase),a.useLayoutEffect(()=>{if(!f||!T)return;k();const H=window.requestAnimationFrame(()=>k()),U=()=>k();window.addEventListener("scroll",U,!0),window.addEventListener("resize",U);const G=L.current,K=Ct(s??b),V=typeof ResizeObserver<"u"?new ResizeObserver(()=>k()):null;return G&&V&&V.observe(G),K&&K!==document.body&&V&&V.observe(K),()=>{window.cancelAnimationFrame(H),window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U),V==null||V.disconnect()}},[f,T,b,s,k,n,o,r]),LF({open:f,portalMounted:T,setPortalMounted:E,tipRef:L}),!T||typeof document>"u")return null;const j=Ct(s??b);if(!j)return null;const B=An(A.current),D=c.jsx(ii,{variant:p,status:C,size:S,icon:h,showIcon:x,glossPanelRef:R,children:P.length===1?P[0]:P}),F=c.jsx(JC.Provider,{value:I,children:c.jsx("div",{ref:N,...B,role:"tooltip",id:m,"data-side":I,className:KF({resolvedSide:I,showArrow:o,slotClass:d.content,className:t}),...l,children:c.jsxs("div",{className:MF,children:[o?w??c.jsx(ci,{}):null,D]})})});return Ut.createPortal(F,j)});ag.displayName="TooltipContent";function QF({size:e="base",variant:t="default",status:n="default",delayShowMs:o=240,side:r="top",icon:s,showIcon:l,portalContainer:u}){const[d,f]=a.useState(!1),m=a.useRef(null),p=a.useRef(null),C=a.useId(),S=a.useCallback(()=>{p.current!=null&&(clearTimeout(p.current),p.current=null)},[]),g=a.useCallback(()=>{S(),p.current=globalThis.setTimeout(()=>{p.current=null,f(!0)},o)},[S,o]),h=a.useCallback(()=>{S(),f(!1)},[S]);return a.useEffect(()=>()=>S(),[S]),a.useEffect(()=>{if(!d)return;const A=b=>{b.key==="Escape"&&h()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[h,d]),{contextValue:a.useMemo(()=>({open:d,tooltipId:C,variant:t,status:n,size:e,side:r,icon:s,showIcon:l,triggerRef:m,scheduleShow:g,hide:h,portalContainer:u}),[h,s,d,u,g,l,r,e,n,C,t])}}function lg({children:e,classNames:t,size:n="base",variant:o="default",status:r="default",delayShowMs:s=240,side:l="top",icon:u,showIcon:d,portalContainer:f}){const{contextValue:m}=QF({size:n,variant:o,status:r,delayShowMs:s,side:l,icon:u,showIcon:d,portalContainer:f});return c.jsx(dF,{classNames:t,children:c.jsx(QC.Provider,{value:m,children:e})})}lg.displayName="TooltipRoot";const bo=Object.assign(lg,{Trigger:sg,Content:ag,Arrow:ci,Panel:ii,Indicator:cn,Icon:og,Message:rg,Title:Fo,Description:li}),ig=a.createContext(null),vs=a.createContext({});function cg(e){const t=a.useContext(ig);if(!t)throw new Error(`${e} must be used inside <Avatar>`);return t}function ug({classNames:e,children:t}){const n=a.useContext(vs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(vs.Provider,{value:o,children:t})}function Tn(){return a.useContext(vs)}function JF(e){const t=e==null?void 0:e.trim();if(!t)return"?";const n=[...t][0];return n?n.toLocaleUpperCase():"?"}function eH(e){return e??"default"}function tH(e){return e??"base"}function nH(e){return(e==null?void 0:e.trim())||void 0}function oH(e){return!!(e!=null&&e.trim())}function rH(e){return e??"group"}function sH(e,t){const n=e==null?void 0:e.trim();return n||(t==null?void 0:t.trim())||void 0}function aH(){return"group"}const lH=!0,Ic=-10,yc=1.08;function iH(e,t){const n=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const o=t.current;if(!o)return;const r=n||!i.isMotionFeatureEnabled("enableContentFade");if(i.killMotion(o),r){$.set(o,{autoAlpha:e?1:0});return}$.to(o,{autoAlpha:e?1:0,...i.motionContentFade(),overwrite:"auto"})},[t,n,e])}function cH(e){const t=i.usePrefersReducedMotion(),n=a.useCallback(()=>{const r=e.current;if(r){if(i.killMotion(r),t){r.style.transform="";return}i.setWillChangeTransform(r,!0),$.to(r,{y:0,scale:1,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(r)})}},[t,e]),o=a.useCallback(()=>{const r=e.current;if(r){if(i.killMotion(r),t){r.style.transform=`translateY(${Ic}px) scale(${yc})`;return}i.setWillChangeTransform(r,!0),$.to(r,{y:Ic,scale:yc,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(r)})}},[t,e]);return a.useEffect(()=>{const r=e.current;return()=>{r&&i.killMotion(r)}},[e]),{applyLift:o,applyRest:n}}const Ls={small:{root:"avatar-size-small"},base:{root:"avatar-size-base"},mid:{root:"avatar-size-mid"},large:{root:"avatar-size-large"}},uH={small:{variant:"small",className:"font-w-strong uppercase"},base:{variant:"base",className:"font-w-strong uppercase"},mid:{variant:"mid",className:"font-w-strong uppercase"},large:{variant:"header-2",className:"font-w-strong uppercase"}};function dg(e,t,n){return i.cn("relative inline-flex shrink-0 select-none overflow-hidden text-left",t?i.cn("gloss-panel size-full rounded-full border-token",Ls[e].root):i.cn("rounded-full bg-surface border-token",Ls[e].root),!t&&n)}function dH(e,t){return i.cn("gloss-wrap inline-flex shrink-0 rounded-full",Ls[e].root,t)}const fH="gloss-shadow rounded-full";function mH(e,t){return i.cn("absolute inset-0 z-[1] size-full object-cover",!e&&"pointer-events-none",t)}function pH(e,t){return i.cn("absolute inset-0 z-0 flex items-center justify-center bg-primary-tint text-primary",e?"opacity-100":"pointer-events-none opacity-0",t)}function CH(e){return i.cn("flex flex-row flex-nowrap items-center text-left",e)}function gH(e,t){return i.cn("relative inline-flex",e>0&&"-ml-mid",t)}const SH="center bottom",ui=a.forwardRef(function({className:t="",onLoad:n,onError:o,...r},s){const{imageStatus:l,onImageLoad:u,onImageError:d}=cg("Avatar.Image"),f=Tn(),m=a.useRef(null),p=a.useCallback(h=>{m.current=h,typeof s=="function"?s(h):s&&(s.current=h)},[s]),C=a.useCallback(h=>{n==null||n(h),h.defaultPrevented||u()},[n,u]),S=a.useCallback(h=>{o==null||o(h),h.defaultPrevented||d()},[o,d]),g=l==="loaded";return iH(g,m),c.jsx("img",{ref:p,className:mH(g,i.cn(f.image,t)),alt:r.alt??"",onLoad:C,onError:S,...r})});ui.displayName="AvatarImage";const di=a.forwardRef(function({className:t="",children:n,...o},r){const{label:s,imageStatus:l,size:u}=cg("Avatar.Fallback"),d=Tn(),f=l!=="loaded",p=n!=null&&n!==!1&&n!==""?n:JF(s),C=uH[u];return c.jsx("span",{ref:r,className:pH(f,i.cn(d.fallback,t)),"aria-hidden":lH,...o,children:c.jsx(q,{as:"span",variant:C.variant,inheritColor:!0,className:C.className,children:p})})});di.displayName="AvatarFallback";function hH({src:e,alt:t="",loading:n}){return c.jsxs(c.Fragment,{children:[e?c.jsx(ui,{src:e,alt:t,loading:n}):null,c.jsx(di,{})]})}const fg=a.forwardRef(function({className:t="",classNames:n,children:o,...r},s){const l=Tn(),u=a.Children.toArray(o).filter(a.isValidElement);return c.jsx(ug,{classNames:n,children:c.jsx("div",{ref:s,role:aH(),className:CH(i.cn(l.group,t)),...r,children:u.map((d,f)=>c.jsx(xH,{stackIndex:f,children:d},d.key??f))})})});fg.displayName="AvatarGroup";function xH({stackIndex:e,children:t}){const n=a.useRef(null),o=Tn(),{applyLift:r,applyRest:s}=cH(n);return c.jsx("div",{ref:n,style:{transformOrigin:SH},className:gH(e,o.groupItem),onPointerEnter:r,onPointerLeave:s,children:t})}const mg=a.forwardRef(function({size:t,className:n,role:o,children:r,...s},l){const u=Tn();return c.jsx("div",{ref:l,role:o,className:dg(t,!1,i.cn(u.root,n)),...s,children:r})});mg.displayName="AvatarDefaultShell";const pg=a.forwardRef(function({size:t,className:n,role:o,children:r,...s},l){const u=Tn(),{"aria-label":d,...f}=s;return c.jsxs("div",{ref:l,className:dH(t,u.glossWrap),...f,children:[c.jsx("div",{className:fH,"aria-hidden":!0}),c.jsx("div",{role:o,className:dg(t,!0,i.cn(u.root,n)),"aria-label":d,children:r})]})});pg.displayName="AvatarGlossShell";function bH({variant:e,size:t,label:n,nickname:o,tooltipSize:r="base",tooltipVariant:s="default",tooltipStatus:l="default",tooltipSide:u="top",children:d,role:f,"aria-label":m}){const p=eH(e),C=tH(t),[S,g]=a.useState("idle"),h=a.useCallback(()=>{g("loaded")},[]),x=a.useCallback(()=>{g("error")},[]),A=a.useMemo(()=>({size:C,label:n,imageStatus:S,onImageLoad:h,onImageError:x}),[C,n,S,h,x]),b=a.useMemo(()=>Ue(d),[d]),L=oH(n),_=nH(o),v=p==="gloss",R=rH(f),T=sH(m,n);return{variant:p,size:C,ctx:A,isCompound:b,hasLabel:L,isGloss:v,rootRole:R,ariaLabel:T,tooltip:_?{size:r,variant:s,status:l,side:u,content:_}:null}}const Cg=a.forwardRef(function({variant:t,size:n,label:o,src:r,alt:s="",loading:l,nickname:u,tooltipSize:d="base",tooltipVariant:f="default",tooltipStatus:m="default",tooltipSide:p="top",classNames:C,className:S="",children:g,role:h,"aria-label":x,...A},b){const{size:L,ctx:_,isCompound:v,isGloss:R,rootRole:T,ariaLabel:E,tooltip:I}=bH({variant:t,size:n,label:o,nickname:u,tooltipSize:d,tooltipVariant:f,tooltipStatus:m,tooltipSide:p,children:g,role:h,"aria-label":x}),N={size:L,className:S,role:T,"aria-label":E,children:v?g:c.jsx(hH,{src:r,alt:s,loading:l}),...A},y=R?c.jsx(pg,{ref:b,...N}):c.jsx(mg,{ref:b,...N}),w=I?c.jsxs(bo,{size:I.size,variant:I.variant,side:I.side,children:[c.jsx(bo.Trigger,{children:y}),c.jsx(bo.Content,{children:I.content})]}):y;return c.jsx(ig.Provider,{value:_,children:c.jsx(ug,{classNames:C,children:w})})});Cg.displayName="AvatarRoot";const AH=Object.assign(Cg,{Image:ui,Fallback:di,Group:fg}),gg=a.createContext(!0),_s=a.createContext({});function vH({collapse:e,children:t}){return c.jsx(gg.Provider,{value:e,children:t})}function Sg(){return a.useContext(gg)}function hg({classNames:e,children:t}){const n=a.useContext(_s),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(_s.Provider,{value:o,children:t})}function En(){return a.useContext(_s)}function LH(e,t=Se.breadcrumbs){return e??t}function _H(e,t=Se.breadcrumbsShowHidden){return pn(t,{count:e})}function TH(e=Se.breadcrumbsHiddenSections){return e}const EH="Breadcrumbs.Item",RH="Breadcrumbs.List";function xg(e){if(a.isValidElement(e))return e.type.displayName}function bg(e){return a.isValidElement(e)?e.props.children:null}function Ag(e,t){return a.Children.toArray(e).some(n=>a.isValidElement(n)?xg(n)===t?!0:Ag(bg(n),t):!1)}function vg(e,t){a.Children.forEach(e,n=>{if(a.isValidElement(n)){if(xg(n)===EH){const o=n.props;t.push({label:o.children,href:o.href,onClick:o.onClick,current:o.current,className:o.className});return}vg(bg(n),t)}})}function IH(e){return Ag(e,RH)}function yH(e){const t=[];return vg(e,t),t}function NH(e){return e.length<=3?[]:e.slice(1,-2)}function wH(e){const t=e.length;return t===0?[]:t<=3?e.map((n,o)=>({kind:"segment",item:n,isLast:n.current??o===t-1})):[{kind:"segment",item:e[0],isLast:!1},{kind:"ellipsis",hiddenItems:NH(e)},{kind:"segment",item:e[t-2],isLast:!1},{kind:"segment",item:e[t-1],isLast:!0}]}function OH(e){return e.map((t,n)=>({kind:"segment",item:t,isLast:t.current??n===e.length-1}))}function PH(e,t){if(e.kind==="ellipsis")return"ellipsis";const n=e.item.label;return`segment-${t}-${typeof n=="string"?n:t}`}function Lg(){const e=a.useRef(null),{handlePointerDown:t}=xt({isDisabled:!1,enabled:!0,textMotionRef:e});return{textRef:e,handlePointerDown:t}}const _g=i.cn("inline-flex max-w-[min(12rem,46vw)] min-w-0 cursor-pointer truncate rounded-mid px-xsmall py-xsmall text-muted no-underline outline-none focus-ring",i.TEXT_COLOR_TRANSITION,"hover:text-foreground"),DH=i.cn(_g,"border-0 bg-transparent font-[inherit]"),kH=i.cn("inline-flex min-w-0 cursor-pointer rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted outline-none focus-ring",i.TEXT_COLOR_TRANSITION,"hover:text-foreground aria-expanded:text-foreground");function BH(e){return i.cn("m-0 flex list-none flex-wrap items-center gap-xsmall gap-y-xsmall p-0 text-left",e)}function jH(e){return i.cn(e)}function MH(e){return i.cn("flex items-center gap-xsmall",e)}function FH(e){return i.cn("min-w-0 max-w-[min(14rem,50vw)] truncate px-xsmall py-xsmall font-w-mid text-foreground",e)}function HH(e){return i.cn("max-w-[min(12rem,46vw)] truncate px-xsmall py-xsmall text-muted",e)}function Tg(e){return i.cn("shrink-0 text-muted opacity-75 icon-small",e)}function GH(e){return i.cn(_g,e)}function VH(e){return i.cn(DH,e)}function zH(e){return i.cn("inline-flex min-w-0",e)}function Nc(e){return i.cn("inline-flex origin-center min-w-0 truncate",e)}function UH(e){return i.cn(kH,e)}function WH(e){return i.cn("inline-flex origin-center",e)}function YH(e){return i.cn("tabular-nums",e)}function $H(e){return i.cn("text-small",e)}function XH(e){return i.cn("p-small",e)}function KH(e){return i.cn("inline-flex",e)}function Eg(e){const t=Sg();return a.useMemo(()=>t?wH(e):OH(e),[t,e])}function qH({children:e}={}){return{isCompound:IH(e)}}function ZH(e){const t=Sg(),n=a.useMemo(()=>yH(e),[e]),o=Eg(n);return{collapse:t,items:n,pieces:o}}function QH(e){return{pieces:Eg(e)}}function Rg(e){return null}Rg.displayName="Breadcrumbs.Item";const Ig=a.forwardRef(function({className:t,classNames:n,children:o,...r},s){const{pieces:l}=ZH(o);return c.jsx(hg,{classNames:n,children:c.jsx(fi,{ref:s,pieces:l,className:t,...r})})});Ig.displayName="Breadcrumbs.List";const fi=a.forwardRef(function({pieces:t,className:n,...o},r){const s=En();return c.jsx("ol",{ref:r,className:BH(i.cn("",s.list,n)),...o,children:t.map((l,u)=>c.jsx(JH,{piece:l,showSeparator:u>0},PH(l,u)))})});fi.displayName="BreadcrumbsPiecesList";function JH({piece:e,showSeparator:t}){const n=En();return c.jsxs("li",{className:MH(n.item),children:[t?c.jsx(tG,{}):null,e.kind==="ellipsis"?c.jsx(nG,{hiddenItems:e.hiddenItems}):c.jsx(eG,{piece:e})]})}function yg({className:e,iconClassName:t,...n}){const o=En();return c.jsx("span",{className:KH(i.cn("",o.separatorWrapper,e)),...n,children:c.jsx(be.IoChevronForward,{className:Tg(i.cn("",o.separator,t)),"aria-hidden":!0})})}yg.displayName="Breadcrumbs.Separator";function eG({piece:e}){const t=En(),{item:n,isLast:o}=e;return o?c.jsx(q,{as:"span",variant:"small","aria-current":"page",className:FH(i.cn("",t.itemCurrent,n.className)),children:n.label}):n.href||n.onClick?c.jsx(Ng,{href:n.href,onClick:n.onClick,className:t.itemLinkWrapper,innerClassName:i.cn("",t.itemLink,n.className),textClassName:t.itemLinkText,children:n.label}):c.jsx(q,{as:"span",variant:"small",className:HH(i.cn("",t.itemStatic,n.className)),children:n.label})}function tG(){const e=En();return c.jsx(be.IoChevronForward,{className:Tg(e.separator),"aria-hidden":!0})}const Ng=a.forwardRef(function({href:t,onClick:n,children:o,className:r="",innerClassName:s,textClassName:l,"aria-current":u},d){const{textRef:f,handlePointerDown:m}=Lg(),p=a.useCallback(S=>{f.current=S,ue(d,S)},[d,f]),C=t?GH(s):VH(s);return c.jsx("span",{className:zH(r),children:t?c.jsx("a",{href:t,onClick:n,"aria-current":u,className:C,onPointerDown:m,children:c.jsx(q,{ref:p,variant:"small",inheritColor:!0,as:"span",className:Nc(l),children:o})}):c.jsx("button",{type:"button",onClick:n,"aria-current":u,className:C,onPointerDown:m,children:c.jsx(q,{ref:p,variant:"small",inheritColor:!0,as:"span",className:Nc(l),children:o})})})});Ng.displayName="BreadcrumbsInteractiveCrumb";function nG({hiddenItems:e}){const t=En(),n=Ie(),o=e.length,{textRef:r,handlePointerDown:s}=Lg();return o===0?null:c.jsxs(Gt,{children:[c.jsx(Gt.Trigger,{"aria-label":_H(o,n.breadcrumbsShowHidden),className:UH(t.ellipsisTrigger),onPointerDown:s,children:c.jsx("span",{ref:r,className:WH(t.ellipsisLiftWrapper),children:c.jsx(q,{as:"span",variant:"small",className:YH(t.ellipsisText),children:"…"})})}),c.jsx(Gt.Popover,{"aria-label":TH(n.breadcrumbsHiddenSections),bodyClassName:XH(t.ellipsisPopover),children:e.map(l=>{const u=l.href??`hidden-${String(l.label)}`;return c.jsx(oG,{item:l,className:$H(i.cn("",t.dropdownItem,l.className))},u)})})]})}function oG({item:e,className:t}){const n=e.href??`hidden-${String(e.label)}`;return e.href?c.jsx(Gt.Item,{href:e.href,selection:!1,onClick:e.onClick,className:t,children:e.label}):c.jsx(Gt.Item,{value:n,selection:!1,onClick:e.onClick,className:t,children:e.label})}function rG({items:e,className:t,...n}){const{pieces:o}=QH(e);return c.jsx(fi,{pieces:o,className:t,...n})}const wg=a.forwardRef(function({collapse:t=!0,className:n,classNames:o,items:r,children:s,"aria-label":l,...u},d){const{isCompound:f}=qH({children:s}),m=St("breadcrumbs");return c.jsx(vH,{collapse:t,children:c.jsx(hg,{classNames:o,children:c.jsx("nav",{ref:d,"aria-label":LH(l,m),className:jH(i.cn("",o==null?void 0:o.root,n)),...u,children:f?s:r!=null?c.jsx(rG,{items:r}):s})})})});wg.displayName="Breadcrumbs";const sG=Object.assign(wg,{List:Ig,Item:Rg,Separator:yg}),mi=a.createContext(null),Ts=a.createContext({});function aG({value:e,children:t}){return c.jsx(mi.Provider,{value:e,children:t})}function lG({classNames:e,children:t}){const n=a.useContext(Ts),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ts.Provider,{value:o,children:t})}function iG(){const e=a.useContext(mi);if(!e)throw new Error("Pagination components must be inside <Pagination>.");return e}function br(){return a.useContext(mi)}function st(){return a.useContext(Ts)}const cG=!0,Og=!0;function uG(e,t=Se.pagination){return e??t}function dG({ariaLabel:e,children:t,pageNumber:n,pageTemplate:o=Se.paginationPage}){if(e!=null)return e;if(t!=null)return pn(o,{n})}function fG(e,t,n){if(t<=0)return[];if(t===1)return[1];if(t<=7)return Array.from({length:t},(l,u)=>u+1);const o=Math.max(e-n,2),r=Math.min(e+n,t-1),s=[1];if(o>2)s.push("ellipsis");else for(let l=2;l<o;l++)s.push(l);for(let l=o;l<=r;l++)s.push(l);if(r<t-1)s.push("ellipsis");else for(let l=r+1;l<t;l++)s.push(l);return s.push(t),s}function mG({disabled:e,page:t}){return e??(t!=null?t<=1:!1)}function pG({disabled:e,page:t,totalPages:n}){return e??(t!=null&&n!=null?t>=n:!1)}function CG(e,{page:t,totalPages:n,siblingCount:o,children:r}){const s=a.useRef(null);s.current||(s.current=new Map);const l=a.useRef(!0),u=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const d=e.current;if(!d)return;const f=Array.from(d.children).filter(h=>h instanceof HTMLElement);let m=0;const p=h=>h.dataset.flipKey??`__keyless_${m++}`,C=u||!i.isMotionFeatureEnabled("enablePaginationFlip"),S=new Map,g=s.current;for(const h of f){const x=p(h),A=h.getBoundingClientRect(),b={x:A.left,y:A.top};if(S.set(x,b),C||l.current)continue;const L=g.get(x);if(L){const _=L.x-b.x;Math.abs(_)>.5&&(i.killMotion(h),i.setWillChangeTransform(h,!0),$.fromTo(h,{x:_},{x:0,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(h)}))}else i.killMotion(h),i.setWillChangeTransform(h,!0),$.fromTo(h,{autoAlpha:0,scale:.82},{autoAlpha:1,scale:1,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(h)})}s.current=S,l.current=!1},[e,u,t,n,o,r]),a.useLayoutEffect(()=>{const d=e.current;return()=>{if(d)for(const f of Array.from(d.children))f instanceof HTMLElement&&i.killMotion(f)}},[e])}function gG(e,t){const n=a.useRef(null),o=a.useCallback(r=>{n.current=r,ue(e,r)},[e]);return CG(n,t),{olRef:n,setRefs:o}}const SG="flex w-full min-w-0 flex-wrap items-center justify-between gap-xsmall gap-y-xsmall text-left",hG="flex min-w-0 flex-1 basis-component-xsmall",xG="min-w-0 truncate text-muted",bG="m-0 ms-auto flex max-w-full min-w-0 list-none flex-nowrap items-center justify-start gap-xsmall overflow-x-auto overscroll-x-contain p-0",AG="flex shrink-0 items-center",vG="inline-flex min-w-0 origin-center cursor-pointer items-center justify-center gap-xsmall rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted no-underline outline-none hover:text-foreground focus-ring disabled:cursor-not-allowed disabled:opacity-48 disabled:hover:text-muted disabled:hover:bg-transparent motion-reduce:animate-none",LG="inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall font-w-mid text-foreground tabular-nums text-base",_G="min-w-[length:var(--size-scale-2xlarge)] tabular-nums",TG="inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall text-muted tabular-nums",EG="",RG="shrink-0 icon-small opacity-75",IG="shrink-0 icon-small opacity-75";function yG({slotClass:e,className:t}){return i.cn(SG,e,t)}function NG({slotClass:e,className:t}){return i.cn(hG,e,t)}function wG({slotClass:e,className:t}){return i.cn(xG,e,t)}function OG({slotClass:e,className:t}){return i.cn(bG,e,t)}function PG({slotClass:e,className:t}){return i.cn(AG,e,t)}function DG({slotClass:e,className:t}){return i.cn(vG,i.hoverVariant(),e,t)}function kG({slotClass:e,className:t}){return i.cn(LG,e,t)}function BG({slotClass:e,className:t}){return i.cn(_G,e,t)}function jG({slotClass:e,className:t}){return i.cn(TG,e,t)}function Pg({slotClass:e,className:t}){return i.cn(EG,e,t)}function MG({slotClass:e,className:t}){return i.cn(RG,e,t)}function FG({slotClass:e,className:t}){return i.cn(IG,e,t)}const Dg=a.forwardRef(function({children:t,className:n,page:o,totalPages:r,onPageChange:s,siblingCount:l,"aria-label":u,...d},f){const m=st();return c.jsx("nav",{ref:f,"aria-label":u,className:yG({slotClass:m.root,className:n}),...d,children:t})});Dg.displayName="Pagination";const Ar=a.forwardRef(function({children:t,className:n,disabled:o,onPointerDown:r,...s},l){const u=a.useRef(null),d=a.useCallback(m=>{u.current=m,ue(l,m)},[l]),{handlePointerDown:f}=xt({isDisabled:!!o,enabled:!o,textMotionRef:u,onPointerDown:r});return c.jsx("button",{ref:d,type:"button",disabled:o,className:DG({className:n}),onPointerDown:f,...s,children:t})});Ar.displayName="PaginationInteractive";const kg=a.forwardRef(function({className:t,children:n,...o},r){const s=st();return c.jsx("div",{ref:r,className:NG({slotClass:s.summary,className:t}),...o,children:c.jsx(q,{as:"span",variant:"small",className:wG({slotClass:s.summaryText}),children:n})})});kg.displayName="Pagination.Summary";const Bg=a.forwardRef(function({className:t,children:n,...o},r){const s=st(),l=br(),{setRefs:u}=gG(r,{page:l==null?void 0:l.page,totalPages:l==null?void 0:l.totalPages,siblingCount:l==null?void 0:l.siblingCount,children:n});return c.jsx("ol",{ref:u,className:OG({slotClass:s.content,className:t}),...o,children:n})});Bg.displayName="Pagination.Content";const Ho=a.forwardRef(function({className:t,children:n,...o},r){const s=st();return c.jsx("li",{ref:r,className:PG({slotClass:s.item,className:t}),...o,children:n})});Ho.displayName="Pagination.Item";const jg=a.forwardRef(function({disabled:t,onClick:n,children:o,className:r,"aria-label":s,...l},u){const d=Ie(),f=br(),m=st(),p=f==null?void 0:f.page,C=mG({disabled:t,page:p}),S=a.useCallback(g=>{n==null||n(g),!(g.defaultPrevented||C)&&f!=null&&f.onPageChange&&p!=null&&p>1&&f.onPageChange(p-1)},[f,n,p,C]);return c.jsx(Ar,{ref:u,disabled:C,className:i.cn(m.previous,r),...s!=null?{"aria-label":s}:{},onClick:S,...l,children:o??c.jsxs(c.Fragment,{children:[c.jsx(pi,{}),c.jsx(q,{variant:"small",inheritColor:!0,as:"span",className:Pg({slotClass:m.previousText}),children:d.paginationPrevious})]})})});jg.displayName="Pagination.Previous";const Mg=a.forwardRef(function({disabled:t,onClick:n,children:o,className:r,"aria-label":s,...l},u){const d=Ie(),f=br(),m=st(),p=f==null?void 0:f.page,C=f==null?void 0:f.totalPages,S=pG({disabled:t,page:p,totalPages:C}),g=a.useCallback(h=>{n==null||n(h),!(h.defaultPrevented||S)&&f!=null&&f.onPageChange&&p!=null&&C!=null&&p<C&&f.onPageChange(p+1)},[f,n,p,S,C]);return c.jsx(Ar,{ref:u,disabled:S,className:i.cn(m.next,r),...s!=null?{"aria-label":s}:{},onClick:g,...l,children:o??c.jsxs(c.Fragment,{children:[c.jsx(q,{variant:"small",inheritColor:!0,as:"span",className:Pg({slotClass:m.nextText}),children:d.paginationNext}),c.jsx(Ci,{})]})})});Mg.displayName="Pagination.Next";const HG=be.IoChevronBack,GG=be.IoChevronForward,pi=a.forwardRef(function({className:t,...n},o){const r=st();return c.jsx(HG,{ref:o,"aria-hidden":Og,className:MG({slotClass:r.previousIcon,className:t}),...n})});pi.displayName="Pagination.PreviousIcon";const Ci=a.forwardRef(function({className:t,...n},o){const r=st();return c.jsx(GG,{ref:o,"aria-hidden":Og,className:FG({slotClass:r.nextIcon,className:t}),...n})});Ci.displayName="Pagination.NextIcon";const gi=a.forwardRef(function({page:t,active:n,children:o,onClick:r,className:s,"aria-label":l,...u},d){const f=Ie(),m=br(),p=st(),C=n??((m==null?void 0:m.page)!=null?m.page===t:!1),S=a.useCallback(x=>{var A;r==null||r(x),!(x.defaultPrevented||C)&&((A=m==null?void 0:m.onPageChange)==null||A.call(m,t))},[C,m,r,t]),g=o??t;if(C)return c.jsx(q,{ref:d,as:"span",variant:"small","aria-current":"page",className:kG({slotClass:p.pageActive,className:s}),onClick:r,...l!=null?{"aria-label":l}:{},...u,children:g});const h=dG({ariaLabel:l,children:o,pageNumber:t,pageTemplate:f.paginationPage});return c.jsx(Ar,{ref:d,...h!=null?{"aria-label":h}:{},onClick:S,className:i.cn(p.page,s),...u,children:c.jsx(q,{variant:"small",inheritColor:!0,as:"span",className:BG({slotClass:p.pageText}),children:g})})});gi.displayName="Pagination.Page";const Si=a.forwardRef(function({className:t,children:n,...o},r){const s=st();return c.jsx(q,{ref:r,as:"span",variant:"small","aria-hidden":cG,className:jG({slotClass:s.ellipsis,className:t}),...o,children:n??"…"})});Si.displayName="Pagination.Ellipsis";function Fg(){const{page:e,totalPages:t,siblingCount:n}=iG();if(e==null||t==null)throw new Error("Pagination.Pages requires `page` and `totalPages` on the root <Pagination>.");const o=a.useMemo(()=>fG(e,t,n),[e,n,t]);let r=0;return c.jsx(c.Fragment,{children:o.map(s=>{if(s==="ellipsis"){const l=r===0?"left":"right";r+=1;const u=`ellipsis-${l}`;return c.jsx(Ho,{"data-flip-key":u,children:c.jsx(Si,{})},u)}return c.jsx(Ho,{"data-flip-key":`page-${s}`,children:c.jsx(gi,{page:s})},s)})})}Fg.displayName="Pagination.Pages";function VG({page:e,defaultPage:t,totalPages:n,onPageChange:o,siblingCount:r=1,"aria-label":s}){const l=St("pagination"),[u,d]=Re({value:e,defaultValue:t,onChange:o?p=>{p!==void 0&&o(p)}:void 0}),f=a.useCallback(p=>{d(p)},[d]);return{contextValue:a.useMemo(()=>({page:u,totalPages:n,onPageChange:f,siblingCount:r}),[u,f,r,n]),ariaLabel:uG(s,l)}}const Hg=a.forwardRef(function({children:t,className:n,classNames:o,page:r,defaultPage:s,totalPages:l,onPageChange:u,siblingCount:d,"aria-label":f,...m},p){const{contextValue:C,ariaLabel:S}=VG({page:r,defaultPage:s,totalPages:l,onPageChange:u,siblingCount:d,"aria-label":f});return c.jsx(aG,{value:C,children:c.jsx(lG,{classNames:o,children:c.jsx(Dg,{ref:p,className:n,page:r,totalPages:l,onPageChange:u,siblingCount:d,"aria-label":S,...m,children:t})})})});Hg.displayName="Pagination";const zG=Object.assign(Hg,{Summary:kg,Content:Bg,Item:Ho,Previous:jg,Next:Mg,PreviousIcon:pi,NextIcon:Ci,Page:gi,Pages:Fg,Ellipsis:Si}),UG={default:"bg-surface",secondary:"bg-secondary",tertiary:"bg-tertiary"},WG={none:"",base:"shadow-token-base",mid:"shadow-token-mid",large:"shadow-token-large"},YG={none:"",small:"p-small",base:"p-base",mid:"p-mid",large:"p-large"},$G={base:"rounded-base",mid:"rounded-mid",large:"rounded-large"},XG="min-w-0 text-left text-foreground",KG="gloss-panel min-w-0 text-left text-foreground",qG="gloss-content";function ZG({variant:e,shadow:t,padding:n,radius:o,className:r}){const s=e==="gloss";return i.cn(s?KG:XG,!s&&UG[e],$G[o],WG[t],YG[n],r)}const Gg=a.forwardRef(function({className:t="",classNames:n,variant:o="default",shadow:r="none",padding:s="none",radius:l="mid",children:u,...d},f){const m=i.useMergedGlossPanelRef(f,o==="gloss"),p=ZG({variant:o,shadow:r,padding:s,radius:l,className:i.cn(n==null?void 0:n.root,t)}),C=void 0;return o==="gloss"?c.jsx("div",{ref:m,role:C,className:p,...d,children:c.jsx("div",{className:i.cn(qG,n==null?void 0:n.glossContent),children:u})}):c.jsx("div",{ref:f,role:C,className:p,...d,children:u})});Gg.displayName="Surface";const Vg=a.createContext(null),zg=a.createContext(!1),Es=a.createContext({});function QG(){return a.useContext(Vg)}function JG({value:e,children:t}){return c.jsx(Vg.Provider,{value:e,children:t})}function e1(){return a.useContext(zg)}function t1({children:e}){return c.jsx(zg.Provider,{value:!0,children:e})}function Ug({classNames:e,children:t}){const n=a.useContext(Es),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Es.Provider,{value:o,children:t})}function vr(){return a.useContext(Es)}function n1({variant:e,hoverLift:t=!0,forwardedRef:n,isDirectAnchorChild:o,placement:r,onPointerOver:s,onPointerOut:l,syncDeps:u}){const d=QG(),f=a.useRef(null),m=a.useRef(null),p=e==="gloss",C=!!(o&&(d!=null&&d.hoverLift)&&!p),S=t&&!C,g=a.useMemo(()=>i.createGlossInteractiveRefCallback(f,S&&p),[p,S]),h=i.useGlossInteractiveHandlers(f,S&&p),x=i.useSecondLevelShadow(f,S&&!p),A=a.useMemo(()=>({onPointerOver:N=>{s==null||s(N),!N.defaultPrevented&&S&&(p?h.onPointerOver(N):x.onPointerEnter(N))},onPointerOut:N=>{l==null||l(N),S&&(p?h.onPointerOut(N):x.onPointerLeave(N))}}),[h.onPointerOut,h.onPointerOver,p,l,s,S,x.onPointerEnter,x.onPointerLeave]),b=S?p?i.GLOSS_INTERACTIVE_MOTION_CLASS:x.motionClass:"",L=C&&!p?i.SHADOW_LIFT_MOTION_CLASS:"",_=a.useCallback(()=>{if(!d||!o||!d.hoverLift){d==null||d.registerLiftTarget(null);return}d.registerLiftTarget(m.current)},[o,d]),v=a.useCallback(N=>{g(N),f.current=N,N===null&&(d==null||d.registerLiftTarget(null)),ue(n,N)},[g,n,d]),{meaningChild:R,icon:T,dot:E,iconOnly:I,children:O}=u;return a.useLayoutEffect(()=>{_(),queueMicrotask(()=>{_()})},[o,d==null?void 0:d.anchorCommitGen,d==null?void 0:d.hoverLift,r,_,R,T,E,I,O]),{isGloss:p,splitLift:C,selfLiftEnabled:S,innerLiftRef:m,setMergedRef:v,pointerHandlers:A,selfLiftMotionCls:b,splitLiftMotionCls:L}}function o1(e,t){return i.useSecondLevelShadowContainer(e,t,{liftScale:i.getMotionConfig().badgeAnchorHoverLiftScale})}function r1(e,t){e&&t&&i.initElementShadow(e,i.shadowBase())}function s1(e){return typeof e["aria-label"]=="string"||typeof e["aria-labelledby"]=="string"}function a1(e){return s1(e)?{role:"img"}:{"aria-hidden":!0,role:"presentation"}}function Rs(e){const t=e.props;return t["aria-hidden"]===!0||t["aria-label"]?e:a.cloneElement(e,{"aria-hidden":!0})}function hi(e){const t=e.props["data-icon"];return t==="inline-start"||t==="start"?"inline-start":t==="inline-end"||t==="end"?"inline-end":null}function l1(e){return a.isValidElement(e)&&hi(e)!=null}const i1={default:"bg-surface border-token text-foreground",primary:"bg-primary border-token text-primary-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground"},c1={"top-right":"absolute right-0 top-0 z-10 translate-x-[38%] -translate-y-[38%]","top-left":"absolute left-0 top-0 z-10 -translate-x-[38%] -translate-y-[38%]","bottom-right":"absolute bottom-0 right-0 z-10 translate-x-[38%] translate-y-[38%]","bottom-left":"absolute bottom-0 left-0 z-10 -translate-x-[38%] translate-y-[38%]"},u1={small:"gap-xsmall px-small py-xsmall",base:"gap-xsmall px-base py-xsmall",mid:"gap-xsmall px-mid py-xsmall",large:"gap-small px-mid py-xsmall"},xi={small:"min-h-3 min-w-3",base:"min-h-4 min-w-4",mid:"min-h-4 min-w-4",large:"min-h-5 min-w-5"},Is={small:"xsmall",base:"small",mid:"base",large:"mid"},d1={small:"shrink-0 p-xsmall [&_svg]:icon-small",base:"shrink-0 p-small [&_svg]:icon-base",mid:"shrink-0 p-base [&_svg]:icon-base",large:"shrink-0 p-mid [&_svg]:icon-large"},f1={small:"icon-small shrink-0 p-0",base:"icon-small shrink-0 p-0",mid:"icon-base shrink-0 p-0",large:"icon-large shrink-0 p-0"},m1={small:"[&_svg]:icon-small",base:"[&_svg]:icon-small",mid:"[&_svg]:icon-base",large:"[&_svg]:icon-large"},p1="box-border isolate inline-flex max-w-full shrink-0 select-none items-center justify-center truncate rounded-full whitespace-nowrap motion-reduce:transition-none",C1="box-border isolate inline-flex items-center justify-center rounded-full whitespace-nowrap",g1="box-border isolate inline-flex shrink-0 rounded-full ring-2 ring-background motion-reduce:ring-1",po={default:"bg-foreground",primary:"bg-primary",outline:"bg-transparent border-token",secondary:"bg-secondary",danger:"bg-danger",success:"bg-success",info:"bg-info",warning:"bg-warning"};function S1(e,t){return e==="gloss"?t!=="default"?po[t]:po.default:t!=="default"?po[t]:po[e]}function h1(e,t){if(e==="gloss")return i.cn("gloss-panel border-0 text-foreground",t!=="default"?i.SEMANTIC_STATUS_TEXT[t]:"");if(t==="default")return i1[e];switch(e){case"default":return i.cn(i.SEMANTIC_STATUS_SURFACE_TINT[t],i.SEMANTIC_STATUS_TEXT[t]);case"primary":return i.SEMANTIC_STATUS_FILL[t];case"outline":return i.cn("bg-transparent",i.SEMANTIC_STATUS_OUTLINE_BORDER[t],i.SEMANTIC_STATUS_TEXT[t]);case"secondary":return i.cn("bg-secondary border-token",i.SEMANTIC_STATUS_TEXT[t])}}function x1(e){return e!=="default"?i.SEMANTIC_STATUS_TEXT[e]:""}function b1(e,t,n){return n?i.cn("gloss-panel border-0",x1(t)):S1(e,t)}const A1="inline-flex shrink-0 [&_svg]:shrink-0";function Wg(e){return i.cn(A1,m1[e])}const v1="relative isolate inline-grid w-fit shrink-0 [&>*]:col-start-1 [&>*]:row-start-1",L1="pointer-events-none",_1="pointer-events-none";function T1(e,t,n,o,r=""){return i.cn(g1,f1[e],xi[e],b1(t,n,o),r)}function E1(e,t,n=""){return i.cn(C1,t,d1[e],xi[e],n)}function R1(e,t,n=""){return i.cn(p1,t,u1[e],xi[e],n)}function I1(e,t){return e&&!t?_1:""}function y1({node:e,size:t}){return e==null||e===!1?null:typeof e=="string"?e.trim()?c.jsx(q,{as:"span",variant:Is[t],inheritColor:!0,children:e}):null:typeof e=="number"?c.jsx(q,{as:"span",variant:Is[t],inheritColor:!0,children:e}):a.isValidElement(e)?hi(e)?c.jsx("span",{className:Wg(t),children:Rs(e)}):e:null}function N1(e){return a.Children.toArray(e).some(l1)}function w1(e){return typeof e=="string"?e.trim().length>0:typeof e=="number"?!0:a.isValidElement(e)?hi(e)==null:!1}function O1(e){return a.Children.toArray(e).some(w1)}function Yg(e){return e==null||e===!1?!1:typeof e=="string"?e.trim().length>0:typeof e=="number"?!0:Array.isArray(e)?e.some(Yg):a.isValidElement(e)}function P1(e,t){return a.Children.map(a.Children.toArray(e),(n,o)=>c.jsx(a.Fragment,{children:c.jsx(y1,{node:n,size:t})},o))}function D1(e){return e.type.displayName==="BadgeRoot"}function k1({size:e,children:t,icon:n,iconOnly:o,iconPosition:r,inlineIconMode:s,meaningChild:l,dot:u}){if(u)return{layoutKind:"dot",bodyContent:null,iconOnlyBody:null,dataIcon:void 0};const d=s?null:n,f=!!d&&!l,m=s&&!l&&a.Children.toArray(t).length>0,p=!l&&(f||!!(o&&d)||m),C=d?c.jsx("span",{className:Wg(e),children:a.isValidElement(d)?Rs(d):d}):null,S=l&&!s?c.jsx(q,{as:"span",variant:Is[e],inheritColor:!0,children:t}):null,g=s?P1(t,e):null,h=s?g:c.jsxs(c.Fragment,{children:[r==="start"&&C,S,r==="end"&&C]}),x=m?g:d?a.isValidElement(d)?Rs(d):d:t,b=!!(!s&&C&&S)?r:void 0;return p?{layoutKind:"iconOnly",bodyContent:h,iconOnlyBody:x,dataIcon:b}:{layoutKind:"text",bodyContent:h,iconOnlyBody:x,dataIcon:b}}function bi({setMergedRef:e,splitLift:t,placementClass:n,splitLiftMotionCls:o,selfLiftMotionCls:r,isDirectAnchorChild:s,isGloss:l,innerLiftRef:u,pointerHandlers:d,rest:f,className:m,dataIcon:p,children:C,withA11y:S=!1}){const g=S?a1(f):void 0;return t?c.jsx("span",{ref:e,"data-badge-root":!0,className:i.cn(L1,n),...f,...g,children:c.jsx("span",{ref:u,"data-badge-lift-target":!0,"data-icon":p,className:i.cn(o,m),children:C})}):c.jsx("span",{ref:e,"data-icon":p,"data-badge-root":!0,className:i.cn(o,r,I1(s,l),n,m),...d,...f,...g,children:C})}function B1({size:e,variant:t,status:n,shell:o,className:r,rest:s}){const l=vr(),u=T1(e,t,n,o.isGloss,i.cn(l.root,l.dot,r));return c.jsx(bi,{...o,className:u,rest:s,withA11y:!0,children:null})}function j1({size:e,surfaceClass:t,shell:n,className:o,rest:r,iconOnlyBody:s}){const l=vr(),u=E1(e,t,i.cn(l.root,l.iconOnly,o));return c.jsx(bi,{...n,className:u,rest:r,withA11y:!0,children:s})}function M1({size:e,surfaceClass:t,shell:n,className:o,rest:r,bodyContent:s,dataIcon:l}){const u=vr(),d=R1(e,t,i.cn(u.root,u.text,o));return c.jsx(bi,{...n,className:d,rest:r,dataIcon:l,children:s})}const $g=a.forwardRef(function({className:t="",classNames:n,children:o,hoverLift:r=!0,onPointerOver:s,onPointerOut:l,...u},d){const f=a.useRef(null),m=a.useRef(null),[p]=a.useState(1),C=a.useCallback(A=>{f.current=A,typeof d=="function"?d(A):d&&(d.current=A)},[d]),S=a.useCallback(A=>{m.current=A,r1(A,r)},[r]),g=a.useMemo(()=>({registerLiftTarget:S,anchorRef:f,anchorCommitGen:p,hoverLift:r}),[S,p,r]),h=o1(m,r),x=vr();return c.jsx(Ug,{classNames:n,children:c.jsx(JG,{value:g,children:c.jsx("div",{ref:C,"data-badge-anchor":!0,className:i.cn(v1,x.anchor,n==null?void 0:n.anchor,t),onPointerOver:A=>{s==null||s(A),A.defaultPrevented||h.onPointerOver(A)},onPointerOut:A=>{l==null||l(A),h.onPointerOut(A)},...u,children:a.Children.map(o,(A,b)=>a.isValidElement(A)&&D1(A)?c.jsx(t1,{children:A},A.key??`badge-anchor-child-${b}`):A)})})})});$g.displayName="BadgeAnchor";function F1({variant:e,status:t,size:n,children:o,icon:r,iconOnly:s,iconPosition:l,dot:u,placement:d}){const f=e1(),m=h1(e,t),p=N1(o),C=a.useMemo(()=>p?O1(o):Yg(o),[o,p]),S=f?d??"top-right":void 0,g=S?c1[S]:"",h=a.useMemo(()=>k1({size:n,children:o,icon:r,iconOnly:s,iconPosition:l,inlineIconMode:p,meaningChild:C,dot:u}),[o,u,r,s,l,p,C,n]);return{size:n,surfaceClass:m,inlineIconMode:p,meaningChild:C,placementClass:g,isDirectAnchorChild:f,layoutKind:h.layoutKind,bodyContent:h.bodyContent,iconOnlyBody:h.iconOnlyBody,dataIcon:h.dataIcon}}const Xg=a.forwardRef(function({variant:t="default",status:n="default",size:o="base",icon:r,iconPosition:s="start",iconOnly:l=!1,dot:u=!1,placement:d,classNames:f,className:m="",children:p,hoverLift:C=!0,onPointerOver:S,onPointerOut:g,...h},x){const A=u,{surfaceClass:b,meaningChild:L,placementClass:_,isDirectAnchorChild:v,layoutKind:R,bodyContent:T,iconOnlyBody:E,dataIcon:I}=F1({variant:t,status:n,size:o,children:p,icon:r,iconOnly:l,iconPosition:s,dot:A,placement:d}),O=n1({variant:t,hoverLift:C,forwardedRef:x,isDirectAnchorChild:v,placement:d,onPointerOver:S,onPointerOut:g,syncDeps:{meaningChild:L,icon:r,dot:A,iconOnly:l,children:p}}),N={setMergedRef:O.setMergedRef,splitLift:O.splitLift,placementClass:_,splitLiftMotionCls:O.splitLiftMotionCls,selfLiftMotionCls:O.selfLiftMotionCls,isDirectAnchorChild:v,isGloss:O.isGloss,innerLiftRef:O.innerLiftRef,pointerHandlers:O.pointerHandlers,rest:h},y=w=>c.jsx(Ug,{classNames:f,children:w});return y(R==="dot"?c.jsx(B1,{size:o,variant:t,status:n,shell:N,className:m,rest:h}):R==="iconOnly"?c.jsx(j1,{size:o,surfaceClass:b,shell:N,className:m,rest:h,iconOnlyBody:E}):c.jsx(M1,{size:o,surfaceClass:b,shell:N,className:m,rest:h,bodyContent:T,dataIcon:I}))});Xg.displayName="BadgeRoot";const H1=Object.assign(Xg,{Anchor:$g});function G1({variant:e,hoverLift:t=!0,forwardedRef:n,onPointerOver:o,onPointerOut:r}){const s=a.useRef(null),l=e==="gloss",u=t,d=a.useMemo(()=>i.createGlossInteractiveRefCallback(s,u&&l),[l,u]),f=i.useGlossInteractiveHandlers(s,u&&l),m=i.useSecondLevelShadow(s,u&&!l),p=a.useCallback(h=>{d(h),s.current=h,ue(n,h)},[d,n]),C=a.useMemo(()=>({onPointerOver:h=>{o==null||o(h),!(!u||h.defaultPrevented)&&(l?f.onPointerOver(h):m.onPointerEnter(h))},onPointerOut:h=>{r==null||r(h),u&&(l?f.onPointerOut(h):m.onPointerLeave(h))}}),[f.onPointerOut,f.onPointerOver,l,u,r,o,m.onPointerEnter,m.onPointerLeave]),S=u&&!l?m.motionClass:"",g=u&&l?i.GLOSS_INTERACTIVE_MOTION_CLASS:"";return{setMergedRef:p,motionClass:S,glossMotionClass:g,pointerHandlers:C}}const ys=a.createContext({});function V1({classNames:e,children:t}){const n=a.useContext(ys),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ys.Provider,{value:o,children:t})}function Kg(){return a.useContext(ys)}const z1={default:"bg-surface border-token text-foreground",primary:"bg-primary border border-transparent text-primary-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground"},U1={small:"xsmall",base:"xsmall",mid:"small",large:"base"},W1={small:"min-h-4 px-xsmall py-0.5",base:"min-h-4 px-small py-xsmall",mid:"min-h-5 px-base py-xsmall",large:"min-h-5 px-base py-xsmall"},Y1="box-border isolate inline-flex max-w-full shrink-0 select-none items-center justify-center whitespace-nowrap rounded-small font-mono motion-reduce:transition-none",$1="inline-flex items-center gap-xsmall",X1="select-none text-muted text-xsmall";function K1(e){return e==="gloss"?"gloss-panel gloss-deep border-0 text-foreground":z1[e]}function q1({variant:e,size:t,motionClass:n,slotRoot:o,className:r}){return i.cn(Y1,K1(e),W1[t],n,o,r)}function Z1(e,t){return i.cn($1,t,e)}function Q1(e){return i.cn(X1,e)}function Ai({size:e,className:t,children:n}){const o=Kg();return c.jsx(q,{as:"span",variant:U1[e],inheritColor:!0,className:i.cn(o.text,t),children:n})}Ai.displayName="Kbd.Text";function qg({size:e,children:t}){return t==null||t===!1?null:a.isValidElement(t)?t:c.jsx(Ai,{size:e,children:t})}qg.displayName="KbdBody";function J1({variant:e,size:t,className:n,classNames:o}){const r=a.useMemo(()=>q1({variant:e,size:t,slotRoot:o==null?void 0:o.root,className:n}),[n,o==null?void 0:o.root,t,e]);return{variant:e,size:t,rootClass:r}}const Zg=a.forwardRef(function({variant:t="default",size:n="base",classNames:o,className:r="",children:s,hoverLift:l=!0,onPointerOver:u,onPointerOut:d,...f},m){const p=J1({variant:t,size:n,className:r,classNames:o}),C=G1({variant:p.variant,hoverLift:l,forwardedRef:m,onPointerOver:u,onPointerOut:d});return c.jsx(V1,{classNames:o,children:c.jsx("kbd",{ref:C.setMergedRef,className:i.cn(p.rootClass,C.motionClass,C.glossMotionClass),...C.pointerHandlers,...f,children:c.jsx(qg,{size:p.size,children:s})})})});Zg.displayName="KbdRoot";function eV(e){return e.type.displayName==="KbdRoot"}function tV(e){const t=[];for(const n of a.Children.toArray(e)){if(!a.isValidElement(n)){n!=null&&t.push(n);continue}if(eV(n)){t.push(n);continue}t.push(n)}return t}const nV=!0;function Qg({className:e,classNames:t,separator:n="+",children:o,...r}){const s=Kg(),l=tV(o);return c.jsx("span",{className:Z1(e,(t==null?void 0:t.group)??s.group),...r,children:l.map((u,d)=>c.jsxs(a.Fragment,{children:[d>0&&n!=null?c.jsx(q,{as:"span",variant:"xsmall","aria-hidden":nV,className:Q1((t==null?void 0:t.separator)??s.separator),children:n}):null,u]},d))})}Qg.displayName="KbdGroup";const oV=Object.assign(Zg,{Group:Qg,Text:Ai});function rV(e,t){if(e)return t==="ascending"?"ascending":t==="descending"?"descending":"none"}function sV(e,t){return e!=="none"?t:void 0}function aV(e){return e!=="none"?"grid":void 0}function Zn(e){return e!=="none"}function lV(e){return e==="multiple"?!0:void 0}function vi(e){return e?"row":void 0}function iV(e,t){if(e)return t?"rowheader":"columnheader"}function Jg(e){return e?"gridcell":void 0}const eS=new Set,wc="secondary",cV="Table.Label";function uV(e){return a.Children.toArray(e).some(t=>a.isValidElement(t)&&t.type.displayName===cV)}function dV(e,t){if(Object.is(e,t))return!0;if(e==="all"||t==="all")return e===t;if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function fV({selectionMode:e,selectedKeys:t,key:n}){if(e==="none")return null;if(e==="single")return new Set([n]);if(t==="all")return new Set([n]);const o=new Set(t);return o.has(n)?o.delete(n):o.add(n),o}function mV(e,t){if(!(!e||(t==null?void 0:t.column)!==e))return t.direction}function pV(e,t){return{column:e,direction:(t==null?void 0:t.column)===e&&t.direction==="ascending"?"descending":"ascending"}}const In="data-table-row-key";function CV(e){return Array.from(e.querySelectorAll(`tbody tr[${In}]`))}function gV(e){const t=e.closest("table")??e.closest("[role='grid']");return t?Array.from(t.querySelectorAll("thead button[type='button']")):[]}function SV(e,t,n){if(e.length===0)return null;const o=e.indexOf(t);if(o<0)return e[0]??null;const r=o+n;return r<0||r>=e.length?e[o]??null:e[r]??null}function hV(e,t,n){if(e.length===0)return null;const o=e.indexOf(t);if(o<0)return e[0]??null;const r=o+n;return r<0||r>=e.length?e[o]??null:e[r]??null}const xV={subscribeSelection:()=>()=>{},subscribeFocus:()=>()=>{},getSelectedKeys:()=>eS,isSelected:()=>!1,getFocusedRowKey:()=>null,isFocusTarget:()=>!1,setSelectedKeys:()=>{},setFocusedRowKey:()=>{},claimFocusedRowKey:()=>{}},tS=a.createContext("default"),Ns=a.createContext({}),nS=a.createContext({selectionMode:"none",onRowSelect:()=>{},sortDescriptor:void 0,onSortChange:void 0,setFocusedRowKey:()=>{},claimFocusedRowKey:()=>{},rowStore:xV}),oS=a.createContext(null);function bV({variant:e,children:t}){return c.jsx(tS.Provider,{value:e,children:t})}function AV({classNames:e,children:t}){const n=a.useContext(Ns),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ns.Provider,{value:o,children:t})}function vV({value:e,children:t}){return c.jsx(nS.Provider,{value:e,children:t})}function LV({value:e,children:t}){return c.jsx(oS.Provider,{value:e,children:t})}function Qn(){return a.useContext(tS)}function Ze(){return a.useContext(Ns)}function sn(){return a.useContext(nS)}function _V(){return a.useContext(oS)}function TV(e){const{rowStore:t}=sn();return a.useSyncExternalStore(t.subscribeSelection,()=>e===void 0?!1:t.isSelected(e),()=>!1)}function EV(e){const{rowStore:t,selectionMode:n}=sn();return a.useSyncExternalStore(t.subscribeFocus,()=>n==="none"||e===void 0?!1:t.isFocusTarget(e),()=>!1)}const RV="w-full",IV={default:"rounded-mid border-token bg-surface overflow-clip",secondary:"",toned:"overflow-visible bg-transparent",gloss:"gloss-panel gloss-deep rounded-mid overflow-clip border-0"},yV="gloss-content w-full min-w-0",NV="w-full overflow-x-auto outline-none focus-ring",wV="w-full",OV={default:"border-collapse",secondary:"border-collapse",toned:"border-separate border-spacing-y-xsmall",gloss:"border-collapse"},PV={default:"border-b-token",secondary:"border-b-token",toned:"",gloss:"border-b-token"},DV="group/col",kV={default:"bg-secondary px-large py-mid text-secondary-foreground whitespace-nowrap",secondary:"px-large py-mid text-secondary-foreground whitespace-nowrap",toned:"px-large py-mid text-muted whitespace-nowrap bg-transparent",gloss:"bg-transparent px-large py-mid text-muted whitespace-nowrap"},BV="select-none",jV="inline-flex w-full min-w-0 items-center gap-xsmall border-0 bg-transparent text-inherit cursor-pointer outline-none focus-ring-inset rounded-small hover:text-foreground -mx-large -my-mid px-large py-mid box-border",rS="inline-flex items-center gap-xsmall",MV="min-w-0 text-small text-left font-w-mid",FV="shrink-0 origin-center",HV="icon-xsmall",GV="text-primary opacity-100",VV="opacity-0 group-hover/col:opacity-40 text-muted",zV="px-large py-large text-center",UV="outline-none",WV={default:"border-b-token last:border-b-0",secondary:"border-b-token last:border-b-0",toned:"",gloss:"border-b-token last:border-b-0"},YV="cursor-pointer",$V="bg-default-hover",XV="bg-primary-tint hover:bg-primary-tint-strong",KV=i.cn(i.SURFACE_COLOR_TRANSITION,"hover:bg-primary-tint focus-visible:bg-primary-tint"),qV="focus-ring-inset",ZV="text-small",QV={default:"px-large py-mid",secondary:"px-large py-mid",toned:"px-large py-mid first:rounded-l-mid last:rounded-r-mid",gloss:"px-large py-mid"},JV="ring-2 ring-inset ring-primary",ez="hover:brightness-[0.97] motion-reduce:hover:brightness-100",tz="flex flex-wrap items-center justify-between gap-base border-t-token px-large py-mid",sS={default:"bg-surface text-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary text-secondary-foreground",danger:"bg-surface-tint-danger text-foreground",success:"bg-surface-tint-success text-foreground",info:"bg-surface-tint-info text-foreground",warning:"bg-surface-tint-warning text-foreground"};function nz({variant:e,slotClass:t,className:n}){return i.cn(RV,IV[e],t,n)}function oz({variant:e,slotClass:t,className:n}){return i.cn(wV,OV[e],t,n)}function rz({variant:e,allowsSorting:t,slotClass:n,className:o}){return i.cn(DV,kV[e],t&&i.cn(BV,i.TEXT_COLOR_TRANSITION),n,o)}function sz({slotClass:e,className:t}){return i.cn(jV,rS,i.TEXT_COLOR_TRANSITION,e,t)}function az({slotClass:e,className:t}){return i.cn(MV,e,t)}function lz({variant:e,isToned:t,isSelectable:n,isSelected:o,slotClass:r,className:s}){return i.cn(UV,WV[e],n&&YV,e==="gloss"&&!t&&(o?XV:KV),e!=="gloss"&&!t&&(o?$V:i.hoverVariant()),n&&qV,r,s)}function iz({variant:e,tone:t,isSelected:n,slotClass:o,className:r}){const s=e==="toned",l=t?sS[t]:void 0;return i.cn(ZV,QV[e],s&&l,s&&n&&JV,s&&!n&&ez,o,r)}function cz(e){return i.cn(FV,e?GV:VV)}function uz({direction:e,children:t}){const n=Ze(),o=a.useRef(null),r=Kt(e==="descending",o,()=>!0);return c.jsx("span",{ref:r,"aria-hidden":!0,className:i.cn(cz(!!e),n.columnSortChevron),children:t??c.jsx(be.IoChevronUp,{className:HV})})}function dz(e){let t=e,n=null;const o=new Set,r=new Set;return{subscribeSelection(s){return o.add(s),()=>{o.delete(s)}},subscribeFocus(s){return r.add(s),()=>{r.delete(s)}},getSelectedKeys(){return t},isSelected(s){return t==="all"||t.has(s)},getFocusedRowKey(){return n},isFocusTarget(s){return n!=null&&String(n)===String(s)},setSelectedKeys(s){dV(t,s)||(t=s,o.forEach(l=>l()))},setFocusedRowKey(s){n!=null&&String(n)===String(s)||(n=s,r.forEach(l=>l()))},claimFocusedRowKey(s){n==null&&(n=s,r.forEach(l=>l()))}}}function fz({selectionMode:e="none",selectedKeys:t,defaultSelectedKeys:n,onSelectionChange:o,sortDescriptor:r,defaultSortDescriptor:s,onSortChange:l}){const u=a.useRef(null);u.current==null&&(u.current=dz(t??n??eS));const d=u.current,f=t!==void 0,m=a.useRef(o);m.current=o;const p=a.useRef(e);p.current=e,a.useLayoutEffect(()=>{t!==void 0&&d.setSelectedKeys(t)},[t,d]);const[C,S]=Re({value:r,defaultValue:s,onChange:l?A=>{A!==void 0&&l(A)}:void 0}),g=a.useCallback(A=>{var L;const b=fV({selectionMode:p.current,selectedKeys:d.getSelectedKeys(),key:A});b&&(f||d.setSelectedKeys(b),(L=m.current)==null||L.call(m,b))},[f,d]),h=a.useCallback(A=>{d.setFocusedRowKey(A)},[d]),x=a.useCallback(A=>{d.claimFocusedRowKey(A)},[d]);return a.useMemo(()=>({selectionMode:e,onRowSelect:g,sortDescriptor:C,onSortChange:S,setFocusedRowKey:h,claimFocusedRowKey:x,rowStore:d}),[x,g,e,h,S,C,d])}function mz(e){return a.Children.toArray(e).some(t=>a.isValidElement(t)&&t.type.displayName==="Table.HeaderRow")}const aS=a.forwardRef(function({className:t,tabIndex:n,...o},r){const s=Ze();return c.jsx("div",{ref:r,tabIndex:n,className:i.cn(NV,s.scrollContainer,t),...o})});aS.displayName="TableScrollContainer";const lS=a.forwardRef(function({selectionMode:t="none",selectedKeys:n,defaultSelectedKeys:o,onSelectionChange:r,sortDescriptor:s,defaultSortDescriptor:l,onSortChange:u,className:d,children:f,...m},p){const C=Qn(),S=Ze(),g=fz({selectionMode:t,selectedKeys:n,defaultSelectedKeys:o,onSelectionChange:r,sortDescriptor:s,defaultSortDescriptor:l,onSortChange:u});return c.jsx(vV,{value:g,children:c.jsx("table",{ref:p,role:aV(t),"aria-multiselectable":lV(t),className:oz({variant:C,slotClass:S.content,className:d}),...m,children:f})})});lS.displayName="TableContent";const Li=a.forwardRef(function({className:t,...n},o){const r=Qn(),s=Ze(),{selectionMode:l}=sn(),u=Zn(l);return c.jsx("tr",{ref:o,role:vi(u),className:i.cn(PV[r],s.headerRow,t),...n})});Li.displayName="Table.HeaderRow";const iS=a.forwardRef(function({columns:t,children:n,className:o,...r},s){const l=Ze(),u=t&&typeof n=="function"?t.map(f=>n(f)):n,d=mz(u)?u:c.jsx(Li,{children:u});return c.jsx("thead",{ref:s,className:i.cn(l.header,o),...r,children:d})});iS.displayName="TableHeader";const _i=a.forwardRef(function({className:t,...n},o){const r=Ze();return c.jsx("span",{ref:o,className:az({slotClass:r.columnLabel,className:t}),...n})});_i.displayName="Table.Label";const cS=a.forwardRef(function({id:t,allowsSorting:n=!1,isRowHeader:o=!1,sortIcon:r,children:s,className:l,onClick:u,...d},f){const m=Qn(),p=Ze(),{sortDescriptor:C,onSortChange:S,selectionMode:g}=sn(),h=Zn(g),x=mV(t,C),A=a.useCallback(E=>{u==null||u(E),!(!t||!S)&&S(pV(t,C))},[t,u,S,C]),b=a.useCallback(E=>{if(E.key!=="ArrowLeft"&&E.key!=="ArrowRight")return;const I=gV(E.currentTarget),O=hV(I,E.currentTarget,E.key==="ArrowRight"?1:-1);!O||O===E.currentTarget||(E.preventDefault(),O.focus())},[]),L=a.useCallback(E=>{u==null||u(E)},[u]),_=typeof s=="function"?s({sortDirection:x}):s,v=uV(_)?_:c.jsx(_i,{children:_});let R=null;n&&(r!==void 0?R=typeof r=="function"?r({sortDirection:x}):r:R=c.jsx(uz,{direction:x}));const T=c.jsxs(c.Fragment,{children:[v,R]});return c.jsx("th",{ref:f,role:iV(h,o),scope:o?"row":"col","aria-sort":rV(n,x),"data-allows-sorting":n||void 0,className:rz({variant:m,allowsSorting:n,slotClass:p.column,className:l}),onClick:n?void 0:L,...d,children:n?c.jsx("button",{type:"button",className:sz({slotClass:p.columnInner}),onClick:A,onKeyDown:b,children:T}):c.jsx("span",{className:i.cn(rS,p.columnInner),children:T})})});cS.displayName="TableColumn";const uS=a.forwardRef(function({items:t,children:n,renderEmptyState:o,className:r,...s},l){const u=Ze(),{selectionMode:d}=sn(),f=Zn(d);let m;if(t!==void 0)if(t.length===0&&o){const p=o();m=c.jsx("tr",{role:vi(f),children:c.jsx("td",{role:Jg(f),colSpan:9999,className:i.cn(zV,u.emptyCell),children:p})})}else typeof n=="function"&&(m=t.map(n));else m=n;return c.jsx("tbody",{ref:l,className:i.cn(u.body,r),...s,children:m})});uS.displayName="TableBody";const pz=a.forwardRef(function({id:t,tone:n,children:o,className:r,onClick:s,onKeyDown:l,...u},d){const f=Qn(),m=Ze(),{selectionMode:p,onRowSelect:C,setFocusedRowKey:S,claimFocusedRowKey:g}=sn(),h=TV(t),x=EV(t),A=p!=="none"&&t!==void 0,b=Zn(p),L=f==="toned",_=n??(L?wc:void 0);a.useLayoutEffect(()=>{!A||t===void 0||g(t)},[g,t,A]);const v=a.useMemo(()=>({tone:_??wc,isSelected:h}),[h,_]),R=a.useCallback(E=>{s==null||s(E),!(E.defaultPrevented||!A||t===void 0)&&(S(t),C(t))},[t,A,s,C,S]),T=a.useCallback(E=>{if(l==null||l(E),E.defaultPrevented||!A||t===void 0)return;if(E.key==="Enter"||E.key===" "){E.preventDefault(),S(t),C(t);return}const I=E.currentTarget.closest("table");if(!I)return;const O=CV(I);if(E.key==="ArrowDown"||E.key==="ArrowUp"){E.preventDefault();const N=SV(O,E.currentTarget,E.key==="ArrowDown"?1:-1);if(!N)return;const y=N.getAttribute(In);if(y==null)return;S(y),N.focus();return}if(E.key==="Home"){E.preventDefault();const N=O[0];if(!N)return;const y=N.getAttribute(In);if(y==null)return;S(y),N.focus();return}if(E.key==="End"){E.preventDefault();const N=O[O.length-1];if(!N)return;const y=N.getAttribute(In);if(y==null)return;S(y),N.focus()}},[t,A,l,C,S]);return c.jsx(LV,{value:L||_?v:null,children:c.jsx("tr",{ref:d,role:vi(b),...t!==void 0?{[In]:String(t)}:{},"data-selected":h||void 0,"data-tone":_,"aria-selected":sV(p,h),tabIndex:A?x?0:-1:void 0,className:lz({variant:f,isToned:L,isSelectable:A,isSelected:h,slotClass:m.row,className:r}),onClick:R,onKeyDown:T,...u,children:o})})}),dS=a.memo(pz);dS.displayName="TableRow";const Cz=a.forwardRef(function({className:t,...n},o){const r=Qn(),s=Ze(),l=_V(),{selectionMode:u}=sn(),d=Zn(u);return c.jsx("td",{ref:o,role:Jg(d),className:iz({variant:r,tone:l==null?void 0:l.tone,isSelected:(l==null?void 0:l.isSelected)??!1,slotClass:s.cell,className:t}),...n})}),fS=a.memo(Cz);fS.displayName="TableCell";const mS=a.forwardRef(function({className:t,...n},o){const r=Ze();return c.jsx("div",{ref:o,className:i.cn(tz,r.footer,t),...n})});mS.displayName="TableFooter";function gz({variant:e="default"}){return{variant:e,isGloss:e==="gloss"}}const pS=a.forwardRef(function({variant:t="default",className:n,classNames:o,children:r,...s},l){const{variant:u,isGloss:d}=gz({variant:t}),f=i.useMergedGlossPanelRef(l,d);return c.jsx(bV,{variant:u,children:c.jsx(AV,{classNames:o,children:c.jsx("div",{ref:f,className:nz({variant:u,slotClass:o==null?void 0:o.root,className:n}),...s,children:d?c.jsx("div",{className:i.cn(yV,o==null?void 0:o.glossContent),children:r}):r})})})});pS.displayName="TableRoot";const Sz=Object.assign(pS,{ScrollContainer:aS,Content:lS,Header:iS,HeaderRow:Li,Column:cS,Label:_i,Body:uS,Row:dS,Cell:fS,Footer:mS}),CS=a.createContext(null),ws=a.createContext({});function hz({value:e,children:t}){return c.jsx(CS.Provider,{value:e,children:t})}function xz({classNames:e,children:t}){const n=a.useContext(ws),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ws.Provider,{value:o,children:t})}function Ne(){const e=a.useContext(CS);if(!e)throw new Error("Calendar compound parts must be inside <Calendar>.");return e}function at(){return a.useContext(ws)}function bz(){return"Previous"}function Az(){return"Next"}function vz(e,t,n,o){return`${e} ${o.months[t]} ${n}`}function Lz(e,t,n){return`${n.months[e]} ${t}`}function _z(e){return String(e)}function Tz(e){return`${e}–${e+9}`}function Oc(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function De(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Et(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Lr(e,t){return new Date(e,t+1,0).getDate()}function Ez(e,t){return(new Date(e,t,1).getDay()+6)%7}function Rz(e,t,n){const o=t.getFullYear(),r=t.getMonth();if(e==="days")return`${n.months[r]} ${o}`;if(e==="months")return String(o);const s=Math.floor(o/10)*10;return`${s}–${s+9}`}function Iz(e,t,n,o){if(e)return new Date(e.getFullYear(),e.getMonth(),1);let r=null;return t==="single"&&n instanceof Date?r=n:t==="range"?r=(n==null?void 0:n.start)??null:t==="multiple"&&(r=(n==null?void 0:n[0])??null),r?new Date(r.getFullYear(),r.getMonth(),1):new Date(o.getFullYear(),o.getMonth(),1)}function gS(e,t){if(e==="single"){const n=t;return n?[n]:[]}if(e==="multiple"){const n=t;return Array.isArray(n)?n:[]}return[]}function SS(e,t,n){return e!=="range"?null:t||((n==null?void 0:n.start)??null)}function yz(e,t,n){return e!=="range"||t?null:(n==null?void 0:n.end)??null}function Nz(e,t,n){return t==="days"?new Date(e.getFullYear(),e.getMonth()+n,1):t==="months"?new Date(e.getFullYear()+n,e.getMonth(),1):new Date(e.getFullYear()+n*10,e.getMonth(),1)}function wz({viewDate:e,selectedDates:t,rangeStart:n,rangeEnd:o,hoverDate:r,mode:s,locale:l,minDate:u,maxDate:d,today:f}){const m=e.getFullYear(),p=e.getMonth(),C=Lr(m,p),S=Ez(m,p),g=o??(n&&r?r:null),h=n&&g?n<=g?n:g:null,x=n&&g?n<=g?g:n:null,A=[...Array(S).fill(null),...Array.from({length:C},(L,_)=>_+1)],b=A.length%7;return b!==0&&A.push(...Array(7-b).fill(null)),A.map((L,_)=>{if(L===null)return{key:`empty-${m}-${p}-${_}`,day:null};const v=new Date(m,p,L),R=`${m}-${p}-${L}`,T=De(v,f),E=s!=="range"&&t.some(B=>De(B,v)),I=s==="range"&&!!n&&De(v,n),O=s==="range"&&!!g&&De(v,g),N=s==="range"&&h&&x?v>h&&v<x:!1,y=s==="range"&&!!n&&!!g&&De(n,g),w=!y&&(N||O),P=!y&&(N||I),k=!!u&&v<u||!!d&&v>d;return{key:R,day:L,date:v,isToday:T,isSelected:E,isRangeStart:I,isRangeEnd:O,showLeftBg:w,showRightBg:P,isDisabled:k,circleActive:E||I||O,ariaLabel:vz(L,p,m,l)}})}function Oz(e,t,n,o){const r=e.getFullYear();return n.monthsShort.map((s,l)=>({month:l,name:s,isCurrentMonth:o.getFullYear()===r&&o.getMonth()===l,isSelected:t.some(u=>u.getFullYear()===r&&u.getMonth()===l)}))}function Pz(e,t,n){const o=Math.floor(e.getFullYear()/10)*10;return Array.from({length:12},(s,l)=>o-1+l).map(s=>({year:s,isCurrentYear:n.getFullYear()===s,isSelected:t.some(l=>l.getFullYear()===s),outOfDecade:s<o||s>o+9}))}function Dz(e,t){return t!==void 0?t:e==="range"?{start:null,end:null}:e==="multiple"?[]:null}function jt(e,t){const n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return Et(n)}function Os(e,t){const n=new Date(e.getFullYear(),e.getMonth()+t,1),o=Lr(n.getFullYear(),n.getMonth());return Et(new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),o)))}function Go(e,t){const n=new Date(e.getFullYear()+t,e.getMonth(),1),o=Lr(n.getFullYear(),n.getMonth());return Et(new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),o)))}function Pc(e,t,n){return!!t&&e<t||!!n&&e>n}function Pe(e,t,n){let o=Et(e);return t&&o<t&&(o=Et(t)),n&&o>n&&(o=Et(n)),o}function kz({mode:e,resolvedValue:t,today:n,minDate:o,maxDate:r}){const s=gS(e,t)[0];if(s)return Pe(s,o,r);if(e==="range"){const l=SS(e,null,t);if(l)return Pe(l,o,r)}return Pe(n,o,r)}function Bz(e,t,n,o,r){let s=null;switch(t){case"ArrowLeft":s=jt(e,-1);break;case"ArrowRight":s=jt(e,1);break;case"ArrowUp":s=jt(e,-7);break;case"ArrowDown":s=jt(e,7);break;case"Home":{const l=(e.getDay()+6)%7;s=jt(e,-l);break}case"End":{const l=(e.getDay()+6)%7;s=jt(e,6-l);break}case"PageUp":s=n?Go(e,-1):Os(e,-1);break;case"PageDown":s=n?Go(e,1):Os(e,1);break;default:return null}if(s=Pe(s,o,r),Pc(s,o,r)){const l=t==="ArrowLeft"||t==="ArrowUp"||t==="Home"||t==="PageUp"?-1:1;let u=s;for(let d=0;d<366;d++){if(u=jt(u,l),u=Pe(u,o,r),!Pc(u,o,r))return u;if(l<0&&o&&De(u,o)||l>0&&r&&De(u,r))break}return e}return s}function jz(e,t){switch(t){case"ArrowLeft":return e>0?e-1:11;case"ArrowRight":return e<11?e+1:0;case"ArrowUp":return(e-3+12)%12;case"ArrowDown":return(e+3)%12;case"Home":return 0;case"End":return 11;default:return null}}function Mz(e,t){switch(t){case"ArrowLeft":return e>0?e-1:11;case"ArrowRight":return e<11?e+1:0;case"ArrowUp":return(e-4+12)%12;case"ArrowDown":return(e+4)%12;case"Home":return 0;case"End":return 11;default:return null}}function Ti(e,t){const n=[];for(let o=0;o<e.length;o+=t)n.push(e.slice(o,o+t));return n}function hS(e=!1){const t=a.useRef(null),{handlePointerEnter:n,handlePointerLeave:o,handlePointerDown:r}=xt({isDisabled:e,enabled:!e,textMotionRef:t,hoverLift:!0,hoverLiftScale:"adaptive"});return{buttonRef:t,handlePointerEnter:n,handlePointerLeave:o,handlePointerDown:r}}const Fz={small:"mx-auto flex aspect-square w-full max-w-control-small items-center justify-center text-xsmall",base:"mx-auto flex aspect-square w-full max-w-control-base items-center justify-center text-small",mid:"mx-auto flex aspect-square w-full max-w-control-mid items-center justify-center text-base",large:"mx-auto flex aspect-square w-full max-w-control-large items-center justify-center text-mid"},Hz={small:"h-control-small w-control-small",base:"h-control-base w-control-base",mid:"h-control-mid w-control-mid",large:"h-control-large w-control-large"},Gz={small:"p-small gap-xsmall",base:"p-large gap-small",mid:"p-large gap-small",large:"p-xlarge gap-base"},Vz={small:"min-w-component-small",base:"min-w-component-base",mid:"min-w-component-mid",large:"min-w-component-large"},zz={small:"text-small",base:"text-base",mid:"text-mid",large:"text-mid"},Uz={default:"rounded-large border-token bg-surface shadow-token-base",secondary:"rounded-large border-token bg-secondary shadow-token-base",outline:"rounded-large bg-transparent border-token shadow-token-base",gloss:"rounded-large border-0"},xS={small:"gap-xsmall",base:"gap-xsmall",mid:"gap-small",large:"gap-small"},Wz={small:"small",base:"base",mid:"mid",large:"mid"},bS={small:"mx-auto aspect-square w-full max-w-control-small",base:"mx-auto aspect-square w-full max-w-control-base",mid:"mx-auto aspect-square w-full max-w-control-mid",large:"mx-auto aspect-square w-full max-w-control-large"},Yz={small:"small",base:"base",mid:"mid",large:"mid"},$z={small:"min-h-control-small w-full px-small py-xsmall",base:"min-h-control-base w-full px-mid py-small",mid:"min-h-control-mid w-full px-large py-mid",large:"min-h-control-large w-full px-large py-mid"},Xz="inline-flex flex-col select-none text-left text-foreground",Kz="gloss-panel gloss-deep rounded-large",qz="gloss-content flex flex-col",Zz="pointer-events-none absolute inset-y-0 bg-default-hover",Qz="flex items-center gap-xsmall",Jz="flex-1 rounded-base py-xsmall text-center font-w-mid",eU="cursor-pointer hover:text-primary focus-ring",tU="cursor-default",nU="min-w-0",oU="grid grid-cols-7 gap-xsmall",rU="grid grid-cols-7 gap-xsmall",sU="flex items-center justify-center font-w-mid text-muted",aU="relative flex items-center justify-center",lU="relative z-10",iU="grid grid-cols-3",cU="grid grid-cols-4",uU="flex items-center justify-between border-t-token pt-small",dU=i.cn(i.hoverVariant(),"flex shrink-0 origin-center items-center justify-center rounded-base","text-muted focus-ring","disabled:cursor-not-allowed disabled:opacity-40"),fU="group/calendar-cell relative inline-flex origin-center items-center justify-center overflow-hidden outline-none focus-ring rounded-mid",mU=i.cn("pointer-events-none absolute -inset-px z-0 origin-center bg-primary",i.SURFACE_COLOR_TRANSITION,"motion-reduce:transition-none group-hover/calendar-cell:bg-primary-hover rounded-mid"),pU=i.cn(Jz,i.TEXT_COLOR_TRANSITION),CU="relative z-[1] min-w-0 shrink-0 leading-none",gU="absolute bottom-[length:calc(var(--border-width)*3)] left-1/2 z-[1] h-[length:calc(var(--border-width)*3)] w-[length:calc(var(--border-width)*3)] -translate-x-1/2 rounded-full bg-primary",Dc="icon-xsmall",SU="bg-transparent font-w-mid text-primary-foreground",hU="font-w-mid text-primary",xU="text-foreground",bU="cursor-not-allowed opacity-35",AU="cursor-pointer",vU="text-muted",LU="text-muted",_U={opacity:0};function TU(e){return i.cn(dU,Hz[e])}function EU(e,t,n){return i.cn(bS[e],t,n)}function RU(e,t,n,o){return i.cn(Xz,n?Kz:Uz[e],Gz[t],Vz[t],o)}function IU(e){return e==="left"?"left-0 right-1/2":"left-1/2 right-0"}function yU(e,t){return t==="day"?bS[e]:$z[e]}function NU(e,t){return t==="day"?Wz[e]:Yz[e]}function wU({selected:e,isToday:t,isCurrent:n}){return e?SU:t||n?hU:xU}function OU(e,t,n,o){return i.cn(fU,yU(e,t),wU({selected:n.selected,isToday:n.isToday,isCurrent:n.isCurrent}),!n.selected&&!n.disabled&&i.hoverVariant(),n.disabled?bU:AU,o)}function PU(e){return i.cn(sU,Fz[e])}function DU(e){return i.cn(iU,xS[e])}function kU(e){return i.cn(cU,xS[e])}function BU(e,t){return e&&!t?vU:void 0}function jU(e,t){return i.cn(pU,zz[e],t!=="years"?eU:tU)}function MU(){const{viewDate:e,selectedDates:t,rangeStart:n,rangeEnd:o,hoverDate:r,mode:s,locale:l,minDate:u,maxDate:d,today:f}=Ne();return a.useMemo(()=>wz({viewDate:e,selectedDates:t,rangeStart:n,rangeEnd:o,hoverDate:r,mode:s,locale:l,minDate:u,maxDate:d,today:f}),[e,t,n,o,r,s,l,u,d,f])}function FU(){const{viewDate:e,selectedDates:t,locale:n,today:o}=Ne();return a.useMemo(()=>Oz(e,t,n,o),[e,t,n,o])}function HU(){const{viewDate:e,selectedDates:t,today:n}=Ne();return a.useMemo(()=>Pz(e,t,n),[e,t,n])}function GU(){const{view:e,viewDate:t,locale:n}=Ne();return a.useMemo(()=>Rz(e,t,n),[e,t,n])}function kc({visible:e,side:t}){const n=at(),o=a.useRef(null),r=a.useRef(!0);return a.useLayoutEffect(()=>{const s=o.current;if(!s)return;const l=u=>{s.style.opacity=u?"1":"0"};if(i.prefersReducedMotion()){i.killMotion(s),l(e);return}if(r.current){r.current=!1,i.killMotion(s),l(e);return}i.killMotion(s),$.to(s,{autoAlpha:e?1:0,...i.motionContentFade(),overwrite:"auto"})},[e]),c.jsx("div",{ref:o,"aria-hidden":!0,className:i.cn(i.cn(Zz,IU(t)),n.rangeHalfFill),style:_U})}const Ei=a.forwardRef(function({direction:t,size:n,onClick:o,disabled:r,children:s,className:l,...u},d){const{navPrevIcon:f,navNextIcon:m}=Ne(),p=at(),C=hS(r),S=t==="prev"?bz():Az(),g=t==="prev"?p.navPrev:p.navNext,h=t==="prev"?f:m,x=a.useCallback(b=>{C.buttonRef.current=b,ue(d,b)},[C.buttonRef,d]),A=t==="prev"?c.jsx(be.IoChevronBack,{className:i.cn(Dc,p.navIcon)}):c.jsx(be.IoChevronForward,{className:i.cn(Dc,p.navIcon)});return c.jsx("button",{ref:x,type:"button","aria-label":S,disabled:r,onClick:o,onPointerEnter:C.handlePointerEnter,onPointerLeave:C.handlePointerLeave,onPointerDown:C.handlePointerDown,className:i.cn(TU(n),g,l),...u,children:s??(h!==void 0?h:A)})});Ei.displayName="Calendar.NavButton";const Ri=a.forwardRef(function({size:t,onClick:n,...o},r){const{navigate:s,size:l}=Ne();return c.jsx(Ei,{ref:r,direction:"prev",size:t??l,onClick:u=>{n==null||n(u),u.defaultPrevented||s(-1)},...o})});Ri.displayName="Calendar.NavPrev";const Ii=a.forwardRef(function({size:t,onClick:n,...o},r){const{navigate:s,size:l}=Ne();return c.jsx(Ei,{ref:r,direction:"next",size:t??l,onClick:u=>{n==null||n(u),u.defaultPrevented||s(1)},...o})});Ii.displayName="Calendar.NavNext";const VU=a.forwardRef(function({selected:t,disabled:n=!1,size:o,ariaLabel:r,tabIndex:s,rovingKey:l,rounded:u="day",cellKind:d="day",isToday:f=!1,isCurrent:m=!1,className:p="",onPress:C,onMouseEnter:S,onMouseLeave:g,children:h},x){const A=a.useRef(null),b=a.useRef(C),L=a.useRef(S),_=a.useRef(g);b.current=C,L.current=S,_.current=g;const{bindFillRef:v}=rm(t,A),R=hS(n),T=at(),E=d==="month"?T.monthCell:d==="year"?T.yearCell:T.dayCell,I=NU(o,u),O=a.useCallback(P=>{R.buttonRef.current=P,ue(x,P)},[R.buttonRef,x]),N=a.useCallback(()=>{n||b.current()},[n]),y=a.useCallback(P=>{var k;(k=L.current)==null||k.call(L),R.handlePointerEnter(P)},[R]),w=a.useCallback(P=>{var k;(k=_.current)==null||k.call(_),R.handlePointerLeave(P)},[R]);return c.jsxs("button",{ref:O,type:"button","aria-label":r,"aria-disabled":n||void 0,disabled:n,tabIndex:n?-1:s,"data-calendar-roving":l,onClick:N,onPointerEnter:y,onPointerLeave:w,onPointerDown:R.handlePointerDown,className:OU(o,u,{selected:t,disabled:n,isToday:f,isCurrent:m},i.cn(T.cell,E,p)),children:[c.jsx("span",{ref:v,"aria-hidden":!0,[nm]:"","data-pressed":t?"true":"false",className:i.cn(mU,T.cellFill)}),c.jsx(q,{variant:I,as:"span",inheritColor:!0,className:i.cn(CU,T.cellText),children:h}),f&&!t&&c.jsx("span",{"aria-hidden":!0,className:i.cn(gU,T.cellTodayDot)})]})});function zU(e,t){return e.selected===t.selected&&e.disabled===t.disabled&&e.size===t.size&&e.rounded===t.rounded&&e.cellKind===t.cellKind&&e.isToday===t.isToday&&e.isCurrent===t.isCurrent&&e.ariaLabel===t.ariaLabel&&e.tabIndex===t.tabIndex&&e.rovingKey===t.rovingKey&&e.className===t.className&&e.children===t.children}const Jn=a.memo(VU,zU),AS=a.forwardRef(function({size:t,...n},o){const{size:r}=Ne();return c.jsx(Jn,{ref:o,size:t??r,...n})});AS.displayName="Calendar.Day";function UU(){var v;const e=at(),{setHoverDate:t,onDayPress:n,size:o,mode:r,locale:s,renderDay:l,focusedDate:u,moveDayFocus:d,viewDate:f,minDate:m,maxDate:p}=Ne(),C=MU(),S=a.useRef(null),g=a.useRef(!1),h=Oc(u),x=a.useMemo(()=>Ti(C,7),[C]),A=Lz(f.getMonth(),f.getFullYear(),s),L=C.some(R=>!!R.date&&!R.isDisabled&&De(R.date,u))?null:((v=C.find(R=>R.date&&!R.isDisabled))==null?void 0:v.date)??null;a.useLayoutEffect(()=>{var I;if(g.current){g.current=!1;const O=(I=S.current)==null?void 0:I.querySelector(`[data-calendar-roving="${h}"]`);O==null||O.focus({preventScroll:!0});return}const R=S.current;if(!R)return;const T=document.activeElement;if(T&&T!==document.body&&T!==document.documentElement&&R.contains(T)||T&&T!==document.body&&T!==document.documentElement)return;const E=R.querySelector(`[data-calendar-roving="${h}"]`);E==null||E.focus({preventScroll:!0})},[h,f]);const _=a.useCallback(R=>{const T=Bz(u,R.key,R.shiftKey,m,p);T&&(R.preventDefault(),g.current=!0,d(T))},[u,m,p,d]);return c.jsxs("div",{ref:S,role:"grid","aria-label":A,onKeyDown:_,children:[c.jsx("div",{role:"row",className:i.cn(oU,e.weekdayGrid),children:s.weekDays.map(R=>c.jsx("div",{role:"columnheader",className:i.cn(PU(o),e.weekdayCell),children:R},R))}),c.jsx("div",{className:i.cn(rU,e.daysGrid),children:x.map((R,T)=>c.jsx("div",{role:"row",className:"contents",children:R.map(E=>{if(E.day===null)return c.jsx("div",{role:"gridcell",className:EU(o,e.dayEmpty)},E.key);const I=l&&E.date?l(E.date,{day:E.day,selected:!!E.isSelected,disabled:!!E.isDisabled,isToday:!!E.isToday,isRangeStart:!!E.isRangeStart,isRangeEnd:!!E.isRangeEnd,circleActive:!!E.circleActive}):E.day,N=!!E.date&&De(E.date,u)||!!L&&!!E.date&&De(E.date,L);return c.jsxs("div",{role:"gridcell","aria-selected":E.circleActive?!0:void 0,className:i.cn(aU,e.dayCellWrapper),children:[E.showLeftBg?c.jsx(kc,{visible:!0,side:"left"}):null,E.showRightBg?c.jsx(kc,{visible:!0,side:"right"}):null,c.jsx(Jn,{selected:!!E.circleActive,disabled:E.isDisabled,isToday:E.isToday,size:o,cellKind:"day",ariaLabel:E.ariaLabel,tabIndex:N?0:-1,rovingKey:E.date?Oc(E.date):void 0,onPress:()=>E.date&&n(E.date),onMouseEnter:()=>r==="range"&&!E.isDisabled&&E.date&&t(E.date),onMouseLeave:()=>r==="range"&&t(null),className:lU,children:I})]},E.key)})},`week-${T}`))})]})}function WU(){const e=at(),{onMonthPress:t,size:n,viewDate:o,focusedDate:r}=Ne(),s=FU(),l=a.useRef(null),u=a.useRef(!1),[d,f]=a.useState(()=>Math.min(11,Math.max(0,r.getMonth()))),m=a.useMemo(()=>Ti(s,3),[s]);a.useLayoutEffect(()=>{var S;if(!u.current)return;u.current=!1;const C=(S=l.current)==null?void 0:S.querySelector(`[data-calendar-roving="${d}"]`);C==null||C.focus({preventScroll:!0})},[d]);const p=a.useCallback(C=>{if(C.key==="Enter"||C.key===" "){C.preventDefault(),t(d);return}const S=jz(d,C.key);S!=null&&(C.preventDefault(),u.current=!0,f(S))},[d,t]);return c.jsx("div",{ref:l,role:"grid","aria-label":_z(o.getFullYear()),className:i.cn(DU(n),e.monthsGrid),onKeyDown:p,children:m.map((C,S)=>c.jsx("div",{role:"row",className:"contents",children:C.map(g=>c.jsx("div",{role:"gridcell","aria-selected":g.isSelected?!0:void 0,className:"contents",children:c.jsx(Jn,{selected:g.isSelected,isCurrent:g.isCurrentMonth,size:n,cellKind:"month",rounded:"picker",tabIndex:d===g.month?0:-1,rovingKey:String(g.month),ariaLabel:g.name,onPress:()=>{f(g.month),t(g.month)},children:g.name})},g.month))},`months-${S}`))})}function YU(){const e=at(),{onYearPress:t,size:n,viewDate:o,focusedDate:r}=Ne(),s=HU(),l=a.useRef(null),u=a.useRef(!1),d=Math.max(0,s.findIndex(g=>g.year===r.getFullYear())),[f,m]=a.useState(d>=0?d:1),p=a.useMemo(()=>Ti(s,4),[s]),C=Math.floor(o.getFullYear()/10)*10;a.useLayoutEffect(()=>{var x,A;if(!u.current)return;u.current=!1;const g=(x=s[f])==null?void 0:x.year;if(g==null)return;const h=(A=l.current)==null?void 0:A.querySelector(`[data-calendar-roving="${g}"]`);h==null||h.focus({preventScroll:!0})},[f,s]);const S=a.useCallback(g=>{var A;const h=(A=s[f])==null?void 0:A.year;if((g.key==="Enter"||g.key===" ")&&h!=null){g.preventDefault(),t(h);return}const x=Mz(f,g.key);x!=null&&(g.preventDefault(),u.current=!0,m(x))},[f,t,s]);return c.jsx("div",{ref:l,role:"grid","aria-label":Tz(C),className:i.cn(kU(n),e.yearsGrid),onKeyDown:S,children:p.map((g,h)=>c.jsx("div",{role:"row",className:"contents",children:g.map((x,A)=>{const b=h*4+A;return c.jsx("div",{role:"gridcell","aria-selected":x.isSelected?!0:void 0,className:"contents",children:c.jsx(Jn,{selected:x.isSelected,isCurrent:x.isCurrentYear,size:n,cellKind:"year",rounded:"picker",tabIndex:f===b?0:-1,rovingKey:String(x.year),ariaLabel:String(x.year),onPress:()=>{m(b),t(x.year)},className:BU(x.outOfDecade,x.isSelected),children:x.year})},x.year)})},`years-${h}`))})}const yi=a.forwardRef(function({className:t="",children:n,onClick:o,...r},s){const l=at(),{view:u,setView:d,size:f}=Ne(),m=GU();return c.jsx("button",{ref:s,type:"button",disabled:u==="years",onClick:p=>{o==null||o(p),!p.defaultPrevented&&(u==="days"?d("months"):u==="months"&&d("years"))},className:i.cn(jU(f,u),l.headerTitle,t),...r,children:n??m})});yi.displayName="Calendar.Title";const Ni=a.forwardRef(function({className:t="",children:n,...o},r){const s=at();return c.jsx("div",{ref:r,className:i.cn(Qz,s.header,t),...o,children:n??c.jsxs(c.Fragment,{children:[c.jsx(Ri,{}),c.jsx(yi,{}),c.jsx(Ii,{})]})})}),wi=a.forwardRef(function({className:t="",...n},o){const r=at(),{view:s}=Ne();return c.jsxs("div",{ref:o,className:i.cn(nU,r.grid,t),...n,children:[s==="days"&&c.jsx(UU,{}),s==="months"&&c.jsx(WU,{}),s==="years"&&c.jsx(YU,{})]})}),vS=a.forwardRef(function({className:t="",...n},o){const r=at(),{onClear:s,onToday:l,locale:u}=Ne();return c.jsxs("div",{ref:o,className:i.cn(uU,r.footer,t),...n,children:[c.jsx(Vt,{variant:"ghost",size:"small",className:i.cn(LU,r.footerToday),onClick:l,children:u.today}),c.jsx(Vt,{variant:"ghost",size:"small",status:"danger",className:r.footerClear,onClick:s,children:u.clear})]})});Ni.displayName="Calendar.Header";wi.displayName="Calendar.Grid";vS.displayName="Calendar.Footer";Jn.displayName="CalendarInteractiveCell";function $U(){return c.jsxs(c.Fragment,{children:[c.jsx(Ni,{}),c.jsx(wi,{})]})}const LS={weekDays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"};function XU(e){const{mode:t="single",variant:n="default",size:o="base",defaultMonth:r,initialView:s="days",locale:l=LS,minDate:u,maxDate:d,navPrevIcon:f,navNextIcon:m,renderDay:p,value:C,defaultValue:S,onValueChange:g}=e,h=n==="gloss",x=a.useMemo(()=>Et(new Date),[]),A=C!==void 0,[b,L]=a.useState(()=>Dz(t,S)),_=A?C:b,v=a.useRef(_);v.current=_;const R=a.useCallback(M=>{const W=v.current,Y=typeof M=="function"?M(W):M;v.current=Y,A||L(Y),g==null||g(Y)},[A,g]),[T,E]=a.useState(s),[I,O]=a.useState(()=>Iz(r,t,_,x)),[N,y]=a.useState(null),[w,P]=a.useState(null),[k,j]=a.useState(()=>kz({mode:t,resolvedValue:_,today:x,minDate:u,maxDate:d})),B=a.useCallback(M=>{j(Pe(M,u,d))},[u,d]),D=a.useCallback(M=>{const W=Pe(M,u,d);j(W),O(new Date(W.getFullYear(),W.getMonth(),1))},[u,d]),F=a.useMemo(()=>gS(t,_),[t,_]),H=a.useMemo(()=>SS(t,N,_),[t,N,_]),U=a.useMemo(()=>yz(t,N,_),[t,N,_]),G=a.useCallback(M=>{O(W=>Nz(W,T,M)),j(W=>Pe(T==="days"?Os(W,M):T==="months"?Go(W,M):Go(W,M*10),u,d))},[T,u,d]),K=a.useCallback(M=>{const W=Et(M);if(j(W),t==="single")R(Y=>{const Z=Y instanceof Date?Y:null;return Z&&De(Z,W)?null:W});else if(t==="multiple")R(Y=>{const Z=Array.isArray(Y)?Y:[],ce=Z.findIndex(z=>De(z,W));return ce>=0?Z.filter((z,Q)=>Q!==ce):[...Z,W]});else if(!N)y(W),R({start:null,end:null});else if(De(W,N))y(null);else{const Y=W<=N?W:N,Z=W<=N?N:W;y(null),P(null),R({start:Y,end:Z})}},[t,N,R]),V=a.useCallback(M=>{const W=I.getFullYear();O(new Date(W,M,1)),j(Y=>{const Z=Lr(W,M);return Pe(new Date(W,M,Math.min(Y.getDate(),Z)),u,d)}),E("days")},[I,u,d]),oe=a.useCallback(M=>{O(new Date(M,I.getMonth(),1)),j(W=>Pe(new Date(M,W.getMonth(),W.getDate()),u,d)),E("months")},[I,u,d]),J=a.useCallback(()=>{y(null),P(null),R(t==="single"?null:t==="multiple"?[]:{start:null,end:null})},[t,R]),ee=a.useCallback(()=>{O(new Date(x.getFullYear(),x.getMonth(),1)),j(Pe(x,u,d)),E("days")},[x,u,d]),se=a.useMemo(()=>({mode:t,view:T,setView:E,viewDate:I,navigate:G,focusedDate:k,setFocusedDate:B,moveDayFocus:D,selectedDates:F,rangeStart:H,rangeEnd:U,hoverDate:w,setHoverDate:P,onDayPress:K,onMonthPress:V,onYearPress:oe,onClear:J,onToday:ee,size:o,variant:n,locale:l,minDate:u,maxDate:d,today:x,navPrevIcon:f,navNextIcon:m,renderDay:p}),[t,T,I,G,k,B,D,F,H,U,w,K,V,oe,J,ee,o,n,l,u,d,x,f,m,p]);return{isGloss:h,variant:n,size:o,contextValue:se,today:x}}const _S=a.forwardRef(function(t,n){const{mode:o,variant:r,size:s,defaultMonth:l,initialView:u,locale:d,minDate:f,maxDate:m,navPrevIcon:p,navNextIcon:C,renderDay:S,value:g,defaultValue:h,onValueChange:x,classNames:A,children:b,className:L="",..._}=t,{isGloss:v,contextValue:R}=XU(t),T=i.useMergedGlossPanelRef(n,v),E=b??c.jsx($U,{});return c.jsx(hz,{value:R,children:c.jsx(xz,{classNames:A,children:c.jsx("div",{ref:T,className:RU(R.variant,R.size,v,i.cn("",A==null?void 0:A.root,L)),..._,children:v?c.jsx("div",{className:i.cn(qz,A==null?void 0:A.glossContent),children:E}):E})})})});_S.displayName="Calendar";const KU=Object.assign(_S,{Header:Ni,Grid:wi,Footer:vS,NavPrev:Ri,NavNext:Ii,Title:yi,Day:AS}),TS=a.createContext(null),Ps=a.createContext({});function qU({value:e,children:t}){return c.jsx(TS.Provider,{value:e,children:t})}function ZU({classNames:e,children:t}){const n=a.useContext(Ps),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ps.Provider,{value:o,children:t})}function kt(){const e=a.useContext(TS);if(!e)throw new Error("ColorPicker compound parts must be inside <ColorPicker>.");return e}function an(){return a.useContext(Ps)}const QU=1,Dr=10;function JU(e=Se.colorPickerArea){return e}function e2(e,t,n=Se.colorPickerAreaValue){return pn(n,{saturation:e,brightness:t})}function t2(e=Se.colorPickerContent){return e}function n2(e=Se.colorPickerHex){return e}function o2(e=Se.colorPickerAlpha){return e}function r2(e,t=Se.colorPickerSelected){return pn(t,{hex:e})}function Mt(e,t,n){return Math.max(t,Math.min(n,e))}function zt({h:e,s:t,v:n,a:o}){const r=t/100,s=n/100,u=(e%360+360)%360/60,d=Math.floor(u),f=u-d,m=s*(1-r),p=s*(1-r*f),C=s*(1-r*(1-f));let S=0,g=0,h=0;switch(d%6){case 0:S=s,g=C,h=m;break;case 1:S=p,g=s,h=m;break;case 2:S=m,g=s,h=C;break;case 3:S=m,g=p,h=s;break;case 4:S=C,g=m,h=s;break;case 5:S=s,g=m,h=p;break}return{r:Math.round(S*255),g:Math.round(g*255),b:Math.round(h*255),a:o}}function ES({r:e,g:t,b:n,a:o}){const r=e/255,s=t/255,l=n/255,u=Math.max(r,s,l),d=Math.min(r,s,l),f=u-d;let m=0;return f>0&&(u===r?m=((s-l)/f+6)%6:u===s?m=(l-r)/f+2:m=(r-s)/f+4,m=Math.round(m*60)),{h:m,s:u===0?0:Math.round(f/u*100),v:Math.round(u*100),a:o}}function RS({r:e,g:t,b:n,a:o}){const r=l=>Math.round(Mt(l,0,255)).toString(16).padStart(2,"0"),s=`#${r(e)}${r(t)}${r(n)}`;return o<100?s+r(Math.round(o/100*255)):s}function IS(e){const t=e.replace(/^#/,"");return t.length===3?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:100}:t.length===6?{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:100}:t.length===8?{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:Math.round(parseInt(t.slice(6,8),16)/255*100)}:null}function Ao(e){return RS(zt(e))}function Bc(e){const t=e.trim().replace(/^#/,"").toLowerCase();return t.length===3?`#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`:`#${t}`}function eo(e){const t=IS(e);return t?ES(t):null}function yS(e){const{r:t,g:n,b:o}=zt(e);return e.a<100?`rgba(${t},${n},${o},${(e.a/100).toFixed(2)})`:`rgb(${t},${n},${o})`}function Vo(e){const{r:t,g:n,b:o}=zt({h:e,s:100,v:100,a:100});return`rgb(${t},${n},${o})`}function s2(e,t){const n=t?"to right":"to top",{r:o,g:r,b:s}=zt(e);return{background:`linear-gradient(${n}, rgba(${o},${r},${s},0), rgb(${o},${r},${s}))`}}function a2({hsva:e,setHsva:t}){const n=a.useRef(null),o=a.useRef(null),r=a.useRef(!1),s=a.useCallback((d,f)=>{const m=n.current;if(!m)return;const p=m.getBoundingClientRect(),C=Mt((d-p.left)/p.width*100,0,100),S=Mt(100-(f-p.top)/p.height*100,0,100);t({...e,s:Math.round(C),v:Math.round(S)})},[e,t]);a.useEffect(()=>{const d=m=>{r.current&&s(m.clientX,m.clientY)},f=()=>{r.current=!1};return window.addEventListener("pointermove",d),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f),()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)}},[s]);const l=a.useCallback(d=>{var f;d.preventDefault(),r.current=!0,s(d.clientX,d.clientY),(f=o.current)==null||f.focus({preventScroll:!0})},[s]),u=a.useCallback(d=>{const m=d.shiftKey?Dr:QU;let p=e.s,C=e.v;switch(d.key){case"ArrowLeft":p=e.s-m;break;case"ArrowRight":p=e.s+m;break;case"ArrowUp":C=e.v+m;break;case"ArrowDown":C=e.v-m;break;case"Home":p=0;break;case"End":p=100;break;case"PageUp":C=e.v+Dr;break;case"PageDown":C=e.v-Dr;break;default:return}d.preventDefault(),t({...e,s:Math.round(Mt(p,0,100)),v:Math.round(Mt(C,0,100))})},[e,t]);return{areaRef:n,thumbRef:o,handlePointerDown:l,handleThumbKeyDown:u}}const NS="#3b82f6",l2={h:217,s:90,v:96,a:100};function i2(e,t){return eo(e??t??NS)??l2}const wS={small:"small",base:"base",mid:"mid",large:"large"},c2={small:"small",base:"base",mid:"mid",large:"large"},u2={small:"w-52",base:"w-64",mid:"w-72",large:"w-80"},d2={small:"h-32",base:"h-40",mid:"h-48",large:"h-56"},f2={small:"p-small gap-small",base:"p-mid gap-mid",mid:"p-large gap-large",large:"p-xlarge gap-xlarge"},m2="relative w-full touch-none select-none rounded-small cursor-crosshair overflow-hidden",p2="absolute z-10 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white [box-shadow:0_0_0_1px_var(--color-foreground),var(--shadow-mid)] focus-ring",C2="flex items-center gap-small",g2="flex min-w-0 flex-1 flex-col gap-xsmall",S2="flex min-w-0 items-center gap-small",h2="flex min-w-0 shrink items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring",x2="text-small text-muted select-none",b2=`w-[8ch] bg-transparent text-small font-mono uppercase text-foreground outline-none ${we}`,A2="flex shrink-0 items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring",v2=`w-8 bg-transparent text-right text-small font-mono text-foreground outline-none ${we}`,L2="text-small text-muted select-none",_2="flex flex-wrap gap-xsmall border-t-token pt-small",T2="flex flex-col text-foreground";function E2(e,t){return i.cn(T2,Ee(e).rounded,u2[e],f2[e],t)}function R2(e,t){return i.cn(m2,d2[e],t)}const I2="overflow-hidden",y2="opacity-48",jc="flex flex-col gap-xsmall",N2="flex items-center justify-between",w2="text-muted",O2="font-w-mid text-foreground",P2={hue:"Hue",saturation:"Saturation",value:"Value",alpha:"Alpha",red:"Red",green:"Green",blue:"Blue"};function D2({size:e,orientation:t,disabled:n,className:o}){const r=t==="horizontal";return i.cn(gC({isHorizontal:r,size:e,className:o}),I2,Ye[e],n&&y2)}function k2(e,t,n){const o=n==="horizontal";if(e==="alpha")return s2(t,o);const r=o?"to right":"to top",{r:s,g:l,b:u}=zt(t);switch(e){case"hue":return{background:`linear-gradient(${r}, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)`};case"saturation":{const d=zt({...t,s:0}),f=Vo(t.h);return{background:`linear-gradient(${r}, rgb(${d.r},${d.g},${d.b}), ${f})`}}case"value":{const d=Vo(t.h);return{background:`linear-gradient(${r}, #000, ${d})`}}case"red":return{background:`linear-gradient(${r}, rgb(0,${l},${u}), rgb(255,${l},${u}))`};case"green":return{background:`linear-gradient(${r}, rgb(${s},0,${u}), rgb(${s},255,${u}))`};case"blue":return{background:`linear-gradient(${r}, rgb(${s},${l},0), rgb(${s},${l},255))`}}}const B2={hue:{min:0,max:360,step:1},saturation:{min:0,max:100,step:1},value:{min:0,max:100,step:1},alpha:{min:0,max:100,step:1},red:{min:0,max:255,step:1},green:{min:0,max:255,step:1},blue:{min:0,max:255,step:1}},OS={hue:0,saturation:100,value:100,alpha:100,red:255,green:0,blue:0},Pn=a.forwardRef(function({channel:t,color:n={h:0,s:100,v:100,a:100},value:o,defaultValue:r,onValueChange:s,size:l="base",orientation:u="horizontal",disabled:d=!1,className:f="",...m},p){const{min:C,max:S,step:g}=B2[t],[h,x]=Re({value:o,defaultValue:r??OS[t]}),A=a.useRef(!1),b=a.useRef(null),[L,_]=a.useState(!1),[v,R]=a.useState(0),T=a.useMemo(()=>CC(void 0,l),[l]),[E,I]=a.useState(T);a.useLayoutEffect(()=>{const D=b.current;if(!D)return;const F=()=>{const U=D.getBoundingClientRect(),{trackSpanPx:G,thumbSpanPx:K}=xo(U,u);R(G),K>0&&I(V=>V===K?V:K)};F();const H=new ResizeObserver(F);return H.observe(D),()=>H.disconnect()},[u]);const O=a.useCallback(D=>{b.current=D,typeof p=="function"?p(D):p&&(p.current=D)},[p]),N=a.useCallback(D=>{const F=Mt(Math.round(D/g)*g,C,S);x(F),s==null||s(F)},[C,S,g,x,s]),y=E>0?E:T,w=a.useCallback((D,F)=>{const H=b.current;if(!H||d)return;const U=H.getBoundingClientRect();N(Cs(D,F,U,u,C,S,y))},[d,y,N,S,C,u]);a.useEffect(()=>{const D=H=>{A.current&&w(H.clientX,H.clientY)},F=()=>{A.current=!1,_(!1)};return window.addEventListener("pointermove",D),window.addEventListener("pointerup",F),window.addEventListener("pointercancel",F),()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",F),window.removeEventListener("pointercancel",F)}},[w]);const P=a.useCallback(D=>{d||D.button!==0||(D.preventDefault(),A.current=!0,_(!0),w(D.clientX,D.clientY))},[d,w]),k=a.useCallback(D=>{d||D.button!==0||(D.stopPropagation(),A.current=!0,_(!0),D.currentTarget.setPointerCapture(D.pointerId))},[d]),j=a.useCallback(D=>{if(d)return;let F=0;if(u==="horizontal"){if(D.key==="ArrowRight")F=g;else if(D.key==="ArrowLeft")F=-g;else if(D.key==="PageUp")F=g*10;else if(D.key==="PageDown")F=-g*10;else if(D.key==="Home"){N(C);return}else if(D.key==="End"){N(S);return}}else if(D.key==="ArrowUp")F=g;else if(D.key==="ArrowDown")F=-g;else if(D.key==="Home"){N(C);return}else if(D.key==="End"){N(S);return}F!==0&&(D.preventDefault(),N(h+F))},[d,u,g,C,S,h,N]),B=ps(h,C,S,v,y);return c.jsx("div",{ref:O,role:"presentation",className:D2({size:l,orientation:u,disabled:d,className:f}),style:k2(t,n,u),onPointerDown:P,...m,children:c.jsx(yn,{size:l,percent:B,orientation:u,disabled:d,active:L,ariaLabel:P2[t],ariaValueNow:h,ariaValueMin:C,ariaValueMax:S,onPointerDown:k,onKeyDown:j})})});Pn.displayName="ColorSliderTrack";const PS=a.forwardRef(function({channel:t,color:n,label:o,size:r="base",orientation:s="horizontal",className:l="",children:u,...d},f){return u?c.jsx("div",{ref:f,className:i.cn(jc,l),children:u}):c.jsxs("div",{ref:f,className:i.cn(jc,l),children:[o?c.jsxs("div",{className:N2,children:[c.jsx(q,{as:"span",variant:"small",className:w2,children:o}),c.jsx(q,{as:"span",variant:"small",className:O2,children:d.value??d.defaultValue??OS[t]})]}):null,c.jsx(Pn,{channel:t,color:n,size:r,orientation:s,...d})]})});PS.displayName="ColorSliderRoot";const Mc={small:"h-5 w-5",base:"h-6 w-6",mid:"h-7 w-7",large:"h-8 w-8"},Fc={circle:"rounded-full",rounded:"rounded-small",square:"rounded-none"};function j2(e,t){if(typeof t["aria-label"]=="string")return t["aria-label"];if(typeof t["aria-labelledby"]!="string")return`Select color ${e}`}const to=a.forwardRef(function({color:t="transparent",size:n="base",shape:o="rounded",selected:r=!1,disabled:s=!1,className:l="",onClick:u,onPointerEnter:d,onPointerLeave:f,onPointerDown:m,...p},C){const{setRefs:S,handlePointerEnter:g,handlePointerLeave:h,handlePointerDown:x}=Uo({isGloss:!1,enabled:!s,hasHoverShadow:!0,forwardedRef:C,onPointerEnter:d,onPointerLeave:f,onPointerDown:m}),{"aria-label":A,...b}=p,L=!!u,_=typeof A=="string"||typeof b["aria-labelledby"]=="string";if(!L&&!_)return c.jsx("span",{"aria-hidden":!0,className:i.cn("relative shrink-0 overflow-hidden",Mc[n],Fc[o],l),style:{backgroundColor:t}});const v=A??(L?j2(t,p):void 0);return c.jsx("button",{ref:S,type:"button",disabled:s,onClick:u,onPointerEnter:g,onPointerLeave:h,onPointerDown:x,"aria-label":v,className:i.cn("relative shrink-0 origin-center overflow-hidden","outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",i.SHADOW_LIFT_MOTION_CLASS,Mc[n],Fc[o],r&&"ring-2 ring-primary ring-offset-2 ring-offset-background",s?"cursor-not-allowed opacity-40":u?"cursor-pointer":"cursor-default",l),style:{backgroundColor:t},...b})});to.displayName="ColorSwatch";const Oi=a.forwardRef(function({className:t,onPointerDown:n,style:o,...r},s){const l=Ie(),{hsva:u,setHsva:d,size:f}=kt(),m=an(),{areaRef:p,thumbRef:C,handlePointerDown:S,handleThumbKeyDown:g}=a2({hsva:u,setHsva:d}),h=a.useCallback(b=>{p.current=b,ue(s,b)},[p,s]),x=Vo(u.h),A=yS(u);return c.jsx("div",{ref:h,role:"group",className:R2(f,i.cn(m.area,t)),style:{background:`linear-gradient(to bottom, transparent, #000), linear-gradient(to right, #fff, ${x})`,...o},onPointerDown:b=>{n==null||n(b),b.defaultPrevented||S(b)},...r,children:c.jsx("button",{ref:C,type:"button",role:"slider",tabIndex:0,"aria-label":JU(l.colorPickerArea),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u.s,"aria-valuetext":e2(u.s,u.v,l.colorPickerAreaValue),className:i.cn(p2,m.areaThumb),style:{left:`${u.s}%`,top:`${100-u.v}%`,width:"14px",height:"14px",backgroundColor:A},onKeyDown:g,onPointerDown:b=>{b.stopPropagation(),S(b)}})})});Oi.displayName="ColorPicker.Area";const Pi=a.forwardRef(function({className:t,...n},o){const r=Ie(),{hex:s,setHsva:l}=kt(),u=an(),[d,f]=a.useState(!1),[m,p]=a.useState(""),C=a.useCallback(g=>{const h=`#${g}`,x=eo(h);x&&l(x)},[l]),S=d?m:s.slice(1);return c.jsxs("div",{ref:o,className:i.cn(h2,u.hexInput,t),...n,children:[c.jsx("span",{className:i.cn(x2,u.hexPrefix),children:"#"}),c.jsx("input",{type:"text",value:S,maxLength:8,spellCheck:!1,"aria-label":n2(r.colorPickerHex),className:i.cn(b2,u.hexInputField,we),onFocus:()=>{f(!0),p(s.slice(1))},onChange:g=>p(g.target.value.replace(/[^0-9a-fA-F]/g,"").toUpperCase()),onBlur:()=>{C(m),f(!1)},onKeyDown:g=>{g.key==="Enter"&&(C(m),f(!1))}})]})});Pi.displayName="ColorPicker.HexInput";const Di=a.forwardRef(function({className:t,...n},o){const r=Ie(),{hsva:s,setHsva:l}=kt(),u=an();return c.jsxs("div",{ref:o,className:i.cn(A2,u.alphaInput,t),...n,children:[c.jsx("input",{type:"text",value:Math.round(s.a),"aria-label":o2(r.colorPickerAlpha),className:i.cn(v2,u.alphaInputField,we),onChange:d=>{const f=parseInt(d.target.value,10);Number.isNaN(f)||l({...s,a:Mt(f,0,100)})}}),c.jsx("span",{className:i.cn(L2,u.alphaSuffix),children:"%"})]})});Di.displayName="ColorPicker.AlphaInput";const ki=a.forwardRef(function({presets:t,className:n,...o},r){const{hex:s,setHsva:l,size:u}=kt(),d=an();return c.jsx("div",{ref:r,className:i.cn(_2,d.presets,n),...o,children:t.map(f=>c.jsx(to,{color:f,size:wS[u],shape:"rounded",selected:s.toLowerCase()===f.toLowerCase(),className:d.presetSwatch,onClick:()=>{const m=eo(f);m&&l(m)}},f))})});ki.displayName="ColorPicker.Presets";function M2({showAlpha:e,presets:t}){const{hsva:n,setHsva:o,hex:r,size:s}=kt(),l=an(),u=c2[s];return c.jsxs(c.Fragment,{children:[c.jsx(Oi,{}),c.jsxs("div",{className:i.cn(C2,l.slidersRow),children:[c.jsx(to,{color:r,size:"mid",shape:"circle",className:i.cn("shrink-0",l.previewSwatch)}),c.jsxs("div",{className:i.cn(g2,l.slidersStack),children:[c.jsx(Pn,{channel:"hue",color:n,value:n.h,size:u,className:l.hueSlider,onValueChange:d=>o({...n,h:d})}),e?c.jsx(Pn,{channel:"alpha",color:n,value:n.a,size:u,className:l.alphaSlider,onValueChange:d=>o({...n,a:d})}):null]})]}),c.jsxs("div",{className:i.cn(S2,l.inputsRow),children:[c.jsx(Pi,{}),e?c.jsx(Di,{}):null]}),t&&t.length>0?c.jsx(ki,{presets:t}):null]})}const DS=a.forwardRef(function({swatchSize:t,className:n,children:o,asChild:r,...s},l){const u=Ie(),{hex:d,disabled:f,size:m}=kt(),p=an();return c.jsx(ke.Trigger,{ref:l,asChild:r,className:i.cn(p.trigger,n),...s,children:o??c.jsx(to,{color:d,size:t??wS[m],shape:"rounded",disabled:f,"aria-label":r2(d,u.colorPickerSelected)})})});DS.displayName="ColorPicker.Trigger";const kS=a.forwardRef(function({showAlpha:t=!1,presets:n,className:o,children:r,...s},l){const u=Ie(),{size:d}=kt(),f=an();return c.jsx(ke.Content,{ref:l,unstyled:!0,offset:Gn,align:"start","aria-label":t2(u.colorPickerContent),className:i.cn(f.content,o),...s,children:c.jsx("div",{className:E2(d,f.contentPanel),children:r??c.jsx(M2,{showAlpha:t,presets:n})})})});kS.displayName="ColorPicker.Content";function F2({value:e,defaultValue:t=NS,onValueChange:n,size:o="base",disabled:r=!1}){const s=e!==void 0,[l,u]=a.useState(()=>i2(e,t));a.useLayoutEffect(()=>{!s||e==null||u(p=>Bc(e)===Bc(Ao(p))?p:eo(e)??p)},[s,e]);const d=a.useCallback(p=>{u(p),n==null||n(Ao(p))},[n]),f=Ao(l);return{contextValue:a.useMemo(()=>({hsva:l,setHsva:d,hex:f,disabled:r,size:o}),[l,d,f,r,o])}}function BS({children:e,value:t,defaultValue:n,onValueChange:o,open:r,defaultOpen:s=!1,onOpenChange:l,size:u="base",variant:d="default",side:f="bottom",disabled:m=!1,classNames:p}){const{contextValue:C}=F2({value:t,defaultValue:n,onValueChange:o,size:u,disabled:m});return c.jsx(qU,{value:C,children:c.jsx(ZU,{classNames:p,children:c.jsx(ke,{open:r,defaultOpen:s,onOpenChange:l,size:u,side:f,variant:d==="gloss"?"gloss":"default",children:e})})})}BS.displayName="ColorPicker";const H2=Object.assign(BS,{Trigger:DS,Content:kS,Area:Oi,HexInput:Pi,AlphaInput:Di,Presets:ki}),G2=Object.assign(PS,{Track:Pn}),Bi=a.createContext(null),Ds=a.createContext({});function V2({value:e,children:t}){return c.jsx(Bi.Provider,{value:e,children:t})}function z2({classNames:e,children:t}){const n=a.useContext(Ds),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ds.Provider,{value:o,children:t})}function jS(){const e=a.useContext(Bi);if(!e)throw new Error("Components TimeField must be inside <TimeField>.");return e}function U2(){return a.useContext(Bi)}function no(){return a.useContext(Ds)}function W2({labelConnected:e,labelId:t,timeLabel:n=Se.time}){return{"aria-label":e?void 0:n,"aria-labelledby":e?t:void 0}}function Y2(e,t=Se){switch(e){case"h":return t.timeHours;case"m":return t.timeMinutes;case"s":return t.timeSeconds}}function $2({seg:e,value:t,required:n,isDanger:o,isFirstSegment:r,disabled:s,segLabel:l}){return{role:"spinbutton","aria-label":l,"aria-valuemin":0,"aria-valuemax":e==="h"?23:59,"aria-valuenow":t,"aria-valuetext":String(t).padStart(2,"0"),"aria-required":r&&n?!0:void 0,"aria-invalid":r&&o?!0:void 0,tabIndex:s?-1:0}}function X2(e){return e==="danger"||e==="default"?"default":e}function K2(e){return e==="segmented"||e==="gloss"?"default":e}const q2="bg-primary-tint",Z2="border-r-token",Q2="border-l-token",J2=`pointer-events-none absolute h-px w-px opacity-0 ${we}`,eW="inline-flex min-w-[2ch] select-none items-center justify-center outline-none",tW="h-[1.65em] min-w-[2.25ch] rounded-xsmall px-xsmall bg-default-hover",nW="rounded-xsmall px-[length:calc(var(--border-width)*2)]",oW="bg-primary text-primary-foreground",rW="cursor-not-allowed",sW="cursor-default",aW="inline-flex w-[0.45em] shrink-0 select-none items-center justify-center self-center text-muted",lW="mx-[length:var(--border-width)]",iW="inline-flex items-center",cW="relative flex min-w-0 flex-1 items-center font-mono tabular-nums leading-none",uW="flex min-w-0 w-full items-stretch",dW="gap-xsmall",fW={small:i.affixSlotClass("small"),base:i.affixSlotClass("base"),mid:i.affixSlotClass("mid"),large:i.affixSlotClass("large")};function mW(e="default"){return q2}function pW({side:e,status:t,size:n,slotClass:o}){return i.cn(fW[n],mW(t),e==="prefix"?Z2:Q2,o)}function CW({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e==="segmented"?"default":e})}function gW({variant:e,status:t,disabled:n,compact:o,shellSurface:r,glossShellHoverMotionClass:s,standardShellHoverMotionClass:l,slotClass:u,className:d}){const f=e==="gloss";return i.cn("m-0 min-w-0 overflow-hidden rounded-base p-0",f?"relative":i.cn("border-1"),o?"w-fit shrink-0":"w-full min-w-0",r,i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),f?"":i.fieldShellHoverClass(!n,t,K2(e)),f?s:l,n?"cursor-not-allowed opacity-55 shadow-token-base":"",u,d)}function SW({variant:e,slotClass:t}){const n=e==="gloss";return i.cn(uW,!n&&i.cn("min-h-full"),t)}function hW({slotClass:e}={}){return i.cn(iW,e)}function xW({variant:e,size:t,compact:n,slotClass:o}){const r=i.CONTROL_SIZE_LAYOUT[t],s=r.controlText==="small"?"text-small":r.controlText==="mid"?"text-mid":"text-base";return i.cn(cW,n?"justify-center px-small":r.padX,r.padY,e==="segmented"&&dW,s,o)}function bW({variant:e,focused:t,disabled:n,slotClass:o}){return i.cn(eW,e==="segmented"?tW:nW,t&&oW,n?rW:sW,o)}function AW({variant:e,slotClass:t}){return i.cn(aW,e==="segmented"&&lW,t)}function vW({compact:e,slotClass:t,className:n}){return i.cn(e&&"w-fit",t,n)}const ks={h:23,m:59,s:59};function Hc(e){const t=e.split(":").map(Number);return{h:Number.isFinite(t[0])?Math.max(0,Math.min(23,t[0])):0,m:Number.isFinite(t[1])?Math.max(0,Math.min(59,t[1])):0,s:Number.isFinite(t[2])?Math.max(0,Math.min(59,t[2])):0}}function LW(e,t){const n=String(e.h).padStart(2,"0"),o=String(e.m).padStart(2,"0"),r=String(e.s).padStart(2,"0");return t==="HH:mm:ss"?`${n}:${o}:${r}`:`${n}:${o}`}function Gc(e,t){return e[t]}function Tt(e,t,n){const o=Math.max(0,Math.min(ks[t],n));return{...e,[t]:o}}function _W(e){return e==="HH:mm:ss"?["h","m","s"]:["h","m"]}function TW({shellRef:e,disabled:t,variant:n,onPointerDown:o,onPointerEnter:r,onPointerLeave:s}){const l=n==="gloss",u=i.useFieldShellHoverLift(e,!t&&!l),d=i.useGlossFieldShellMotion(e,!t&&l),f=a.useCallback((S,g)=>{g(S),!t&&l&&d.bindShellRef(S)},[t,d,l]),m=a.useCallback(S=>{if(o==null||o(S),S.defaultPrevented||t||l)return;const g=e.current;!g||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(g)},[t,l,o,e]),p=a.useCallback(S=>{r==null||r(S),!S.defaultPrevented&&(l?d.onShellPointerEnter(S):u.onShellPointerEnter(S))},[d,l,r,u]),C=a.useCallback(S=>{s==null||s(S),l?d.onShellPointerLeave(S):u.onShellPointerLeave(S)},[d,l,s,u]);return{isGloss:l,bindShellRef:f,shellPointerDown:l&&!t?d.onShellPointerDown:m,shellPointerEnter:p,shellPointerLeave:C,shellFocusCapture:l&&!t?d.onShellFocusIn:void 0,shellBlurCapture:l&&!t?d.onShellFocusOut:void 0,glossShellHoverMotionClass:d.shellHoverMotionClass,standardShellHoverMotionClass:u.shellHoverMotionClass}}function EW({value:e,defaultValue:t="00:00",onValueChange:n,format:o="HH:mm",disabled:r=!1,size:s,status:l,variant:u,compact:d,id:f,onPointerDown:m,onPointerEnter:p,onPointerLeave:C,ref:S}){const g=St("time"),h=U2(),x=s??(h==null?void 0:h.size)??"base",A=l??(h==null?void 0:h.status)??"default",b=u??(h==null?void 0:h.variant)??"default",L=d??(h==null?void 0:h.compact)??!1,_=b==="gloss",v=h==null?void 0:h.fieldId,R=(h==null?void 0:h.labelId)??"",T=(h==null?void 0:h.labelConnected)??!1,E=(h==null?void 0:h.required)??!1,[I,O]=Re({value:e!==void 0?Hc(e):void 0,defaultValue:()=>Hc(t),onChange:X=>n==null?void 0:n(LW(X,o))}),N=a.useRef(null),[y,w]=a.useState(null),P=a.useRef(null),k=a.useRef(null),j=a.useRef(null),B=a.useRef(null),D=a.useRef(null),F=a.useMemo(()=>({h:j,m:B,s:D}),[]),H=a.useMemo(()=>_W(o),[o]),U=a.useCallback(X=>{P.current=X,typeof S=="function"?S(X):S&&(S.current=X)},[S]),G=TW({shellRef:P,disabled:r,variant:b,onPointerDown:m,onPointerEnter:p,onPointerLeave:C}),K=a.useCallback(X=>{G.bindShellRef(X,U)},[U,G]),V=a.useCallback(X=>{var re,pe;N.current=null,w(X),(re=P.current)==null||re.scrollIntoView({block:"nearest",inline:"center"}),(pe=k.current)==null||pe.focus({preventScroll:!0})},[]),oe=a.useCallback((X,re)=>{const pe=H.indexOf(X);re==="next"&&pe<H.length-1&&V(H[pe+1]),re==="prev"&&pe>0&&V(H[pe-1])},[H,V]),J=a.useCallback(()=>{const X=N.current;X&&(O(Tt(I,X.seg,X.digit)),N.current=null)},[I,O]),ee=a.useCallback((X,re)=>{const pe=ks[X],fe=N.current;if(fe&&fe.seg===X){const Le=fe.digit*10+re;Le>pe?(O(Tt(I,X,fe.digit)),re*10>pe?(O(Tt(I,X,Math.min(re,pe))),N.current=null,oe(X,"next")):N.current={seg:X,digit:re}):(O(Tt(I,X,Le)),N.current=null,oe(X,"next"))}else re*10>pe?(O(Tt(I,X,Math.min(re,pe))),N.current=null,oe(X,"next")):(N.current={seg:X,digit:re},O(Tt(I,X,re)))},[I,oe,O]),se=a.useCallback((X,re)=>{if(r)return;const pe=ks[re],fe=parseInt(X.key,10);if(!Number.isNaN(fe))X.preventDefault(),ee(re,fe);else if(X.key==="ArrowUp"){X.preventDefault(),N.current=null;const Le=Gc(I,re);O(Tt(I,re,Le>=pe?0:Le+1))}else if(X.key==="ArrowDown"){X.preventDefault(),N.current=null;const Le=Gc(I,re);O(Tt(I,re,Le<=0?pe:Le-1))}else X.key==="ArrowLeft"||X.key==="Backspace"?(X.preventDefault(),J(),oe(re,"prev")):X.key==="ArrowRight"?(X.preventDefault(),J(),oe(re,"next")):X.key==="Tab"&&J()},[ee,J,r,I,oe,O]),M=a.useCallback(X=>{const re=P.current,pe=X.relatedTarget;if(!(re&&pe&&re.contains(pe))){if(re&&pe==null){requestAnimationFrame(()=>{const fe=document.activeElement;re.contains(fe)||(J(),w(null))});return}J(),w(null)}},[J]),W=a.useCallback(X=>{N.current=null,w(X)},[]),Y=a.useCallback(X=>{const re=X.currentTarget.value;if(X.currentTarget.value="",!(r||!y))for(const pe of re){const fe=parseInt(pe,10);Number.isNaN(fe)||ee(y,fe)}},[ee,r,y]),Z=a.useCallback(X=>{r||!y||se(X,y)},[r,y,se]),ce=a.useCallback((X,re)=>{X.stopPropagation(),V(re)},[V]),z=a.useCallback(X=>{if(r)return;const re=H[0];re&&(X.target instanceof Element&&X.target.closest('[role="spinbutton"]')||V(re))},[r,V,H]),Q=X=>{var re;return((re=N.current)==null?void 0:re.seg)===X&&y===X},te=X=>Q(X)?String(N.current.digit):String(I[X]).padStart(2,"0"),me=CW({variant:b}),Ae=W2({labelConnected:T,labelId:R,timeLabel:g}),he=je(h!=null&&h.hintConnected?h.hintId:void 0,h!=null&&h.errorConnected?h.errorId:void 0);return{size:x,status:A,variant:b,compact:L,disabled:r,isGloss:_,format:o,fieldId:v,controlId:f??v,shellAria:Ae,ariaDescribedBy:he,required:E,hms:I,segments:H,segRefById:F,keyboardInputRef:k,bindShellRef:K,shellMotion:G,shellSurface:me,focusedSeg:y,handleSegKeyDown:se,handleFieldBlur:M,handleSegFocus:W,handleKeyboardInput:Y,handleKeyboardInputKeyDown:Z,handleSegClick:ce,handleShellClick:z,segDisplay:te}}function Vc({side:e,status:t,size:n,className:o,children:r}){return c.jsx("span",{className:pW({side:e,status:t,size:n,slotClass:o}),children:r})}const ji=a.forwardRef(function(t,n){const{value:o,defaultValue:r,onValueChange:s,format:l,disabled:u,size:d,status:f,variant:m,compact:p,prefix:C,suffix:S,segmentSeparator:g,className:h,id:x,onPointerDown:A,onPointerEnter:b,onPointerLeave:L,..._}=t,v=Ie(),R=no(),T=EW({value:o,defaultValue:r,onValueChange:s,format:l,disabled:u,size:d,status:f,variant:m,compact:p,id:x,onPointerDown:A,onPointerEnter:b,onPointerLeave:L,ref:n});return c.jsx("fieldset",{ref:T.bindShellRef,id:T.controlId,"aria-label":T.shellAria["aria-label"],"aria-labelledby":T.shellAria["aria-labelledby"],"aria-describedby":T.ariaDescribedBy,"data-slot":"timefield-shell",onPointerDown:T.shellMotion.shellPointerDown,onPointerEnter:T.shellMotion.shellPointerEnter,onPointerLeave:T.shellMotion.shellPointerLeave,onFocusCapture:T.shellMotion.shellFocusCapture,onBlurCapture:T.shellMotion.shellBlurCapture,...T.disabled&&T.isGloss?{"data-gloss-disabled":""}:{},className:gW({variant:T.variant,status:T.status,disabled:T.disabled,size:T.size,compact:T.compact,shellSurface:T.shellSurface,glossShellHoverMotionClass:T.shellMotion.glossShellHoverMotionClass,standardShellHoverMotionClass:T.shellMotion.standardShellHoverMotionClass,slotClass:R.shell,className:h}),..._,children:c.jsxs("div",{className:SW({variant:T.variant,slotClass:R.shellInner}),onClick:T.handleShellClick,children:[C!=null?c.jsx(Vc,{side:"prefix",status:T.status,size:T.size,className:R.prefix,children:C}):null,c.jsxs("div",{className:xW({variant:T.variant,size:T.size,compact:T.compact,slotClass:R.segments}),children:[c.jsx("input",{ref:T.keyboardInputRef,type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"off","aria-hidden":!0,tabIndex:-1,disabled:T.disabled,className:i.cn(J2,R.keyboardInput,we),onInput:T.handleKeyboardInput,onKeyDown:T.handleKeyboardInputKeyDown,onBlur:T.handleFieldBlur}),T.segments.map((E,I)=>c.jsxs("span",{className:hW({slotClass:R.segmentGroup}),children:[I>0&&c.jsx("span",{"aria-hidden":!0,className:AW({variant:T.variant,slotClass:R.segmentSeparator}),children:g??":"}),c.jsx("span",{ref:T.segRefById[E],...$2({seg:E,value:T.hms[E],required:T.required,isDanger:T.status==="danger",isFirstSegment:E===T.segments[0],disabled:T.disabled,segLabel:Y2(E,v)}),className:bW({variant:T.variant,focused:T.focusedSeg===E,disabled:T.disabled,slotClass:R.segment}),onKeyDown:O=>T.handleSegKeyDown(O,E),onFocus:()=>T.handleSegFocus(E),onBlur:T.handleFieldBlur,onClick:O=>T.handleSegClick(O,E),children:T.segDisplay(E)})]},E))]}),S!=null?c.jsx(Vc,{side:"suffix",status:T.status,size:T.size,className:R.suffix,children:S}):null]})})});ji.displayName="TimeFieldControl";function MS({className:e,classNames:t,...n}){const o=no();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}MS.displayName="TimeFieldLabel";function Mi({children:e,id:t,className:n,...o}){const r=jS(),s=no();return c.jsx(le.Hint,{id:t??r.hintId,status:X2(r.status),className:i.cn(s.hint,n),...o,children:e})}Mi.displayName="TimeFieldHint";function Fi({children:e,id:t,className:n,...o}){const r=jS(),s=no();return c.jsx(le.Error,{id:t??r.errorId,role:"alert",className:i.cn(s.error,n),...o,children:e})}Fi.displayName="TimeFieldError";function RW({label:e,hint:t,error:n,labelId:o,controlProps:r}){const s=no();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:o,classNames:{root:s.label},children:e}):null,c.jsx(ji,{...r}),t!=null&&c.jsx(Mi,{children:t}),n!=null&&c.jsx(Fi,{children:n})]})}function IW({children:e,label:t,hint:n,error:o,id:r,required:s=!1,status:l="default",size:u="base",variant:d="default",compact:f=!1}){const m=a.useId(),p=r??`timefield-${m}`,C=Ve(p),S=ze(p),g=`${p}-label`,{isCompound:h,hasLabel:x,hasHint:A,hasError:b}=a.useMemo(()=>{const v=Ue(e);return{isCompound:v,hasLabel:t!=null||v&&ge(e,"Label"),hasHint:n!=null||v&&ge(e,"TimeFieldHint"),hasError:o!=null||v&&ge(e,"TimeFieldError")}},[e,o,n,t]),L=a.useMemo(()=>({fieldId:p,labelId:g,labelConnected:x,hintId:C,errorId:S,hintConnected:A,errorConnected:b,required:s,status:l,size:u,variant:d,compact:f}),[f,S,p,b,A,x,C,s,g,u,l,d]),_=a.useMemo(()=>({labelId:g,required:s}),[g,s]);return{fieldCtx:L,fieldLabelCtx:_,isCompound:h,fieldId:p,label:t,hint:n,error:o,status:l,size:u,variant:d,compact:f}}function FS({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u=!1,status:d="default",size:f="base",variant:m="default",value:p,defaultValue:C,onValueChange:S,format:g,disabled:h,compact:x=!1,prefix:A,suffix:b,segmentSeparator:L,..._}){const v=IW({children:e,label:t,hint:n,error:o,id:l,required:u,status:d,size:f,variant:m,compact:x}),R=v.isCompound?e:c.jsx(RW,{label:v.label,hint:v.hint,error:v.error,labelId:v.fieldCtx.labelId,controlProps:{id:v.fieldId,value:p,defaultValue:C,onValueChange:S,format:g,disabled:h,size:v.size,status:v.status,variant:v.variant,compact:v.compact,prefix:A,suffix:b,segmentSeparator:L}});return c.jsx(V2,{value:v.fieldCtx,children:c.jsx(z2,{classNames:s,children:c.jsx(Ge.Provider,{value:v.fieldLabelCtx,children:c.jsx(le,{className:vW({compact:v.compact,slotClass:s==null?void 0:s.root,className:r}),..._,children:R})})})})}FS.displayName="TimeField";const yW=Object.assign(FS,{Label:MS,Control:ji,Hint:Mi,Error:Fi});function _r(){return{"aria-hidden":!0,role:"presentation"}}function NW(e){return{"aria-busy":e,"aria-live":"polite"}}const Tr="relative overflow-hidden bg-primary-tint",wW="pointer-events-none absolute inset-0 -translate-x-full",OW="rounded-full",PW="h-control-base w-control-base",DW="flex flex-col gap-small",kW="h-[1em] rounded-small",BW="w-3/5",jW="w-full",MW="rounded-mid px-large py-mid",FW={none:"rounded-none",small:"rounded-small",mid:"rounded-mid",full:"rounded-full"},HW="skeleton-pulse 1.6s ease-in-out infinite",GW="skeleton-wave-slide 2s linear 0.2s infinite",VW="skeleton-shimmer 2s linear infinite",zW="linear-gradient(90deg, transparent 0%, var(--color-primary-tint-strong) 50%, transparent 100%)",UW="linear-gradient(90deg, var(--color-primary-tint) 0%, var(--color-primary-tint-strong) 50%, var(--color-primary-tint) 100%)";function WW(){return{animation:HW}}function YW(){return{backgroundImage:UW,backgroundSize:"400% 100%",animation:VW}}function Er(e){return e==="pulse"?WW():e==="shimmer"?YW():{}}function $W(){return{animation:GW,background:zW}}function XW(e){return FW[e]}function KW(e){return`${e*.06}s`}function Rr({className:e,style:t}){return c.jsx("span",{"aria-hidden":!0,className:i.cn(wW,e),style:{...$W(),...t}})}const HS=a.forwardRef(function({animation:t="wave",size:n=PW,className:o,classNames:r,style:s,...l},u){return c.jsx("div",{ref:u,className:i.cn(Tr,OW,n,r==null?void 0:r.root,o),style:{...Er(t),...s},..._r(),...l,children:t==="wave"?c.jsx(Rr,{className:r==null?void 0:r.wave}):null})});HS.displayName="SkeletonCircle";const GS=a.forwardRef(function({animation:t="wave",lines:n=3,lastShort:o=!0,className:r,classNames:s,style:l,...u},d){const f=Array.from({length:n},(m,p)=>o&&p===n-1?BW:jW);return c.jsx("div",{ref:d,className:i.cn(DW,s==null?void 0:s.root,r),style:l,..._r(),...u,children:f.map((m,p)=>c.jsx("div",{className:i.cn(Tr,kW,m,s==null?void 0:s.line),style:{...Er(t),animationDelay:KW(p)},children:t==="wave"?c.jsx(Rr,{className:s==null?void 0:s.wave}):null},p))})});GS.displayName="SkeletonText";const VS=a.forwardRef(function({animation:t="wave",className:n,classNames:o,style:r,children:s,...l},u){return c.jsxs("div",{ref:u,className:i.cn(Tr,MW,o==null?void 0:o.root,n),style:{...Er(t),...r},..._r(),...l,children:[t==="wave"?c.jsx(Rr,{className:o==null?void 0:o.wave}):null,s]})});VS.displayName="SkeletonBlock";const zS=a.forwardRef(function({busy:t=!0,className:n,classNames:o,children:r,...s},l){return c.jsx("div",{ref:l,className:i.cn(o==null?void 0:o.root,n),...NW(t),...s,children:r})});zS.displayName="SkeletonRegion";function qW({animation:e="wave",radius:t="small"}){return{animation:e,radius:t,isWave:e==="wave"}}const US=a.forwardRef(function({animation:t="wave",radius:n="small",className:o,classNames:r,style:s,children:l,...u},d){const{animation:f,radius:m,isWave:p}=qW({animation:t,radius:n});return c.jsxs("div",{ref:d,className:i.cn(Tr,XW(m),r==null?void 0:r.root,o),style:{...Er(f),...s},..._r(),...u,children:[p?c.jsx(Rr,{className:r==null?void 0:r.wave}):null,l]})});US.displayName="Skeleton";const ZW=Object.assign(US,{Circle:HS,Text:GS,Block:VS,Region:zS}),WS=a.createContext(null),YS=a.createContext(null),Bs=a.createContext({});function QW({value:e,children:t}){return c.jsx(WS.Provider,{value:e,children:t})}function Hi(){const e=a.useContext(WS);if(!e)throw new Error("Disclosure parts must be inside <Disclosure>.");return e}function JW({value:e,children:t}){return c.jsx(YS.Provider,{value:e,children:t})}function eY(){return a.useContext(YS)}function $S({classNames:e,children:t}){const n=a.useContext(Bs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Bs.Provider,{value:o,children:t})}function Gi(){return a.useContext(Bs)}function tY(e){return e==="outline"||e==="secondary"||e==="default"}function nY(e){return e.displayName}function oY(e){const t=[],n=[],o=[],r=[];return a.Children.forEach(e,s=>{if(!a.isValidElement(s)){r.push(s);return}const l=nY(s.type);l==="DisclosureTrigger"?t.push(s):l==="DisclosureContent"?n.push(s):l==="DisclosureHandle"?o.push(s):r.push(s)}),[...t,...n,...o,...r]}const rY={default:"flex flex-col",outline:"flex flex-col",secondary:"flex flex-col",card:"overflow-hidden rounded-base border-token bg-surface shadow-token-base",ghost:"flex flex-col",gloss:"flex flex-col"},zc={outline:"bg-transparent border-token rounded-mid text-foreground",secondary:"bg-secondary border-token rounded-mid text-secondary-foreground"},ln=i.cn("bg-transparent text-foreground",i.hoverVariant()),sY={default:i.cn("rounded-mid",ln),outline:i.cn("rounded-mid",ln),secondary:i.cn("rounded-mid",ln),card:ln,ghost:i.cn("rounded-mid",ln),gloss:i.cn("rounded-mid",ln)},aY="flex w-full select-none items-center gap-small text-left outline-none focus-ring",lY="cursor-not-allowed opacity-48",iY="cursor-pointer",cY="min-w-0 flex-1 origin-center",uY="block",dY="inline-flex shrink-0 origin-center items-center justify-center text-muted",fY="size-full",mY="text-primary",pY="overflow-hidden",CY="flex touch-none select-none shrink-0 cursor-grab items-center justify-center border-t-token py-xsmall active:cursor-grabbing",gY="pointer-events-none opacity-48",SY="h-1 w-10 rounded-full bg-tertiary",hY="gloss-panel gloss-deep rounded-mid text-foreground",xY="gloss-content text-muted";function XS(e){const t=It(e);return{pad:t.triggerPadding,text:t.titleVariant,titleClassName:t.titleClassName,chevron:i.CONTROL_SIZE_LAYOUT[e].chevronIcon}}function bY({variant:e,groupedCardShell:t,className:n,slotClass:o}){const r=e==="card"&&t?"":rY[e];return i.cn(r,o,n)}function AY({variant:e,size:t,disabled:n,className:o,slotClass:r}){const s=XS(t);return i.cn(aY,s.pad,sY[e],n?lY:iY,r,o)}function vY(e){if(e==="outline"||e==="secondary"||e==="gloss")return"pt-xsmall"}function LY({variant:e,size:t,className:n,slotClass:o}){const r=tY(e);return i.cn(It(t).contentPadding,r&&e==="outline"&&zc.outline,r&&e==="secondary"&&zc.secondary,e==="card"&&"border-t-token",e==="ghost"&&"text-muted",e==="default"&&"text-muted",o,n)}function _Y(e,t){return i.cn(xY,It(e).contentPadding,t)}function TY({separated:e,variant:t,className:n,slotClass:o}){return i.cn("flex w-full flex-col",e&&"gap-large",!e&&t==="default"&&"divide-y-token border-t-token border-b-token",!e&&t==="card"&&"overflow-hidden rounded-mid border-token bg-surface shadow-token-base divide-y-token",!e&&(t==="outline"||t==="secondary"||t==="ghost"||t==="gloss")&&"gap-small",o,n)}function EY(e){return e!=null&&!e.separated&&e.variant==="card"}function RY({open:e,disabled:t,setOpen:n,chevronRef:o,skipContentAnimRef:r,forwardedRef:s,onClick:l,onKeyDown:u,onPointerEnter:d,onPointerLeave:f,onPointerDown:m}){const p=a.useRef(null),C=a.useRef(null),S=a.useRef(!1),g=a.useCallback(v=>{p.current=v,ue(s,v)},[s]),h=Kt(e,o,()=>i.isMotionFeatureEnabled("enableExpandable"),r);a.useEffect(()=>{const v=C.current;return()=>{v&&i.killMotion(v)}},[]),a.useEffect(()=>{if(!t)return;S.current=!1;const v=C.current;v&&i.killMotion(v)},[t]);const x=a.useCallback(v=>{l==null||l(v),!(v.defaultPrevented||t)&&n(!e)},[t,l,e,n]),A=a.useCallback(v=>{u==null||u(v),(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),t||n(!e))},[t,u,e,n]),b=a.useCallback(v=>{if(d==null||d(v),v.defaultPrevented||t)return;S.current=!0;const R=C.current;!R||i.shouldSkipInteractiveHoverLift()||i.animateInteractiveHoverLift(R,!0)},[t,d]),L=a.useCallback(v=>{f==null||f(v),S.current=!1;const R=C.current;!R||i.shouldSkipInteractiveHoverLift()||i.animateInteractiveHoverLift(R,!1)},[f]),_=a.useCallback(v=>{if(m==null||m(v),v.defaultPrevented||t)return;const R=C.current;!R||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(R,{pointerInside:S.current})},[t,m]);return{setRefs:g,titleLiftRef:C,bindChevronRef:h,handleClick:x,handleKeyDown:A,handlePointerEnter:b,handlePointerLeave:L,handlePointerDown:_,mergeRefs:$e}}const Uc=.38,IY=.45,yY=-.45;function NY(e){return e.getBoundingClientRect().height}function wY(e,t,n){if(!e||n<=0)return;const o=Math.min(Math.max(t/n,0),1);$.set(e,{rotation:o*180})}function OY(e,t,n,o,r,s,l){return{onPointerDown:a.useCallback(d=>{if(s)return;const f=e.current,m=t.current;if(!f||!m||i.prefersReducedMotion())return;d.preventDefault();const p=Eo(m);if(p<=0)return;const C=d.currentTarget;C.setPointerCapture(d.pointerId);const S=d.clientY,g=NY(f);let h=S,x=performance.now(),A=0;i.killMotion(f,n.current),f.style.overflow="hidden",f.style.willChange="height";const b=_=>{if(_.pointerId!==d.pointerId)return;const v=_.clientY,R=v-S,T=performance.now(),E=T-x;E>0&&(A=(v-h)/E),h=v,x=T;const I=Math.max(0,Math.min(p,g+R));f.style.height=`${I}px`,wY(n.current,I,p)},L=_=>{if(_.pointerId!==d.pointerId)return;C.releasePointerCapture(_.pointerId),C.removeEventListener("pointermove",b),C.removeEventListener("pointerup",L),C.removeEventListener("pointercancel",L);const R=_.clientY-S,E=Math.max(0,Math.min(p,g+R))/p,I={...i.motionInteractive(),overwrite:"auto"},O=E>=Uc||A>IY,N=E<=1-Uc||A<yY;if(i.killMotion(f,n.current),!o&&O){const k=$.timeline({onComplete:()=>{f.style.willChange="",f.style.height="auto",f.style.overflow="",l&&(l.current=!0),r(!0)}});k.to(f,{height:p,...I},0),n.current&&k.to(n.current,{rotation:180,...I},0);return}if(o&&N){const k=$.timeline({onComplete:()=>{f.style.willChange="",f.style.height="0px",f.style.overflow="hidden",l&&(l.current=!0),r(!1)}});k.to(f,{height:0,...I},0),n.current&&k.to(n.current,{rotation:0,...I},0);return}const y=E>=.5,w=y?p:0,P=$.timeline({onComplete:()=>{f.style.willChange="",y?(f.style.height="auto",f.style.overflow=""):(f.style.height="0px",f.style.overflow="hidden"),l&&(l.current=!0),r(y)}});P.to(f,{height:w,...I},0),n.current&&P.to(n.current,{rotation:y?180:0,...I},0)};C.addEventListener("pointermove",b),C.addEventListener("pointerup",L),C.addEventListener("pointercancel",L)},[n,s,t,o,r,e,l])}}function KS({className:e,onPointerDown:t,...n}){const o=Gi(),{variant:r,disabled:s,dragHandle:l,shellRef:u,innerRef:d,chevronRef:f,open:m,setOpen:p,skipContentAnimRef:C}=Hi(),{onPointerDown:S}=OY(u,d,f,m,p,s,C);return!l||r!=="card"?null:c.jsx("div",{"aria-hidden":!0,className:i.cn(CY,s&&gY,o.handle,e),onPointerDown:g=>{t==null||t(g),S(g)},...n,children:c.jsx("span",{className:SY})})}KS.displayName="DisclosureHandle";const qS=a.forwardRef(function({children:t,className:n,...o},r){const s=Gi(),{open:l,panelId:u,triggerId:d,size:f,variant:m,shellRef:p,innerRef:C,skipContentAnimRef:S}=Hi();pu(l,p,C,{skipAnimRef:S});const g=mu(p,l),h=a.useCallback(b=>{g(b),typeof r=="function"?r(b):r&&(r.current=b)},[g,r]),x=vY(m),A=m==="gloss";return c.jsx("div",{ref:h,"aria-hidden":!l,className:i.cn(pY,s.contentShell),children:c.jsx("div",{ref:C,className:i.cn(x,s.contentWrap),children:A?c.jsx("section",{id:u,"aria-labelledby":d,className:i.cn(s.contentPanel,n),...o,children:c.jsx("div",{className:i.cn(hY,s.glossPanel),children:c.jsx("div",{className:_Y(f,s.glossContent),children:t})})}):c.jsx("section",{id:u,"aria-labelledby":d,className:LY({variant:m,size:f,className:n,slotClass:s.contentPanel}),...o,children:t})})})});qS.displayName="DisclosureContent";const ZS=a.forwardRef(function({children:t,icon:n,asChild:o,className:r,onKeyDown:s,onClick:l,onPointerEnter:u,onPointerLeave:d,onPointerDown:f,...m},p){const C=Gi(),{open:S,setOpen:g,triggerId:h,panelId:x,variant:A,size:b,disabled:L,iconPosition:_,chevronRef:v,skipContentAnimRef:R}=Hi(),T=XS(b),E=RY({open:S,disabled:L,setOpen:g,chevronRef:v,skipContentAnimRef:R,forwardedRef:p,onClick:l,onKeyDown:s,onPointerEnter:u,onPointerLeave:d,onPointerDown:f}),I=n!==null?c.jsx("span",{ref:E.bindChevronRef,"aria-hidden":!0,className:i.cn(dY,T.chevron,i.TEXT_COLOR_TRANSITION,S&&mY,C.triggerChevron),children:n??c.jsx(be.IoChevronDown,{className:fY})}):null;if(o&&a.isValidElement(t)){const O=t;return a.cloneElement(O,{...m,id:h,ref:E.mergeRefs(p,E.setRefs,O.props.ref),className:i.cn(O.props.className,r),disabled:L||O.props.disabled,"aria-expanded":S,"aria-controls":x,onClick:N=>{var y,w;(w=(y=O.props).onClick)==null||w.call(y,N),E.handleClick(N)},onKeyDown:N=>{var y,w;(w=(y=O.props).onKeyDown)==null||w.call(y,N),E.handleKeyDown(N)}})}return c.jsxs("button",{ref:E.setRefs,id:h,type:"button","aria-expanded":S,"aria-controls":x,disabled:L,className:AY({variant:A,size:b,disabled:L,className:r,slotClass:C.trigger}),onClick:E.handleClick,onKeyDown:E.handleKeyDown,onPointerEnter:E.handlePointerEnter,onPointerLeave:E.handlePointerLeave,onPointerDown:E.handlePointerDown,...m,children:[_==="start"&&I,c.jsx("span",{ref:E.titleLiftRef,className:i.cn(cY,C.triggerTitleLift),children:c.jsx(q,{as:"span",variant:T.text,className:i.cn(uY,T.titleClassName,S?"text-primary":"text-foreground",C.triggerTitle),children:t})}),_==="end"&&I]})});ZS.displayName="DisclosureTrigger";function PY(e){return`disclosure-trigger-${e}`}function DY(e){return`disclosure-panel-${e}`}function kY({children:e,open:t,defaultOpen:n=!1,onOpenChange:o,value:r,variant:s,size:l,disabled:u=!1,iconPosition:d="end",dragHandle:f=!1}){const m=eY(),p=m!==null&&r!==void 0&&m.accordion,C=p?m.openValue===r:void 0,[S,g]=a.useState(n),h=p?C:t!==void 0?t:S,x=a.useCallback(w=>{p?m.setOpenValue(w?r??null:null):(t===void 0&&g(w),o==null||o(w))},[p,m,r,t,o]),A=a.useId(),b=PY(A),L=DY(A),_=a.useRef(null),v=a.useRef(null),R=a.useRef(null),T=a.useRef(!1),E=s??(m==null?void 0:m.variant)??"default",I=l??(m==null?void 0:m.size)??"base",O=EY(m),N=a.useMemo(()=>({open:h,setOpen:x,triggerId:b,panelId:L,variant:E,size:I,disabled:u,iconPosition:d,dragHandle:f,shellRef:_,innerRef:v,chevronRef:R,skipContentAnimRef:T}),[u,f,d,h,L,x,I,b,E]),y=f&&E==="card"?oY(e):e;return{contextValue:N,variant:E,groupedCardShell:O,orderedChildren:y}}const QS=a.forwardRef(function({children:t,className:n,classNames:o,open:r,defaultOpen:s,onOpenChange:l,value:u,variant:d,size:f,disabled:m,iconPosition:p,dragHandle:C,...S},g){const h=kY({children:t,open:r,defaultOpen:s,onOpenChange:l,value:u,variant:d,size:f,disabled:m,iconPosition:p,dragHandle:C});return c.jsx(QW,{value:h.contextValue,children:c.jsx($S,{classNames:o,children:c.jsx("div",{ref:g,className:bY({variant:h.variant,groupedCardShell:h.groupedCardShell,className:n,slotClass:o==null?void 0:o.root}),...S,children:h.orderedChildren})})})});QS.displayName="Disclosure";function BY({accordion:e=!0,separated:t=!1,variant:n="default",size:o="base",value:r,defaultValue:s,onValueChange:l}){const u=r!==void 0,[d,f]=a.useState(s??null),m=u?r:d,p=a.useCallback(S=>{const g=e&&S===m?null:S;u||f(g),l==null||l(g)},[e,u,l,m]);return{contextValue:a.useMemo(()=>({openValue:m,setOpenValue:p,variant:n,size:o,separated:t,accordion:e}),[e,m,p,n,o,t]),separated:t,variant:n}}const JS=a.forwardRef(function({children:t,accordion:n,separated:o,variant:r,size:s,value:l,defaultValue:u,onValueChange:d,className:f,classNames:m,...p},C){const S=BY({accordion:n,separated:o,variant:r,size:s,value:l,defaultValue:u,onValueChange:d});return c.jsx(JW,{value:S.contextValue,children:c.jsx($S,{classNames:m,children:c.jsx("div",{ref:C,className:TY({separated:S.separated,variant:S.variant,className:f,slotClass:m==null?void 0:m.group}),...p,children:t})})})});JS.displayName="DisclosureGroup";const jY=Object.assign(QS,{Trigger:ZS,Handle:KS,Content:qS,Group:JS});function eh(e={}){const t=JSON.stringify(e.storageKey??i.DEFAULT_THEME_STORAGE_KEY),n=JSON.stringify(e.defaultTheme??"dark");return`(function(){try{var k=${t};var d=${n};var s=localStorage.getItem(k);var t=(s==="light"||s==="dark"||s==="system")?s:d;var r=t==="system"?(window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"):t;var e=document.documentElement;if(r==="light")e.setAttribute("data-theme","light");else e.removeAttribute("data-theme");}catch(_){}})();`}function MY({storageKey:e,defaultTheme:t,nonce:n}={}){return a.createElement("script",{nonce:n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:eh({storageKey:e,defaultTheme:t})}})}function FY(e){const{config:t,theme:n,tokens:o,customTokens:r,motion:s,toast:l,storageKey:u,labels:d}=e;return{theme:n??(t==null?void 0:t.theme)??"dark",storageKey:u!==void 0?u:(t==null?void 0:t.storageKey)??i.DEFAULT_THEME_STORAGE_KEY,tokens:o??(t==null?void 0:t.tokens),colors:t==null?void 0:t.colors,customTokens:r??(t==null?void 0:t.customTokens),motion:s??(t==null?void 0:t.motion),toast:l!==void 0?l:(t==null?void 0:t.toast)??!0,labels:d??(t==null?void 0:t.labels)}}function HY({children:e,resolvedConfig:t,root:n}){const{resolvedTheme:o}=i.useBurneTheme(),[r,s]=a.useState(null),l=a.useRef(!1),u=a.useCallback(()=>s(null),[]),d=r??t;a.useLayoutEffect(()=>{if(!d.tokens&&!d.motion&&!d.colors&&!d.customTokens){if(l.current){const p=n??(typeof document<"u"?document.documentElement:null);if(!p)return;i.applyThemeTokens(i.createDefaultThemeState(o),p),i.clearThemeInlineTokens(p),i.clearCustomThemeTokens(p),i.applyThemeMode(o,p),l.current=!1}return}const m=n??(typeof document<"u"?document.documentElement:null);m&&(i.applyBurneThemeConfig(d,m,o),l.current=!0)},[d,o,n]),a.useLayoutEffect(()=>{const m=n??(typeof document<"u"?document.documentElement:null);return()=>{!l.current||!m||(i.applyThemeTokens(i.createDefaultThemeState(o),m),i.clearThemeInlineTokens(m),i.clearCustomThemeTokens(m),l.current=!1)}},[n,o]);const f=a.useMemo(()=>({baseConfig:t,config:d,previewConfig:r,resolvedTheme:o,setPreviewConfig:s,clearPreview:u}),[t,d,r,o,u]);return c.jsx(i.BurneThemeRuntimeContextProvider,{value:f,children:e})}function GY(e){const{children:t,config:n,theme:o,tokens:r,customTokens:s,motion:l,labels:u,toast:d,storageKey:f,defaultTheme:m,root:p,onThemeChange:C}=e,S=a.useMemo(()=>FY({config:n,theme:o,tokens:r,customTokens:s,motion:l,labels:u,toast:d,storageKey:f}),[n,o,r,s,l,u,d,f]),g=S.theme??"dark",h=S.storageKey===void 0?i.DEFAULT_THEME_STORAGE_KEY:S.storageKey;let x=c.jsx(HY,{resolvedConfig:S,root:p,children:t});const A=S.toast??!0;if(A){const b=typeof A=="object"?A:{};x=c.jsx(op.Provider,{...b,children:x})}return x=c.jsx(uu,{labels:S.labels,children:x}),c.jsx(i.ThemeProvider,{theme:o,defaultTheme:m??(g==="system"?"system":g),storageKey:h,root:p,onThemeChange:C,children:x})}exports.DEFAULT_THEME_STORAGE_KEY=i.DEFAULT_THEME_STORAGE_KEY;exports.FONT_WEIGHT_CSS_VAR=i.FONT_WEIGHT_CSS_VAR;exports.FONT_WEIGHT_DEFAULTS=i.FONT_WEIGHT_DEFAULTS;exports.MOTION_CONFIG_DEFAULTS=i.MOTION_CONFIG_DEFAULTS;exports.NARROW_VIEWPORT_MAX_PX=i.NARROW_VIEWPORT_MAX_PX;exports.SHADOW_CSS_VAR=i.SHADOW_CSS_VAR;exports.TOUCH_OR_NARROW_VIEWPORT_MQL=i.TOUCH_OR_NARROW_VIEWPORT_MQL;exports.TOUCH_OR_NARROW_VIEWPORT_MQL_ANY_POINTER=i.TOUCH_OR_NARROW_VIEWPORT_MQL_ANY_POINTER;exports.ThemeProvider=i.ThemeProvider;exports.burneFontWeightScale=i.burneFontWeightScale;exports.burneShadowScale=i.burneShadowScale;exports.buttonRippleTone=i.buttonRippleTone;exports.cn=i.cn;exports.colorToken=i.colorToken;exports.configureMotion=i.configureMotion;exports.designTokenNames=i.designTokenNames;exports.fontWeightToken=i.fontWeightToken;exports.getMotionConfig=i.getMotionConfig;exports.isMotionEnabled=i.isMotionEnabled;exports.isMotionFeatureEnabled=i.isMotionFeatureEnabled;exports.shadowToken=i.shadowToken;exports.tokensConfig=i.tokensConfig;exports.useBurneTheme=i.useBurneTheme;exports.useBurneThemeOptional=i.useBurneThemeOptional;exports.Accordion=Yb;exports.Alert=Ob;exports.AlertDialog=EN;exports.Avatar=AH;exports.BURNE_LABELS_RU=ix;exports.Badge=H1;exports.Breadcrumbs=sG;exports.BurneLabelsProvider=uu;exports.BurneUIProvider=GY;exports.Button=Vt;exports.ButtonGroup=AI;exports.COMPONENT_SIZES=oh;exports.Calendar=KU;exports.Card=uF;exports.Checkbox=KP;exports.CheckboxGroup=iv;exports.CloseButton=Cn;exports.ColorPicker=H2;exports.ColorSlider=G2;exports.ColorSwatch=to;exports.ComboBox=Af;exports.DEFAULT_BURNE_LABELS=Se;exports.Dialog=PN;exports.Disclosure=jY;exports.Drawer=GO;exports.Dropdown=Gt;exports.EN_LOCALE=LS;exports.Expandable=ht;exports.Field=le;exports.Form=uA;exports.Input=$f;exports.Kbd=oV;exports.Label=ve;exports.Link=i0;exports.ListBox=Ht;exports.Loading=pl;exports.Meter=Wj;exports.OVERLAY_BACKDROP_CSS_VAR=uh;exports.OVERLAY_BACKDROP_DEFAULTS=fh;exports.Pagination=zG;exports.Popover=ke;exports.ProgressBar=OM;exports.RIPPLE_COLOR=Co;exports.Radio=PD;exports.RadioGroup=xv;exports.Ripple=Dn;exports.SearchInput=Qa;exports.Select=gP;exports.SelectionIndicator=Be;exports.SelectionThumb=On;exports.Separator=Ya;exports.Skeleton=ZW;exports.Slider=iB;exports.Surface=Gg;exports.Switch=HB;exports.TABLE_ROW_TONE_SURFACE=sS;exports.TOAST_SCRIM_CSS_VAR=dt;exports.TOAST_SCRIM_DEFAULTS=nh;exports.Table=Sz;exports.Tabs=uj;exports.Text=q;exports.TextArea=P0;exports.ThemeScript=MY;exports.TimeField=yW;exports.Toast=op;exports.ToastContext=ml;exports.ToggleButton=um;exports.ToggleButtonGroup=gy;exports.Tooltip=bo;exports.Z_INDEX_CSS_VAR=ph;exports.Z_INDEX_DEFAULTS=Ch;exports.burneZIndexScale=mh;exports.fieldErrorId=ze;exports.fieldHintId=Ve;exports.footerButtonSizeForAlertDialog=Lm;exports.formatBurneLabel=pn;exports.getThemeScript=eh;exports.hexToHsva=eo;exports.hexToRgba=IS;exports.hsvaToColorString=yS;exports.hsvaToHex=Ao;exports.hsvaToRgba=zt;exports.hueToRgbString=Vo;exports.joinFieldDescribedBy=je;exports.mergeBurneLabels=iu;exports.overlayBackdropToken=dh;exports.primaryButtonStatusForAlertTone=Ry;exports.primaryButtonVariantForAlertTone=Ey;exports.resolveAlertLiveRole=Iu;exports.resolveAlertStatus=Qs;exports.resolveAlertVariant=Zs;exports.rgbaToHex=RS;exports.rgbaToHsva=ES;exports.sliderThicknessToCss=qn;exports.toastScrimToken=ft;exports.useAlertDialog=Lt;exports.useBurneLabel=St;exports.useBurneLabels=Ie;exports.useCalendar=Ne;exports.useColorPicker=kt;exports.useComboBoxContext=Fn;exports.useFieldSetErrorId=ha;exports.useFieldSetHintId=Sa;exports.useFormField=cA;exports.useListBox=bn;exports.useListBoxActiveValue=Id;exports.useTabsContext=gr;exports.useToast=Bw;exports.useToastContext=Xm;exports.zIndexToken=gh;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./themeRuntimeContext-C1c5qNb1.cjs"),c=require("react/jsx-runtime"),a=require("react"),$=require("gsap");require("gsap/CustomEase");const be=require("react-icons/io5"),Ut=require("react-dom"),ft={size:"--toast-scrim-size",density:"--toast-scrim-density",height:"--toast-scrim-height",insetX:"--toast-scrim-inset-x",offsetY:"--toast-scrim-offset-y",gradientTop:"--toast-scrim-gradient-top",gradientBottom:"--toast-scrim-gradient-bottom",mask:"--toast-scrim-mask"};function mt(e){return`var(${e})`}const rh={size:1,density:1},sh=["small","base","mid","large"];function js(e){return e??"base"}const ye={small:{title:"small",desc:"xsmall",gridGap:"gap-x-small gap-y-xsmall",listItemGapX:"gap-x-small"},base:{title:"base",desc:"small",gridGap:"gap-x-base gap-y-xsmall",listItemGapX:"gap-x-base"},mid:{title:"mid",desc:"small",gridGap:"gap-x-base gap-y-xsmall",listItemGapX:"gap-x-base"},large:{title:"large",desc:"base",gridGap:"gap-x-mid gap-y-xsmall",listItemGapX:"gap-x-mid"}},ah={small:{maxWidthClass:"max-w-component-base",shellPadding:`${i.CONTROL_SIZE_LAYOUT.small.rounded} p-base`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-small",titleVariant:"small",descVariant:"xsmall",loadingSize:"small",toastWidthPx:280},base:{maxWidthClass:"max-w-component-large",shellPadding:`${i.CONTROL_SIZE_LAYOUT.base.rounded} p-mid`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-mid",titleVariant:"base",descVariant:"small",loadingSize:"small",toastWidthPx:360},mid:{maxWidthClass:"max-w-component-xlarge",shellPadding:`${i.CONTROL_SIZE_LAYOUT.mid.rounded} p-mid`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-large",titleVariant:"mid",descVariant:"base",loadingSize:"base",toastWidthPx:400},large:{maxWidthClass:"max-w-component-2xlarge",shellPadding:`${i.CONTROL_SIZE_LAYOUT.large.rounded} p-large`,gridGap:"gap-x-base gap-y-xsmall",iconSvgClass:"[&_svg]:icon-large",titleVariant:"large",descVariant:"base",loadingSize:"mid",toastWidthPx:440}};function Ms(e){return js(e)}function Ct(e){return ah[Ms(e)]}function lh(e){const t=Ct(e);return`w-fit ${t.maxWidthClass} ${t.shellPadding}`}function ih(e,t="base"){const n=Ct(t).toastWidthPx;return e.length===0?n:Math.max(n,...e.map(o=>Ct(o.size??t).toastWidthPx))}const zo={small:{rounded:i.CONTROL_SIZE_LAYOUT.small.rounded,panelMax:"max-w-component-base",panelMin:"min-w-component-xsmall",popoverMax:"max-w-component-small",maxHeight:"max-h-[min(85dvh,26rem)]",headerPadding:"px-mid pb-base pt-mid",bodyPadding:"p-mid",footerPadding:"px-mid pt-base pb-mid",headerGap:"gap-base",alertHeaderGap:"gap-x-base",headingGap:"gap-small",titleVariant:"base",alertTitleVariant:"base",descVariant:"small",bodyVariant:"small",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-mid",footerButtonSize:"small",closeButtonSize:"small"},base:{rounded:i.CONTROL_SIZE_LAYOUT.base.rounded,panelMax:"max-w-component-large",panelMin:"min-w-component-small",popoverMax:"max-w-component-base",maxHeight:"max-h-[min(90dvh,36rem)]",headerPadding:"px-mid pt-mid pb-base",bodyPadding:"p-mid",footerPadding:"px-mid pb-mid pt-base",headerGap:"gap-base",alertHeaderGap:"gap-x-mid gap-y-xsmall",headingGap:"gap-base",titleVariant:"mid",alertTitleVariant:"mid",descVariant:"base",bodyVariant:"base",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-large",footerButtonSize:"base",closeButtonSize:"small"},mid:{rounded:i.CONTROL_SIZE_LAYOUT.mid.rounded,panelMax:"max-w-component-xlarge",panelMin:"min-w-component-small",popoverMax:"max-w-component-mid",maxHeight:"max-h-[min(90dvh,40rem)]",headerPadding:"px-large pb-mid pt-large",bodyPadding:"p-large",footerPadding:"px-large pt-mid pb-large",headerGap:"gap-mid",alertHeaderGap:"gap-x-mid gap-y-small",headingGap:"gap-base",titleVariant:"mid",alertTitleVariant:"mid",descVariant:"base",bodyVariant:"base",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-large",footerButtonSize:"base",closeButtonSize:"base"},large:{rounded:i.CONTROL_SIZE_LAYOUT.large.rounded,panelMax:"max-w-component-2xlarge",panelMin:"min-w-component-base",popoverMax:"max-w-component-large",maxHeight:"max-h-[min(90dvh,44rem)]",headerPadding:"px-large pb-mid pt-large",bodyPadding:"p-large",footerPadding:"px-large pt-mid pb-large",headerGap:"gap-mid",alertHeaderGap:"gap-x-mid gap-y-small",headingGap:"gap-base",titleVariant:"large",alertTitleVariant:"large",descVariant:"base",bodyVariant:"base",titleClassName:"leading-none",descClassName:"text-muted",iconClass:"icon-large",footerButtonSize:"base",closeButtonSize:"base"}};function Yc(e){return js(e)}function Ee(e){return zo[Yc(e)]}const $c=Yc,ch={small:{triggerPadding:"p-base",contentPadding:"p-base",titleVariant:"small",titleClassName:"leading-none",descVariant:"small"},base:{triggerPadding:"p-mid",contentPadding:"p-mid",titleVariant:"base",titleClassName:"leading-none",descVariant:"small"},mid:{triggerPadding:"p-mid",contentPadding:"p-mid",titleVariant:"mid",titleClassName:"leading-none",descVariant:"base"},large:{triggerPadding:"p-large",contentPadding:"p-large",titleVariant:"large",titleClassName:"leading-none",descVariant:"base"}};function uh(e){return js(e)}function It(e){return ch[uh(e)]}function dh(){return{"aria-hidden":!0}}const fh={color:"--overlay-backdrop-color",blur:"--overlay-backdrop-blur",saturate:"--overlay-backdrop-saturate",scrim:"--overlay-backdrop-scrim"};function mh(e){return`var(${e})`}const ph={color:"color-mix(in oklab, var(--color-foreground) 14%, transparent)",blur:"14px",saturate:1.5,scrim:"color-mix(in oklab, black 58%, transparent)"},Ch=["dialog","dropdown","dropdown-sub","popover","toast","tooltip"],gh={dialog:"--z-dialog",dropdown:"--z-dropdown","dropdown-sub":"--z-dropdown-sub",popover:"--z-popover",toast:"--z-toast",tooltip:"--z-tooltip"},Sh={dialog:100,dropdown:200,"dropdown-sub":210,popover:200,toast:300,tooltip:400};function hh(e){return`var(--z-${e})`}const Co={primarySolid:i.colorToken("converge-ripple-primary-fill"),neutral:i.colorToken("converge-ripple-neutral"),neutralMuted:i.colorToken("converge-ripple-neutral-muted"),danger:i.colorToken("converge-ripple-danger"),success:i.colorToken("converge-ripple-success"),info:i.colorToken("converge-ripple-info"),warning:i.colorToken("converge-ripple-warning")};function xh(e){return e==null||e===""?Co.neutral:e in Co?Co[e]:e}function bh(e){return e.closest("button,a[href],[role='button']")??e.parentElement}const Ah="pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]",Xc=a.memo(a.forwardRef(function({tone:t,durationMs:n,opacityFrom:o,direction:r},s){const{ripples:l,pushAtClientCoords:u,dismiss:d}=i.useConvergeRipples();return a.useImperativeHandle(s,()=>({pushAtClientCoords:u}),[u]),c.jsx(i.ConvergeRippleLayer,{ripples:l,tone:t,onDone:d,durationMs:n,opacityFrom:o,direction:r})}));Xc.displayName="ConvergeRipplePaint";function Dn({color:e,disabled:t=!1,duration:n=i.getMotionConfig().rippleDefaultDuration,direction:o="out",className:r=""}){const s=a.useRef(null),l=a.useRef(null),u=xh(e),d=i.getMotionConfig().rippleDefaultOpacityFrom;return a.useLayoutEffect(()=>{const f=s.current;if(!f||t)return;const m=bh(f);if(!m)return;const p=C=>{var S;t||i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableRipple")||C.defaultPrevented||C.pointerType==="mouse"&&C.button!==0||(S=l.current)==null||S.pushAtClientCoords(m,C.clientX,C.clientY)};return m.addEventListener("pointerdown",p),()=>m.removeEventListener("pointerdown",p)},[t]),c.jsx("span",{ref:s,className:i.cn(Ah,r),...dh(),children:c.jsx(Xc,{ref:l,tone:u,durationMs:n,opacityFrom:d,direction:o})})}function ue(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function $e(...e){return t=>{for(const n of e)n!=null&&ue(n,t)}}function vh(e){return/^on[A-Z]/.test(e)}function _h(e){const t=e.props.ref;return t??e.ref}function zi(e,t){return(...n)=>{e(...n),t(...n)}}function yt(e,t,n,o){const r=e.props,s=o==null?void 0:o.runBeforeChild,l={...r};for(const[f,m]of Object.entries(t))if(!(f==="className"||f==="style"||f==="ref")){if(vh(f)&&typeof m=="function"&&typeof r[f]=="function"){const p=m,C=r[f];l[f]=(s==null?void 0:s.includes(f))===!0?zi(p,C):zi(C,p);continue}l[f]=m}(r.className!=null||t.className!=null)&&(l.className=i.cn(r.className,t.className));const u=r.style,d=t.style;return(u!=null||d!=null)&&(l.style=u!=null&&d!=null?{...u,...d}:d??u),l.ref=$e(_h(e),n),l}function Uo({isGloss:e,enabled:t,hasHoverShadow:n,useContentRef:o=!1,forwardedRef:r,onPointerEnter:s,onPointerLeave:l,onPointerDown:u,onPressReleaseStart:d}){const f=a.useRef(null),m=a.useRef(null),p=a.useRef(!1),C=a.useMemo(()=>i.createGlossInteractiveRefCallback(f,e),[e]),S=a.useCallback(_=>{C(_),f.current=_,ue(r,_)},[C,r]),g=a.useCallback(()=>o?m.current:f.current,[o]);a.useEffect(()=>{if(t)return;const _=f.current,L=m.current;p.current=!1,_&&(i.killMotion(_),_.style.removeProperty("--el-shadow")),L&&(i.killMotion(L),L.style.transform="")},[t]);const h=a.useMemo(()=>n&&!e?i.firstLevelHoverShadow():void 0,[n,e]),x=a.useCallback(_=>{if(s==null||s(_),!t||_.defaultPrevented||i.shouldSkipInteractiveHoverLift())return;const L=g();L&&(p.current=!0,e&&!o?i.animateGlossInteractiveHoverLift(L,!0):i.animateInteractiveHoverLift(L,!0,void 0,o?void 0:h))},[h,t,e,g,s,o]),A=a.useCallback(_=>{if(l==null||l(_),p.current=!1,!t||i.shouldSkipInteractiveHoverLift())return;const L=g();L&&(e&&!o?i.animateGlossInteractiveHoverLift(L,!1):i.animateInteractiveHoverLift(L,!1,void 0,o?void 0:h))},[h,t,e,g,l,o]),b=a.useCallback(_=>{if(u==null||u(_),!t||_.defaultPrevented||i.prefersReducedMotion())return;const L=g();if(L){if(e&&!o){i.animateGlossInteractivePressSqueeze(L,p.current,void 0,d);return}i.animateInteractivePressSqueeze(L,{pointerInside:p.current,shadow:o?void 0:h,onReleaseStart:d})}},[h,t,e,g,u,d,o]);return{setRefs:S,btnRef:f,contentMotionRef:m,hoverPointerInsideRef:p,handlePointerEnter:x,handlePointerLeave:A,handlePointerDown:b}}const Kc=new Set(["ButtonContent","ButtonLabel","ButtonIcon","ButtonText","ButtonLoader","ButtonSuccess","ButtonError"]);function qc(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function Zc(e){return qc(e,t=>t!=null&&Kc.has(t))}function ro(e,t){return qc(e,n=>n===t)}function Lh(e){if(e==null||e===!1)return!1;if(typeof e=="string"||typeof e=="number")return!0;const t=a.Children.toArray(e).filter(r=>r!=null);if(t.length!==1)return!1;const n=t[0];if(typeof n=="string"||typeof n=="number")return!0;if(!a.isValidElement(n))return!1;const o=n.type.displayName;return o==null||!Kc.has(o)}function Th(e,t,n,o){return Math.max(...[[0,0],[n,0],[0,o],[n,o]].map(([s,l])=>Math.hypot(s-e,l-t)))}function Eh(e,t){return 2*Th(e/2,t/2,e,t)}function Rh(e,t){switch(t){case"label":return e==="idle";case"loader":return e==="loading";case"success":return e==="success";case"error":return e==="error"}}const Ui="data-button-async-layer-init",Ih={label:{in:1,out:.92},loader:{in:1,out:.85},success:{in:1,out:.85},error:{in:1,out:.85}};function yh(e,t,n){const o=Rh(t,n),{in:r,out:s}=Ih[n];$.set(e,{autoAlpha:o?1:0,scale:o?r:s})}function so(e,t,n){return o=>{e.current=o,o&&!o.hasAttribute(Ui)&&(o.setAttribute(Ui,""),yh(o,t,n))}}function Nh({variant:e,asyncState:t,isControlled:n,blocked:o,groupSegment:r,forwardedRef:s,onPointerEnter:l,onPointerLeave:u,onPointerDown:d}){const f=a.useRef(null),m=a.useRef(null),p=a.useRef(null),C=a.useRef(null),S=a.useRef("idle"),g=a.useRef(void 0),h=a.useRef(!1),x=a.useRef(null),A=a.useRef(t),b=a.useMemo(()=>so(f,A.current,"label"),[]),_=a.useMemo(()=>so(m,A.current,"loader"),[]),L=a.useMemo(()=>so(p,A.current,"success"),[]),v=a.useMemo(()=>so(C,A.current,"error"),[]),R=Uo({isGloss:e==="gloss",enabled:!o,hasHoverShadow:i.BUTTON_VARIANT_HAS_HOVER_SHADOW.has(e),useContentRef:!!r,forwardedRef:s,onPointerEnter:l,onPointerLeave:u,onPointerDown:d}),T=a.useCallback(I=>{var y;const O=R.btnRef.current;if(!O)return;const N=O.getBoundingClientRect();(y=x.current)==null||y.push(I,Eh(N.width,N.height))},[R.btnRef]);a.useLayoutEffect(()=>{if(!n)return;const I=S.current;(t==="success"||t==="error")&&I==="loading"&&T(t==="success"?"success":"error"),S.current=t},[t,n,T]),a.useLayoutEffect(()=>{const I=f.current,O=m.current,N=p.current,y=C.current;if(!I||!O||!N||!y)return;const w=i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableAsyncButtonCrossfade"),P=i.motionInteractive(),k=[{el:I,active:t==="idle",scaleIn:1,scaleOut:.92},{el:O,active:t==="loading",scaleIn:1,scaleOut:.85},{el:N,active:t==="success",scaleIn:1,scaleOut:.85},{el:y,active:t==="error",scaleIn:1,scaleOut:.85}];if(g.current===void 0){g.current=t;for(const{el:j,active:B,scaleIn:D,scaleOut:F}of k)i.killMotion(j),$.set(j,{autoAlpha:B?1:0,scale:B?D:F});return}if(g.current!==t){g.current=t;for(const{el:j,active:B,scaleIn:D,scaleOut:F}of k){if(i.killMotion(j),w){$.set(j,{autoAlpha:B?1:0,scale:B?D:F});continue}$.to(j,{autoAlpha:B?1:0,scale:B?D:F,...P,overwrite:"auto"})}}},[t]);const E=a.useCallback((I,O,N,y,w,P)=>k=>{I==null||I(k),!(N||!O||k.defaultPrevented)&&(h.current||y!=="idle"||(h.current=!0,w("loading"),Promise.resolve(O(k)).then(j=>{const B=j?"success":"error";w(B),T(B),P()}).catch(()=>{w("error"),T("error"),P()}).finally(()=>{h.current=!1})))},[T]);return{setRefs:R.setRefs,contentMotionRef:R.contentMotionRef,bindLabelRef:b,bindLoaderRef:_,bindSuccessRef:L,bindErrorRef:v,expandRippleLayerRef:x,pushExpandRipple:T,handlePointerEnter:R.handlePointerEnter,handlePointerLeave:R.handlePointerLeave,handlePointerDown:R.handlePointerDown,createAsyncClickHandler:E,asyncInFlight:h}}const Qc=a.createContext(null),kr=a.createContext({});function wh({classNames:e,children:t}){const n=a.useContext(kr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(kr.Provider,{value:o,children:t})}function Wt(){return a.useContext(kr)}function Yt(){return a.useContext(Qc)}function Oh({value:e,children:t}){return c.jsx(Qc.Provider,{value:e,children:t})}function Ph(e,t){return e??t}const Dh={"accent-header":"text-accent-header","header-1":"text-header-1","header-2":"text-header-2",large:"text-large",mid:"text-mid",base:"text-base",small:"text-small",xsmall:"text-xsmall"},kh={"accent-header":"h1","header-1":"h2","header-2":"h3",large:"p",mid:"p",base:"p",small:"p",xsmall:"p"},Bh="text-foreground";function jh(e,t,n){return i.cn(Dh[e],!t&&Bh,n)}const q=a.forwardRef(function({variant:t,as:n,inheritColor:o,className:r,children:s,...l},u){const d=Ph(n,kh[t]);return a.createElement(d,{...l,ref:u,className:jh(t,o,r)},s)});function Mh({className:e}){return c.jsx("span",{className:i.cn(i.buttonSpinnerInnerClass(),e),"aria-hidden":!0})}function Fh({className:e}){return c.jsx("svg",{className:i.cn(i.buttonIconSvgClass(),e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"M20 6L9 17l-5-5"})})}function Hh({className:e}){return c.jsx("svg",{className:i.cn(i.buttonIconSvgClass(),e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function Gh({size:e,tone:t,onDone:n}){const o=a.useRef(null),r=a.useRef(n);return r.current=n,a.useLayoutEffect(()=>{const s=o.current;if(!s)return;let l=!1;if(i.killMotion(s),i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableFeedbackExpand")){r.current();return}i.setWillChangeTransform(s,!0);const d=$.fromTo(s,{scale:0,autoAlpha:.5},{scale:1,autoAlpha:0,...i.motionFeedbackExpand(),ease:i.ensureRippleEase(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(s,()=>{l||r.current()})});return()=>{l=!0,d.kill(),i.killMotion(s)}},[e,t]),c.jsx("span",{ref:o,className:i.buttonFeedbackExpandRippleClass(),style:{width:e,height:e,marginLeft:-e/2,marginTop:-e/2,background:t==="success"?"color-mix(in oklab, var(--color-success) 55%, transparent)":"color-mix(in oklab, var(--color-danger) 55%, transparent)",transform:"scale(0)"},"aria-hidden":!0})}const vo=a.forwardRef(function({className:t="",children:n,...o},r){const s=Yt(),l=Wt();return c.jsx("span",{ref:r??(s==null?void 0:s.contentMotionRef),className:i.buttonContentClass({groupSegment:!!(s!=null&&s.groupSegment),slotClass:l.content,className:t}),...o,children:n})});vo.displayName="ButtonContent";const Fs=a.forwardRef(function({className:t="",children:n,...o},r){const s=Yt(),l=Wt();return c.jsx("span",{ref:r??(s==null?void 0:s.bindLabelRef),className:i.buttonLabelClass({slotClass:l.label,className:t}),...o,children:n})});Fs.displayName="ButtonLabel";function Hs({className:e="",children:t,...n}){const o=Yt(),r=Wt(),s=(o==null?void 0:o.size)??"base";return c.jsx("span",{className:i.buttonIconClass(s,i.cn(r.icon,e)),"aria-hidden":!0,...n,children:t})}Hs.displayName="ButtonIcon";function Gs({className:e="",children:t,...n}){const o=Yt(),r=Wt(),s=(o==null?void 0:o.size)??"base";return c.jsx(q,{variant:i.BUTTON_SIZE_TEXT_VARIANT[s],as:"span",inheritColor:!0,className:i.buttonTextClass(r.text,e),...n,children:t})}Gs.displayName="ButtonText";const _o=a.forwardRef(function({className:t="",...n},o){const r=Yt(),s=Wt(),l=(r==null?void 0:r.size)??"base",u=(r==null?void 0:r.asyncState)??"idle",d=(r==null?void 0:r.loaderTextClass)??"";return c.jsx("span",{ref:o??(r==null?void 0:r.bindLoaderRef),"data-button-async-layer":!0,className:i.buttonLoaderLayerClass(d,i.cn(s.loader,t)),"aria-hidden":u!=="loading",...n,children:c.jsx(Mh,{className:i.cn(i.buttonSpinnerClass(l),i.BUTTON_SPINNER_MOTION_CLASS)})})});_o.displayName="ButtonLoader";const Lo=a.forwardRef(function({className:t="",...n},o){const r=Yt(),s=Wt(),l=(r==null?void 0:r.size)??"base",u=(r==null?void 0:r.asyncState)??"idle",d=i.CONTROL_SIZE_LAYOUT[l];return c.jsx("span",{ref:o??(r==null?void 0:r.bindSuccessRef),"data-button-async-layer":!0,className:i.buttonSuccessLayerClass(i.cn(s.success,t)),"aria-hidden":u!=="success",...n,children:c.jsx(Fh,{className:d.icon})})});Lo.displayName="ButtonSuccess";const To=a.forwardRef(function({className:t="",...n},o){const r=Yt(),s=Wt(),l=(r==null?void 0:r.size)??"base",u=(r==null?void 0:r.asyncState)??"idle",d=i.CONTROL_SIZE_LAYOUT[l];return c.jsx("span",{ref:o??(r==null?void 0:r.bindErrorRef),"data-button-async-layer":!0,className:i.buttonErrorLayerClass(i.cn(s.error,t)),"aria-hidden":u!=="error",...n,children:c.jsx(Hh,{className:d.icon})})});To.displayName="ButtonError";const Jc=a.memo(a.forwardRef(function({clipClass:t},n){const[o,r]=a.useState([]),s=a.useRef(0);a.useImperativeHandle(n,()=>({push(u,d){const f=++s.current;r(m=>[...m,{id:f,size:d,tone:u}])}}),[]);const l=a.useCallback(u=>{r(d=>d.filter(f=>f.id!==u))},[]);return c.jsx("span",{className:i.cn(i.BUTTON_CLIP_LAYER_CLASS,t),"aria-hidden":!0,children:o.map(u=>c.jsx(Gh,{size:u.size,tone:u.tone,onDone:()=>l(u.id)},u.id))})}));Jc.displayName="ButtonExpandRippleLayer";function Vh({icon:e,iconPosition:t="start",children:n}){const o=Lh(n),r=e!=null?c.jsx(Hs,{children:e}):null;return c.jsxs(c.Fragment,{children:[t==="start"?r:null,o?c.jsx(Gs,{children:n}):n,t==="end"?r:null]})}const eu=a.createContext(null),tu=a.createContext(null),Br=a.createContext({});function zh({value:e,children:t}){return c.jsx(tu.Provider,{value:e,children:t})}function nu({segment:e,buttonSize:t,variant:n,children:o}){const r=a.useMemo(()=>({segment:e,buttonSize:t,variant:n}),[t,e,n]);return c.jsx(eu.Provider,{value:r,children:o})}function et(){return a.useContext(eu)}function $t(){return a.useContext(tu)}function Vs(){const e=$t();return!!(et()&&!(e!=null&&e.segmented))}function Uh({classNames:e,children:t}){const n=a.useContext(Br),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Br.Provider,{value:o,children:t})}function ou(){return a.useContext(Br)}const jr=a.createContext({}),ru=a.createContext(null),su=a.createContext(null);function Wh({classNames:e,children:t}){const o={...a.useContext(jr),...e};return c.jsx(jr.Provider,{value:o,children:t})}function Yh({shellIds:e,children:t}){return c.jsx(ru.Provider,{value:e,children:t})}function Xt(){return a.useContext(jr)}function Wo(){return a.useContext(ru)}function tt(){return a.useContext(su)}function $h(e){return e==="loading"}function Xh({variant:e,status:t="default",size:n,type:o="button",asyncState:r,onAsyncStateChange:s,onAsyncClick:l,asyncFeedbackMs:u=2e3,disabled:d,icon:f,iconPosition:m="start",ripple:p=!1,iconOnly:C=!1,groupSegment:S,className:g="",classNames:h,children:x,onClick:A}){const b=$t(),_=et(),L=tt(),v=b!=null&&b.segmented?void 0:S??(_==null?void 0:_.segment),R=n??(_==null?void 0:_.buttonSize)??(L==null?void 0:L.size)??"base",T=e??(_==null?void 0:_.variant)??"default",E=!!(d??(L==null?void 0:L.disabled)??(L==null?void 0:L.isSubmitting)),I=T==="gloss",[O,N]=a.useState("idle"),y=r!==void 0,w=y?r:O,P=a.useCallback(ee=>{N(ee),s==null||s(ee)},[s]),k=a.useCallback(()=>{window.setTimeout(()=>{P("idle")},u)},[u,P]),j=w==="loading"||w==="success"||w==="error",B=E||j,D=i.CONTROL_SIZE_LAYOUT[R].rounded,F=v?i.buttonGroupRoundingClasses(v):D,H=v?i.buttonGroupSegmentSurfaceClasses(v):"",U=v?i.buttonGroupRoundingClasses(v):D,G=a.useMemo(()=>Zc(x),[x]),K=G?void 0:g,V=i.cn(i.BUTTON_BASE_INTERACTIVE_CLASS,i.BUTTON_STATUS_FOCUS_OUTLINE[t],i.buttonRootClass(R,C),i.buttonSurfaceMotionClass(I,t,T,!!v,B),E?i.BUTTON_DISABLED_OPACITY_CLASS:"",F,H,i.BUTTON_CURSOR_CLASS,h==null?void 0:h.root,g),oe=i.buttonConvergeRippleColor(T,t),J=i.buttonLoaderTextClass(T,t);return{type:o,size:R,variant:T,status:t,ripple:p,blocked:B,busy:j,userDisabled:E,isGloss:I,groupSegment:v,clipClass:U,buttonClass:V,convergeRippleColor:oe,loaderTextClass:J,asyncState:w,isControlled:y,internalAsync:O,icon:f,iconPosition:m,children:x,classNames:h,isCompound:G,labelLayoutClass:K,onClick:A,onAsyncClick:l,setUncontrolledAsync:P,scheduleAsyncIdleReset:k,ariaBusy:$h(w)}}function Kh({children:e,isCompound:t,hasCompoundContent:n,hasCompoundLoader:o,hasCompoundSuccess:r,hasCompoundError:s,icon:l,iconPosition:u,classNames:d,labelLayoutClass:f}){return t?n?e:c.jsxs(vo,{children:[e,o?null:c.jsx(_o,{}),r?null:c.jsx(Lo,{}),s?null:c.jsx(To,{})]}):c.jsxs(vo,{children:[c.jsx(Fs,{className:i.cn(d==null?void 0:d.label,f),children:c.jsx(Vh,{icon:l,iconPosition:u,children:e})}),c.jsx(_o,{}),c.jsx(Lo,{}),c.jsx(To,{})]})}const au=a.forwardRef(function({className:t,classNames:n,variant:o,status:r,size:s,type:l,asyncState:u,onAsyncStateChange:d,onAsyncClick:f,asyncFeedbackMs:m,disabled:p,icon:C,iconPosition:S,ripple:g,iconOnly:h,groupSegment:x,asChild:A=!1,children:b,onClick:_,onPointerDown:L,onPointerEnter:v,onPointerLeave:R,onMouseDown:T,...E},I){const O=A&&a.isValidElement(b)&&a.Children.count(b)===1?b:null,N=O?O.props.children:b,y=Xh({className:t,classNames:n,variant:o,status:r,size:s,type:l,asyncState:u,onAsyncStateChange:d,onAsyncClick:f,asyncFeedbackMs:m,disabled:p,icon:C,iconPosition:S,ripple:g,iconOnly:h,groupSegment:x,children:N,onClick:_}),w=Nh({variant:y.variant,asyncState:y.asyncState,isControlled:y.isControlled,blocked:y.blocked,groupSegment:y.groupSegment,forwardedRef:I,onPointerEnter:v,onPointerLeave:R,onPointerDown:L}),P=w.createAsyncClickHandler(y.onClick,y.onAsyncClick,y.isControlled,y.internalAsync,y.setUncontrolledAsync,y.scheduleAsyncIdleReset),k={size:y.size,variant:y.variant,status:y.status,asyncState:y.asyncState,groupSegment:y.groupSegment,loaderTextClass:y.loaderTextClass,bindLabelRef:w.bindLabelRef,bindLoaderRef:w.bindLoaderRef,bindSuccessRef:w.bindSuccessRef,bindErrorRef:w.bindErrorRef,contentMotionRef:w.contentMotionRef},{hasCompoundContent:j,hasCompoundLoader:B,hasCompoundSuccess:D,hasCompoundError:F,isCompound:H}=a.useMemo(()=>({hasCompoundContent:ro(N,"ButtonContent"),hasCompoundLoader:ro(N,"ButtonLoader"),hasCompoundSuccess:ro(N,"ButtonSuccess"),hasCompoundError:ro(N,"ButtonError"),isCompound:Zc(N)}),[N]),U=c.jsxs(c.Fragment,{children:[y.ripple?c.jsx(Dn,{color:y.convergeRippleColor,disabled:y.blocked||y.asyncState!=="idle",duration:i.getMotionConfig().rippleDefaultDuration,className:y.clipClass}):null,c.jsx(Jc,{ref:w.expandRippleLayerRef,clipClass:y.clipClass}),Kh({children:N,isCompound:H,hasCompoundContent:j,hasCompoundLoader:B,hasCompoundSuccess:D,hasCompoundError:F,icon:y.icon,iconPosition:y.iconPosition,classNames:y.classNames,labelLayoutClass:y.labelLayoutClass})]});return c.jsx(Oh,{value:k,children:c.jsx(wh,{classNames:y.classNames,children:O?a.cloneElement(O,yt(O,{...E,className:y.buttonClass,"aria-busy":y.ariaBusy,"aria-disabled":y.blocked||void 0,tabIndex:y.blocked?-1:E.tabIndex,onPointerDown:w.handlePointerDown,onPointerEnter:w.handlePointerEnter,onPointerLeave:w.handlePointerLeave,onMouseDown:T,onClick:G=>{if(y.blocked){G.preventDefault();return}P(G)},children:U},w.setRefs)):c.jsx("button",{ref:w.setRefs,...E,type:y.type,disabled:y.blocked,"aria-busy":y.ariaBusy,className:y.buttonClass,onPointerDown:w.handlePointerDown,onPointerEnter:w.handlePointerEnter,onPointerLeave:w.handlePointerLeave,onMouseDown:T,onClick:P,children:U})})})});au.displayName="ButtonRoot";const Vt=Object.assign(au,{Content:vo,Label:Fs,Icon:Hs,Text:Gs,Loader:_o,Success:Lo,Error:To}),qh=new Set(["default","primary","outline","secondary","ghost"]),Zh={default:"default",primary:"primary",outline:"transparent-hover",secondary:"secondary",ghost:"transparent-hover",gloss:"default"},Qh={default:{convergeBg:i.colorToken("converge-ripple-neutral")},primary:{convergeBg:i.colorToken("converge-ripple-primary-fill")},outline:{convergeBg:i.colorToken("converge-ripple-neutral")},secondary:{convergeBg:i.colorToken("converge-ripple-neutral")},ghost:{convergeBg:i.colorToken("converge-ripple-neutral")},gloss:{convergeBg:i.colorToken("converge-ripple-neutral")}},lu={small:{root:"h-control-xsmall w-control-xsmall",icon:"icon-small"},base:{root:"h-control-small w-control-small",icon:"icon-base"},mid:{root:"h-control-base w-control-base",icon:"icon-mid"},large:{root:"h-control-mid w-control-mid",icon:"icon-large"}},Jh="relative z-0 flex shrink-0 cursor-pointer items-center justify-center rounded-full outline-none focus-ring overflow-hidden",ex="cursor-not-allowed opacity-50",tx="relative z-[1] shrink-0 text-current",nx="rounded-full";function ox(e){return Qh[e]}function rx({variant:e,size:t,disabled:n,className:o,slotRoot:r}){const s=e==="gloss",l=lu[t];return i.cn(Jh,s?i.cn("gloss-btn",i.GLOSS_INTERACTIVE_MOTION_CLASS):i.SHADOW_LIFT_MOTION_CLASS,!n&&!s&&i.hoverVariant(Zh[e]),!s&&i.INTERACTIVE_VARIANT_ROOT[e],l.root,n&&ex,o,r)}function sx(e,t){return i.cn(tx,lu[e].icon,t)}function ax({variant:e,disabled:t,forwardedRef:n,onPointerDown:o,onPointerEnter:r,onPointerLeave:s}){const l=Uo({isGloss:e==="gloss",enabled:!t,hasHoverShadow:qh.has(e),useContentRef:!1,forwardedRef:n,onPointerEnter:r,onPointerLeave:s,onPointerDown:o});return{setRefs:l.setRefs,handlePointerEnter:l.handlePointerEnter,handlePointerLeave:l.handlePointerLeave,handlePointerDown:l.handlePointerDown}}const Mr=a.createContext({});function lx({classNames:e,children:t}){const n=a.useContext(Mr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Mr.Provider,{value:o,children:t})}function iu(){return a.useContext(Mr)}function ix({color:e,disabled:t,className:n}){const o=iu();return c.jsx(Dn,{color:e,disabled:t,duration:i.getMotionConfig().rippleDefaultDuration,className:i.cn(nx,o.ripple,n)})}function cx({size:e}){const t=iu();return c.jsx(be.IoClose,{"aria-hidden":!0,className:sx(e,t.icon)})}const Se={close:"Close",openSearch:"Open search",search:"Search",clearField:"Clear field",time:"Time",timeHours:"hours",timeMinutes:"minutes",timeSeconds:"seconds",openList:"Open list",closeList:"Close list",showPassword:"Show password",hidePassword:"Hide password",removeFile:"Remove file",resizeHeight:"Resize height",breadcrumbs:"Breadcrumbs",breadcrumbsShowHidden:"Show {count} hidden sections",breadcrumbsHiddenSections:"Hidden sections",pagination:"Pagination",paginationPrevious:"Back",paginationNext:"Forward",paginationPage:"Page {n}",drawerDragDownToClose:"Drag down to close",drawerDragUpToClose:"Drag up to close",drawerDragLeftToClose:"Drag left to close",drawerDragRightToClose:"Drag right to close",toastNotifications:"Notifications ({placement})",colorPickerArea:"Saturation and brightness",colorPickerAreaValue:"{saturation}% saturation, {brightness}% brightness",colorPickerContent:"Color selection",colorPickerHex:"Hex code of the color",colorPickerAlpha:"Transparency (%)",colorPickerSelected:"Selected color: {hex}"},ux={close:"Закрыть",openSearch:"Открыть поиск",search:"Поиск",clearField:"Очистить поле",time:"Время",timeHours:"часы",timeMinutes:"минуты",timeSeconds:"секунды",openList:"Открыть список",closeList:"Закрыть список",showPassword:"Показать пароль",hidePassword:"Скрыть пароль",removeFile:"Удалить файл",resizeHeight:"Изменить высоту",breadcrumbs:"Навигационная цепочка",breadcrumbsShowHidden:"Показать скрытые разделы: {count}",breadcrumbsHiddenSections:"Скрытые разделы",pagination:"Пагинация",paginationPrevious:"Назад",paginationNext:"Вперёд",paginationPage:"Страница {n}",drawerDragDownToClose:"Потяните вниз, чтобы закрыть",drawerDragUpToClose:"Потяните вверх, чтобы закрыть",drawerDragLeftToClose:"Потяните влево, чтобы закрыть",drawerDragRightToClose:"Потяните вправо, чтобы закрыть",toastNotifications:"Уведомления ({placement})",colorPickerArea:"Насыщенность и яркость",colorPickerAreaValue:"Насыщенность {saturation}%, яркость {brightness}%",colorPickerContent:"Выбор цвета",colorPickerHex:"HEX-код цвета",colorPickerAlpha:"Прозрачность (%)",colorPickerSelected:"Выбранный цвет: {hex}"};function cu(e){return e?{...Se,...e}:Se}function pn(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>{const r=t[o];return r===void 0?n:String(r)})}const uu=a.createContext(Se);function du({children:e,labels:t}){const n=a.useMemo(()=>cu(t),[t]);return c.jsx(uu.Provider,{value:n,children:e})}function Ie(){return a.useContext(uu)}function St(e){return Ie()[e]}function dx(e,t=Se.close){return e??t}function fx({variant:e="default",size:t="base",ripple:n=!1,className:o,disabled:r,type:s="button","aria-label":l,classNames:u}){const d=St("close"),f=!!r,m=ox(e),p=rx({variant:e,size:t,disabled:f,className:o,slotRoot:u==null?void 0:u.root});return{variant:e,size:t,ripple:n,disabled:f,type:s,ariaLabel:dx(l,d),buttonClass:p,convergeRippleColor:m.convergeBg,classNames:u}}const Cn=a.forwardRef(function({variant:t,size:n,ripple:o,className:r,classNames:s,disabled:l,type:u,"aria-label":d,onPointerDown:f,onPointerEnter:m,onPointerLeave:p,...C},S){const g=fx({variant:t,size:n,ripple:o,className:r,classNames:s,disabled:l,type:u,"aria-label":d}),h=ax({variant:g.variant,disabled:g.disabled,forwardedRef:S,onPointerDown:f,onPointerEnter:m,onPointerLeave:p});return c.jsx(lx,{classNames:g.classNames,children:c.jsxs("button",{ref:h.setRefs,type:g.type,disabled:g.disabled,"aria-label":g.ariaLabel,className:g.buttonClass,onPointerEnter:h.handlePointerEnter,onPointerLeave:h.handlePointerLeave,onPointerDown:h.handlePointerDown,...C,children:[g.ripple?c.jsx(ix,{color:g.convergeRippleColor,disabled:g.disabled}):null,c.jsx(cx,{size:g.size})]})})});Cn.displayName="CloseButton";const fu=a.createContext(null),Fr=a.createContext({}),zs=a.createContext(null);function mx({value:e,children:t}){return c.jsx(fu.Provider,{value:e,children:t})}function Kt(){const e=a.useContext(fu);if(!e)throw new Error("Expandable components must be used inside <Expandable>.");return e}function px({classNames:e,children:t}){const n=a.useContext(Fr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Fr.Provider,{value:o,children:t})}function Nt(){return a.useContext(Fr)}function Cx({gridSlots:e,children:t}){return c.jsx(zs.Provider,{value:e,children:t})}function gx(){const e=a.useContext(zs);if(!e)throw new Error("Expandable trigger parts must be inside <Expandable.Trigger>.");return e}function Yo(){return a.useContext(zs)}function $o(e){return e?2:1}function Sx(e){return e.hasAction?$o(e.hasIndicator)+1:null}function hx(e){return e.hasClose?$o(e.hasIndicator)+(e.hasAction?2:1):null}function xx(e){const{hasIndicator:t,hasAction:n,hasClose:o}=e;return t&&n&&o?"grid-cols-[auto_minmax(0,1fr)_auto_auto]":t&&(n||o)?"grid-cols-[auto_minmax(0,1fr)_auto]":t?"grid-cols-[auto_minmax(0,1fr)]":n&&o?"grid-cols-[minmax(0,1fr)_auto_auto]":n||o?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]"}const Xo={1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4"};function gn(e,t="gap-x-base"){const n=e.hasTitle&&e.hasDescription;return i.cn("grid w-full min-w-0 text-left",xx(e),n?"grid-rows-[auto_auto] gap-y-xsmall":"grid-rows-[auto]",t)}function Ft(e){return e.hasIndicator?"col-start-1 row-start-1 self-center shrink-0":"hidden"}function Sn(e){return i.cn("row-start-1 self-center min-w-0 max-w-full justify-self-start",Xo[$o(e.hasIndicator)])}function kn(e){return i.cn(e.hasTitle?"row-start-2":"row-start-1","min-w-0 w-full max-w-full justify-self-stretch self-start",Xo[$o(e.hasIndicator)])}function Bn(e){const t=Sx(e);return t==null?"hidden":i.cn("row-start-1 self-center shrink-0 justify-self-end",Xo[t])}function mu(e){const t=hx(e);return t==null?"hidden":i.cn("row-start-1 self-center shrink-0 justify-self-end",Xo[t])}const Wi="data-chevron-init";function go(e,t){$.set(e,{rotation:t?180:0})}function bx(e,t){return n=>{e.current=n,n&&!n.hasAttribute(Wi)&&(n.setAttribute(Wi,""),go(n,t))}}function qt(e,t,n=()=>!0,o){const r=a.useRef(e),s=a.useRef(void 0),l=i.usePrefersReducedMotion(),u=a.useMemo(()=>bx(t,r.current),[t]);return a.useLayoutEffect(()=>{const d=t.current;if(!d)return;if(o!=null&&o.current){o.current=!1,s.current=e,go(d,e);return}const f=l||!n();if(s.current===void 0){s.current=e,go(d,e);return}if(s.current!==e){if(s.current=e,i.killMotion(d),f){go(d,e);return}$.to(d,{rotation:e?180:0,...i.motionInteractive(),overwrite:"auto"})}},[e,t,n,o,l]),u}function Eo(e){return e.scrollHeight}function Ax(e,t){const n=Eo(t),o=e.getBoundingClientRect().height;if(n<=0){$.set(e,{clearProps:"height"}),e.style.removeProperty("overflow");return}if(Math.abs(n-o)<=.5){requestAnimationFrame(()=>{requestAnimationFrame(()=>{$.set(e,{clearProps:"height"}),e.style.removeProperty("height"),e.style.removeProperty("overflow")})});return}e.style.height=`${n}px`,e.style.overflow="hidden",requestAnimationFrame(()=>{requestAnimationFrame(()=>{$.set(e,{clearProps:"height"}),e.style.removeProperty("height"),e.style.removeProperty("overflow")})})}function So(e,t){t?($.set(e,{clearProps:"height"}),e.style.removeProperty("height"),e.style.removeProperty("overflow")):(e.style.height="0px",e.style.overflow="hidden")}const Yi="data-collapsible-init";function pu(e,t){const n=a.useRef(t);return a.useCallback(o=>{e.current=o,o&&!o.hasAttribute(Yi)&&(o.setAttribute(Yi,""),So(o,n.current))},[e])}function Cu(e,t,n,o){const r=a.useRef((o==null?void 0:o.enabled)??(()=>i.isMotionFeatureEnabled("enableExpandable")));r.current=(o==null?void 0:o.enabled)??(()=>i.isMotionFeatureEnabled("enableExpandable"));const s=o==null?void 0:o.skipAnimRef,l=a.useRef(void 0),u=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const d=t.current,f=n.current;if(!d||!f)return;const m=u||!r.current();if(l.current===void 0){l.current=e,So(d,e);return}if(s!=null&&s.current){s.current=!1,l.current=e,So(d,e);return}if(l.current!==e){if(l.current=e,i.killMotion(d),m){So(d,e);return}if(e)d.style.overflow="hidden",$.fromTo(d,{height:0},{height:()=>Eo(f),...i.motionExpand(),overwrite:"auto",onComplete:()=>Ax(d,f)});else{const p=d.getBoundingClientRect().height||Eo(f);d.style.height=`${p}px`,d.style.overflow="hidden",$.to(d,{height:0,...i.motionExpand(),overwrite:"auto",onComplete:()=>{d.style.height="0px",d.style.overflow="hidden"}})}}},[e,t,n,s,u])}function vx({open:e,disabled:t,toggle:n,forwardedRef:o,onClick:r,onKeyDown:s,onPointerDown:l}){const u=a.useRef(null),d=a.useRef(null),f=qt(e,d,()=>i.isMotionFeatureEnabled("enableExpandable"));a.useEffect(()=>{const g=u.current;return()=>{g&&i.killMotion(g)}},[]),a.useEffect(()=>{if(!t)return;const g=u.current;g&&i.killMotion(g)},[t]);const m=a.useCallback(g=>{ue(o,g)},[o]),p=a.useCallback(g=>{r==null||r(g),!(g.defaultPrevented||t)&&n()},[t,r,n]),C=a.useCallback(g=>{s==null||s(g),!(g.defaultPrevented||t)&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n())},[t,s,n]),S=a.useCallback(g=>{if(!t){const h=u.current;h&&!i.prefersReducedMotion()&&i.animateInteractivePressSqueeze(h)}l==null||l(g)},[t,l]);return{liftSpanRef:u,bindChevronRef:f,setTriggerRef:m,handleClick:p,handleKeyDown:C,handlePointerDown:S}}function _x(e){const t=a.useRef(null),n=a.useRef(null),o=pu(t,e);return Cu(e,t,n),{shellRef:t,innerRef:n,bindShellRef:o}}const Lx=new Set(["ExpandableIcon","Accordion.Icon"]),Tx=new Set(["ExpandableTitle","Accordion.Title"]),Ex=new Set(["ExpandableDescription","Accordion.Description"]),Rx=new Set(["ExpandableChevron","Accordion.Chevron"]),Ix=new Set(["ExpandableMessage","Accordion.Message"]),yx=new Set(["ExpandableTrigger","ExpandablePanel","ExpandableMessage","Accordion.Trigger","Accordion.Panel","Accordion.Message","Accordion.Heading"]);function Nx(...e){return t=>{for(const n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Us(e){return e.displayName}function wx(e){const t=[],n=[];return a.Children.forEach(e,o=>{a.isValidElement(o)&&o.type===Dn?t.push(o):n.push(o)}),{ripples:t,rest:n}}function Ox(e){let t=!1;return a.Children.forEach(e,n=>{if(t||!a.isValidElement(n))return;const o=Us(n.type);o!=null&&Ix.has(o)&&(t=!0)}),t}function Px(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;const s=Us(r.type);if(s!=null&&yx.has(s)){t=!0;return}n(r.props.children)}};return n(e),t}function Ko(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=Us(s.type);if(l!=null&&t.has(l)){n=!0;return}o(s.props.children)}};return o(e),n}function Dx(e){return Ko(e,Lx)}function kx(e){return Ko(e,Tx)}function Bx(e){return Ko(e,Ex)}function gu(e){return Ko(e,Rx)}function jx({children:e,hideChevron:t,hasPanel:n}){const o=gu(e),r=n&&!t&&!o;return{hasIndicator:Dx(e),hasTitle:kx(e),hasDescription:Bx(e),hasAction:r||o,hasClose:!1}}const Mx="rounded-mid text-left text-foreground",Fx="border-token bg-surface shadow-token-base",Hx="gloss-panel gloss-deep border-0",Gx="gloss-content flex min-w-0 flex-col",Vx="relative w-full overflow-hidden rounded-[inherit] text-left outline-none focus-ring",zx="cursor-not-allowed opacity-50",Ux="cursor-pointer",Wx="relative z-[1] w-full min-w-0 origin-center",Su="contents",hu="relative z-[1] flex shrink-0 origin-center self-center",Yx=Su,$x="shrink-0 text-primary [&_svg]:size-full",Xx=Su,Kx="text-muted",qx="font-w-mid",Zx=hu,Qx="overflow-hidden",Jx="pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]";function eb({variant:e,className:t,slotClass:n}){return i.cn(Mx,e==="gloss"?Hx:Fx,n,t)}function tb({size:e,disabled:t,className:n,slotClass:o}){return i.cn(Vx,It(e).triggerPadding,t?zx:Ux,o,n)}function nb({gridSlots:e,slotClass:t}){return i.cn(Wx,gn(e),t)}function ob({size:e,className:t,slotClass:n}){return i.cn($x,i.CONTROL_SIZE_LAYOUT[e].icon,n,t)}function rb({size:e,className:t,slotClass:n}){return i.cn(It(e).contentPadding,"text-left",n,t)}function sb(e){return i.CONTROL_SIZE_LAYOUT[e].chevronIcon}function ab(e){return i.CONTROL_SIZE_LAYOUT[e].chevronIcon}function lb(e){return It(e).titleVariant}function ib(e){return It(e).titleClassName}function cb(e){return It(e).descVariant}function xu({className:e}){return c.jsx("svg",{className:i.cn("shrink-0",e),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"m6 9 6 6 6-6"})})}const Ws=a.forwardRef(function({className:t,...n},o){const r=Nt();return c.jsx("div",{ref:o,className:i.cn(Yx,r.message,t),...n})});Ws.displayName="ExpandableMessage";const Ys=a.forwardRef(function({hideChevron:t=!1,asChild:n,className:o,onClick:r,onKeyDown:s,onPointerDown:l,children:u,type:d="button",...f},m){const{open:p,disabled:C,hasPanel:S,size:g,toggle:h,headerId:x,panelId:A}=Kt(),b=Nt(),_=vx({open:p,disabled:C,toggle:h,forwardedRef:m,onClick:r,onKeyDown:s,onPointerDown:l}),{ripples:L,rest:v}=a.useMemo(()=>wx(u),[u]),R=a.useMemo(()=>jx({children:v,hideChevron:t,hasPanel:S}),[v,t,S]),T=Ox(v)?c.jsx(c.Fragment,{children:v}):c.jsx(Ws,{children:v}),E=S&&!t&&!gu(v),I=L.length>0?c.jsx("span",{className:i.cn(Jx,b.triggerRippleOverlay),"aria-hidden":!0,children:L}):null,O=c.jsxs(c.Fragment,{children:[T,E?c.jsx("span",{ref:_.bindChevronRef,className:i.cn(Bn(R),hu,b.chevron),"aria-hidden":!0,children:c.jsx(xu,{className:ab(g)})}):null]});if(n&&a.isValidElement(u)){const N=u;return a.cloneElement(N,{...f,id:x,ref:Nx(m,N.props.ref),className:i.cn(N.props.className,o),disabled:C||N.props.disabled,"aria-expanded":S?p:void 0,"aria-controls":S?A:void 0,onClick:y=>{var w,P;(P=(w=N.props).onClick)==null||P.call(w,y),_.handleClick(y)},onKeyDown:y=>{var w,P;(P=(w=N.props).onKeyDown)==null||P.call(w,y),_.handleKeyDown(y)}})}return c.jsxs("button",{ref:_.setTriggerRef,type:d,id:x,className:tb({size:g,disabled:C,className:o,slotClass:b.trigger}),"aria-expanded":S?p:void 0,"aria-controls":S?A:void 0,disabled:C,onPointerDown:_.handlePointerDown,onClick:_.handleClick,onKeyDown:_.handleKeyDown,...f,children:[I,c.jsx(Cx,{gridSlots:R,children:c.jsx("span",{ref:_.liftSpanRef,className:nb({gridSlots:R,slotClass:b.triggerLift}),children:O})})]})});Ys.displayName="ExpandableTrigger";function $s({className:e,children:t,...n}){const{size:o}=Kt(),r=Nt(),s=Yo();return t==null?null:c.jsx("span",{"aria-hidden":!0,className:i.cn(ob({size:o,className:e,slotClass:r.icon}),s&&Ft(s)),...n,children:t})}$s.displayName="ExpandableIcon";function bu({className:e,...t}){const n=Nt();return c.jsx("div",{className:i.cn(Xx,n.content,e),...t})}bu.displayName="ExpandableContent";function Xs({className:e,...t}){const{size:n}=Kt(),o=Nt(),r=Yo();return c.jsx(q,{as:"div",variant:lb(n),className:i.cn(qx,ib(n),r&&Sn(r),o.title,e),...t})}Xs.displayName="ExpandableTitle";function Ks({className:e,...t}){const{size:n}=Kt(),o=Nt(),r=Yo();return c.jsx(q,{as:"div",variant:cb(n),className:i.cn(Kx,r&&kn(r),o.description,e),...t})}Ks.displayName="ExpandableDescription";function Au({className:e,...t}){const{open:n,hasPanel:o,size:r}=Kt(),s=Nt(),l=gx(),u=a.useRef(null),d=qt(n,u,()=>i.isMotionFeatureEnabled("enableExpandable"));return o?c.jsx("span",{ref:d,className:i.cn(Bn(l),Zx,s.chevron,e),"aria-hidden":!0,...t,children:c.jsx(xu,{className:sb(r)})}):null}Au.displayName="ExpandableChevron";const qs=a.forwardRef(function({className:t,children:n,...o},r){const{open:s,headerId:l,panelId:u,size:d,setHasPanel:f}=Kt(),m=Nt(),p=_x(s);a.useLayoutEffect(()=>(f(!0),()=>f(!1)),[f]);const C=a.useCallback(S=>{typeof r=="function"?r(S):r&&(r.current=S)},[r]);return c.jsx("div",{ref:p.bindShellRef,className:i.cn(Qx,m.panelShell),children:c.jsx("div",{ref:p.innerRef,children:c.jsx("section",{ref:C,id:u,"aria-labelledby":l,"aria-hidden":!s,inert:!s,className:rb({size:d,className:t,slotClass:m.panel}),...o,children:n})})})});qs.displayName="ExpandablePanel";function ub({title:e,description:t,icon:n,panelChildren:o}){return c.jsxs(c.Fragment,{children:[c.jsxs(Ys,{children:[n!=null?c.jsx($s,{children:n}):null,e!=null?c.jsx(Xs,{children:e}):null,t!=null?c.jsx(Ks,{children:t}):null]}),o!=null?c.jsx(qs,{children:o}):null]})}function db({children:e,compound:t,defaultOpen:n=!1,open:o,onOpenChange:r,disabled:s=!1,size:l="base",variant:u="default"}){const d=a.useId(),f=a.useId(),m=o!==void 0,[p,C]=a.useState(n),[S,g]=a.useState(!1),h=a.useCallback(L=>{g(L)},[]),x=m?o:p,A=a.useCallback(()=>{if(s||!S)return;const L=!x;m||C(L),r==null||r(L)},[m,s,S,x,r]),b={open:x,disabled:s,hasPanel:S,size:l,variant:u,toggle:A,headerId:f,panelId:d,setHasPanel:h},_=t===!0||Px(e);return{contextValue:b,isCompound:_,isGloss:u==="gloss"}}const vu=a.forwardRef(function({children:t,compound:n,title:o,description:r,icon:s,variant:l="default",size:u="base",defaultOpen:d=!1,open:f,onOpenChange:m,disabled:p=!1,className:C,classNames:S,...g},h){const x=db({children:t,compound:n,defaultOpen:d,open:f,onOpenChange:m,disabled:p,size:u,variant:l}),A=i.useMergedGlossPanelRef(h,x.isGloss),b=x.isCompound?t:c.jsx(ub,{title:o,description:r,icon:s,panelChildren:t});return c.jsx(mx,{value:x.contextValue,children:c.jsx(px,{classNames:S,children:c.jsx("div",{ref:A,className:eb({variant:l,className:C,slotClass:S==null?void 0:S.root}),...g,children:x.isGloss?c.jsx("div",{className:i.cn(Gx,S==null?void 0:S.glossContent),children:b}):b})})})});vu.displayName="ExpandableRoot";const ht=Object.assign(vu,{Trigger:Ys,Message:Ws,Icon:$s,Content:bu,Title:Xs,Description:Ks,Chevron:Au,Panel:qs}),jn=a.createContext(null),Hr=a.createContext({});function fb({classNames:e,children:t}){const n=a.useContext(Hr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Hr.Provider,{value:o,children:t})}function hn(){return a.useContext(Hr)}const Zs={danger:be.IoCloseCircleOutline,success:be.IoCheckmarkCircleOutline,info:be.IoInformationCircleOutline,warning:be.IoWarning};function Qs(e){return e??"default"}function Js(e){return e??"default"}function Mn(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function mb(e){return Mn(e,t=>t==="AlertTitle")}function pb(e){return Mn(e,t=>t==="AlertDescription")}function Cb(e){return Mn(e,t=>t==="AlertIndicator")}function _u(e,t){for(const n of a.Children.toArray(e)){if(!a.isValidElement(n))continue;n.type.displayName==="AlertIndicator"&&t(n.props),_u(n.props.children,t)}}function gb(e,t,n,o){const r=o??t;return n===null?!1:n!==void 0||r!=="default"?!0:e==="outline"}function Sb(e,t,n){if(!Cb(e))return!1;let o=!1;return _u(e,r=>{gb(t,n,r.children,r.status)&&(o=!0)}),o}function hb(e){return Mn(e,t=>t==="AlertAction")}const xb=new Set(["AlertMessage","AlertIndicator","AlertContent","AlertTitle","AlertDescription","AlertAction"]);function bb(e){return Mn(e,t=>t!=null&&xb.has(t))}function ea(e,t){return t!=="default"?!0:e==="outline"}function ta(e,t){return t!=="default"?Zs[t]:e==="outline"?be.IoHelpCircleOutline:null}function Ab(e,t,n,o,r){return o?Sb(r,e,t):n===null?!1:n!==void 0?!0:ea(e,t)&&ta(e,t)!==null}const vb={default:"bg-surface border-token text-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground"};function Lu(e,t="default"){return e==="gloss"?"gloss-panel border-0 text-foreground":vb[e]}function Tu(e){return e!=="default"?i.SEMANTIC_STATUS_TEXT[e]:"text-primary"}const _b="inline-flex shrink-0 items-center justify-center";function Lb(e,t){return i.cn(_b,t,Tu(e))}const Eu="contents",Tb="font-w-mid";function Eb(e){return i.cn(Tb,e!=="default"?i.SEMANTIC_STATUS_TEXT[e]:"")}const Rb="text-muted";function na({status:e,className:t="",children:n,...o}){const r=a.useContext(jn),s=hn(),l=(r==null?void 0:r.variant)??"default",u=e??(r==null?void 0:r.status)??"default",d=(r==null?void 0:r.sizePreset)??Ct("base"),f=r==null?void 0:r.gridSlots;if(n===null)return null;const m=ta(l,u),p=n!==void 0?n:ea(l,u)&&m!==null?c.jsx(m,{"aria-hidden":!0}):null;return p===null?null:c.jsx("span",{className:i.cn(Lb(u,d.iconSvgClass),f&&Ft(f),s.indicator,t),...o,children:p})}na.displayName="AlertIndicator";function Ru({className:e="",...t}){const n=hn();return c.jsx("div",{className:i.cn(Eu,n.content,e),...t})}Ru.displayName="AlertContent";const Iu=a.forwardRef(function({className:t="",...n},o){const r=hn();return c.jsx("div",{ref:o,className:i.cn(Eu,r.message,t),...n})});Iu.displayName="AlertMessage";function oa({className:e="",id:t,...n}){const o=a.useContext(jn),r=hn(),s=(o==null?void 0:o.sizePreset)??Ct("base"),l=(o==null?void 0:o.status)??"default";return c.jsx(q,{as:"div",id:t??(o==null?void 0:o.titleId),variant:s.titleVariant,className:i.cn(Eb(l),(o==null?void 0:o.gridSlots)&&Sn(o.gridSlots),r.title,e),...n})}oa.displayName="AlertTitle";function ra({className:e="",id:t,...n}){const o=a.useContext(jn),r=hn(),s=(o==null?void 0:o.sizePreset)??Ct("base");return c.jsx(q,{as:"div",id:t??(o==null?void 0:o.descriptionId),variant:s.descVariant,className:i.cn(Rb,(o==null?void 0:o.gridSlots)&&kn(o.gridSlots),r.description,e),...n})}ra.displayName="AlertDescription";function sa({className:e="",...t}){const n=a.useContext(jn),o=hn();return c.jsx("div",{className:i.cn((n==null?void 0:n.gridSlots)&&Bn(n.gridSlots),o.action,e),...t})}sa.displayName="AlertAction";function Ib({gridSlots:e,title:t,description:n,icon:o,action:r,children:s}){return c.jsxs(c.Fragment,{children:[e.hasIndicator?c.jsx(na,{children:o}):null,t!=null?c.jsx(oa,{children:t}):null,n!=null?c.jsx(ra,{children:n}):null,s,r!=null?c.jsx(sa,{children:r}):null]})}function yb({variant:e,status:t,hoverLift:n=!0,ref:o,onPointerOver:r,onPointerOut:s}){const l=e==="gloss",u=n,d=a.useRef(null),f=a.useMemo(()=>i.createGlossInteractiveRefCallback(d,u&&l),[l,u]),m=a.useCallback(x=>{f(x),d.current=x,typeof o=="function"?o(x):o&&(o.current=x)},[f,o]),p=i.useGlossInteractiveHandlers(d,u&&l),C=i.useSecondLevelShadow(d,u&&!l),S=u?l?i.GLOSS_INTERACTIVE_MOTION_CLASS:C.motionClass:"",g=i.cn(Lu(e,t),S),h=a.useMemo(()=>({onPointerOver:x=>{r==null||r(x),!(x.defaultPrevented||!u)&&(l?p.onPointerOver(x):C.onPointerEnter(x))},onPointerOut:x=>{s==null||s(x),u&&(l?p.onPointerOut(x):C.onPointerLeave(x))}}),[p.onPointerOut,p.onPointerOver,l,u,s,r,C.onPointerEnter,C.onPointerLeave]);return{setRootRef:m,surfaceClass:g,pointerHandlers:h}}function yu(e,t){return t??(e==="danger"||e==="warning"?"alert":"status")}function Nb(e,t,n,o){if(n)return e;if(o)return t}function wb(e,t,n){if(t&&n)return e}function Ob(e,t,n,o,r,s,l,u){return{hasIndicator:Ab(e,t,n,r,s),hasTitle:l,hasDescription:u,hasAction:r?hb(s):o!=null,hasClose:!1}}function Pb({variant:e,status:t,size:n,role:o,title:r,description:s,icon:l,action:u,children:d,ariaLabelledByProp:f,ariaDescribedByProp:m}){const p=Qs(e),C=Js(t),S=Ms(n),g=Ct(S),h=a.useId(),x=`${h}-title`,A=`${h}-description`,b=a.useMemo(()=>bb(d),[d]),_=a.useMemo(()=>r!=null||mb(d),[d,r]),L=a.useMemo(()=>s!=null||pb(d),[d,s]),v=a.useMemo(()=>Ob(p,C,l,u,b,d,_,L),[u,d,L,_,l,b,C,p]),R=yu(C,o),T=f??Nb(x,A,_,L),E=m??wb(A,_,L),I=a.useMemo(()=>({variant:p,status:C,size:S,sizePreset:g,titleId:x,descriptionId:A,gridSlots:v}),[A,v,S,g,C,x,p]);return{variant:p,status:C,size:S,sizePreset:g,isCompound:b,gridSlots:v,liveRole:R,ariaLabelledBy:T,ariaDescribedBy:E,contextValue:I}}const Nu=a.forwardRef(function({variant:t="default",status:n,size:o="base",role:r,title:s,description:l,icon:u,action:d,classNames:f,hoverLift:m=!0,className:p="",children:C,onPointerOver:S,onPointerOut:g,"aria-labelledby":h,"aria-describedby":x,...A},b){const{isCompound:_,gridSlots:L,sizePreset:v,liveRole:R,ariaLabelledBy:T,ariaDescribedBy:E,contextValue:I}=Pb({variant:t,status:n,size:o,role:r,title:s,description:l,icon:u,action:d,children:C,ariaLabelledByProp:h,ariaDescribedByProp:x}),{setRootRef:O,surfaceClass:N,pointerHandlers:y}=yb({variant:I.variant,status:I.status,hoverLift:m,ref:b,onPointerOver:S,onPointerOut:g});return c.jsx(jn.Provider,{value:I,children:c.jsx(fb,{classNames:f,children:c.jsx("div",{ref:O,role:R,"aria-labelledby":T,"aria-describedby":E,className:i.cn(gn(L,v.gridGap),lh(o),N,f==null?void 0:f.root,p),...y,...A,children:_?C:c.jsx(Ib,{gridSlots:L,title:s,description:l,icon:u,action:d,children:C})})})})});Nu.displayName="AlertRoot";const Db=Object.assign(Nu,{Indicator:na,Message:Iu,Content:Ru,Title:oa,Description:ra,Action:sa}),wu=a.createContext(null),Gr=a.createContext({});function kb(){const e=a.useContext(wu);if(!e)throw new Error("Accordion components must be inside <Accordion>.");return e}function Ou({classNames:e,children:t}){const n=a.useContext(Gr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Gr.Provider,{value:o,children:t})}function aa(){return a.useContext(Gr)}function Bb(){return"h3"}function Pu(){return{"aria-hidden":!0}}function jb(e){const t=a.useRef(null);return qt(e,t,()=>i.isMotionFeatureEnabled("enableExpandable"))}function Mb(e,t){return e??(t!=null?String(t):null)}function Fb(e){return{root:e.item,glossContent:e.glossContent,trigger:e.trigger,triggerLift:e.triggerLift,message:e.message,icon:e.icon,content:e.content,title:e.title,description:e.description,chevron:e.chevron,panelShell:e.panelShell,panel:e.panel}}function Hb({className:e,slotClass:t}){return i.cn("flex w-full flex-col text-left","[&>[data-accordion-item]:first-child]:!rounded-t-mid","[&>[data-accordion-item]:last-child]:!rounded-b-mid","[&>[data-accordion-item]:not(:first-child)]:-mt-px",t,e)}function Gb(e){return i.cn("relative !rounded-none",e)}function Vb({className:e,slotClass:t}){return i.cn("m-0 font-[inherit] text-[inherit]",t,e)}function zb({className:e,slotClass:t}){return i.cn("relative z-[1] flex shrink-0 origin-center self-center",t,e)}function Ub(e){return i.cn("text-muted",e)}const Wb="shrink-0";function Yb({className:e=""}){return c.jsx("svg",{className:i.cn(Wb,e),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...Pu(),children:c.jsx("path",{d:"m6 9 6 6 6-6"})})}const Du=a.forwardRef(function({value:t,disabled:n,classNames:o,className:r,children:s,...l},u){const{value:d,setValue:f,getItemId:m,size:p}=kb(),C=aa(),S=a.useMemo(()=>({...C,...o}),[C,o]),g=m(t),h=d===g;return c.jsx(Ou,{classNames:o,children:c.jsx(ht,{ref:u,compound:!0,size:p,"data-accordion-item":!0,disabled:n,open:h,onOpenChange:x=>f(x?g:null),className:Gb(r),classNames:Fb(S),...l,children:s})})});Du.displayName="Accordion.Item";function ku({className:e,children:t,...n}){const o=aa(),r=Bb();return c.jsx(r,{className:Vb({className:e,slotClass:o.heading}),...n,children:t})}ku.displayName="Accordion.Heading";const Bu=a.forwardRef(function({hideChevron:t=!0,className:n,...o},r){return c.jsx(ht.Trigger,{ref:r,hideChevron:t,className:n,...o})});Bu.displayName="Accordion.Trigger";function ju(e){return c.jsx(ht.Message,{...e})}ju.displayName="Accordion.Message";function Mu(e){return c.jsx(ht.Icon,{...e})}Mu.displayName="Accordion.Icon";function Fu(e){return c.jsx(ht.Content,{...e})}Fu.displayName="Accordion.Content";function Hu(e){return c.jsx(ht.Title,{...e})}Hu.displayName="Accordion.Title";function Gu(e){return c.jsx(ht.Description,{...e})}Gu.displayName="Accordion.Description";function Vu({className:e,children:t,...n}){const{open:o,hasPanel:r}=Kt(),s=aa(),l=jb(o),u=Yo();return r?c.jsx("span",{ref:l,className:i.cn(u&&Bn(u),zb({className:e,slotClass:s.chevron})),...Pu(),...n,children:t??c.jsx(Yb,{})}):null}Vu.displayName="Accordion.Chevron";const zu=a.forwardRef(function(t,n){return c.jsx(ht.Panel,{ref:n,...t})});zu.displayName="Accordion.Panel";function Uu({className:e,...t}){return c.jsx(q,{as:"div",variant:"base",className:Ub(e),...t})}Uu.displayName="Accordion.Body";function $b({defaultValue:e=null,defaultOpenIndex:t=null,value:n,onValueChange:o,size:r="base"}){const s=n!==void 0,l=Mb(e,t),[u,d]=a.useState(l),f=s?n:u,m=a.useRef(0);m.current=0;const p=a.useCallback(g=>{if(g!=null)return g;const h=String(m.current);return m.current+=1,h},[]),C=a.useCallback(g=>{s||d(g),o==null||o(g)},[s,o]);return{contextValue:a.useMemo(()=>({value:f,setValue:C,getItemId:p,size:r}),[p,f,C,r])}}const Wu=a.forwardRef(function({defaultValue:t=null,defaultOpenIndex:n=null,value:o,onValueChange:r,size:s="base",className:l,classNames:u,children:d,...f},m){const{contextValue:p}=$b({defaultValue:t,defaultOpenIndex:n,value:o,onValueChange:r,size:s});return c.jsx(wu.Provider,{value:p,children:c.jsx(Ou,{classNames:u,children:c.jsx("div",{ref:m,className:Hb({className:l,slotClass:u==null?void 0:u.root}),...f,children:d})})})});Wu.displayName="Accordion";const Xb=Object.assign(Wu,{Item:Du,Heading:ku,Trigger:Bu,Message:ju,Icon:Mu,Content:Fu,Title:Hu,Description:Gu,Chevron:Vu,Panel:zu,Body:Uu});function Yu(e){return e?!0:void 0}function Kb({descriptionId:e,errorSummaryId:t,hasErrors:n}){const o=[e,n?t:void 0].filter(Boolean);return o.length>0?o.join(" "):void 0}function qb(e){return e<=0?"":e===1?"Fix the error in the form":`Fix ${e} errors in the form`}function Zb(){return"Form submitted successfully"}function $i(e,t){const n=Object.keys(t)[0];if(n==null)return;const o=e.get(n);o==null||o.focus()}function Nr(e){return Object.keys(e).length}function Qb(e){return Object.entries(e)}function Jb(e,t,n){if(!t.includes("."))return{...e,[t]:n};const o=t.split("."),r={...e};let s=r;for(let l=0;l<o.length-1;l+=1){const u=o[l],d=s[u],f=d!=null&&typeof d=="object"&&!Array.isArray(d)?{...d}:{};s[u]=f,s=f}return s[o[o.length-1]]=n,r}function eA(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:!1}function wr(e,t,n){if(n!=null){if(n.required){const o=typeof n.required=="string"?n.required:"Required field";if(typeof e=="boolean"){if(!e)return o}else if(eA(e))return o}if(typeof e=="string"){if(n.minLength&&e.length<n.minLength.value)return n.minLength.message;if(n.maxLength&&e.length>n.maxLength.value)return n.maxLength.message;if(n.pattern&&!n.pattern.value.test(e))return n.pattern.message}if(n.validate)return n.validate(e,t)}}function $u(...e){const t={};for(const n of e)n!=null&&Object.assign(t,n);return Object.keys(t).length>0?t:void 0}function tA(e,t){if(e==null||typeof e!="object"||!("target"in e))return e;const n=e.target;if(n instanceof HTMLInputElement)return t==="checkbox"?n.checked:t==="number"?n.value===""?void 0:Number(n.value):n.value}function nA(e,t){return i.cn("flex w-full max-w-full flex-col gap-large text-left",t==null?void 0:t.root,e)}function oA(e,t){return i.cn("flex flex-col gap-base",t==null?void 0:t.section,e)}function rA(e,t){return i.cn("text-base font-w-mid text-foreground",t==null?void 0:t.title,e)}function sA(e,t){return i.cn("text-base text-muted",t==null?void 0:t.description,e)}function aA(e,t){return i.cn("flex flex-wrap items-center justify-end gap-small pt-small",t==null?void 0:t.actions,e)}function lA(e,t){return i.cn("sr-only",t==null?void 0:t.errorSummary,e)}function iA(e,t){return i.cn("sr-only",t==null?void 0:t.announce,e)}function cA(e,t){return i.cn(e,t==null?void 0:t.field)}const Xu=a.forwardRef(function({className:t="",classNames:n,...o},r){const s=Xt();return c.jsx("div",{ref:r,className:oA(t,{...s,section:n==null?void 0:n.section}),...o})});Xu.displayName="Form.Section";const Ku=a.forwardRef(function({className:t="",id:n,...o},r){const s=Xt(),l=Wo();return c.jsx(q,{ref:r,as:"h2",variant:"mid",id:n??(l==null?void 0:l.titleId),className:rA(t,s),...o})});Ku.displayName="Form.Title";const qu=a.forwardRef(function({className:t="",id:n,...o},r){const s=Xt(),l=Wo();return c.jsx("p",{ref:r,id:n??(l==null?void 0:l.descriptionId),className:sA(t,s),...o})});qu.displayName="Form.Description";const Zu=a.forwardRef(function({className:t="",...n},o){const r=Xt();return c.jsx("div",{ref:o,className:aA(t,r),...n})});Zu.displayName="Form.Actions";const la=a.forwardRef(function({className:t="",id:n,children:o,...r},s){const l=Xt(),u=Wo(),d=tt(),f=(d==null?void 0:d.getErrors())??{},m=Qb(f);if(m.length===0)return null;const p=typeof o=="function"?o(m):o??m.map(([,C])=>C).join(". ");return c.jsx("div",{ref:s,id:n??(u==null?void 0:u.errorSummaryId),role:"alert",className:lA(t,l),...r,children:p})});la.displayName="Form.ErrorSummary";const ia=a.forwardRef(function({className:t="",id:n,message:o,...r},s){const l=Xt(),u=Wo();return o?c.jsx("div",{ref:s,id:n??(u==null?void 0:u.announceId),role:"status","aria-live":"polite","aria-atomic":"true",className:iA(t,l),...r,children:o}):null});ia.displayName="Form.Announce";const Qu=a.forwardRef(function({name:t,rules:n,className:o="",classNames:r,children:s,...l},u){const d=Xt(),f=tt();return a.useEffect(()=>{if(!(!f||!n))return f.registerFieldRules(t,n),()=>f.unregisterFieldRules(t)},[f,t,n]),c.jsx("div",{ref:u,className:cA(o,{...d,field:r==null?void 0:r.field}),...l,children:s})});Qu.displayName="Form.Field";function uA({defaultValues:e,values:t,onValuesChange:n,rules:o,resolver:r,validateMode:s="onSubmit",disabled:l=!1,readOnly:u=!1,size:d,onSubmit:f,onSubmitError:m}){const p=a.useId(),C=a.useId(),S=a.useId(),g=a.useId(),h={titleId:p,descriptionId:C,errorSummaryId:S,announceId:g},x=t!==void 0,[A,b]=a.useState(e??{}),_=x?t:A,[L,v]=a.useState({}),[R,T]=a.useState({}),[E,I]=a.useState(0),[O,N]=a.useState(!1),[y,w]=a.useState(null),P=a.useRef(new Map),k=a.useRef(o??{});k.current=o??{};const j=a.useCallback(z=>{x||b(z),n==null||n(z)},[x,n]),B=a.useCallback(z=>z.split(".").reduce((te,me)=>{if(!(te==null||typeof te!="object"))return te[me]},_),[_]),D=a.useCallback((z,Q,te)=>{const me=Jb(_,z,Q);if(j(me),te!=null&&te.shouldValidate){const Ae=wr(Q,me,k.current[z]);v(he=>{const X={...he};return Ae?X[z]=Ae:delete X[z],X})}},[j,_]),F=a.useCallback(z=>L[z],[L]),H=a.useCallback(()=>L,[L]),U=a.useCallback(z=>k.current[z],[]),G=a.useCallback((z,Q)=>{T(te=>({...te,[z]:Q}))},[]),K=a.useCallback(z=>!!R[z],[R]),V=a.useCallback((z,Q)=>{Q?P.current.set(z,Q):P.current.delete(z)},[]),oe=a.useCallback((z,Q)=>{Q!=null&&(k.current={...k.current,[z]:Q})},[]),J=a.useCallback(z=>{const Q={...k.current};delete Q[z],k.current=Q},[]),ee=a.useCallback(z=>{const Q=wr(B(z),_,k.current[z]);return v(te=>{const me={...te};return Q?me[z]=Q:delete me[z],me}),Q},[B,_]),se=a.useCallback(()=>{const z={};for(const Q of Object.keys(k.current)){const te=wr(B(Q),_,k.current[Q]);te&&(z[Q]=te)}return v(z),z},[B,_]),M=a.useCallback(()=>{$i(P.current,L)},[L]),W=a.useCallback(()=>w(null),[]),Y=a.useMemo(()=>({disabled:l,readOnly:u,size:d,validateMode:s,isSubmitting:O,submitCount:E,getValue:B,setValue:D,getError:F,getErrors:H,getFieldRules:U,setTouched:G,isTouched:K,registerRef:V,registerFieldRules:oe,unregisterFieldRules:J,validateField:ee,validateForm:se,focusFirstInvalid:M,announce:y,clearAnnounce:W}),[y,W,l,M,F,H,U,B,O,K,u,V,oe,J,G,D,d,E,ee,se,s]),Z=a.useCallback(async z=>{z.preventDefault(),I(te=>te+1),w(null);let Q=se();if(r){const te=await r(_);te.errors&&(Q={...Q,...te.errors},v(Q))}if(Nr(Q)>0){w(qb(Nr(Q))),$i(P.current,Q),m==null||m(Q);return}if(f)try{N(!0),await f(_),w(Zb())}finally{N(!1)}},[f,m,r,se,_]),ce=Nr(L)>0;return{shellIds:h,bindingValue:Y,handleSubmit:Z,errors:L,hasErrors:ce,isSubmitting:O,announce:y}}const Ju=a.forwardRef(function({children:t,className:n="",classNames:o,defaultValues:r,values:s,onValuesChange:l,rules:u,resolver:d,validateMode:f,readOnly:m,size:p,disabled:C,onSubmit:S,onSubmitError:g,errorSummary:h,...x},A){const{shellIds:b,bindingValue:_,handleSubmit:L,hasErrors:v,announce:R}=uA({defaultValues:r,values:s,onValuesChange:l,rules:u,resolver:d,validateMode:f,readOnly:m,size:p,disabled:C,onSubmit:S,onSubmitError:g,classNames:o});return c.jsx(Wh,{classNames:o,children:c.jsx(su.Provider,{value:_,children:c.jsx(Yh,{shellIds:b,children:c.jsxs("form",{ref:A,noValidate:!0,onSubmit:L,"aria-labelledby":b.titleId,"aria-describedby":Kb({descriptionId:b.descriptionId,errorSummaryId:b.errorSummaryId,hasErrors:v}),className:nA(n,o),...x,children:[c.jsx(ia,{message:R}),c.jsx(la,{children:h}),t]})})})})});Ju.displayName="Form";function ca({name:e,value:t,onChange:n,onBlur:o,disabled:r,readOnly:s,type:l,rules:u}){const d=tt(),f=t!==void 0,m=d!=null&&e!=null&&!f,p=a.useRef(null),C=a.useCallback(L=>{p.current=L,m&&e&&d.registerRef(e,L)},[m,d,e]),S=r??(d==null?void 0:d.disabled)??!1,g=s??(d==null?void 0:d.readOnly)??!1,h=m&&e?d.getError(e):void 0,x=a.useMemo(()=>$u(e?d==null?void 0:d.getFieldRules(e):void 0,u),[d,e,u]),A=m&&e?d.getValue(e):t,b=a.useCallback(L=>{if(n==null||n(L),!m||!e||!d)return;const v=tA(L,l);d.setValue(e,v,{shouldValidate:d.validateMode==="onChange"})},[m,d,e,n,l]),_=a.useCallback(L=>{o==null||o(L),!(!m||!e||!d)&&(d.setTouched(e,!0),d.validateMode==="onBlur"&&d.validateField(e))},[m,d,e,o]);return{bound:m,name:e,value:m&&l==="checkbox"?!!A:m?A??"":A,checked:m&&l==="checkbox"?!!A:void 0,onChange:b,onBlur:_,disabled:S||(d==null?void 0:d.isSubmitting),readOnly:g,ref:C,"aria-invalid":Yu(h),error:h,rules:x}}function dA(e,t){return ca({name:e,rules:t})}function ed({name:e,value:t,onChange:n,disabled:o,readOnly:r,rules:s}){const l=tt(),u=t!==void 0,d=l!=null&&e!=null&&!u,f=a.useRef(null),m=a.useCallback(_=>{f.current=_,d&&e&&l.registerRef(e,_)},[d,l,e]),p=o??(l==null?void 0:l.disabled)??!1,C=r??(l==null?void 0:l.readOnly)??!1,S=d&&e?l.getError(e):void 0,g=a.useMemo(()=>$u(e?l==null?void 0:l.getFieldRules(e):void 0,s),[l,e,s]),h=d&&e?l.getValue(e):t,x=d?h??"":h,A=a.useCallback(_=>{n==null||n(_),!(!d||!e||!l)&&l.setValue(e,_,{shouldValidate:l.validateMode==="onChange"})},[d,l,e,n]),b=a.useCallback(()=>{!d||!e||!l||(l.setTouched(e,!0),l.validateMode==="onBlur"&&l.validateField(e))},[d,l,e]);return{bound:d,name:e,value:x,setValue:A,onBlur:b,disabled:p||(l==null?void 0:l.isSubmitting),readOnly:C,ref:m,"aria-invalid":Yu(S),error:S,rules:g}}const fA=Object.assign(Ju,{Section:Xu,Title:Ku,Description:qu,Actions:Zu,ErrorSummary:la,Announce:ia,Field:Qu}),Ge=a.createContext(null),Vr=a.createContext({});function mA({classNames:e,children:t}){const n=a.useContext(Vr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Vr.Provider,{value:o,children:t})}function ua(){return a.useContext(Ge)}function td(){return a.useContext(Vr)}const pA="inline-flex flex-wrap items-baseline gap-x-xsmall gap-y-0",CA="font-w-mid",gA="text-danger";function SA({className:e,slotClass:t}){return i.cn(pA,t,e)}function hA(e){return i.cn(CA,e)}function xA(e){return i.cn(gA,e)}const bA=!0;function nd(e){return null}nd.displayName="Label";function Xi({children:e,required:t}){const n=td();return c.jsxs(c.Fragment,{children:[c.jsx(q,{as:"span",variant:"base",className:hA(n.text),children:e}),t?c.jsx("span",{className:xA(n.required),"aria-hidden":bA,children:"*"}):null]})}function AA({required:e,htmlFor:t,id:n}){const o=ua();return{htmlFor:t??(o==null?void 0:o.controlId),id:n??(o==null?void 0:o.labelId),required:e??(o==null?void 0:o.required)??!1}}function vA({children:e,className:t,required:n,htmlFor:o,id:r,...s}){const{htmlFor:l,id:u,required:d}=AA({required:n,htmlFor:o,id:r}),f=td(),m=SA({className:t,slotClass:f.root});if(l!=null)return c.jsx("label",{id:u,htmlFor:l,className:m,...s,children:c.jsx(Xi,{required:d,children:e})});const p=s;return c.jsx("span",{id:u,className:m,...p,children:c.jsx(Xi,{required:d,children:e})})}function _A({classNames:e,...t}){return c.jsx(mA,{classNames:e,children:c.jsx(vA,{...t})})}const ve=Object.assign(_A,{Slot:nd}),LA=new Set(["FieldLegend","OptionGroupLegend","RadioGroup.Legend","CheckboxGroup.Legend"]);function je(...e){const t=e.filter(Boolean).join(" ");return t.length>0?t:void 0}function Ve(e){return`${e}-hint`}function ze(e){return`${e}-error`}const zr=a.createContext({}),Ur=a.createContext({}),od=a.createContext("base");function TA({classNames:e,children:t}){const n=a.useContext(zr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(zr.Provider,{value:o,children:t})}function da(){return a.useContext(zr)}function EA({classNames:e,children:t}){const n=a.useContext(Ur),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ur.Provider,{value:o,children:t})}function xn(){return a.useContext(Ur)}function RA({size:e,children:t}){return c.jsx(od.Provider,{value:e,children:t})}function fa(){return a.useContext(od)}const IA="flex w-full flex-col gap-xsmall",yA={default:"text-muted",danger:"text-danger",success:"text-success",info:"text-info",warning:"text-warning"},NA="m-0 min-w-0 border-0 p-0 disabled:pointer-events-none disabled:opacity-55",wA="flex min-w-0 w-full flex-col",OA="m-0 block w-full max-w-full border-0 p-0",PA="flex flex-col w-fit",DA="flex min-w-0 w-full flex-col",kA="flex flex-wrap w-fit items-center",ma={small:{legendGap:"mt-large",stackGap:"gap-large",groupGap:"gap-base",actionsGap:"gap-base"},base:{legendGap:"mt-xlarge",stackGap:"gap-xlarge",groupGap:"gap-mid",actionsGap:"gap-mid"},mid:{legendGap:"mt-2xlarge",stackGap:"gap-2xlarge",groupGap:"gap-large",actionsGap:"gap-large"},large:{legendGap:"mt-2xlarge",stackGap:"gap-2xlarge",groupGap:"gap-xlarge",actionsGap:"gap-xlarge"}};function BA({status:e,className:t,slotClass:n}){return i.cn(yA[e],n,t)}function jA({size:e,hasLegend:t,slotClass:n}){const o=ma[e];return i.cn(wA,o.stackGap,t&&o.legendGap,n)}function MA({size:e,className:t,slotClass:n}){return i.cn(DA,ma[e].groupGap,n,t)}function FA({size:e,className:t,slotClass:n}){return i.cn(kA,ma[e].actionsGap,n,t)}function HA({className:e,children:t,...n}){const o=da();return c.jsx("div",{className:i.cn(IA,o.root,e),...n,children:t})}function GA({classNames:e,...t}){return c.jsx(TA,{classNames:e,children:c.jsx(HA,{...t})})}const pa=a.forwardRef(function({children:t,className:n,status:o="default",as:r="p",variant:s="small",...l},u){const d=da();return c.jsx(q,{ref:u,as:r,variant:s,inheritColor:r==="span",className:BA({status:o,className:n,slotClass:d.hint}),...l,children:t})});pa.displayName="FieldHint";const VA=ve;function zA({role:e="alert",className:t,...n}){const o=da();return c.jsx(pa,{status:"danger",role:e,className:i.cn(o.error,t),...n})}const Ca=a.forwardRef(function({className:t,children:n,...o},r){const s=xn();return c.jsx("legend",{ref:r,className:i.cn(OA,s.legend,t),...o,children:n})});Ca.displayName="FieldLegend";function rd({children:e,className:t,...n}){const o=xn();return c.jsx("span",{className:i.cn(PA,o.legendHeader,t),...n,children:e})}const qo=a.forwardRef(function({className:t,children:n,...o},r){const s=fa(),l=xn();return c.jsx("div",{ref:r,className:MA({size:s,className:t,slotClass:l.group}),...o,children:n})});qo.displayName="FieldSetGroup";const ga=a.forwardRef(function({className:t,children:n,...o},r){const s=fa(),l=xn();return c.jsx("div",{ref:r,className:FA({size:s,className:t,slotClass:l.actions}),...o,children:n})});ga.displayName="FieldSetActions";function UA({legend:e,loose:t,groups:n,actions:o}){const r=fa(),s=xn(),l=[];return n.length>0?l.push(...t,...n):t.length>0&&l.push(c.jsx(qo,{children:t},"field-set-group")),o!=null&&l.push(o),l.length===0?null:c.jsx("div",{className:jA({size:r,hasLegend:e!=null,slotClass:s.stack}),children:l})}const sd=a.forwardRef(function({className:t,hintId:n,errorId:o,disabled:r,state:s,...l},u){const d=xn();return c.jsxs("fieldset",{ref:u,disabled:r,"aria-describedby":je(n,o),className:i.cn(NA,d.root,t),...l,children:[s.legend,c.jsx(UA,{...s})]})});sd.displayName="FieldSetRootInner";function WA(e){return e.displayName}function Sa(e){if(a.isValidElement(e))return WA(e.type)}function YA(e){if(!a.isValidElement(e))return!1;if(e.type==="legend")return!0;const t=Sa(e);return t!=null&&LA.has(t)}function $A(e){return Sa(e)==="FieldSetGroup"}function XA(e){return Sa(e)==="FieldSetActions"}function KA(e){const t=a.Children.toArray(e),n=t.findIndex(YA);return n===-1?{legend:null,body:t}:{legend:t[n],body:[...t.slice(0,n),...t.slice(n+1)]}}function qA(e){const t=[],n=[];let o=null;for(const r of e)XA(r)?o=r:$A(r)?n.push(r):t.push(r);return{loose:t,groups:n,actions:o}}function ZA(e){return a.useMemo(()=>{const{legend:t,body:n}=KA(e),{loose:o,groups:r,actions:s}=qA(n);return{legend:t,loose:o,groups:r,actions:s}},[e])}const ad=a.forwardRef(function({children:t,className:n,classNames:o,hintId:r,errorId:s,disabled:l,size:u="base",...d},f){const m=ZA(t);return c.jsx(RA,{size:u,children:c.jsx(EA,{classNames:o,children:c.jsx(sd,{ref:f,className:n,hintId:r,errorId:s,disabled:l,state:m,...d})})})});ad.displayName="FieldSet";function ha(e){const t=a.useId();return e??`${t}-hint`}function xa(e){const t=a.useId();return e??`${t}-error`}const QA=Object.assign(ad,{Legend:Ca,LegendHeader:rd,Group:qo,Actions:ga}),le=Object.assign(GA,{Hint:pa,Label:VA,Error:zA,Set:QA,Legend:Ca,LegendHeader:rd,Group:qo,Actions:ga}),ba={vertical:"flex flex-col gap-mid",horizontal:"flex flex-row flex-wrap items-start gap-x-large gap-y-mid"},ld=a.forwardRef(function({size:t="small",...n},o){return c.jsx(le.Set,{ref:o,size:t,...n})}),id=a.forwardRef(function({children:t,...n},o){return c.jsx(le.Legend,{ref:o,...n,children:t})});id.displayName="OptionGroupLegend";const cd=le.Set.Group,ud=le.Set.Actions;function JA({children:e,className:t,id:n,...o}){return c.jsx(le.Hint,{as:"span",variant:"small",id:n,className:t,...o,children:e})}function ev({children:e,className:t,...n}){return c.jsx(le.LegendHeader,{className:t,...n,children:e})}a.forwardRef(function({className:t,orientation:n="vertical",children:o,...r},s){return c.jsx("div",{ref:s,className:i.cn("text-left",ba[n],t),...r,children:o})});function dd(e){function t({children:n,...o}){return c.jsx(id,{...o,children:c.jsx(ev,{children:n})})}return t.displayName=e,t}function fd(e,t,n){function o({id:r,className:s,...l}){const u=e(),d=t();return c.jsx(JA,{id:r??u,className:i.cn(d,s),...l})}return o.displayName=n,o}function md(e,t,n){function o({id:r,className:s,...l}){const u=e(),d=t();return c.jsx(le.Error,{id:r??u,className:i.cn(d,s),...l})}return o.displayName=n,o}function pd(){const e=a.createContext({});function t({classNames:o,children:r}){const s=a.useContext(e),l=a.useMemo(()=>({...s,...o}),[o,s]);return c.jsx(e.Provider,{value:l,children:r})}function n(){return a.useContext(e)}return{Context:e,Provider:t,useClassNames:n}}const Aa=a.createContext(null),{Provider:tv,useClassNames:Zo}=pd();function nv({value:e,children:t}){return c.jsx(Aa.Provider,{value:e,children:t})}function Cd(){const e=a.useContext(Aa);if(!e)throw new Error("CheckboxGroup components must be inside <CheckboxGroup>.");return e}function ov(){return a.useContext(Aa)}function rv(e="vertical",t){return i.cn("text-left",ba[e],t)}const sv=dd("CheckboxGroup.Legend"),av=fd(()=>Cd().hintId,()=>Zo().hint,"CheckboxGroup.Hint"),lv=md(()=>Cd().errorId,()=>Zo().error,"CheckboxGroup.Error"),gd=a.forwardRef(function({className:t,orientation:n="vertical",...o},r){const s=Zo().list;return c.jsx("div",{ref:r,className:rv(n,i.cn(s,t)),...o})});gd.displayName="CheckboxGroup.List";function Sd(e){const t=a.useRef(!1);return a.useEffect(()=>{t.current=!1},e),{claimRequiredAnchor:a.useCallback(()=>t.current?!1:(t.current=!0,!0),[])}}function hd({value:e,defaultValue:t,onValueChange:n,allowClear:o=!0}){const r=e!==void 0,[s,l]=a.useState(t),u=r?e==null?void 0:String(e):s,d=a.useCallback(f=>{!o&&f===void 0||(r||l(f),n==null||n(f))},[o,r,n]);return{selectedValue:u,selectValue:d}}function iv({required:e=!1,selection:t="multiple",value:n,defaultValue:o,onValueChange:r,disabled:s=!1,hintId:l,errorId:u}){const d=ha(l),f=xa(u),{selectedValue:m,selectValue:p}=hd({value:n,defaultValue:o,onValueChange:r,allowClear:!0}),C=t==="single"?m:void 0,S=a.useCallback((b,_)=>{t==="single"&&p(_?b:void 0)},[p,t]),{claimRequiredAnchor:g}=Sd([e,t]),h=a.useCallback(()=>t!=="single"||!e?!1:g(),[g,e,t]),x=a.useMemo(()=>({selection:t,disabled:s,required:e,hintId:d,errorId:f,selectedValue:C,selectSingleValue:S,claimRequiredAnchor:h}),[h,s,f,d,e,S,C,t]),A=a.useMemo(()=>({required:e}),[e]);return{contextValue:x,fieldLabelCtx:A,hintId:d,errorId:f,disabled:s}}const cv=a.forwardRef(function(t,n){const o=Zo();return c.jsx(ld,{ref:n,classNames:o,...t})}),xd=a.forwardRef(function(t,n){const{children:o,className:r,classNames:s,size:l,disabled:u=!1,required:d,selection:f,value:m,defaultValue:p,onValueChange:C,hintId:S,errorId:g,...h}=t,{contextValue:x,fieldLabelCtx:A,hintId:b,errorId:_}=iv(t),L=c.jsx(cv,{ref:n,disabled:u,hintId:b,errorId:_,size:l,className:r,...h,children:o});return c.jsx(nv,{value:x,children:c.jsx(tv,{classNames:s,children:c.jsx(Ge.Provider,{value:A,children:L})})})});xd.displayName="CheckboxGroup";const uv=Object.assign(xd,{Legend:sv,Label:ve,Hint:av,Error:lv,List:gd,Group:cd,Actions:ud});function dv(e,t){return e??`radio-group-${t}`}const va=a.createContext(null),{Provider:fv,useClassNames:Qo}=pd();function mv({value:e,children:t}){return c.jsx(va.Provider,{value:e,children:t})}function bd(){const e=a.useContext(va);if(!e)throw new Error("RadioGroup components must be inside <RadioGroup>.");return e}function pv(){return a.useContext(va)}function Cv(e="vertical",t){return i.cn("text-left",ba[e],t)}const gv=dd("RadioGroup.Legend"),Sv=fd(()=>bd().hintId,()=>Qo().hint,"RadioGroup.Hint"),hv=md(()=>bd().errorId,()=>Qo().error,"RadioGroup.Error"),Ad=a.forwardRef(function({className:t,orientation:n="vertical",...o},r){const s=Qo().list;return c.jsx("div",{ref:r,className:Cv(n,i.cn(s,t)),...o})});Ad.displayName="RadioGroup.List";function xv({required:e=!1,value:t,defaultValue:n,onValueChange:o,disabled:r=!1,name:s,hintId:l,errorId:u}){const d=a.useId(),f=dv(s,d),m=ha(l),p=xa(u),{selectedValue:C,selectValue:S}=hd({value:t,defaultValue:n,onValueChange:o,allowClear:!e}),{claimRequiredAnchor:g}=Sd([e,f]),h=a.useCallback(()=>e?g():!1,[g,e]),x=a.useMemo(()=>({name:f,disabled:r,required:e,hintId:m,errorId:p,selectedValue:C,selectValue:S,claimRequiredAnchor:h}),[h,r,p,f,m,e,S,C]),A=a.useMemo(()=>({required:e}),[e]);return{contextValue:x,fieldLabelCtx:A,hintId:m,errorId:p,disabled:r}}const bv=a.forwardRef(function(t,n){const o=Qo();return c.jsx(ld,{ref:n,classNames:o,...t})}),vd=a.forwardRef(function(t,n){const{children:o,className:r,classNames:s,size:l,disabled:u=!1,name:d,required:f,value:m,defaultValue:p,onValueChange:C,hintId:S,errorId:g,...h}=t,{contextValue:x,fieldLabelCtx:A,hintId:b,errorId:_}=xv(t),L=c.jsx(bv,{ref:n,disabled:u,hintId:b,errorId:_,size:l,className:r,...h,children:o});return c.jsx(mv,{value:x,children:c.jsx(fv,{classNames:s,children:c.jsx(Ge.Provider,{value:A,children:L})})})});vd.displayName="RadioGroup";const Av=Object.assign(vd,{Legend:gv,Label:ve,Hint:Sv,Error:hv,List:Ad,Group:cd,Actions:ud}),vv="group";function _v(){return{"aria-hidden":!0}}const _d=a.createContext(null),Ld=a.createContext(null),Wr=a.createContext({});function Lv({value:e,children:t}){return c.jsx(_d.Provider,{value:e,children:t})}function Fn(){const e=a.useContext(_d);if(!e)throw new Error("ComboBox.* must be inside <ComboBox>.");return e}function Tv({value:e,children:t}){return c.jsx(Ld.Provider,{value:e,children:t})}function Td(){const e=a.useContext(Ld);if(!e)throw new Error("ComboBox compound-parts must be inside <ComboBox>.");return e}function Ev({classNames:e,children:t}){const n=a.useContext(Wr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Wr.Provider,{value:o,children:t})}function wt(){return a.useContext(Wr)}const Rv="No matches";function _a(e,t){return`${e}-opt-${t}`}function Iv({ariaLabel:e,ariaLabelledBy:t}){return{"aria-label":e,"aria-labelledby":t}}function yv(e,t){return t?_a(e,t):void 0}function Jo(e){return Array.from(e.querySelectorAll('[role="option"]:not([disabled]):not([aria-disabled="true"])'))}function dn(e){return e.dataset.value??null}const Ed=a.createContext(null),Rd=a.createContext(null),Yr=a.createContext({}),Id=a.createContext(null);function Nv({value:e,children:t}){return c.jsx(Ed.Provider,{value:e,children:t})}function wv({value:e,children:t}){return c.jsx(Rd.Provider,{value:e,children:t})}function bn(e){const t=a.useContext(Ed);if(!t)throw new Error(`${e} must be inside <ListBox>.`);return t}function yd(){return a.useContext(Rd)}function Ov({classNames:e,children:t}){const n=a.useContext(Yr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Yr.Provider,{value:o,children:t})}function nt(){return a.useContext(Yr)}function Pv({value:e,children:t}){return c.jsx(Id.Provider,{value:e,children:t})}function Dv(){return a.useContext(Id)}function La(){return{"aria-hidden":!0}}const Nd=a.createContext(null);function kv({value:e,children:t}){return c.jsx(Nd.Provider,{value:e,children:t})}function wd(){const e=a.useContext(Nd);if(!e)throw new Error("SelectionIndicator.* parts must be inside <SelectionIndicator>.");return e}const Bv={xsmall:"selection-indicator-xsmall",small:"selection-indicator-small",base:"selection-indicator-base",mid:"selection-indicator-mid",large:"selection-indicator-large"},Ye={xsmall:"rounded-[var(--selection-indicator-radius-xsmall)]",small:"rounded-[var(--selection-indicator-radius-small)]",base:"rounded-[var(--selection-indicator-radius-base)]",mid:"rounded-[var(--selection-indicator-radius-mid)]",large:"rounded-[var(--selection-indicator-radius-large)]"},Ta={xsmall:"size-[length:calc(var(--icon-size-xsmall)*0.75)]",small:"size-[length:calc(var(--icon-size-small)*0.75)]",base:"size-[length:calc(var(--icon-size-base)*0.75)]",mid:"size-[length:calc(var(--icon-size-mid)*0.75)]",large:"size-[length:calc(var(--icon-size-large)*0.75)]"},jv="pointer-events-none relative z-[2] inline-flex items-center justify-center";function Mv(e){return i.cn("[&_svg]:size-full",Ta[e])}function Fv(e){return Ta[e]}const Hv={xsmall:"size-[calc(var(--selection-indicator-xsmall)*0.333333)] rounded-[var(--selection-indicator-radius-xsmall)]",small:"size-[calc(var(--selection-indicator-small)*0.333333)] rounded-[var(--selection-indicator-radius-small)]",base:"size-[calc(var(--selection-indicator-base)*0.333333)] rounded-[var(--selection-indicator-radius-base)]",mid:"size-[calc(var(--selection-indicator-mid)*0.333333)] rounded-[var(--selection-indicator-radius-mid)]",large:"size-[calc(var(--selection-indicator-large)*0.333333)] rounded-[var(--selection-indicator-radius-large)]"},Gv="shrink-0 bg-indicator-foreground",Vv="shrink-0 bg-foreground",$r="relative box-border inline-flex shrink-0 items-center justify-center overflow-hidden",Ea="pointer-events-none absolute -inset-[var(--border-width)] z-[0] flex origin-center items-center justify-center rounded-[inherit]",zv="bg-indicator text-indicator-foreground",Uv="bg-secondary text-secondary-foreground",Wv=i.cn(Ea,"z-[1] gloss-indicator-fill text-foreground");i.cn(Ea,"z-[1] bg-primary-tint");const Yv={xsmall:"--selection-indicator-xsmall",small:"--selection-indicator-small",base:"--selection-indicator-base",mid:"--selection-indicator-mid",large:"--selection-indicator-large"},$v={xsmall:.875,small:1,base:1.125,mid:1.25,large:1.5};function He(e,t=16){if(typeof document<"u"){const n=getComputedStyle(document.documentElement).getPropertyValue(Yv[e]).trim(),o=/^([\d.]+)rem$/i.exec(n);if(o)return Number.parseFloat(o[1])*t;const r=/^([\d.]+)px$/i.exec(n);if(r)return Number.parseFloat(r[1])}return $v[e]*t}function Xv(e){switch(e){case"gloss":case"outline":return Vv;case"secondary":return"shrink-0 bg-secondary-foreground";default:return Gv}}function Kv(e){return e!=="outline"}function qv(e){if(e==="gloss")return Wv;const t=e==="secondary"?Uv:zv;return i.cn(Ea,t)}function Zv(e){switch(e){case"gloss":case"outline":return"text-foreground";case"secondary":return"text-secondary-foreground";default:return"text-indicator-foreground"}}function Qv(e,t){return i.cn($r,Bv[e],Ye[e],t)}function Jv(e,t){switch(e){case"default":return"border border-primary bg-surface";case"secondary":return"border-token bg-secondary";case"outline":return"border border-primary bg-surface";case"gloss":return"gloss-indicator border-0 [--border-width:0px]"}}const Od="SelectionIndicatorFill",Pd="SelectionIndicatorMark";function Dd(e){return e.type.displayName===Od}function kd(e){return e.type.displayName===Pd}function e_({resolvedIcon:e,showCheck:t,showDot:n,size:o,variant:r}){if(e!=null)return e;if(t)return a.createElement(be.IoCheckmarkSharp,{"aria-hidden":!0,className:"size-full"});if(n)return a.createElement("span",{"aria-hidden":!0,className:i.cn(Hv[o],Xv(r))})}function t_(e){return a.Children.toArray(e).some(t=>a.isValidElement(t)&&(Dd(t)||kd(t)))}function n_(e){const t=a.Children.toArray(e);let n,o;const r=[];for(const s of t){if(a.isValidElement(s)&&Dd(s)){n=s;continue}if(a.isValidElement(s)&&kd(s)){o=s;continue}r.push(s)}return{fillSlot:n,markSlot:o,legacyIcon:r.length===0?void 0:r.length===1?r[0]:r}}function o_({root:e,fill:t,mark:n,classNames:o,className:r}){return{root:i.cn(e,o==null?void 0:o.root,r),fill:i.cn(t,o==null?void 0:o.fill),mark:i.cn(n,o==null?void 0:o.mark)}}const r_={transform:"scale(0)",opacity:0},s_={opacity:0},Ro=a.forwardRef(function({className:t,style:n,...o},r){const s=wd();return c.jsx("span",{ref:l=>{s.fillRef.current=l,ue(r,l)},...La(),className:i.cn(s.fillClassName,t),style:{...r_,...n},...o})});Ro.displayName=Od;const Io=a.forwardRef(function({className:t,children:n,style:o,...r},s){const l=wd(),u=n??l.markContent;return u==null?null:c.jsx("span",{ref:d=>{l.markRef.current=d,ue(s,d)},...La(),className:i.cn(l.markClassName,t),style:{...s_,...o},...r,children:u})});Io.displayName=Pd;function a_(e,t,n){const o=a.useRef(!0),r=i.usePrefersReducedMotion()||!i.isMotionFeatureEnabled("enableSelectionFill");a.useLayoutEffect(()=>{const s=t==null?void 0:t.current,l=n==null?void 0:n.current,u=m=>{s&&(s.style.transform=`scale(${m?1:0})`,s.style.opacity=m?"1":"0"),l&&(l.style.opacity=m?"1":"0",l.style.transform="scale(1)")};if(!s&&!l)return;if(r){s&&i.killMotion(s),l&&i.killMotion(l),u(e);return}if(o.current){o.current=!1,s&&i.killMotion(s),l&&i.killMotion(l),u(e);return}const d={...i.motionSelectionFill(),overwrite:"auto"},f={...i.motionSelectionFill(),overwrite:"auto"};s&&(i.killMotion(s),e?$.fromTo(s,{scale:0,autoAlpha:0},{scale:1,autoAlpha:1,...d}):$.to(s,{scale:0,autoAlpha:0,...d})),l&&(i.killMotion(l),e?$.fromTo(l,{scale:.88,autoAlpha:0},{scale:1,autoAlpha:1,...f}):$.to(l,{scale:.92,autoAlpha:0,...f}))},[e,t,n,r])}function l_({size:e="base",variant:t="default",selected:n,check:o=!1,dot:r=!1,icon:s,children:l,className:u,classNames:d}){const f=a.useRef(null),m=a.useRef(null),{fillSlot:p,markSlot:C,legacyIcon:S,usesCompound:g}=a.useMemo(()=>({...n_(l),usesCompound:t_(l)}),[l]),h=C!=null,x=s??(h?C.props.children:S),A=x!=null,b=o&&!A,L=e_({resolvedIcon:x,showCheck:b,showDot:r&&!A&&!b,size:e,variant:t}),v=h||L!=null,R=Kv(t);a_(n,R?f:void 0,v?m:void 0);const T=o_({root:Jv(t),fill:qv(t),mark:i.cn(jv,b&&Mv(e),A&&Fv(e),Zv(t)),classNames:d,className:u}),E=a.useMemo(()=>({fillRef:f,markRef:m,fillClassName:T.fill,markClassName:T.mark,markContent:L}),[T.fill,T.mark,L]);return{shellClassName:Qv(e,T.root),contextValue:E,usesCompound:g,fillSlot:p,markSlot:C,hasMark:v,markContent:L,showsFill:R}}function Bd({size:e="base",variant:t="default",selected:n,check:o=!1,dot:r=!1,icon:s,children:l,className:u,classNames:d,...f}){const{shellClassName:m,contextValue:p,usesCompound:C,fillSlot:S,markSlot:g,hasMark:h,markContent:x,showsFill:A}=l_({size:e,variant:t,selected:n,check:o,dot:r,icon:s,children:l,className:u,classNames:d}),b=C?c.jsxs(c.Fragment,{children:[A?S??c.jsx(Ro,{}):null,h?g??c.jsx(Io,{}):null]}):c.jsxs(c.Fragment,{children:[A?c.jsx(Ro,{}):null,h?c.jsx(Io,{children:x}):null]});return c.jsx(kv,{value:p,children:c.jsx("span",{className:m,...La(),...f,children:b})})}Bd.displayName="SelectionIndicator";const Be=Object.assign(Bd,{Fill:Ro,Mark:Io});function Ra(e,t,n="right",o){const r=n==="left"?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[auto_minmax(0,1fr)]",s=e>=2?"grid-rows-[auto_auto_auto]":e===1?"grid-rows-[auto_auto]":"grid-rows-[auto] items-center";return i.cn("grid",r,s,t,o)}function er(e="right"){return i.cn("row-start-1 self-center justify-self-start",e==="left"?"col-start-2":"col-start-1")}function tr(e="right"){return i.cn("row-start-1 inline-flex min-w-0 max-w-full items-center justify-self-start [width:fit-content]",e==="left"?"col-start-1":"col-start-2")}function nr(e,t="right"){return i.cn(e===2?"row-start-2":"row-start-3","min-w-0 max-w-full justify-self-start [width:fit-content]",t==="left"?"col-start-1":"col-start-2")}function Ia(e){return e?3:2}function jd(e,t,n,o){const r=n&&o?"grid-cols-[auto_minmax(0,1fr)_auto]":n?"grid-cols-[auto_minmax(0,1fr)]":o?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]",s=e?"grid-rows-[auto_auto] gap-y-xsmall":"grid-rows-[auto] items-center";return i.cn("grid w-full min-w-0 text-left",r,s,t)}function i_(){return er()}function c_(e){return e?tr():i.cn("row-start-1 col-start-1 inline-flex min-w-0 max-w-full items-center justify-self-start [width:fit-content]")}function u_(e){return e?nr(2):i.cn("row-start-2 col-start-1 min-w-0 max-w-full justify-self-start [width:fit-content]")}function d_(e){return i.cn("row-start-1 self-center shrink-0 justify-self-end",e?"col-start-3":"col-start-2")}const Md=a.createContext(null);function Xr({value:e,children:t}){return c.jsx(Md.Provider,{value:e,children:t})}function Hn(e){const t=a.useContext(Md);if(!t)throw new Error(`${e} must be used inside a list item (Dropdown.Item / ListBox.Item).`);return t}const f_="inline-flex min-w-0 items-center",m_="min-w-0",p_="origin-center",C_="font-w-mid",g_="text-muted",S_="text-muted",h_="opacity-80",x_="inline-flex items-center [&_svg]:icon-base",b_="relative inline-flex shrink-0 items-center justify-center";function Fd(e){return e?S_:h_}function A_(e){return i.cn(C_,e&&g_)}function Hd({className:e,children:t,textVariant:n="base",...o}){const r=Hn("ItemLabel");return c.jsx("span",{ref:s=>{r.enableLabelMotion&&r.labelMotionRef&&(r.labelMotionRef.current=s)},className:i.cn(f_,c_(r.showIndicatorSlot),r.hasHint&&m_,r.enableLabelMotion&&p_,e),...o,children:c.jsx(q,{as:"span",variant:n,inheritColor:!0,className:A_(!!r.disabled),children:t})})}function Gd({className:e,children:t,...n}){const o=Hn("ItemHint");return c.jsx(q,{as:"span",variant:"xsmall",inheritColor:!0,className:i.cn(u_(o.showIndicatorSlot),Fd(!!(o.mutedHint||o.disabled)),e),...n,children:t})}function Vd({className:e,children:t,...n}){const o=Hn("ItemIcon");return c.jsx("span",{className:i.cn(x_,d_(o.showIndicatorSlot),Fd(!!(o.mutedHint||o.disabled)),e),...n,children:t})}function zd({className:e,children:t,...n}){return c.jsx("span",{className:i.cn(b_,i_(),e),...n,children:t})}const v_=new Set(["ListBoxItemIndicator","DropdownItemIndicator"]),__=new Set(["ListBoxLabel","DropdownItemLabel","Dropdown.ItemLabel"]),L_=new Set(["ListBoxHint","DropdownItemHint","Dropdown.ItemHint"]),T_=new Set(["ListBoxIcon","DropdownItemIcon","Dropdown.ItemIcon"]);function E_(e){return e.displayName}function Ud(e){let t=null,n=null,o=null,r=null;const s=[];for(const l of a.Children.toArray(e)){if(!a.isValidElement(l)){s.push(l);continue}const u=E_(l.type);if(u&&v_.has(u)){t==null&&(t=l);continue}if(u&&__.has(u)){n==null&&(n=l);continue}if(u&&L_.has(u)){o==null&&(o=l);continue}if(u&&T_.has(u)){r==null&&(r=l);continue}s.push(l)}return{indicator:t,label:n,hint:o,icon:r,rest:s}}const R_={small:"xsmall",base:"small",mid:"base",large:"large"};function I_(e,t){return t??R_[e]}function y_({slotClassNames:e,classNames:t}){return{root:i.cn(e.itemIndicatorShell,t==null?void 0:t.root,t==null?void 0:t.itemIndicatorShell),fill:i.cn(e.itemIndicatorFill,t==null?void 0:t.fill,t==null?void 0:t.itemIndicatorFill),mark:i.cn(e.itemIndicatorMark,t==null?void 0:t.mark,t==null?void 0:t.itemIndicatorMark)}}function Ki(e){return e==null?[]:Array.isArray(e)?[...e]:[e]}function N_(e){return Ud(e)}function w_({children:e,label:t,hint:n,icon:o,showIndicator:r}){const s=N_(e),l=s.indicator!=null,u=s.hint!=null||n!=null,d=s.icon!=null||o!=null,f=s.label!=null||s.hint!=null||s.icon!=null,m=t!=null||s.label!=null;return{parts:s,hasCompoundIndicator:l,hasHint:u,hasIcon:d,isCompound:f,hasLabel:m,showIndicatorSlot:f?r&&l:r}}function qi({root:e,activeValue:t,delta:n}){const o=Jo(e);if(o.length===0)return t;const r=t?o.findIndex(l=>dn(l)===t):-1;let s;return r<0?s=n>0?0:o.length-1:s=(r+n+o.length)%o.length,dn(o[s])??t}function Wd(e){const t=Jo(e)[0];return t?dn(t):null}function O_(e){const t=Jo(e),n=t[t.length-1];return n?dn(n):null}function Zi(e){const t=e.querySelector('[role="option"][aria-selected="true"]:not([disabled]):not([aria-disabled="true"])');if(t){const n=dn(t);if(n)return n}return Wd(e)}function P_(e){const t=Jo(e),n=[],o=[];for(const r of t){const s=dn(r);s&&(n.push(s),o.push((r.textContent??"").trim().replace(/\s+/g," ")))}return{values:n,labels:o}}function xt({isDisabled:e,enabled:t,textMotionRef:n,hoverLift:o=!1,hoverLiftScale:r,onPointerEnter:s,onPointerLeave:l,onPointerDown:u}){const d=i.usePrefersReducedMotion(),f=a.useRef(!1),m=a.useCallback(()=>{if(r!=="adaptive")return typeof r=="number"?r:i.getMotionConfig().hoverLiftScale},[r]);a.useEffect(()=>{const g=n.current;return()=>{g&&i.killMotion(g)}},[]),a.useEffect(()=>{const g=n.current;!g||!e||(f.current=!1,i.killMotion(g),g.style.transform="")},[e,n]);const p=a.useCallback(g=>{if(s==null||s(g),!o||!t||e||g.defaultPrevented||i.shouldSkipInteractiveHoverLift())return;f.current=!0;const h=n.current;h&&i.animateInteractiveHoverLift(h,!0,m())},[t,o,e,s,m,n]),C=a.useCallback(g=>{if(l==null||l(g),!o||(f.current=!1,i.shouldSkipInteractiveHoverLift()))return;const h=n.current;h&&i.animateInteractiveHoverLift(h,!1,m())},[o,l,m,n]),S=a.useCallback(g=>{if(u==null||u(g),g.defaultPrevented||e||!t||d)return;const h=n.current;h&&(o?i.animateInteractivePressSqueeze(h,{pointerInside:f.current,liftScale:m()}):i.animateInteractivePressSqueeze(h))},[t,o,e,u,d,m,n]);return{handlePointerEnter:p,handlePointerLeave:C,handlePointerDown:S}}function D_(e){return i.useMergedGlossPanelRef(void 0,e)}function k_({listId:e,activeValue:t,rootRef:n}){a.useLayoutEffect(()=>{const o=n.current;if(!o)return;for(const s of o.querySelectorAll('[role="option"][data-active]'))s.removeAttribute("data-active");if(!t)return;const r=document.getElementById(_a(e,t));r&&o.contains(r)&&r.setAttribute("data-active","")},[t,e,n])}function B_({disabled:e,hasLabel:t,onPointerDown:n}){const o=a.useRef(null),r=!e&&t,{handlePointerDown:s}=xt({isDisabled:e,enabled:r,textMotionRef:o,onPointerDown:n});return{labelMotionRef:o,enableLabelMotion:r,handlePointerDown:s}}const j_="flex min-h-0 flex-col gap-xsmall text-left outline-none",M_="gloss-panel gloss-deep rounded-mid p-mid text-foreground",F_="flex min-w-0 flex-col gap-xsmall",H_="px-mid text-left",G_="text-muted",V_="my-xsmall h-0 w-full shrink-0 border-t-token",z_="px-large py-small text-center text-muted",U_="w-full min-w-0 rounded-mid text-left outline-none",W_={small:i.cn(i.CONTROL_SIZE_LAYOUT.small.padX,i.CONTROL_SIZE_LAYOUT.small.padY),base:i.cn(i.CONTROL_SIZE_LAYOUT.base.padX,i.CONTROL_SIZE_LAYOUT.base.padY),mid:i.cn(i.CONTROL_SIZE_LAYOUT.mid.padX,i.CONTROL_SIZE_LAYOUT.mid.padY),large:i.cn(i.CONTROL_SIZE_LAYOUT.large.padX,i.CONTROL_SIZE_LAYOUT.large.padY)},Y_="cursor-pointer text-foreground focus-ring",$_="cursor-not-allowed bg-transparent text-muted opacity-45",X_="data-active:bg-default-hover";function K_({isGloss:e,slotClass:t,className:n}){return i.cn(j_,e&&M_,t,n)}function q_({slotClass:e,className:t}){return i.cn(F_,e,t)}function Z_({slotClass:e,className:t}){return i.cn(H_,e,t)}function Q_({slotClass:e,className:t}){return i.cn(G_,e,t)}function J_({slotClass:e,className:t}){return i.cn(V_,e,t)}function eL({slotClass:e,className:t}){return i.cn(z_,e,t)}function tL({size:e,disabled:t,slotClass:n,className:o}){return i.cn(U_,W_[e],!t&&i.cn(Y_,i.SURFACE_COLOR_TRANSITION,X_),t&&$_,n,o)}function nL({children:e,label:t,hint:n,icon:o,value:r,disabled:s=!1}){const{listId:l,size:u,selected:d,showIndicator:f,indicatorMode:m,disabled:p,selectItem:C,setActiveValue:S}=bn("ListBox.Item"),g=s||!!p,h=d.has(r),x=_a(l,r),A=a.useMemo(()=>w_({children:e,label:t,hint:n,icon:o,showIndicator:f}),[e,n,o,t,f]);return{size:u,disabled:g,isSelected:h,optionId:x,indicatorMode:m,selectItem:C,setActiveValue:S,...A}}const oL=500;function or(){return{buffer:"",timeoutId:null}}function ya(e,t){return!(t.ctrlKey||t.altKey||t.metaKey||e.length!==1||e===" ")}function Na(e,t,n=oL){return e.buffer+=t,e.timeoutId!=null&&clearTimeout(e.timeoutId),e.timeoutId=setTimeout(()=>{e.buffer="",e.timeoutId=null},n),e.buffer}function rL(e){return e.length>1&&e.split("").every(t=>t===e[0])?e[0]:e}function wa(e,t,n){const o=rL(t).toLowerCase();if(!o||e.length===0)return-1;const r=e.length,s=n>=0?n:-1;for(let l=1;l<=r;l+=1){const u=(s+l)%r;if((e[u]??"").toLowerCase().startsWith(o))return u}return-1}function Yd({listId:e,variant:t="default",className:n,ariaLabel:o,ariaLabelledBy:r,children:s,tabIndex:l,onKeyDown:u,onFocus:d,...f}){const m=nt(),{setActiveValue:p,selectItem:C,multiple:S,disabled:g,standaloneKeyboard:h}=bn("ListBox"),x=yd(),A=t==="gloss",b=a.useRef(null),_=D_(A),L=a.useCallback(I=>{b.current=I,_(I)},[_]);k_({listId:e,activeValue:x,rootRef:b});const v=a.useRef(or()),R=a.useCallback(I=>{if(u==null||u(I),I.defaultPrevented||!h||g)return;const O=I.currentTarget,N=()=>{document.activeElement!==O&&O.focus()};if(I.key==="ArrowDown"){I.preventDefault();const y=qi({root:O,activeValue:x,delta:1});y&&p(y),N();return}if(I.key==="ArrowUp"){I.preventDefault();const y=qi({root:O,activeValue:x,delta:-1});y&&p(y),N();return}if(I.key==="Home"){I.preventDefault();const y=Wd(O);y&&p(y),N();return}if(I.key==="End"){I.preventDefault();const y=O_(O);y&&p(y),N();return}if(I.key==="Enter"||I.key===" "){if(!x){const y=Zi(O);y&&(I.preventDefault(),p(y),C(y),N());return}I.preventDefault(),C(x),N();return}if(ya(I.key,I)){I.preventDefault();const{values:y,labels:w}=P_(O),P=x?y.indexOf(x):-1,k=wa(w,Na(v.current,I.key),P);if(k<0)return;const j=y[k];j&&p(j),N()}},[x,g,u,C,p,h]),T=a.useCallback(I=>{if(d==null||d(I),I.defaultPrevented||!h||g||x)return;const O=Zi(I.currentTarget);O&&p(O)},[x,g,d,p,h]),E=l??(h&&!g?0:void 0);return c.jsx("div",{ref:L,id:e,role:"listbox","aria-label":o,"aria-labelledby":r,"aria-multiselectable":S||void 0,"aria-activedescendant":h?yv(e,x):void 0,"aria-disabled":g||void 0,tabIndex:E,onKeyDown:R,onFocus:T,className:K_({isGloss:A,slotClass:m.root,className:n}),...f,children:s})}Yd.displayName="ListBox";function $d({className:e,children:t,...n}){const o=nt(),[r,s]=a.useState(),l=a.useCallback(u=>{s(u)},[]);return c.jsx(Pv,{value:l,children:c.jsx("div",{role:"group","aria-labelledby":r,className:q_({slotClass:o.section,className:e}),...n,children:t})})}$d.displayName="ListBoxSection";function Xd({className:e,textClassName:t,children:n,id:o,...r}){const s=a.useId(),l=o??s,u=nt(),d=Dv();return a.useEffect(()=>(d==null||d(l),()=>d==null?void 0:d(void 0)),[l,d]),c.jsx("div",{id:l,className:Z_({slotClass:u.header,className:e}),...r,children:c.jsx(q,{as:"span",variant:"small",className:Q_({slotClass:u.headerText,className:t}),children:n})})}Xd.displayName="ListBoxHeader";function Kd({className:e,...t}){const n=nt();return c.jsx("div",{role:"presentation","aria-hidden":!0,className:J_({slotClass:n.separator,className:e}),...t})}Kd.displayName="ListBoxSeparator";function qd({className:e,children:t,...n}){const o=nt();return c.jsx(q,{as:"p",variant:"base",className:eL({slotClass:o.empty,className:e}),...n,children:t??Rv})}qd.displayName="ListBoxEmpty";const sL=a.forwardRef(function({children:t,className:n,value:o,disabled:r=!1,label:s,hint:l,icon:u,onClick:d,onPointerDown:f,onPointerEnter:m,...p},C){const S=nt(),{size:g,disabled:h,isSelected:x,optionId:A,indicatorMode:b,isCompound:_,hasHint:L,hasIcon:v,hasLabel:R,showIndicatorSlot:T,selectItem:E,setActiveValue:I}=nL({children:t,label:s,hint:l,icon:u,value:o,disabled:r}),{labelMotionRef:O,enableLabelMotion:N,handlePointerDown:y}=B_({disabled:h,hasLabel:R,onPointerDown:f}),w=a.useCallback(B=>{d==null||d(B),!(B.defaultPrevented||h)&&E(o)},[h,d,E,o]),P=a.useCallback(B=>{m==null||m(B),!h&&I(o)},[h,m,I,o]),k=a.useMemo(()=>({showIndicatorSlot:T,hasHint:L,hasIcon:v,selected:x,indicatorMode:b,disabled:h,mutedHint:h,enableLabelMotion:N,labelMotionRef:O}),[h,N,L,v,b,x,O,T]),j=_?c.jsx(c.Fragment,{children:t}):c.jsxs(c.Fragment,{children:[T?c.jsx(ka,{}):null,s!=null?c.jsx(Oa,{children:s}):null,l!=null?c.jsx(Pa,{children:l}):null,u!=null?c.jsx(Da,{children:u}):null]});return c.jsx(Xr,{value:k,children:c.jsx("button",{ref:C,type:"button",id:A,role:"option","data-value":o,"aria-selected":x,disabled:h,tabIndex:-1,className:i.cn(tL({size:g,disabled:h}),jd(L,ye[g].listItemGapX,T,v),S.item,n),onClick:w,onPointerDown:y,onPointerEnter:P,...p,children:j})})}),Zd=a.memo(sL);Zd.displayName="ListBoxItem";function Oa({className:e,...t}){const{size:n}=bn("ListBox.Label"),o=nt();return c.jsx(Hd,{textVariant:i.CONTROL_SIZE_LAYOUT[n].controlText,className:i.cn(o.label,e),...t})}Oa.displayName="ListBoxLabel";function Pa({className:e,...t}){const n=nt();return c.jsx(Gd,{className:i.cn(n.hint,e),...t})}Pa.displayName="ListBoxHint";function Da({className:e,...t}){const{size:n}=bn("ListBox.Icon"),o=nt();return c.jsx(Vd,{className:i.cn(`[&_svg]:${i.CONTROL_SIZE_LAYOUT[n].icon}`,o.icon,e),...t})}Da.displayName="ListBoxIcon";function ka({variant:e="default",size:t,check:n,children:o,className:r,classNames:s,...l}){const u=Hn("ListBox.ItemIndicator"),{size:d}=bn("ListBox.ItemIndicator"),f=nt(),m=I_(d,t);if(!u.showIndicatorSlot)return null;const p=n??u.indicatorMode==="multi";return c.jsx(zd,{className:i.cn(f.itemIndicator,s==null?void 0:s.itemIndicator,r),...l,children:c.jsx(Be,{variant:e,size:m,selected:u.selected,check:p,classNames:y_({slotClassNames:f,classNames:s}),children:o})})}ka.displayName="ListBoxItemIndicator";function Ba(e,t,n){if(n){const o=[...e],r=o.indexOf(t);return r>=0?o.splice(r,1):o.push(t),o}return e.includes(t)?[]:[t]}function aL({size:e="base",multiple:t=!1,value:n,defaultValue:o,onValueChange:r,selectionIndicator:s=!0,disabled:l=!1,activeValue:u,onActiveValueChange:d,listId:f}){const m=a.useId(),p=f??`listbox-${m}`,C=n!==void 0,[S,g]=a.useState(()=>Ki(o)),h=C?Ki(n):S,x=a.useMemo(()=>new Set(h),[h]),A=a.useRef(h);A.current=h;const[b,_]=a.useState(null),L=u!==void 0,v=L?u:b,R=a.useCallback(O=>{L||_(O),d==null||d(O)},[L,d]),T=a.useCallback(O=>{C||g(O),r==null||r(t?O:O[0]??"")},[C,t,r]),E=a.useCallback(O=>{const N=Ba(A.current,O,t);A.current=N,T(N)},[t,T]),I=a.useMemo(()=>({listId:p,size:e,multiple:t,selected:x,selectItem:E,setActiveValue:R,showIndicator:s,indicatorMode:t?"multi":"radio",disabled:l,standaloneKeyboard:!L}),[l,L,p,t,E,x,s,R,e]);return{listId:p,contextValue:I,activeValue:v}}function Qd({classNames:e,children:t,className:n,size:o,variant:r="default",multiple:s,value:l,defaultValue:u,onValueChange:d,selectionIndicator:f,disabled:m,activeValue:p,onActiveValueChange:C,listId:S,"aria-label":g,"aria-labelledby":h,...x}){const{listId:A,contextValue:b,activeValue:_}=aL({size:o,multiple:s,value:l,defaultValue:u,onValueChange:d,selectionIndicator:f,disabled:m,activeValue:p,onActiveValueChange:C,listId:S}),L=Iv({ariaLabel:g,ariaLabelledBy:h});return c.jsx(Nv,{value:b,children:c.jsx(wv,{value:_,children:c.jsx(Ov,{classNames:e,children:c.jsx(Yd,{listId:A,variant:r,className:n,ariaLabel:L["aria-label"],ariaLabelledBy:L["aria-labelledby"],...x,children:t})})})})}Qd.displayName="ListBox";const lL=Object.assign(ka,{Fill:Be.Fill,Mark:Be.Mark}),Ht=Object.assign(Qd,{Section:$d,Header:Xd,Separator:Kd,Empty:qd,Item:Zd,Label:Oa,Hint:Pa,Icon:Da,ItemIndicator:lL}),Jd=a.createContext(null),Kr=a.createContext({}),ef=a.createContext("bottom"),tf=a.createContext({unstyled:!1});function iL({value:e,children:t}){return c.jsx(Jd.Provider,{value:e,children:t})}function Zt(e){const t=a.useContext(Jd);if(!t)throw new Error(`${e} must be inside <Popover>.`);return t}function cL({classNames:e,children:t}){const n=a.useContext(Kr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Kr.Provider,{value:o,children:t})}function Qt(){return a.useContext(Kr)}function uL({value:e,children:t}){return c.jsx(ef.Provider,{value:e,children:t})}function dL(){return a.useContext(ef)}function fL({unstyled:e,children:t}){const n=a.useMemo(()=>({unstyled:e}),[e]);return c.jsx(tf.Provider,{value:n,children:t})}function nf(){return a.useContext(tf)}function mL(e,t){if(e===t)return!0;const n=e==null?void 0:e.displayName;if(typeof t=="string")return n===t;const o=t==null?void 0:t.displayName;return o!=null&&n===o}function ge(e,...t){let n=!1;const o=r=>{if(!n){for(const s of a.Children.toArray(r))if(a.isValidElement(s)){if(t.some(l=>mL(s.type,l))){n=!0;return}o(s.props.children)}}};return o(e),n}const pL="dialog";function Qi(e,t){return{"aria-haspopup":pL,"aria-expanded":e,"aria-controls":e?t:void 0}}function CL(e){return`${e}-label`}function gL(e){return`${e}-hint`}function SL({contentRole:e,labelConnected:t,hintConnected:n,labelId:o,hintId:r}){if(e==="dialog"){if(t&&n)return`${o} ${r}`;if(n)return r}}function hL({contentRole:e,labelConnected:t,labelId:n}){if(e==="dialog"&&t)return n}const xL=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function bL(e){const t=e.querySelectorAll(xL);for(const n of t)if(!n.closest("[aria-hidden='true']"))return n;return null}const of="PopoverArrow";function AL(...e){return t=>{for(const n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Ji(e){return e.type.displayName===of}function vL(e){const t=a.Children.toArray(e),n=t.find(r=>a.isValidElement(r)&&Ji(r)),o=t.filter(r=>!(a.isValidElement(r)&&Ji(r)));return{customArrow:n,panelChildren:o}}function _L(e,t,n){const[o,r]=a.useState(t),s=e!==void 0,l=s?e:o,u=a.useCallback(d=>{s||r(d),n==null||n(d)},[s,n]);return[l,u]}function LL({children:e,size:t="base",variant:n="default",side:o="bottom",open:r,defaultOpen:s=!1,onOpenChange:l,anchorRef:u,shouldDismiss:d,portalContainer:f}){const[m,p]=_L(r,s,l),C=a.useRef(null),S=a.useRef(null),g=a.useRef(m),x=`popover-${a.useId()}`,A=CL(x),b=gL(x),{labelConnected:_,hintConnected:L}=a.useMemo(()=>({labelConnected:ge(e,"PopoverTitle"),hintConnected:ge(e,"PopoverDescription")}),[e]);return a.useEffect(()=>{if(!m)return;const R=T=>{T.key==="Escape"&&p(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[m,p]),a.useEffect(()=>{if(!m)return;const R=T=>{var O;const E=T.target,I=(u==null?void 0:u.current)??C.current;I!=null&&I.contains(E)||(O=S.current)!=null&&O.contains(E)||d&&!d(E)||p(!1)};return document.addEventListener("pointerdown",R),()=>document.removeEventListener("pointerdown",R)},[u,m,p,d]),a.useEffect(()=>{if(g.current&&!m){const R=(u==null?void 0:u.current)??C.current;R==null||R.focus({preventScroll:!0})}g.current=m},[u,m,C]),{contextValue:a.useMemo(()=>({open:m,setOpen:p,popoverId:x,labelId:A,hintId:b,size:t,variant:n,side:o,labelConnected:_,hintConnected:L,triggerRef:C,anchorRef:u,contentRef:S,portalContainer:f}),[u,L,b,_,A,m,x,f,p,o,t,n])}}const ja="data-theme",rf=`[${ja}]`;function qr(e){const t=e.getAttribute(ja);return t==="light"?"light":t?"dark":null}function TL(e){if(typeof document>"u")return!1;if(e){const t=e.closest(rf);if(t)return qr(t)==="light"}return qr(document.documentElement)==="light"}function An(e){if(typeof document>"u")return{};const t=(e==null?void 0:e.closest(rf))??document.documentElement;return qr(t)!=="light"?{}:t===document.documentElement?{}:{"data-theme":"light"}}function EL(e){if(typeof document>"u")return[];const t=new Set,n=[],o=r=>{let s=r;for(;s&&!t.has(s);)t.add(s),n.push(s),s=s.parentElement};return e&&o(e),o(document.documentElement),n}function RL(e,t){if(typeof document>"u")return()=>{};const n=new MutationObserver(t);for(const o of EL(e))n.observe(o,{attributes:!0,attributeFilter:[ja]});return()=>n.disconnect()}function Ma(e){return a.useSyncExternalStore(a.useCallback(t=>RL(e,t),[e]),()=>TL(e),()=>!1)}function IL(e){return e?"current"in e?e.current:e:null}function Fa(e,t){const n=IL(t),o=a.useRef(null);if(!e)o.current=null;else if(!n&&o.current===null){const r=typeof document<"u"?document.activeElement:null;o.current=r instanceof HTMLElement?r:null}return n??o.current}function gt(e){return e||(typeof document>"u"?null:document.body)}function fn(e){return typeof document>"u"||e==null?!1:e!==document.body}function yL(e,t){e.open||(t!=null&&t.contained?e.show():e.showModal())}function sf(e,t,n){if(fn(n)&&n){const o=n.getBoundingClientRect();e.style.position="absolute",e.style.left=`${t.left-o.left+n.scrollLeft}px`,e.style.top=`${t.top-o.top+n.scrollTop}px`;return}e.style.position="fixed",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`}function bt({triggerRef:e,openingRef:t,setOpen:n,disabled:o=!1,onOpened:r,runSqueeze:s=l=>i.animateInteractivePressSqueeze(l)}){if(o||t.current)return;const l=()=>{o||(n(!0),r==null||r())};if(i.prefersReducedMotion()){l();return}const u=e.current;if(!u){l();return}t.current=!0,s(u).then(()=>{t.current=!1,l()})}function At(){return a.useRef(!1)}const NL=8;function wL(e,t,n,o){return Math.max(o,Math.min(e,n-t-o))}function rr(e,t,n,o,r,s){const l=o==="start"?e:o==="end"?e+t-n:e+t/2-n/2;return wL(l,n,r,s)}function OL(e,t,n,o){return e.top-n-t>=o}function PL(e,t,n,o){return e.bottom+n+t<=window.innerHeight-o}function DL(e,t,n,o){return e.left-n-t>=o}function kL(e,t,n,o){return e.right+n+t<=window.innerWidth-o}function BL(e,t,n,o,r){return{left:rr(e.left,e.width,t.width,r,window.innerWidth,o),top:e.top-n-t.height,resolvedSide:"top"}}function jL(e,t,n,o,r){return{left:rr(e.left,e.width,t.width,r,window.innerWidth,o),top:e.bottom+n,resolvedSide:"bottom"}}function ML(e,t,n,o,r){return{left:e.left-n-t.width,top:rr(e.top,e.height,t.height,r,window.innerHeight,o),resolvedSide:"left"}}function FL(e,t,n,o,r){return{left:e.right+n,top:rr(e.top,e.height,t.height,r,window.innerHeight,o),resolvedSide:"right"}}const ec={top:BL,bottom:jL,left:ML,right:FL},HL={top:(e,t,n,o,r)=>OL(e,n,o,r),bottom:(e,t,n,o,r)=>PL(e,n,o,r),left:(e,t,n,o,r)=>DL(e,t,o,r),right:(e,t,n,o,r)=>kL(e,t,o,r)},GL={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]};function af(e,t,n,o,r){const s=o,l=NL,u=(r==null?void 0:r.align)??"center",d=GL[n];for(const f of d)if(HL[f](e,t.width,t.height,s,l))return ec[f](e,t,s,l,u);return ec[n](e,t,s,l,u)}const lf={top:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",bottom:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",left:"right-0 top-1/2 -translate-y-1/2 translate-x-1/2",right:"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"},cf={top:"pb-1",bottom:"pt-1",left:"pr-1",right:"pl-1"},sr=.97;function Rt(){return i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableModalMotion")}function uf(){return{opacity:Rt()?1:0}}function VL(e,t,n){e&&(e.style.opacity="1"),t&&(t.style.opacity="1",t.style.visibility="visible",$.set(t,{scale:1,clearProps:"transform"}),n!=null&&n.focusPanel&&t.focus())}function zL({overlay:e,panel:t,vars:n,panelFrom:o={scale:sr},panelTo:r={scale:1}}){i.killMotion(e,t),$.fromTo(e,{opacity:0},{opacity:1,...n}),i.setWillChangeTransform(t,!0),$.fromTo(t,o,{...r,...n,onComplete:i.clearWillChangeOnComplete(t,n.onComplete)})}function UL({overlay:e,panel:t,vars:n,onComplete:o,panelExit:r={autoAlpha:0,scale:sr}}){i.killMotion(e,t),i.setWillChangeTransform(t,!0);const s=$.timeline({onComplete:()=>{i.setWillChangeTransform(t,!1),o()}});return s.to(e,{opacity:0,...n},0),s.to(t,{...r,...n},0),s}function ar(e){e&&(e.style.opacity="",e.style.visibility="",$.set(e,{scale:1,clearProps:"transform"}))}function WL(e){e.style.opacity="1",e.style.visibility="visible"}function lr({surface:e,vars:t,from:n={scale:sr},to:o={scale:1}}){i.killMotion(e),WL(e),i.setWillChangeTransform(e,!0),$.fromTo(e,n,{...o,...t,onComplete:i.clearWillChangeOnComplete(e,t.onComplete)})}function ir({surface:e,vars:t,onComplete:n,exit:o={}}){i.killMotion(e),i.setWillChangeTransform(e,!0);const r=Number.parseFloat(getComputedStyle(e).opacity),s=Number.isFinite(r)&&r>0?r:1;return $.fromTo(e,{autoAlpha:s},{autoAlpha:0,...o,...t,onComplete:i.clearWillChangeOnComplete(e,n??t.onComplete)})}function YL(e){const t=typeof document<"u"?document.activeElement:null;return!(t instanceof HTMLElement)||t===e||e.contains(t)?null:t}function $L({dialog:e,focusReturn:t,unmount:n}){e!=null&&e.open&&e.close(),n(),t&&document.contains(t)&&t.focus({preventScroll:!0})}function XL({open:e,side:t,offset:n,align:o,matchAnchorWidth:r,showArrow:s,isGloss:l,forwardedRef:u,contentRef:d,triggerRef:f,anchorRef:m,portalContainer:p}){const C=a.useRef(null),S=a.useRef(null),g=a.useMemo(()=>i.createGlossInteractiveRefCallback(S,l),[l]),[h,x]=a.useState(!1),[A,b]=a.useState(t);e&&!h&&x(!0);const _=a.useCallback(v=>{C.current=v,d.current=v,AL(u)(v)},[d,u]),L=a.useCallback(()=>{const v=(m==null?void 0:m.current)??f.current,R=C.current;if(!v||!R)return;const T=v.getBoundingClientRect();r?R.style.minWidth=`${Math.max(T.width,192)}px`:R.style.minWidth="";const E=af(T,R.getBoundingClientRect(),t,n,{align:o});b(E.resolvedSide),sf(R,E,p),R.style.transform=""},[o,m,r,n,p,t,f]);return i.usePersistentElShadow(C,!l,i.shadowBase),a.useLayoutEffect(()=>{if(!e||!h)return;L();const v=window.requestAnimationFrame(()=>L()),R=()=>L();window.addEventListener("scroll",R,!0),window.addEventListener("resize",R);const T=C.current,E=typeof document<"u"?gt(p):null,I=typeof ResizeObserver<"u"?new ResizeObserver(()=>L()):null;return T&&I&&I.observe(T),E&&E!==document.body&&I&&I.observe(E),()=>{window.cancelAnimationFrame(v),window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R),I==null||I.disconnect()}},[e,h,p,L,s,n,o,r]),a.useLayoutEffect(()=>{var E;if(!e||!h)return;const v=C.current,R=f.current;if(!v||!R)return;const T=document.activeElement;T!==R&&!R.contains(T)||(E=bL(v))==null||E.focus({preventScroll:!0})},[e,h,f]),a.useLayoutEffect(()=>{if(!h)return;const v=C.current;if(!v)return;const R=Rt();let T=!1;if(R)return i.killMotion(v),e?ar(v):x(!1),()=>{T=!0};if(i.killMotion(v),e)return lr({surface:v,vars:{...i.motionTooltip(),overwrite:"auto"}}),()=>{T=!0,i.killMotion(v)};const E=ir({surface:v,vars:{...i.motionTooltip(),overwrite:"auto"},onComplete:()=>{T||x(!1)}});return()=>{T=!0,i.killMotion(v),E.kill()}},[e,h]),{panelRef:C,setPanelRef:_,bindGlossPanelRef:g,portalMounted:h,resolvedSide:A}}function KL({alignProp:e,matchAnchorWidth:t}){return e??(t?"start":"center")}const Gn=6,qL={small:"small",base:"base",mid:"mid",large:"large"},ZL={small:"xsmall",base:"small",mid:"base",large:"base"},QL={small:"gap-small",base:"gap-base",mid:"gap-mid",large:"gap-large"},JL="inline-flex shrink-0 border-0 bg-transparent p-0 outline-none focus-ring",eT="pointer-events-auto z-popover w-max min-w-0 overflow-visible text-left outline-none",tT="relative overflow-visible",nT="gloss-panel gloss-deep relative z-[1] flex min-w-0 origin-center flex-col overflow-hidden text-foreground",oT="gloss-content flex min-w-0 flex-col",rT="relative z-[1] flex min-w-0 flex-col overflow-hidden border-token bg-surface text-foreground animate-shadow",sT="pointer-events-none absolute z-0 size-2 rotate-45",aT="border-0 bg-[var(--color-surface)]",lT="border-token bg-surface",iT="flex shrink-0 flex-col text-left",cT="min-w-0 font-w-mid",uT="min-h-0 min-w-0 text-left";function df(e,t){return t?QL[e]:!1}function dT({size:e,unstyled:t,contentGap:n,gapPropSet:o}){const r=Ee(e);return t?r.rounded:i.cn(r.rounded,r.panelMin,r.popoverMax,df(n,o))}function fT({rootSlot:e,slotClass:t,className:n}){return i.cn(JL,e,t,n)}function mT({resolvedSide:e,showArrow:t,slotClass:n,className:o}){return i.cn(eT,t&&cf[e],n,o)}function pT({size:e,unstyled:t,slotClass:n}){const o=Ee(e);return i.cn(nT,i.GLOSS_INTERACTIVE_MOTION_CLASS,t?o.rounded:i.cn(o.rounded,o.panelMin,o.popoverMax),n)}function CT({unstyled:e,contentGap:t,gapPropSet:n,slotClass:o}){return i.cn(oT,!e&&df(t,n),o)}function gT({size:e,unstyled:t,contentGap:n,gapPropSet:o,slotClass:r}){return i.cn(rT,dT({size:e,unstyled:t,contentGap:n,gapPropSet:o}),r)}function ST({isGloss:e,arrowSideClass:t,slotClass:n,className:o}){return i.cn(sT,e?aT:lT,t,n,o)}function hT({size:e,unstyled:t,slotClass:n,className:o}){const r=Ee(e);return i.cn(iT,!t&&r.headerPadding,r.headingGap,n,o)}function xT({size:e,slotClass:t,className:n}){return i.cn(cT,Ee(e).titleClassName,t,n)}function bT({size:e,unstyled:t,slotClass:n,className:o}){return i.cn(uT,!t&&Ee(e).bodyPadding,n,o)}function AT(e){return qL[e]}function vT(e){return ZL[e]}const ff=a.forwardRef(function({className:t="",children:n,asChild:o=!0,onClick:r,onPointerDown:s,onKeyDown:l,...u},d){const{open:f,setOpen:m,triggerRef:p,popoverId:C}=Zt("Popover.Trigger"),S=Qt(),g=At(),h=a.useCallback(v=>{p.current=v,typeof d=="function"?d(v):d&&(d.current=v)},[d,p]),x=a.useCallback(v=>{f||g.current||v.button!==0||(v.preventDefault(),bt({triggerRef:p,openingRef:g,setOpen:()=>m(!0)}))},[f,g,p,m]),A=a.useCallback(v=>{r==null||r(v),!v.defaultPrevented&&f&&m(!1)},[r,f,m]),b=a.useCallback(v=>{l==null||l(v),!v.defaultPrevented&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),f?m(!1):g.current||m(!0))},[l,f,g,m]),_=a.Children.count(n)===1&&a.isValidElement(n)?n:null;if(o&&_){const v=_,R=Qi(f,C);return a.cloneElement(v,yt(v,{...u,className:i.cn(S.root,S.trigger,t),onPointerDown:T=>{x(T),s==null||s(T)},onClick:A,onKeyDown:T=>{b(T)},...R},h,{runBeforeChild:["onPointerDown"]}))}const L=Qi(f,C);return c.jsx("button",{type:"button",ref:h,className:fT({rootSlot:S.root,slotClass:S.trigger,className:t}),...L,onPointerDown:v=>{s==null||s(v),x(v)},onClick:A,onKeyDown:b,...u,children:n})});ff.displayName="PopoverTrigger";const Ha=a.forwardRef(function({className:t,...n},o){const r=dL(),{variant:s}=Zt("Popover.Arrow"),l=Qt(),u=s==="gloss";return c.jsx("span",{ref:o,"aria-hidden":!0,className:ST({isGloss:u,arrowSideClass:lf[r],slotClass:l.arrow,className:t}),...n})});Ha.displayName=of;const mf=a.forwardRef(function({className:t,children:n,...o},r){const{size:s}=Zt("Popover.Header"),{unstyled:l}=nf(),u=Qt();return c.jsx("div",{ref:r,className:hT({size:s,unstyled:l,slotClass:u.header,className:t}),...o,children:n})});mf.displayName="PopoverHeader";const pf=a.forwardRef(function({className:t,children:n,id:o,...r},s){const{labelId:l,size:u}=Zt("Popover.Title"),d=Qt();return c.jsx(q,{ref:s,as:"h2",variant:AT(u),id:o??l,className:xT({size:u,slotClass:d.label,className:t}),...r,children:n})});pf.displayName="PopoverTitle";const Cf=a.forwardRef(function({className:t,children:n,variant:o,...r},s){const{hintId:l,size:u}=Zt("Popover.Description"),d=Qt();return c.jsx(le.Hint,{ref:s,as:"p",id:l,variant:o??vT(u),className:i.cn(d.hint,t),...r,children:n})});Cf.displayName="PopoverDescription";const gf=a.forwardRef(function({className:t,children:n,...o},r){const{size:s}=Zt("Popover.Body"),{unstyled:l}=nf(),u=Qt();return c.jsx("div",{ref:r,className:bT({size:s,unstyled:l,slotClass:u.body,className:t}),...o,children:n})});gf.displayName="PopoverBody";const Sf=a.forwardRef(function({className:t="",children:n,showArrow:o=!1,offset:r=Gn,gap:s,matchAnchorWidth:l=!1,align:u,unstyled:d=!1,contentRole:f="dialog",portalContainer:m,...p},C){const{open:S,popoverId:g,size:h,variant:x,side:A,labelConnected:b,hintConnected:_,labelId:L,hintId:v,triggerRef:R,anchorRef:T,contentRef:E,portalContainer:I}=Zt("Popover.Content"),O=Qt(),N=x==="gloss",y=KL({alignProp:u,matchAnchorWidth:l}),w=s!==void 0,P=s??"base",{customArrow:k,panelChildren:j}=a.useMemo(()=>vL(n),[n]),{setPanelRef:B,bindGlossPanelRef:D,portalMounted:F,resolvedSide:H}=XL({open:S,side:A,offset:r,align:y,matchAnchorWidth:l,showArrow:o,isGloss:N,forwardedRef:C,contentRef:E,triggerRef:R,anchorRef:T,portalContainer:m??I});if(!F||typeof document>"u")return null;const U=gt(m??I);if(!U)return null;const G=An((T==null?void 0:T.current)??R.current),K=SL({contentRole:f,labelConnected:b,hintConnected:_,labelId:L,hintId:v}),V=hL({contentRole:f,labelConnected:b,labelId:L}),oe=c.jsx(uL,{value:H,children:c.jsx(fL,{unstyled:d,children:c.jsx("div",{ref:B,...G,id:g,role:f,"aria-modal":f==="dialog"?"false":void 0,"aria-labelledby":V,"aria-describedby":K,"data-side":H,className:mT({resolvedSide:H,showArrow:o,slotClass:O.content,className:t}),...p,children:c.jsxs("div",{className:i.cn(tT,O.panelRelative),children:[o?k??c.jsx(Ha,{}):null,N?c.jsx("div",{ref:D,className:pT({size:h,unstyled:d,slotClass:O.glossPanel}),children:c.jsx("div",{className:CT({unstyled:d,contentGap:P,gapPropSet:w,slotClass:O.glossContent}),children:j})}):c.jsx("div",{className:gT({size:h,unstyled:d,contentGap:P,gapPropSet:w,slotClass:O.panel}),children:j})]})})})});return Ut.createPortal(oe,U)});Sf.displayName="PopoverContent";function hf({children:e,classNames:t,size:n="base",variant:o="default",side:r="bottom",open:s,defaultOpen:l=!1,onOpenChange:u,anchorRef:d,shouldDismiss:f,portalContainer:m}){const{contextValue:p}=LL({children:e,size:n,variant:o,side:r,open:s,defaultOpen:l,onOpenChange:u,anchorRef:d,shouldDismiss:f,portalContainer:m});return c.jsx(iL,{value:p,children:c.jsx(cL,{classNames:t,children:e})})}hf.displayName="PopoverRoot";const ke=Object.assign(hf,{Trigger:ff,Content:Sf,Header:mf,Title:pf,Description:Cf,Body:gf,Arrow:Ha});function _T(e){return`${e}-label`}function LT(e){return`${e}-listbox`}function TT(e){return{hintId:Ve(e),errorId:ze(e),labelId:_T(e),listId:LT(e)}}function ET(e,t,n){return t&&n?`${e}-opt-${n}`:void 0}function RT(e,t={openList:Se.openList,closeList:Se.closeList}){return e?t.closeList:t.openList}function IT(e,t){return e||(t==="danger"||t==="default"?"default":t)}function xf({className:e,classNames:t,...n}){const o=wt();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}xf.displayName="ComboBoxLabel";function Ga({children:e,status:t,className:n,id:o,...r}){const s=Td(),l=wt(),u=IT(t,s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}Ga.displayName="ComboBoxHint";function Va({children:e,className:t,id:n,...o}){const r=Td(),s=wt();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Va.displayName="ComboBoxError";const we="field-control-mobile-no-zoom",yT={small:i.CONTROL_SIZE_LAYOUT.small.controlPad,base:i.CONTROL_SIZE_LAYOUT.base.controlPad,mid:i.CONTROL_SIZE_LAYOUT.mid.controlPad,large:i.CONTROL_SIZE_LAYOUT.large.controlPad},NT={small:i.CONTROL_SIZE_LAYOUT.small.chevronIcon,base:i.CONTROL_SIZE_LAYOUT.base.chevronIcon,mid:i.CONTROL_SIZE_LAYOUT.mid.chevronIcon,large:i.CONTROL_SIZE_LAYOUT.large.chevronIcon},wT="relative z-0 flex min-w-0 items-stretch border-1 text-left overflow-hidden motion-reduce:transition-none",OT=`min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted ${we}`,PT="text-muted",DT="flex shrink-0 origin-center items-center justify-center self-stretch px-small outline-none text-muted hover:text-foreground focus-ring-inset",kT="pointer-events-none",BT="z-popover",jT="gap-0 p-base",MT="overflow-y-auto overflow-x-hidden",FT="cursor-not-allowed opacity-55 shadow-token-base",HT="cursor-pointer";function GT({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function VT(e){return e?i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e)):"rounded-base"}function zT({variant:e,status:t,disabled:n,groupSegment:o,shellHoverMotionClass:r,className:s,slotClass:l}){const u=e==="gloss";return i.cn(wT,(o==null?void 0:o.orientation)==="horizontal"?"flex-1":"w-full",VT(o),GT({variant:e}),i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),u?"":i.fieldShellHoverClass(!n,t,e),r,n?FT:HT,l,s)}function UT({size:e,muted:t,className:n,slotClass:o}){return i.cn(OT,yT[e],t&&PT,we,o,n)}function WT({disabled:e,className:t,slotClass:n}){return i.cn(DT,e&&kT,n,t)}function YT(e){const t=[e.value];return e.filterText&&t.push(e.filterText),typeof e.label=="string"&&t.push(e.label),typeof e.hint=="string"&&t.push(e.hint),t.join(" ").toLowerCase()}function $T(e,t){const n=t.trim().toLowerCase();return n?YT(e).includes(n):!0}function bf(e,t){const n=[];for(const o of e)$T(o,t)&&n.push(o.value);return n}function XT(e){return new Map(e.map(t=>[t.value,t]))}function KT(e){return e?typeof e.label=="string"?e.label:e.filterText?e.filterText:e.value:""}function qT({filteredValues:e,activeValue:t,optionsByValue:n,delta:o}){if(e.length===0)return t;const r=t?e.indexOf(t):-1;let s=r<0?0:r;for(let l=0;l<e.length;l+=1){s=(s+o+e.length)%e.length;const u=e[s],d=n.get(u);if(u&&d&&!d.disabled)return u}return t}function ZT(e,t){for(const n of e){const o=t.get(n);if(o&&!o.disabled)return n}return null}function QT(e,t){for(let n=e.length-1;n>=0;n-=1){const o=e[n],r=t.get(o);if(r&&!r.disabled)return o}return null}const JT=[];function eE({onKeyDown:e,onChange:t,onBlur:n},o){const r=Fn(),{comboBoxId:s,open:l,setOpen:u,value:d,setValue:f,filterQuery:m,setFilterQuery:p,listId:C,activeValue:S,setActiveValue:g,inputRef:h,anchorRef:x,options:A,filteredValues:b,disabled:_,placeholder:L,size:v,status:R,required:T,hintConnected:E,errorConnected:I,hintId:O,errorId:N,formInputRef:y,formOnBlur:w}=r,P=At(),k=a.useRef(null),j=a.useMemo(()=>XT(A),[A]),B=a.useMemo(()=>j.get(d),[j,d]),D=a.useMemo(()=>KT(B),[B]),F=ET(C,l,S),H=je(E?O:void 0,I?N:void 0),U=a.useCallback(()=>{const M=k.current;k.current=null;const W=M??"";p(W);const Y=bf(A,W),Z=Y.indexOf(d);g(Z>=0?d:Y[0]??null),requestAnimationFrame(()=>{const ce=h.current;if(!ce)return;ce.focus();const z=W.length;ce.setSelectionRange(z,z)})},[h,A,g,p,d]),G=a.useCallback(()=>{bt({triggerRef:x,disabled:_,setOpen:u,onOpened:U,openingRef:P})},[x,_,U,P,u]),K=a.useCallback(M=>{const W=qT({filteredValues:b,activeValue:S,optionsByValue:j,delta:M});W&&g(W)},[S,b,j,g]),V=a.useCallback(M=>{var Y;const W=j.get(M);!W||W.disabled||(f(M),u(!1),p(""),(Y=h.current)==null||Y.focus())},[h,j,p,u,f]),oe=a.useCallback(M=>{t==null||t(M),l&&p(M.target.value)},[t,l,p]),J=a.useCallback(M=>{if(e==null||e(M),!(M.defaultPrevented||_)&&!M.nativeEvent.isComposing){if(!l){if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault(),G();return}if(M.key==="Enter"||M.key===" "){M.preventDefault(),G();return}M.key.length===1&&!M.ctrlKey&&!M.metaKey&&!M.altKey&&M.key!=="Tab"&&(M.preventDefault(),k.current=M.key,G());return}if(M.key==="ArrowDown"){M.preventDefault(),K(1);return}if(M.key==="ArrowUp"){M.preventDefault(),K(-1);return}if(M.key==="Enter"){M.preventDefault(),S&&V(S);return}if(M.key==="Home"){M.preventDefault();const W=ZT(b,j);W&&g(W);return}if(M.key==="End"){M.preventDefault();const W=QT(b,j);W&&g(W)}}},[S,K,_,b,e,l,G,j,V,g]);a.useEffect(()=>{l||p("")},[l,p]);const ee=a.useCallback(M=>{n==null||n(M),w==null||w()},[w,n]),se=a.useCallback(M=>{ue(o,M),ue(h,M),y&&ue(y,M)},[y,o,h]);return{comboBoxId:s,open:l,disabled:_,placeholder:L,size:v,status:R,required:T,activeOptionId:F,ariaDescribedBy:H,inputValue:l?m:D,isMuted:!l&&!B,setRefs:se,handleChange:oe,handleKeyDown:J,handleBlur:ee}}const za=a.forwardRef(function({className:t,children:n,groupSegment:o,onPointerEnter:r,onPointerLeave:s,...l},u){const d=$t(),f=et(),m=wt(),p=Fn(),{open:C,setOpen:S,disabled:g,variant:h,status:x,size:A,anchorRef:b,listId:_}=p,L=At(),v=h==="gloss",R=d!=null&&d.segmented?void 0:o??(f==null?void 0:f.segment),T=i.useFieldShellHoverLift(b,!g&&!v&&R==null),E=i.useGlossFieldShellMotion(b,!g&&v&&R==null),I=a.useCallback(y=>{b.current=y,!g&&v&&E.bindShellRef(y)},[b,g,E,v]),O=a.useCallback(()=>{bt({triggerRef:b,disabled:g,setOpen:S,openingRef:L})},[b,g,S,L]),N=a.useCallback(y=>{g||C||y.button===0&&O()},[g,C,O]);return c.jsx("div",{ref:y=>{ue(u,y),I(y)},role:"combobox","aria-expanded":C,"aria-controls":C?_:void 0,"aria-haspopup":"listbox","aria-disabled":g||void 0,onPointerDown:N,onPointerEnter:y=>{r==null||r(y),!y.defaultPrevented&&(v&&R==null?E.onShellPointerEnter(y):T.onShellPointerEnter(y))},onPointerLeave:y=>{s==null||s(y),v&&R==null?E.onShellPointerLeave(y):T.onShellPointerLeave(y)},onFocusCapture:v&&!g&&R==null?E.onShellFocusIn:void 0,onBlurCapture:v&&!g&&R==null?E.onShellFocusOut:void 0,...g&&v?{"data-gloss-disabled":""}:{},className:zT({variant:h,status:x,disabled:g,groupSegment:R,shellHoverMotionClass:v?E.shellHoverMotionClass:T.shellHoverMotionClass,className:t,slotClass:m.inputGroup}),...l,children:n})});za.displayName="ComboBoxInputGroup";const Ua=a.forwardRef(function({className:t,onKeyDown:n,onChange:o,onBlur:r,...s},l){const u=wt(),{comboBoxId:d,open:f,disabled:m,placeholder:p,size:C,status:S,required:g,activeOptionId:h,ariaDescribedBy:x,inputValue:A,isMuted:b,setRefs:_,handleChange:L,handleKeyDown:v,handleBlur:R}=eE({onKeyDown:n,onChange:o,onBlur:r},l);return c.jsx("input",{ref:_,id:d,type:"text","aria-autocomplete":"list","aria-activedescendant":h,"aria-required":g||void 0,"aria-invalid":S==="danger"?!0:void 0,"aria-describedby":x,disabled:m,readOnly:!f,autoComplete:"off",placeholder:p,value:A,onChange:L,onKeyDown:v,onBlur:R,className:UT({size:C,muted:b,className:t,slotClass:u.input}),...s})});Ua.displayName="ComboBoxInput";const Wa=a.forwardRef(function({className:t,onPointerDown:n,children:o,...r},s){const l=Ie(),u=wt(),{open:d,setOpen:f,setFilterQuery:m,disabled:p,size:C,inputRef:S}=Fn(),g=a.useRef(null),h=qt(d,g),x=a.useCallback(b=>{h(b),ue(s,b)},[h,s]),A=a.useCallback(b=>{if(n==null||n(b),b.stopPropagation(),!p){if(d){f(!1),m("");return}b.button===0&&(f(!0),requestAnimationFrame(()=>{var _;return(_=S.current)==null?void 0:_.focus()}))}},[p,S,n,d,m,f]);return c.jsx("button",{type:"button",ref:x,tabIndex:-1,disabled:p,"aria-label":RT(d,l),className:WT({disabled:p,className:t,slotClass:u.trigger}),onPointerDown:A,...r,children:o??c.jsx(be.IoChevronDown,{className:i.cn(NT[C],u.triggerIcon),"aria-hidden":!0})})});Wa.displayName="ComboBoxTrigger";const Ya=a.forwardRef(function({children:t,className:n,side:o="bottom",align:r,offset:s=Gn,listBoxProps:l,...u},d){const f=wt(),{open:m,setOpen:p,anchorRef:C,listId:S,labelId:g,labelConnected:h,placeholder:x,menuMaxHeight:A,options:b,filteredValues:_,value:L,setValue:v,activeValue:R,setActiveValue:T,setFilterQuery:E,variant:I,size:O}=Fn(),{className:N,classNames:y,style:w,size:P,...k}=l??{},j=a.useCallback(D=>{const F=Array.isArray(D)?D[0]??"":D;v(F),E(""),p(!1)},[E,p,v]),B=t??(_.length===0?c.jsx(Ht.Empty,{}):_.map(D=>{const F=b.find(H=>H.value===D);return c.jsx(Ht.Item,{value:D,disabled:F.disabled,label:F.label,hint:F.hint,icon:F.icon},D)}));return c.jsx(ke,{open:m,onOpenChange:p,side:o,anchorRef:C,variant:I==="gloss"?"gloss":"default",children:c.jsx(ke.Content,{ref:d,matchAnchorWidth:!0,unstyled:!0,contentRole:void 0,align:r,offset:s,className:i.cn(BT,f.popover,n),...u,children:c.jsx(ke.Body,{className:i.cn(jT,f.popoverBody),children:c.jsx(Ht,{selectionIndicator:!0,size:P??O,...k,listId:S,"aria-labelledby":h?g:void 0,"aria-label":h?void 0:x,value:L,onValueChange:j,activeValue:R,onActiveValueChange:T,classNames:{item:f.listBoxItem,label:f.listBoxLabel,hint:f.listBoxHint,icon:f.listBoxIcon,empty:f.listBoxEmpty,header:f.listBoxHeader,headerText:f.listBoxHeaderText,...y},className:i.cn(MT,f.listBox,N),style:{maxHeight:A,...w},children:B})})})})});Ya.displayName="ComboBoxPopover";function tE({label:e,hint:t,error:n,labelId:o}){const r=wt();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:o,classNames:{root:r.label},children:e}):null,c.jsxs(za,{children:[c.jsx(Ua,{}),c.jsx(Wa,{})]}),c.jsx(Ya,{}),t!=null?c.jsx(Ga,{children:t}):null,n!=null?c.jsx(Va,{children:n}):null]})}function Re({value:e,defaultValue:t,onChange:n}){const o=e!==void 0,[r,s]=a.useState(t),l=o?e:r,u=a.useCallback(d=>{o||s(d),n==null||n(d)},[o,n]);return[l,u,o]}function Ue(e){return a.Children.toArray(e).some(t=>a.isValidElement(t))}function nE({children:e,label:t,hint:n,error:o,id:r,name:s,required:l=!1,status:u="default",size:d="base",options:f=JT,value:m,defaultValue:p,onValueChange:C,open:S,defaultOpen:g=!1,onOpenChange:h,variant:x,disabled:A=!1,placeholder:b="Select a value",menuMaxHeight:_="min(24rem, 70vh)"}){const L=ed({name:s,value:m,disabled:A}),v=L.bound,R=L.disabled??A,T=a.useId(),E=et(),I=x??((E==null?void 0:E.variant)!=null?i.fieldShellVariantFromButtonGroup(E.variant):"default"),O=r??`combobox-${T}`,{hintId:N,errorId:y,labelId:w,listId:P}=TT(O),{isCompound:k,hasLabel:j,hasHint:B,hasError:D}=a.useMemo(()=>{const te=Ue(e);return{isCompound:te,hasLabel:t!=null||te&&ge(e,"Label"),hasHint:n!=null||te&&ge(e,"ComboBoxHint"),hasError:o!=null||te&&ge(e,"ComboBoxError")}},[e,o,n,t]),F=m!==void 0||v,[H,U]=a.useState(p??""),G=v?String(L.value??""):F?m??"":H,K=a.useCallback(te=>{F||U(te),C==null||C(te),v&&L.setValue(te)},[v,L,F,C]),[V,oe]=Re({value:S,defaultValue:g,onChange:h}),[J,ee]=a.useState(""),[se,M]=a.useState(null),W=a.useRef(null),Y=a.useRef(null);a.useEffect(()=>{var te;!V||!se||(te=document.getElementById(`${P}-opt-${se}`))==null||te.scrollIntoView({block:"nearest"})},[se,P,V]);const Z=a.useMemo(()=>bf(f,J),[J,f]),ce=a.useMemo(()=>({comboBoxId:O,hintId:N,errorId:y,labelId:w,labelConnected:j,hintConnected:B,errorConnected:D,required:l,status:u,size:d,errorMessage:o}),[O,o,y,D,B,j,N,l,w,d,u]),z=a.useMemo(()=>({...ce,open:V,setOpen:oe,value:G,setValue:K,filterQuery:J,setFilterQuery:ee,listId:P,activeValue:se,setActiveValue:M,anchorRef:W,inputRef:Y,variant:I,disabled:R,placeholder:b,menuMaxHeight:_,options:f,filteredValues:Z,formInputRef:v?L.ref:void 0,formOnBlur:v?L.onBlur:void 0}),[se,R,ce,J,Z,v,L,P,_,V,f,b,K,G,I]),Q=a.useMemo(()=>({controlId:O,labelId:w,required:l}),[O,l,w]);return{isCompound:k,label:t,hint:n,error:o,children:e,fieldCtx:ce,comboCtx:z,fieldLabelCtx:Q}}function Af({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u,status:d,size:f,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:_,menuMaxHeight:L,name:v,...R}){const T=tt(),E=typeof v=="string"?v:void 0,I=E?T==null?void 0:T.getError(E):void 0,O=o??I,N=d==="default"&&I?"danger":d,y=f??(T==null?void 0:T.size)??"base",w=Vs(),P=nE({children:e,label:t,hint:n,error:O,id:l,name:v,required:u,status:N,size:y,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:_,menuMaxHeight:L});return c.jsx(Tv,{value:P.fieldCtx,children:c.jsx(Lv,{value:P.comboCtx,children:c.jsx(Ev,{classNames:s,children:c.jsx(Ge.Provider,{value:P.fieldLabelCtx,children:c.jsx(le,{className:i.cn(w&&i.BUTTON_GROUP_RADIUS_BRIDGE_CLASS,r,s==null?void 0:s.root),...R,children:P.isCompound?e:c.jsx(tE,{label:P.label,hint:P.hint,error:P.error,labelId:P.fieldCtx.labelId})})})})})})}Af.displayName="ComboBox";const vf=Object.assign(Af,{Label:xf,InputGroup:za,Input:Ua,Trigger:Wa,Popover:Ya,Hint:Ga,Error:Va}),_f=a.createContext(null),Zr=a.createContext({}),Lf=a.createContext(!1),Tf=a.createContext(null),Ef=a.createContext(null);function oE({value:e,children:t}){return c.jsx(_f.Provider,{value:e,children:t})}function rE({classNames:e,children:t}){const n=a.useContext(Zr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Zr.Provider,{value:o,children:t})}function Rf({value:e,children:t}){return c.jsx(Lf.Provider,{value:e,children:t})}function sE({value:e,children:t}){return c.jsx(Tf.Provider,{value:e,children:t})}function aE({value:e,children:t}){return c.jsx(Ef.Provider,{value:e,children:t})}function Vn(){const e=a.useContext(_f);if(!e)throw new Error("Dropdown.* components must be inside <Dropdown>.");return e}function Me(){return a.useContext(Zr)}function If(){return a.useContext(Lf)}function lE(){return a.useContext(Tf)}function yf(){const e=a.useContext(Ef);if(!e)throw new Error("DropdownSub.* components must be inside <DropdownSub>.");return e}function iE(e){return e==="vertical"?"vertical":void 0}const cE="box-border shrink-0",uE="my-xsmall h-0 w-full min-w-0 max-w-full border-t-token",dE="mx-xsmall min-h-[1.5rem] w-0 self-stretch border-l-token";function fE(e,t){return i.cn(cE,e==="horizontal"?uE:dE,t)}const $a=a.forwardRef(function({orientation:t="horizontal",className:n="",...o},r){const s=fE(t,n);return t==="horizontal"?c.jsx("hr",{ref:r,className:s,...o}):c.jsx("div",{ref:r,role:"separator","aria-orientation":iE(t),className:s,...o})});$a.displayName="Separator";const mE='[role="menuitem"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([disabled]), [role="menuitemradio"]:not([disabled])';function yo(e){return Array.from(e.querySelectorAll(mE)).filter(t=>!t.hasAttribute("disabled"))}function pt(e,t){const n=e[t];n&&n.focus()}function pE(e){return(e.textContent??"").trim().replace(/\s+/g," ")}function Nf(e,t,n){if(!ya(e.key,e))return!1;e.preventDefault();const o=t.map(pE),r=document.activeElement,s=r?t.indexOf(r):-1,l=wa(o,Na(n,e.key),s);return l>=0&&pt(t,l),!0}function CE({open:e,setOpen:t,triggerRef:n,contentRef:o}){const r=a.useRef(or());a.useLayoutEffect(()=>{var u;if(!e)return;const s=o.current;if(!s)return;(u=yo(s)[0])==null||u.focus()},[o,e]),a.useEffect(()=>{if(!e)return;const s=o.current;if(!s)return;const l=r.current,u=d=>{var C;if(d.key==="Escape"){d.preventDefault(),t(!1),(C=n.current)==null||C.focus();return}const f=yo(s);if(f.length===0)return;const m=document.activeElement,p=m?f.indexOf(m):-1;if(d.key==="ArrowDown"){d.preventDefault(),pt(f,p<f.length-1?p+1:0);return}if(d.key==="ArrowUp"){d.preventDefault(),pt(f,p>0?p-1:f.length-1);return}if(d.key==="Home"){d.preventDefault(),pt(f,0);return}if(d.key==="End"){d.preventDefault(),pt(f,f.length-1);return}Nf(d,f,l)};return s.addEventListener("keydown",u),()=>s.removeEventListener("keydown",u)},[o,e,t,n])}function gE({subOpen:e,portalMounted:t,panelRef:n,triggerRef:o,setOpen:r}){const s=a.useRef(or());a.useLayoutEffect(()=>{var f;if(!e||!t)return;const l=n.current,u=o.current;if(!l||!u||document.activeElement!==u)return;(f=yo(l)[0])==null||f.focus()},[n,t,e,o]),a.useEffect(()=>{if(!e||!t)return;const l=n.current;if(!l)return;const u=s.current,d=f=>{var S;if(f.key==="Escape"||f.key==="ArrowLeft"){f.preventDefault(),f.stopPropagation(),r(!1),(S=o.current)==null||S.focus();return}const m=yo(l);if(m.length===0)return;const p=document.activeElement,C=p?m.indexOf(p):-1;if(f.key==="ArrowDown"){f.preventDefault(),pt(m,C<m.length-1?C+1:0);return}if(f.key==="ArrowUp"){f.preventDefault(),pt(m,C>0?C-1:m.length-1);return}if(f.key==="Home"){f.preventDefault(),pt(m,0);return}if(f.key==="End"){f.preventDefault(),pt(m,m.length-1);return}Nf(f,m,u)};return l.addEventListener("keydown",d),()=>l.removeEventListener("keydown",d)},[n,t,r,e,o])}function SE({subOpen:e,triggerRef:t,menuTriggerRef:n,subPanelRootsRef:o,popoverVariant:r,portalContainer:s}){const l=r==="gloss",u=a.useRef(null),[d,f]=a.useState({top:0,left:0,minW:0}),[m,p]=a.useState(!1);e&&!m&&p(!0);const C=a.useCallback(()=>{const S=t.current;if(!S)return;const g=S.getBoundingClientRect(),h=6,x=Math.max(g.width,160);let A=g.right+h,b=g.top;const _=x;A+_>window.innerWidth-12&&(A=Math.max(12,g.left-_-h));const L=u.current,v=(L==null?void 0:L.offsetHeight)??0;if(v>0&&b+v>window.innerHeight-8&&(b=Math.max(8,window.innerHeight-v-8)),fn(s)&&s){const R=s.getBoundingClientRect();f({top:b-R.top+s.scrollTop,left:A-R.left+s.scrollLeft,minW:x});return}f({top:b,left:A,minW:x})},[s,t]);return a.useLayoutEffect(()=>{if(!e||!m)return;C();const S=window.requestAnimationFrame(()=>C());return()=>window.cancelAnimationFrame(S)},[e,m,C]),a.useEffect(()=>{if(!e||!m)return;const S=()=>C();return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[e,m,C]),a.useLayoutEffect(()=>{const S=u.current,g=o.current;if(!(!m||!S))return g.add(S),()=>{g.delete(S)}},[m,o]),a.useLayoutEffect(()=>{if(!m)return;const S=u.current;if(!S)return;const g=Rt();let h=!1;if(g)return i.killMotion(S),e?ar(S):p(!1),()=>{h=!0};if(i.killMotion(S),e)return lr({surface:S,vars:{...i.motionTooltip(),overwrite:"auto"}}),()=>{h=!0,i.killMotion(S)};const x=ir({surface:S,vars:{...i.motionTooltip(),overwrite:"auto"},onComplete:()=>{h||p(!1)}});return()=>{h=!0,i.killMotion(S),x.kill()}},[e,m]),{isGlossPanel:l,panelRef:u,pos:d,portalMounted:m,menuTriggerRef:n,contained:fn(s)}}const hE="relative inline-flex";function xE({inJoinedButtonGroup:e,className:t}={}){return i.cn(hE,e&&i.BUTTON_GROUP_RADIUS_BRIDGE_CLASS,t)}const tc="inline-flex outline-none focus-ring",bE="z-dropdown",AE="max-h-[min(24rem,70vh)] gap-xsmall overflow-y-auto overflow-x-hidden p-base text-left outline-none",vE="flex min-w-0 flex-col gap-xsmall text-left",_E="px-base text-left",LE="text-muted",TE="relative min-w-0",EE="flex w-full min-w-0 cursor-pointer items-center gap-base rounded-mid px-base py-small text-left outline-none text-base text-foreground focus-ring",RE="min-w-0 flex-1",IE="shrink-0 text-muted icon-base",yE="fixed z-dropdown-sub outline-none",NE="flex max-h-[min(22rem,65vh)] flex-col overflow-y-auto overflow-x-hidden rounded-mid border-token bg-surface p-base text-left shadow-token-mid",wE="gloss-panel gloss-deep flex max-h-[min(22rem,65vh)] min-w-0 origin-center flex-col overflow-hidden rounded-mid text-foreground",OE="gloss-content flex min-h-0 flex-col overflow-y-auto overflow-x-hidden p-base text-left",PE="w-full min-w-0 origin-center rounded-mid px-base py-small text-left no-underline outline-none text-base",DE="cursor-not-allowed bg-transparent text-muted opacity-45 hover:bg-transparent",kE={default:i.cn("text-foreground",i.hoverVariant(),"focus-ring"),danger:i.cn("text-danger",i.hoverVariant("danger"),"focus-ring [--color-focus-ring:var(--color-focus-ring-danger)]"),warning:i.cn("text-warning",i.hoverVariant("warning"),"focus-ring [--color-focus-ring:var(--color-focus-ring-warning)]"),info:i.cn("text-info",i.hoverVariant("info"),"focus-ring [--color-focus-ring:var(--color-focus-ring-info)]"),success:i.cn("text-success",i.hoverVariant("success"),"focus-ring [--color-focus-ring:var(--color-focus-ring-success)]")};function BE({status:e,disabled:t,hasHint:n,showIndicatorSlot:o,hasIcon:r,className:s,slotClass:l}){return i.cn(PE,jd(n,ye.base.listItemGapX,o,r),!t&&i.cn("cursor-pointer",kE[e]),t&&DE,l,s)}function jE({className:e,slotClass:t}){return i.cn(EE,i.hoverVariant(),t,e)}function ME({isGlossPanel:e,subOpen:t,portalMounted:n,className:o,slotClass:r}){return i.cn(yE,!e&&NE,!t&&n&&"pointer-events-none",r,o)}function FE({slotClassNames:e,classNames:t}){return{root:i.cn(e.itemIndicatorShell,t==null?void 0:t.root,t==null?void 0:t.itemIndicatorShell),fill:i.cn(e.itemIndicatorFill,t==null?void 0:t.fill,t==null?void 0:t.itemIndicatorFill),mark:i.cn(e.itemIndicatorMark,t==null?void 0:t.mark,t==null?void 0:t.itemIndicatorMark)}}function nc(e){return e==null?[]:Array.isArray(e)?[...e]:[e]}function HE(e){return Ud(e)}function GE({children:e,href:t,selection:n,value:o,disabled:r=!1,status:s="default"}){const{selected:l,selectItem:u,multiple:d,indicatorMode:f,setOpen:m}=Vn(),p=If(),C=a.useMemo(()=>HE(e),[e]),S=C.indicator!=null,g=C.hint!=null,h=C.icon!=null,x=!!t,A=!x&&n!==!1,b=A&&(d||p||S),_=b?f==="multi"?"menuitemcheckbox":"menuitemradio":"menuitem",L=A&&o!=null&&l.has(o),v=a.useMemo(()=>({showIndicatorSlot:b,hasHint:g,hasIcon:h,selected:L,indicatorMode:f,disabled:r,mutedHint:r||s==="default"}),[r,g,h,f,L,b,s]);return{parts:C,selectItem:u,indicatorMode:f,setOpen:m,hasItemIndicator:S,hasHint:g,hasIcon:h,isLink:x,isSelectionItem:A,showIndicatorSlot:b,itemRole:_,isSelected:L,itemCtx:v}}function wf({className:e,...t}){const n=Me();return c.jsx(Hd,{className:i.cn(n.itemLabel,e),...t})}wf.displayName="DropdownItemLabel";function Of({className:e,...t}){const n=Me();return c.jsx(Gd,{className:i.cn(n.itemHint,e),...t})}Of.displayName="DropdownItemHint";function Pf({className:e,...t}){const n=Me();return c.jsx(Vd,{className:i.cn(n.itemIcon,e),...t})}Pf.displayName="DropdownItemIcon";function Xa({variant:e="default",size:t="small",check:n,children:o,className:r,classNames:s,...l}){const u=Hn("Dropdown.ItemIndicator"),d=Me();if(!u.showIndicatorSlot)return null;const f=n??u.indicatorMode==="multi";return c.jsx(zd,{className:i.cn(d.itemIndicator,s==null?void 0:s.itemIndicator,r),...l,children:c.jsx(Be,{variant:e,size:t,selected:u.selected,check:f,classNames:FE({slotClassNames:d,classNames:s}),children:o})})}Xa.displayName="DropdownItemIndicator";const VE=a.forwardRef(function({children:t,className:n,value:o,href:r,disabled:s=!1,selection:l,status:u="default",onClick:d,onPointerDown:f,...m},p){const C=Me(),{parts:S,selectItem:g,setOpen:h,hasItemIndicator:x,hasHint:A,hasIcon:b,isLink:_,isSelectionItem:L,showIndicatorSlot:v,itemRole:R,isSelected:T,itemCtx:E}=GE({children:t,href:r,selection:l,value:o,disabled:s,status:u}),I=a.useCallback(P=>{ue(p,P)},[p]),O=BE({status:u,disabled:s,hasHint:A,showIndicatorSlot:v,hasIcon:b,className:n,slotClass:C.item}),N=a.useCallback(P=>{if(f==null||f(P),P.defaultPrevented||s)return;const k=P.currentTarget;!k||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(k)},[s,f]),y=a.useCallback(P=>{if(d==null||d(P),!(P.defaultPrevented||s)){if(!L){h(!1);return}o!=null&&g(o)}},[s,L,d,g,h,o]),w=c.jsxs(c.Fragment,{children:[v&&!x?c.jsx(Xa,{}):null,S.indicator,S.label,S.hint,S.icon,S.rest]});return _?c.jsx(Xr,{value:E,children:c.jsx("a",{ref:I,role:R,href:s?void 0:r,tabIndex:-1,"aria-disabled":s||void 0,className:O,onClick:y,onPointerDown:N,...m,children:w})}):c.jsx(Xr,{value:E,children:c.jsx("button",{ref:I,type:"button",role:R,disabled:s,tabIndex:-1,"aria-checked":v?T:void 0,className:O,onClick:y,onPointerDown:N,...m,children:w})})}),Df=a.memo(VE);Df.displayName="Dropdown.Item";function zE(e){const[t,n]=a.useState(!1),o=a.useRef(null),r=a.useRef(void 0);a.useEffect(()=>{e||n(!1)},[e]);const s=a.useCallback(()=>{window.clearTimeout(r.current),r.current=void 0},[]),l=a.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n(!1)},160)},[]);return{contextValue:a.useMemo(()=>({open:t,setOpen:n,triggerRef:o,scheduleClose:l,cancelClose:s}),[t,l,s])}}const kf=a.forwardRef(function({className:t,children:n,...o},r){const{open:s}=Vn(),l=Me(),{contextValue:u}=zE(s);return c.jsx(aE,{value:u,children:c.jsx("div",{ref:r,className:i.cn(TE,l.sub,t),...o,children:n})})});kf.displayName="Dropdown.Sub";const Bf=a.forwardRef(function({className:t,children:n,asChild:o,icon:r,onPointerEnter:s,onPointerLeave:l,onClick:u,onKeyDown:d,...f},m){const{open:p,setOpen:C,triggerRef:S,scheduleClose:g,cancelClose:h}=yf(),x=Me(),A=a.useCallback(R=>{s==null||s(R),!R.defaultPrevented&&(h(),C(!0))},[h,s,C]),b=a.useCallback(R=>{l==null||l(R),!R.defaultPrevented&&g()},[l,g]),_=a.useCallback(R=>{u==null||u(R),!R.defaultPrevented&&(h(),C(!0))},[h,u,C]),L=a.useCallback(R=>{if(d==null||d(R),!R.defaultPrevented){if(R.key==="Enter"||R.key===" "||R.key==="ArrowRight"){R.preventDefault(),h(),C(!0);return}R.key==="ArrowLeft"&&p&&(R.preventDefault(),C(!1))}},[h,d,p,C]),v=jE({className:t,slotClass:x.subTrigger});if(o&&a.isValidElement(n)){const R=n;return a.cloneElement(R,{...f,ref:(T=>{ue(m,T),ue(S,T),R.props.ref&&ue(R.props.ref,T)}),className:i.cn(R.props.className,v),onPointerEnter:T=>{var E,I;(I=(E=R.props).onPointerEnter)==null||I.call(E,T),A(T)},onPointerLeave:T=>{var E,I;(I=(E=R.props).onPointerLeave)==null||I.call(E,T),b(T)},onClick:T=>{var E,I;(I=(E=R.props).onClick)==null||I.call(E,T),_(T)},onKeyDown:T=>{var E,I;(I=(E=R.props).onKeyDown)==null||I.call(E,T),L(T)},role:"menuitem","aria-expanded":p,"aria-haspopup":"menu"})}return c.jsxs("div",{ref:R=>{ue(m,R),ue(S,R)},role:"menuitem",tabIndex:-1,"aria-expanded":p,"aria-haspopup":"menu",className:v,onPointerEnter:A,onPointerLeave:b,onClick:_,onKeyDown:L,...f,children:[c.jsx("span",{className:i.cn(RE,x.subTriggerLabelWrap),children:n}),r!==void 0?r:c.jsx(be.IoChevronForward,{className:i.cn(IE,x.subTriggerChevron),"aria-hidden":!0})]})});Bf.displayName="Dropdown.SubTrigger";const jf=a.forwardRef(function({children:t,className:n,style:o,onPointerEnter:r,onPointerLeave:s,portalContainer:l,...u},d){const{open:f,triggerRef:m,scheduleClose:p,cancelClose:C,setOpen:S}=yf(),{subPanelRootsRef:g,triggerRef:h,popoverVariant:x,portalContainer:A}=Vn(),b=Me(),_=SE({subOpen:f,triggerRef:m,menuTriggerRef:h,subPanelRootsRef:g,popoverVariant:x,portalContainer:l??A});gE({subOpen:f,portalMounted:_.portalMounted,panelRef:_.panelRef,triggerRef:m,setOpen:S});const L=a.useCallback(I=>{r==null||r(I),!I.defaultPrevented&&C()},[C,r]),v=a.useCallback(I=>{s==null||s(I),!I.defaultPrevented&&p()},[s,p]);if(!_.portalMounted)return null;const R=An(h.current),T=c.jsx("div",{ref:I=>{ue(d,I),ue(_.panelRef,I)},...R,role:"menu",className:ME({isGlossPanel:_.isGlossPanel,subOpen:f,portalMounted:_.portalMounted,className:n,slotClass:b.subContent}),style:{position:_.contained?"absolute":"fixed",top:_.pos.top,left:_.pos.left,minWidth:_.pos.minW,...o},...u,onPointerEnter:L,onPointerLeave:v,children:_.isGlossPanel?c.jsx("div",{className:i.cn(wE,b.subContentGlossPanel),children:c.jsx("div",{className:i.cn(OE,b.subContentGlossContent),children:t})}):t}),E=typeof document<"u"?gt(l??A):null;return E?Ut.createPortal(T,E):null});jf.displayName="Dropdown.SubContent";const Mf=a.forwardRef(function({children:t,className:n,asChild:o,onClick:r,onPointerDown:s,onKeyDown:l,...u},d){const{open:f,setOpen:m,triggerRef:p,contentId:C}=Vn(),S=Me(),g=At(),h=a.useCallback(b=>{f||g.current||b.button!==0||(b.preventDefault(),bt({triggerRef:p,openingRef:g,setOpen:()=>m(!0)}))},[f,g,p,m]),x=a.useCallback(b=>{r==null||r(b),!b.defaultPrevented&&f&&m(!1)},[r,f,m]),A=a.useCallback(b=>{l==null||l(b),!b.defaultPrevented&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f?m(!1):g.current||m(!0))},[l,f,g,m]);if(o&&a.isValidElement(t)){const b=t;return a.cloneElement(b,yt(b,{...u,className:i.cn(tc,S.trigger,n),onPointerDown:_=>{h(_),s==null||s(_)},onClick:x,onKeyDown:A,"aria-expanded":f,"aria-haspopup":"menu","aria-controls":f?C:void 0},$e(d,p),{runBeforeChild:["onPointerDown"]}))}return c.jsx("button",{type:"button",ref:b=>{ue(d,b),ue(p,b)},className:i.cn(tc,S.trigger,n),"aria-expanded":f,"aria-haspopup":"menu","aria-controls":f?C:void 0,onPointerDown:b=>{s==null||s(b),h(b)},onClick:x,onKeyDown:A,...u,children:t})});Mf.displayName="Dropdown.Trigger";const Ff=a.forwardRef(function({children:t,className:n,bodyClassName:o,variant:r,side:s="bottom",align:l,offset:u=Gn,portalContainer:d,...f},m){const{open:p,setOpen:C,triggerRef:S,contentRef:g,contentId:h,subPanelRootsRef:x,popoverVariant:A,portalContainer:b}=Vn(),_=Me(),L=r??A,v=a.useCallback(R=>{for(const T of x.current)if(T.contains(R))return!1;return!0},[x]);return CE({open:p,setOpen:C,triggerRef:S,contentRef:g}),c.jsx(ke,{open:p,onOpenChange:C,side:s,variant:L,anchorRef:S,shouldDismiss:v,portalContainer:d??b,children:c.jsx(ke.Content,{ref:R=>{ue(m,R),ue(g,R)},matchAnchorWidth:!0,unstyled:!0,contentRole:void 0,align:l,offset:u,id:h,className:i.cn(bE,_.popover,n),...f,children:c.jsx(ke.Body,{role:"menu",className:i.cn(AE,_.popoverBody,o),children:t})})})});Ff.displayName="Dropdown.Popover";const Hf=a.forwardRef(function({className:t,children:n,selectionIndicator:o,...r},s){const l=If(),u=Me(),d=o!==void 0?o:l,[f,m]=a.useState(),p=a.useCallback(C=>{m(C)},[]);return c.jsx(Rf,{value:d,children:c.jsx(sE,{value:p,children:c.jsx("div",{ref:s,role:"group","aria-labelledby":f,className:i.cn(vE,u.group,t),...r,children:n})})})});Hf.displayName="Dropdown.Group";const Gf=a.forwardRef(function({className:t,children:n,id:o,...r},s){const l=a.useId(),u=o??l,d=lE(),f=Me();return a.useLayoutEffect(()=>(d==null||d(u),()=>d==null?void 0:d(void 0)),[u,d]),c.jsx("div",{ref:s,id:u,className:i.cn(_E,f.label,t),...r,children:c.jsx(q,{as:"span",variant:"small",className:LE,children:n})})});Gf.displayName="Dropdown.Label";function Vf({className:e,...t}){const n=Me();return c.jsx($a,{className:i.cn(n.separator,e),...t})}Vf.displayName="Dropdown.Separator";function UE({open:e,defaultOpen:t=!1,onOpenChange:n,multiple:o=!1,value:r,defaultValue:s,onValueChange:l,closeOnSelect:u,popoverVariant:d="default",portalContainer:f}){const m=e!==void 0,[p,C]=a.useState(t),S=m?e:p,g=a.useRef(null),h=a.useRef(null),x=a.useRef(null);x.current||(x.current=new Set);const A=a.useId(),b=a.useCallback(w=>{m||C(w),n==null||n(w),w||requestAnimationFrame(()=>{var P;(P=g.current)==null||P.focus({preventScroll:!0})})},[m,n]),_=r!==void 0,[L,v]=a.useState(()=>nc(s)),R=_?nc(r):L,T=a.useMemo(()=>new Set(R),[R]),E=a.useRef(R);E.current=R;const I=a.useCallback(w=>{_||v(w),l==null||l(o?w:w[0]??"")},[_,o,l]),O=a.useCallback(w=>{const P=Ba(E.current,w,o);E.current=P,I(P),(u??!o)&&b(!1)},[u,o,b,I]),N=o?"multi":"radio";return{contextValue:a.useMemo(()=>({open:S,setOpen:b,multiple:o,selected:T,selectItem:O,indicatorMode:N,closeOnSelect:u??!o,popoverVariant:d,triggerRef:g,contentRef:h,contentId:A,subPanelRootsRef:x,portalContainer:f}),[S,b,o,T,O,N,u,d,A,f,x])}}function zf({children:e,className:t,classNames:n,open:o,defaultOpen:r,onOpenChange:s,multiple:l,value:u,defaultValue:d,onValueChange:f,selectionIndicator:m=!1,closeOnSelect:p,popoverVariant:C,portalContainer:S,...g}){const{contextValue:h}=UE({open:o,defaultOpen:r,onOpenChange:s,multiple:l,value:u,defaultValue:d,onValueChange:f,closeOnSelect:p,popoverVariant:C,portalContainer:S}),x=Vs();return c.jsx(oE,{value:h,children:c.jsx(rE,{classNames:n,children:c.jsx(Rf,{value:m,children:c.jsx("div",{className:xE({inJoinedButtonGroup:x,className:i.cn(n==null?void 0:n.root,t)}),...g,children:e})})})})}zf.displayName="Dropdown";const WE=Object.assign(Xa,{Fill:Be.Fill,Mark:Be.Mark}),Gt=Object.assign(zf,{Trigger:Mf,Popover:Ff,Group:Hf,Label:Gf,Separator:Vf,Item:Df,ItemLabel:wf,ItemHint:Of,ItemIcon:Pf,ItemIndicator:WE,Sub:kf,SubTrigger:Bf,SubContent:jf}),Ka=a.createContext(null),Qr=a.createContext({});function YE({value:e,children:t}){return c.jsx(Ka.Provider,{value:e,children:t})}function $E({classNames:e,children:t}){const n=a.useContext(Qr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Qr.Provider,{value:o,children:t})}function Uf(){const e=a.useContext(Ka);if(!e)throw new Error("Input compound parts must be used inside <Input>.");return e}function XE(){return a.useContext(Ka)}function vt(){return a.useContext(Qr)}function KE(e){return i.killMotion(e),new Promise(t=>{$.to(e,{scale:.94,y:"-0.5rem",autoAlpha:0,...i.motionInteractive(),overwrite:"auto",onComplete:()=>{i.killMotion(e),t()}})})}function qE({shellRef:e,blocked:t,variant:n,groupSegment:o,onPointerDown:r}){const s=n==="gloss",l=i.useFieldShellHoverLift(e,!t&&!s&&o==null),u=i.useGlossFieldShellMotion(e,!t&&s&&o==null),d=a.useCallback(m=>{e.current=m,!t&&s&&u.bindShellRef(m)},[t,u,s,e]),f=a.useCallback(m=>{if(r==null||r(m),m.defaultPrevented||t||s||o!=null)return;const p=e.current;!p||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(p)},[t,o,s,r,e]);return{isGloss:s,setShellRef:d,handleShellPointerDown:f,shellPointerDown:s&&!t?u.onShellPointerDown:f,shellPointerEnter:s&&!t?u.onShellPointerEnter:l.onShellPointerEnter,shellPointerLeave:s&&!t?u.onShellPointerLeave:l.onShellPointerLeave,shellFocusCapture:s&&!t?u.onShellFocusIn:void 0,shellBlurCapture:s&&!t?u.onShellFocusOut:void 0,shellHoverMotionClass:s?u.shellHoverMotionClass:l.shellHoverMotionClass,glossDisabledAttr:t&&s?{"data-gloss-disabled":""}:{}}}function ZE(e,t){const n=new DataTransfer;t.forEach(o=>n.items.add(o)),e.files=n.files}function QE(e=Se.showPassword){return e}function JE(e=Se.hidePassword){return e}function eR(e=Se.removeFile){return e}const tR="bg-primary-tint",nR="flex items-stretch overflow-hidden",oR="relative",rR=`min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted ${we}`,sR=`absolute inset-0 cursor-pointer opacity-0 disabled:cursor-not-allowed ${we}`,aR="pointer-events-none size-12 shrink-0 text-muted",lR="flex size-9 shrink-0 items-center justify-center rounded-base bg-surface text-muted border-token",iR="icon-mid shrink-0",cR="icon-mid shrink-0",oc="shrink-0",uR="pointer-events-none max-w-[18rem] text-center text-muted",rc="size-9 shrink-0 rounded-base border-token object-cover",dR="flex min-w-0 items-center gap-base",fR="flex h-full min-w-0 flex-1 items-center gap-base",sc="min-w-0 flex-1 truncate",mR="relative z-10 flex size-8 shrink-0 items-center justify-center rounded-base text-danger outline-none",pR="flex self-stretch shrink-0 items-stretch border-l-token",CR="relative z-10 flex h-full items-center justify-center text-muted outline-none hover:text-foreground focus-ring-inset",gR="border-r-token",SR="border-l-token",hR={small:i.affixSlotClass("small"),base:i.affixSlotClass("base"),mid:i.affixSlotClass("mid"),large:i.affixSlotClass("large")},xR={small:i.CONTROL_SIZE_LAYOUT.small.controlPad,base:i.CONTROL_SIZE_LAYOUT.base.controlPad,mid:i.CONTROL_SIZE_LAYOUT.mid.controlPad,large:i.CONTROL_SIZE_LAYOUT.large.controlPad},Wf={small:{icon:"icon-small",pad:"px-xsmall"},base:{icon:"icon-base",pad:"px-small"},mid:{icon:"icon-mid",pad:"px-base"},large:{icon:"icon-large",pad:"px-base"}};function Yf(e="default"){return tR}function bR({side:e,status:t,size:n,slotClass:o}){return i.cn(hR[n],Yf(t),e==="prefix"?gR:SR,o)}function AR({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function vR(e){return e!=null?i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e),"relative focus-within:z-[2]"):"rounded-base"}function _R({variant:e,status:t,blocked:n,groupSegment:o,fileListEmpty:r,shellSurface:s,shellFileEmptySurface:l,shellHoverMotionClass:u,className:d,slotClass:f}){const m=e==="gloss";return i.cn(nR,m&&oR,(o==null?void 0:o.orientation)==="horizontal"?"min-w-0 flex-1":"w-full",r?"min-h-[7.25rem]":i.cn(m?"":"border-1"),vR(o),l??s,i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),!m&&i.fieldShellHoverClass(!n,t,e),u,n&&"cursor-not-allowed opacity-55 shadow-token-base",f,d)}function LR(e){return i.cn("relative flex min-h-[6.5rem] min-w-0 flex-1 flex-col items-center justify-center gap-mid px-xlarge py-2xlarge",e)}function TR({multipleFiles:e,slotClass:t}){return i.cn("relative min-w-0 flex-1 px-xlarge py-base",e?"flex flex-col gap-base":"flex h-full items-center gap-mid",t)}function ER({size:e,disabled:t,slotClass:n}){const o=Wf[e];return i.cn(CR,i.TEXT_COLOR_TRANSITION,i.affixToggleMinWClass(e),o.pad,t?"cursor-not-allowed opacity-45":"cursor-pointer",n)}function RR({disabled:e,slotClass:t}){return i.cn(mR,i.TEXT_COLOR_TRANSITION,i.hoverVariant("danger"),"focus-ring",e&&"pointer-events-none opacity-40",t)}function ac({side:e,status:t,controlSize:n,children:o}){const r=vt();return c.jsx("span",{className:bR({side:e,status:t,size:n,slotClass:e==="prefix"?r.prefix:r.suffix}),children:o})}function IR({status:e,controlSize:t,visible:n,disabled:o,onToggle:r}){const s=Ie(),l=vt(),u=Wf[t];return c.jsx("span",{className:i.cn(pR,Yf(e)),children:c.jsx("button",{type:"button",disabled:o,"aria-label":n?JE(s.hidePassword):QE(s.showPassword),"aria-pressed":n,onClick:d=>{d.preventDefault(),d.stopPropagation(),r()},onPointerDown:d=>d.stopPropagation(),className:ER({size:t,disabled:o,slotClass:l.passwordToggle}),children:n?c.jsx(be.IoEyeOff,{className:i.cn(oc,u.icon),"aria-hidden":!0}):c.jsx(be.IoEye,{className:i.cn(oc,u.icon),"aria-hidden":!0})})})}function lc({className:e}){const t=vt();return c.jsx("span",{className:i.cn(lR,t.fileGlyph,e),"aria-hidden":!0,children:c.jsx(be.IoFolderOpen,{className:iR,"aria-hidden":!0})})}function ic({disabled:e,onRemove:t}){const n=eR(St("removeFile")),o=vt();return c.jsx("button",{type:"button",disabled:e,title:n,"aria-label":n,onClick:r=>{r.preventDefault(),r.stopPropagation(),t(r)},onPointerDown:r=>r.stopPropagation(),className:RR({disabled:e,slotClass:o.fileRemove}),children:c.jsx(be.IoClose,{className:cR,"aria-hidden":!0})})}const qa=a.forwardRef(function({variant:t="default",status:n,size:o,inputType:r="text",placeholder:s,prefix:l,suffix:u,id:d,disabled:f,readOnly:m,className:p="",groupSegment:C,onPointerDown:S,onChange:g,onBlur:h,"aria-describedby":x,name:A,value:b,..._},L){const v=ca({name:typeof A=="string"?A:void 0,value:b,onChange:g,onBlur:h,disabled:f,readOnly:m,type:r}),R=v.name??A,T=v.bound?v.value:b,E=v.onChange,I=v.onBlur,O=v.disabled??f,N=v.readOnly??m,y=v.ref,w=XE(),P=tt(),k=vt(),j=$t(),B=et(),D=a.useId(),F=d??(w==null?void 0:w.inputId)??D,H=n??(w==null?void 0:w.status)??"default",U=o??(w==null?void 0:w.size)??(P==null?void 0:P.size)??((B==null?void 0:B.buttonSize)??"base"),G=(w==null?void 0:w.required)??!1,K=(w==null?void 0:w.hintConnected)??!1,V=(w==null?void 0:w.errorConnected)??!1,oe=w==null?void 0:w.hintId,J=w==null?void 0:w.errorId,ee=x??je(K?oe:void 0,V?J:void 0),se=j!=null&&j.segmented?void 0:C??(B==null?void 0:B.segment),M=a.useRef(null),W=a.useRef(null),Y=a.useCallback(ie=>{W.current=ie,y(ie),typeof L=="function"?L(ie):L&&(L.current=ie)},[L,y]),Z=!!(O||N),ce=t==="gloss",z=qE({shellRef:M,blocked:Z,variant:t,groupSegment:se,onPointerDown:S}),Q=r==="file",te=r==="password",[me,Ae]=a.useState(!1),[he,X]=a.useState([]);a.useEffect(()=>{te||Ae(!1)},[te]);const re=a.useMemo(()=>he.map(ie=>({file:ie,previewUrl:ie.type.startsWith("image/")?URL.createObjectURL(ie):null})),[he]);a.useEffect(()=>{const ie=re.map(xe=>xe.previewUrl).filter(xe=>xe!=null);return()=>{for(const xe of ie)URL.revokeObjectURL(xe)}},[re]),a.useEffect(()=>{if(!Q)return;const ie=W.current,xe=ie==null?void 0:ie.form;if(!xe)return;const Je=()=>X([]);return xe.addEventListener("reset",Je),()=>xe.removeEventListener("reset",Je)},[Q]);const pe=a.useCallback(ie=>{const xe=ie.target.files;X(xe?Array.from(xe):[]),E==null||E(ie)},[E]),fe=a.useCallback((ie,xe)=>{if(Z)return;const Je=()=>{X(Ir=>{const oo=Ir.filter(yr=>yr!==ie),Bt=W.current;return Bt&&ZE(Bt,oo),Bt&&(g==null||g({target:Bt,currentTarget:Bt})),oo})};if(!xe||i.prefersReducedMotion()){Je();return}KE(xe).then(Je)},[Z,g]),_e=ie=>xe=>{const Je=xe.currentTarget.closest("[data-file-row]");fe(ie,Je instanceof HTMLElement?Je:null)},Lt=he.length>1,it=Q&&he.length===0,Qe=!Q,de=AR({variant:t}),Le=it?i.cn(de,!ce&&"border-2 border-dashed"):null;return c.jsxs("div",{ref:z.setShellRef,"data-slot":"input-shell",role:"presentation",onPointerDown:z.shellPointerDown,onPointerEnter:z.shellPointerEnter,onPointerLeave:z.shellPointerLeave,onFocusCapture:z.shellFocusCapture,onBlurCapture:z.shellBlurCapture,...z.glossDisabledAttr,className:_R({variant:t,status:H,blocked:Z,groupSegment:se,fileListEmpty:it,shellSurface:de,shellFileEmptySurface:Le,shellHoverMotionClass:z.shellHoverMotionClass,className:p,slotClass:k.shell}),children:[Qe&&l!=null?c.jsx(ac,{side:"prefix",status:H,controlSize:U,children:l}):null,Q?c.jsxs("div",{className:it?LR(k.fileArea):TR({multipleFiles:Lt,slotClass:k.fileArea}),children:[it?c.jsxs(c.Fragment,{children:[c.jsx(be.IoFolderOpen,{className:i.cn(aR,k.fileEmpty),"aria-hidden":!0}),c.jsx(q,{as:"span",variant:"base",className:i.cn(uR,k.fileEmpty),children:s??"Select file"})]}):Lt?re.map(({file:ie,previewUrl:xe})=>c.jsxs("div",{"data-file-row":"",className:i.cn(dR,k.fileRow),children:[xe?c.jsx("img",{src:xe,alt:"",className:i.cn(rc,k.filePreview)}):c.jsx(lc,{}),c.jsx(q,{as:"span",variant:"base",className:sc,children:ie.name}),Z?null:c.jsx(ic,{onRemove:_e(ie)})]},`${ie.name}-${ie.size}-${ie.lastModified}`)):c.jsxs("div",{"data-file-row":"",className:i.cn(fR,k.fileRow),children:[re[0].previewUrl?c.jsx("img",{src:re[0].previewUrl,alt:"",className:i.cn(rc,k.filePreview)}):c.jsx(lc,{}),c.jsx(q,{as:"span",variant:"base",className:sc,children:re[0].file.name}),Z?null:c.jsx(ic,{onRemove:_e(re[0].file)})]}),c.jsx("input",{ref:Y,id:F,name:R,type:"file",disabled:O,readOnly:N,onChange:pe,onBlur:I,"aria-required":G||void 0,"aria-invalid":v["aria-invalid"]??(H==="danger"?!0:void 0),"aria-describedby":ee,className:sR,..._})]}):c.jsx("input",{ref:Y,id:F,name:R,type:te?me?"text":"password":r,disabled:O,readOnly:N,placeholder:s,value:T,onChange:E,onBlur:I,"aria-required":G||void 0,"aria-invalid":v["aria-invalid"]??(H==="danger"?!0:void 0),"aria-describedby":ee,className:i.cn(rR,xR[U],k.control,we),..._}),Qe&&u!=null?c.jsx(ac,{side:"suffix",status:H,controlSize:U,children:u}):null,Qe&&te?c.jsx(IR,{status:H,controlSize:U,visible:me,disabled:f,onToggle:()=>Ae(ie=>!ie)}):null]})});qa.displayName="InputControl";function $f({className:e,classNames:t,...n}){const o=vt();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}$f.displayName="InputLabel";function Za({children:e,status:t,className:n,id:o,...r}){const s=Uf(),l=vt(),u=t??(s.status==="danger"||s.status==="default"?"default":s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}Za.displayName="InputHint";function Qa({children:e,className:t,id:n,...o}){const r=Uf(),s=vt();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Qa.displayName="InputError";function yR({label:e,hint:t,error:n,inputId:o,labelId:r,size:s,status:l,controlProps:u}){const d=vt();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:r,classNames:{root:d.label},children:e}):null,c.jsx(qa,{id:o,size:s,status:l,...u}),t!=null?c.jsx(Za,{children:t}):null,n!=null?c.jsx(Qa,{children:n}):null]})}function NR({children:e,label:t,hint:n,error:o,id:r,required:s=!1,status:l="default",size:u="base"}){const d=a.useId(),f=r??`input-${d}`,m=Ve(f),p=ze(f),C=`${f}-label`,{isCompound:S,hasHint:g,hasError:h}=a.useMemo(()=>{const b=Ue(e);return{isCompound:b,hasHint:n!=null||b&&ge(e,"InputHint"),hasError:o!=null||b&&ge(e,"InputError")}},[e,o,n]),x=a.useMemo(()=>({inputId:f,hintId:m,errorId:p,labelId:C,hintConnected:g,errorConnected:h,required:s,status:l,size:u}),[p,h,g,m,f,s,C,u,l]),A=a.useMemo(()=>({controlId:f,labelId:C,required:s}),[f,s,C]);return{fieldCtx:x,fieldLabelCtx:A,isCompound:S,inputId:f,label:t,hint:n,error:o,status:l,size:u}}function wR({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u=!1,status:d="default",size:f="base",...m}){const p=tt(),C=typeof m.name=="string"?m.name:void 0,S=C?p==null?void 0:p.getError(C):void 0,g=o??S,h=d==="default"&&S?"danger":d,x=f??(p==null?void 0:p.size)??"base",A=NR({children:e,label:t,hint:n,error:g,id:l,required:u,status:h,size:x}),b=A.isCompound?e:c.jsx(yR,{label:A.label,hint:A.hint,error:A.error,inputId:A.inputId,labelId:A.fieldCtx.labelId,size:A.size,status:A.status,controlProps:m});return c.jsx(YE,{value:A.fieldCtx,children:c.jsx($E,{classNames:s,children:c.jsx(Ge.Provider,{value:A.fieldLabelCtx,children:c.jsx(le,{className:i.cn(s==null?void 0:s.root,r),children:b})})})})}const Xf=Object.assign(wR,{Label:$f,Control:qa,Hint:Za,Error:Qa});function OR(e,t=Se.openSearch){return e??t}function PR(e,t,n=Se.search){return e??(t?String(t):n)}function DR(e=Se.clearField){return e}const kR="absolute inset-0 z-[2] m-0 cursor-pointer border-0 bg-transparent p-0 outline-none focus-ring-inset rounded-[inherit]",BR="pointer-events-none absolute inset-y-0 z-[1] flex items-center justify-center text-muted",jR="shrink-0",MR="box-border min-h-0 w-full border-0 bg-transparent text-foreground outline-none placeholder:text-muted [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none disabled:cursor-not-allowed disabled:opacity-100",FR="relative z-[2] opacity-100",HR="pointer-events-none absolute inset-0 opacity-0",GR="absolute top-1/2 z-[3] flex -translate-y-1/2 items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground outline-none focus-ring-inset cursor-pointer",VR="shrink-0",zR="relative box-border inline-block overflow-hidden text-left",UR="gloss-control border-0",WR="border-1 border-token",YR="rounded-full",$R="cursor-text",XR="cursor-pointer",KR="pointer-events-none opacity-55",qR={small:"--radius-small",base:"--radius-base",mid:"--radius-mid",large:"--radius-large"},ZR={small:"small",base:"base",mid:"mid",large:"large"},QR={small:.875,base:1,mid:1.125,large:1.25},JR={small:"rounded-small",base:"rounded-base",mid:"rounded-mid",large:"rounded-large"},eI={small:"w-control-small",base:"w-control-base",mid:"w-control-mid",large:"w-control-large"},tI={small:8,base:12,mid:16,large:20},nI={small:14,base:16,mid:20,large:20},oI={small:20,base:24,mid:28,large:32},rI={small:240,base:280,mid:320,large:360};function ao(e){const t=i.CONTROL_SIZE_LAYOUT[e];return{defaultExpandedW:rI[e],iconBox:nI[e],padX:tI[e],iconClass:t.icon,controlPad:t.controlPad,shellWCollapsed:eI[e],clearTap:oI[e],clearIconClass:t.chevronIcon,textGapClear:e==="small"?4:6}}const sI={small:ao("small"),base:ao("base"),mid:ao("mid"),large:ao("large")};function Kf(e){return sI[e]}function aI(e,t){const n=/^([\d.]+)rem$/i.exec(e);if(n)return Number.parseFloat(n[1])*t;const o=/^([\d.]+)px$/i.exec(e);if(o)return Number.parseFloat(o[1])}function lI(e,t=16){const n=ZR[e];if(typeof document<"u"){const o=getComputedStyle(document.documentElement).getPropertyValue(qR[n]).trim(),r=aI(o,t);if(r!=null)return r}return t*.5*QR[n]}function iI(e){return i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e))}function cI({size:e,variant:t,expanded:n,blocked:o,isGloss:r,groupSegment:s,shellHoverMotionClass:l,standardMotionClass:u,className:d,slotRoot:f}){const m=Kf(e),p=t==="gloss"?"default":t;return i.cn(s?iI(s):n?JR[e]:i.cn(YR,m.shellWCollapsed),zR,r?UR:i.cn(WR,i.FIELD_SHELL_VARIANT_BG_CLASS[p]),i.FIELD_SHELL_TRANSITION_CLASS,i.FIELD_SHELL_FOCUS_CLASS,r?l:i.fieldShellHoverClass(!o,"default",p),!r&&!o&&u,n?$R:"",!n&&!o?XR:"",o?KR:"",f,d)}function uI(e){return i.cn(BR,e)}function dI(e){return i.cn(jR,e)}function fI({controlPad:e,expanded:t,slotInput:n}){return i.cn(MR,e,we,t?FR:HR,n)}function mI(e){return i.cn(GR,i.TEXT_COLOR_TRANSITION,i.hoverVariant(),e)}function pI(e){return i.cn(VR,e)}function CI({disabled:e}){return c.jsx(Dn,{color:"neutral",disabled:e})}function gI({bindIconRef:e,layout:t,className:n}){return c.jsx("span",{ref:e,className:uI(n),style:{width:t.iconBox},"aria-hidden":!0,children:c.jsx(be.IoSearch,{className:dI(t.iconClass),"aria-hidden":!0})})}function SI({inputRef:e,id:t,disabled:n,readOnly:o,placeholder:r,value:s,defaultValue:l,onChange:u,onBlur:d,onKeyDown:f,expanded:m,ariaLabel:p,layout:C,paddingStyle:S,className:g,rest:h}){return c.jsx("input",{ref:e,id:t,type:"search",disabled:n,readOnly:o,placeholder:r,value:s,defaultValue:l,onChange:u,onBlur:d,onKeyDown:f,tabIndex:m?0:-1,"aria-label":p,className:fI({controlPad:C.controlPad,expanded:m,slotInput:g}),style:S,...h})}function hI({layout:e,onClick:t,className:n}){const o=St("clearField");return c.jsx("button",{type:"button","aria-label":DR(o),onClick:t,onPointerDown:r=>r.stopPropagation(),className:mI(n),style:{right:e.padX,width:e.clearTap,height:e.clearTap},children:c.jsx(be.IoClose,{className:pI(e.clearIconClass),"aria-hidden":!0})})}function xI({size:e,expanded:t,blocked:n,isGloss:o,groupSegment:r,layout:s,targetW:l}){const u=a.useRef(null),d=a.useRef(null),f=a.useRef(null),m=a.useRef(!1),p=a.useRef(t),C=a.useRef(t),S=i.readControlHeightPx(e),g=a.useCallback(()=>t?i.shadowBase():i.shadowNone(),[t]),h=i.useSecondLevelShadow(u,!n&&!o&&r==null,{resolveIdle:g,idleSyncKey:t}),x=i.useGlossFieldShellMotion(u,!n&&o&&r==null),A=a.useCallback(y=>{u.current=y,!n&&o&&r==null&&x.bindShellRef(y)},[n,x,r,o]),b=a.useCallback(y=>y.offsetWidth-y.clientWidth,[]),_=a.useCallback((y,w)=>(y-w-s.iconBox)/2,[s.iconBox]),L=`calc(50% - ${s.iconBox/2}px)`,v=a.useCallback(y=>{if(d.current=y,y&&!y.hasAttribute("data-search-icon-init")){y.setAttribute("data-search-icon-init","");const w=C.current;y.style.left=w?`${s.padX}px`:L}},[L,s.padX]),R=a.useCallback(y=>{const w=u.current,P=d.current;!w||!P||(y?w.style.width=`${l}px`:w.style.removeProperty("width"),w.style.removeProperty("height"),w.style.removeProperty("borderRadius"),P.style.left=y?`${s.padX}px`:L)},[L,s.padX,l]),T=a.useCallback(y=>{const w=u.current,P=d.current;if(!w||!P)return;if(i.prefersReducedMotion()){R(y);return}i.killMotion(w),i.killMotion(P),w.style.removeProperty("borderRadius");const k=lI(e);if(y){w.style.width=`${S}px`,w.style.borderRadius=`${S/2}px`;const F=(w.clientWidth-s.iconBox)/2;P.style.left=`${F}px`;const H=i.motionInteractive();$.timeline({onComplete:()=>{w.style.removeProperty("borderRadius")}}).to(w,{width:l,borderRadius:k,...H,overwrite:"auto"},0).to(P,{left:s.padX,...H,overwrite:"auto"},0);return}const j=b(w),B=_(S,j);P.style.left=`${s.padX}px`;const D=i.motionInteractive();$.timeline({onComplete:()=>{w.style.removeProperty("width"),w.style.removeProperty("borderRadius"),P.style.left=L}}).to(w,{width:S,borderRadius:S/2,...D,overwrite:"auto"},0).to(P,{left:B,...D,overwrite:"auto"},0)},[R,S,_,L,s.iconBox,s.padX,b,e,l]);a.useLayoutEffect(()=>{if(!m.current){m.current=!0,R(t),p.current=t;return}p.current!==t&&(p.current=t,T(t))},[R,t,T]);const E=a.useCallback(()=>{if(n||t)return;const y=u.current;if(!y||i.prefersReducedMotion()){f.current=Promise.resolve();return}f.current=o&&r==null?i.animateGlossInteractivePressSqueeze(y):i.animateInteractivePressSqueeze(y).then(()=>{})},[n,t,r,o]),I=a.useCallback(async()=>{await(f.current??Promise.resolve()),f.current=null},[]),O=o&&r==null?x.onShellPointerEnter:h.onPointerEnter,N=o&&r==null?x.onShellPointerLeave:h.onPointerLeave;return{rootRef:u,bindRootRef:A,bindIconRef:v,beginPressSqueeze:E,awaitPressSqueeze:I,handlePointerEnter:O,handlePointerLeave:N,onShellFocusIn:o&&r==null?x.onShellFocusIn:void 0,onShellFocusOut:o&&r==null?x.onShellFocusOut:void 0,shellHoverMotionClass:x.shellHoverMotionClass,standardMotionClass:h.motionClass}}function bI({size:e="base",variant:t,expandedWidth:n,defaultExpanded:o=!1,expanded:r,onExpandedChange:s,collapseOnBlur:l=!0,disabled:u,readOnly:d,placeholder:f="Search…",value:m,defaultValue:p,onChange:C,onBlur:S,onKeyDown:g,id:h,"aria-label":x,ripple:A=!1,groupSegment:b,className:_="",classNames:L,forwardedRef:v}){const R=Ie(),T=$t(),E=et(),I=T!=null&&T.segmented?void 0:b??(E==null?void 0:E.segment),O=t??((E==null?void 0:E.variant)!=null?i.fieldShellVariantFromButtonGroup(E.variant):"default"),N=a.useId(),y=h??N,[w,P]=Re({value:r,defaultValue:o,onChange:s}),k=a.useRef(null),j=m!==void 0,[B,D]=a.useState(()=>p!=null&&String(p).trim().length>0||m!=null&&String(m).trim().length>0);a.useEffect(()=>{j&&D(String(m??"").trim().length>0)},[j,m]);const F=a.useCallback(de=>{k.current=de,ue(v,de)},[v]),H=!!(u||d),U=Kf(e),G=n??U.defaultExpandedW,K=O==="gloss",{rootRef:V,bindRootRef:oe,bindIconRef:J,beginPressSqueeze:ee,awaitPressSqueeze:se,handlePointerEnter:M,handlePointerLeave:W,onShellFocusIn:Y,onShellFocusOut:Z,shellHoverMotionClass:ce,standardMotionClass:z}=xI({size:e,expanded:w,blocked:H,isGloss:K,groupSegment:I,layout:U,targetW:G}),Q=a.useCallback(de=>{C==null||C(de),j||D(de.target.value.trim().length>0)},[j,C]),te=a.useCallback(de=>{var xe;if(de.preventDefault(),de.stopPropagation(),H)return;const Le=k.current;if(!Le)return;j||D(!1);const ie=(xe=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:xe.set;ie==null||ie.call(Le,""),Le.dispatchEvent(new Event("input",{bubbles:!0})),C==null||C({target:Le,currentTarget:Le}),requestAnimationFrame(()=>Le.focus())},[H,j,C]),me=a.useCallback(()=>{requestAnimationFrame(()=>{var de;return(de=k.current)==null?void 0:de.focus()})},[]),Ae=a.useCallback(async()=>{H||w||(await se(),P(!0),me())},[se,H,w,me,P]),he=a.useCallback(de=>{ee()},[ee]),X=a.useCallback(de=>{H||(de.preventDefault(),Ae())},[H,Ae]),re=a.useCallback(de=>{S==null||S(de),!(!l||H)&&window.setTimeout(()=>{const Le=V.current;if(!(Le!=null&&Le.contains(document.activeElement))){const ie=k.current;((ie==null?void 0:ie.value)??"").trim().length===0&&P(!1)}},0)},[H,l,S,V,P]),pe=a.useCallback(de=>{H||(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),Ae())},[H,Ae]),fe=a.useCallback(de=>{var Le;g==null||g(de),!de.defaultPrevented&&de.key==="Escape"&&l&&(((Le=k.current)==null?void 0:Le.value)??"").length===0&&(de.stopPropagation(),P(!1),requestAnimationFrame(()=>{var ie,xe;(xe=(ie=V.current)==null?void 0:ie.querySelector("[data-search-expand]"))==null||xe.focus()}))},[l,g,V,P]),_e=U.padX+U.iconBox+6,Lt=w&&B&&!H,it=U.padX+(Lt?U.clearTap+U.textGapClear:0),Qe=cI({size:e,variant:O,expanded:w,blocked:H,isGloss:K,groupSegment:I,shellHoverMotionClass:ce,standardMotionClass:z,className:_,slotRoot:L==null?void 0:L.root});return{size:e,variant:O,expanded:w,blocked:H,isGloss:K,groupSegment:I,layout:U,ripple:A,inputId:y,placeholder:f,valueProp:m,defaultValue:p,disabled:u,readOnly:d,classNames:L,showClear:Lt,rootClass:Qe,collapseA11yLabel:OR(x,R.openSearch),inputAriaLabel:PR(x,f,R.search),inputPaddingStyle:w?{paddingLeft:_e,paddingRight:it}:void 0,setInputRef:F,handleInputChange:Q,handleClearClick:te,handleRootPointerDown:he,handleRootClick:X,handleInputBlur:re,handleRootKeyDown:pe,handleInputKeyDown:fe,bindRootRef:oe,bindIconRef:J,handlePointerEnter:M,handlePointerLeave:W,onShellFocusIn:Y,onShellFocusOut:Z}}const Ja=a.forwardRef(function({className:t="",size:n,variant:o,expandedWidth:r,defaultExpanded:s,expanded:l,onExpandedChange:u,collapseOnBlur:d,disabled:f,readOnly:m,placeholder:p,value:C,defaultValue:S,onChange:g,onBlur:h,onKeyDown:x,id:A,"aria-label":b,ripple:_,groupSegment:L,classNames:v,...R},T){var I,O,N,y;const E=bI({className:t,size:n,variant:o,expandedWidth:r,defaultExpanded:s,expanded:l,onExpandedChange:u,collapseOnBlur:d,disabled:f,readOnly:m,placeholder:p,value:C,defaultValue:S,onChange:g,onBlur:h,onKeyDown:x,id:A,"aria-label":b,ripple:_,groupSegment:L,classNames:v,forwardedRef:T});return c.jsxs("div",{ref:E.bindRootRef,role:"search","data-search-expanded":E.expanded?"":void 0,onFocusCapture:E.onShellFocusIn,onBlurCapture:E.onShellFocusOut,className:E.rootClass,onPointerDown:E.handleRootPointerDown,onPointerEnter:E.handlePointerEnter,onPointerLeave:E.handlePointerLeave,children:[E.expanded?null:c.jsx("button",{type:"button","data-search-expand":"",className:i.cn(kR,(I=E.classNames)==null?void 0:I.expandTrigger),tabIndex:E.blocked?-1:0,disabled:E.blocked,"aria-expanded":!1,"aria-controls":E.inputId,"aria-label":E.collapseA11yLabel,onClick:E.handleRootClick,onKeyDown:E.handleRootKeyDown}),E.ripple?c.jsx(CI,{disabled:E.blocked}):null,c.jsx(gI,{bindIconRef:E.bindIconRef,layout:E.layout,className:(O=E.classNames)==null?void 0:O.icon}),c.jsx(SI,{inputRef:E.setInputRef,id:E.inputId,disabled:E.disabled,readOnly:E.readOnly,placeholder:E.placeholder,value:E.valueProp,defaultValue:E.defaultValue,onChange:E.handleInputChange,onBlur:E.handleInputBlur,onKeyDown:E.handleInputKeyDown,expanded:E.expanded,ariaLabel:E.inputAriaLabel,layout:E.layout,paddingStyle:E.inputPaddingStyle,className:(N=E.classNames)==null?void 0:N.input,rest:R}),E.showClear?c.jsx(hI,{layout:E.layout,onClick:E.handleClearClick,className:(y=E.classNames)==null?void 0:y.clear}):null]})});Ja.displayName="SearchInput";const qf=a.createContext(null),Zf=a.createContext(null),Jr=a.createContext({});function AI({value:e,children:t}){return c.jsx(qf.Provider,{value:e,children:t})}function cr(){const e=a.useContext(qf);if(!e)throw new Error("Select.* must be inside <Select>.");return e}function vI({value:e,children:t}){return c.jsx(Zf.Provider,{value:e,children:t})}function Qf(){const e=a.useContext(Zf);if(!e)throw new Error("Select compound-parts must be inside <Select>.");return e}function _I({classNames:e,children:t}){const n=a.useContext(Jr),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Jr.Provider,{value:o,children:t})}function Ot(){return a.useContext(Jr)}function LI(e){return new Map(e.map(t=>[t.value,t]))}function TI(e){return e.map(t=>t.value)}function EI({optionValues:e,activeValue:t,optionsByValue:n,delta:o}){if(e.length===0)return t;const r=t?e.indexOf(t):-1;let s=r<0?0:r;for(let l=0;l<e.length;l+=1){s=(s+o+e.length)%e.length;const u=e[s],d=n.get(u);if(u&&d&&!d.disabled)return u}return t}function RI(e,t){for(const n of e){const o=t.get(n);if(o&&!o.disabled)return n}return null}function II(e,t){for(let n=e.length-1;n>=0;n-=1){const o=e[n],r=t.get(o);if(r&&!r.disabled)return o}return null}function yI(e){return e?typeof e.label=="string"?e.label.trim():e.value:""}function NI(e,t){return e.map(n=>yI(t.get(n)))}function wI(e,t){return e||(t==="danger"||t==="default"?"default":t)}const OI=[];function Jf({className:e,classNames:t,...n}){const o=Ot();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}Jf.displayName="SelectLabel";function el({children:e,status:t,className:n,id:o,...r}){const s=Qf(),l=Ot(),u=wI(t,s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}el.displayName="SelectHint";function tl({children:e,className:t,id:n,...o}){const r=Qf(),s=Ot();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e??r.errorMessage})}tl.displayName="Select.Error";const PI={small:i.CONTROL_SIZE_LAYOUT.small.controlPad,base:i.CONTROL_SIZE_LAYOUT.base.controlPad,mid:i.CONTROL_SIZE_LAYOUT.mid.controlPad,large:i.CONTROL_SIZE_LAYOUT.large.controlPad},DI={small:i.CONTROL_SIZE_LAYOUT.small.chevronIcon,base:i.CONTROL_SIZE_LAYOUT.base.chevronIcon,mid:i.CONTROL_SIZE_LAYOUT.mid.chevronIcon,large:i.CONTROL_SIZE_LAYOUT.large.chevronIcon},kI="relative z-0 flex min-w-0 items-stretch border-1 text-left overflow-hidden motion-reduce:transition-none",BI="min-w-0 flex-1 truncate bg-transparent text-left text-foreground outline-none",jI="text-muted",MI="flex shrink-0 origin-center items-center justify-center self-stretch px-small outline-none text-muted hover:text-foreground focus-ring-inset",FI="pointer-events-none",HI="z-popover",GI="gap-0 p-base",VI="overflow-y-auto overflow-x-hidden",zI="cursor-not-allowed opacity-55 shadow-token-base",UI="cursor-pointer";function WI({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function YI(e){return e?i.cn(i.buttonGroupRoundingClasses(e),i.buttonGroupSegmentSurfaceClasses(e)):"rounded-base"}function $I({variant:e,status:t,disabled:n,groupSegment:o,shellHoverMotionClass:r,className:s,slotClass:l}){const u=e==="gloss";return i.cn(kI,(o==null?void 0:o.orientation)==="horizontal"?"flex-1":"w-full",YI(o),WI({variant:e}),i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),u?"":i.fieldShellHoverClass(!n,t,e),r,n?zI:UI,l,s)}function XI({size:e,muted:t,className:n,slotClass:o}){return i.cn(BI,PI[e],t&&jI,o,n)}function KI({disabled:e,className:t,slotClass:n}){return i.cn(MI,e&&FI,n,t)}function qI(e){return`${e}-label`}function ZI(e){return`${e}-listbox`}function QI(e){return{hintId:Ve(e),errorId:ze(e),labelId:qI(e),listId:ZI(e)}}function JI(e,t,n){return t&&n?`${e}-opt-${n}`:void 0}function ey(e,t={openList:Se.openList,closeList:Se.closeList}){return e?t.closeList:t.openList}const nl=a.forwardRef(function({className:t,children:n,groupSegment:o,onPointerEnter:r,onPointerLeave:s,...l},u){const d=$t(),f=et(),m=Ot(),p=cr(),{open:C,setOpen:S,disabled:g,variant:h,status:x,anchorRef:A,listId:b,valueRef:_,value:L,optionValues:v,setActiveValue:R,activeValue:T,required:E,hintConnected:I,errorConnected:O,hintId:N,errorId:y,labelId:w,labelConnected:P,placeholder:k}=p,{"aria-label":j,"aria-labelledby":B,...D}=l,F=JI(b,C,T),H=je(I?N:void 0,O?y:void 0),U=B??(P?w:void 0),G=j??(U?void 0:k||void 0),K=At(),V=h==="gloss",oe=d!=null&&d.segmented?void 0:o??(f==null?void 0:f.segment),J=i.useFieldShellHoverLift(A,!g&&!V&&oe==null),ee=i.useGlossFieldShellMotion(A,!g&&V&&oe==null),se=a.useCallback(Z=>{A.current=Z,!g&&V&&ee.bindShellRef(Z)},[A,g,ee,V]),M=a.useCallback(()=>{const Z=v.indexOf(L);R(Z>=0?L:v[0]??null),requestAnimationFrame(()=>{var ce;return(ce=_.current)==null?void 0:ce.focus()})},[v,R,L,_]),W=a.useCallback(()=>{bt({triggerRef:A,disabled:g,setOpen:S,onOpened:M,openingRef:K})},[A,g,M,S,K]),Y=a.useCallback(Z=>{g||C||Z.button===0&&W()},[g,C,W]);return c.jsx("div",{ref:$e(u,se),role:"combobox","aria-expanded":C,"aria-controls":C?b:void 0,"aria-haspopup":"listbox","aria-activedescendant":C?F:void 0,"aria-labelledby":U,"aria-label":G,"aria-required":E||void 0,"aria-invalid":x==="danger"?!0:void 0,"aria-describedby":H,"aria-disabled":g||void 0,tabIndex:-1,onPointerDown:Y,onPointerEnter:Z=>{r==null||r(Z),!Z.defaultPrevented&&(V&&oe==null?ee.onShellPointerEnter(Z):J.onShellPointerEnter(Z))},onPointerLeave:Z=>{s==null||s(Z),V&&oe==null?ee.onShellPointerLeave(Z):J.onShellPointerLeave(Z)},onFocusCapture:V&&!g&&oe==null?ee.onShellFocusIn:void 0,onBlurCapture:V&&!g&&oe==null?ee.onShellFocusOut:void 0,...g&&V?{"data-gloss-disabled":""}:{},className:$I({variant:h,status:x,disabled:g,groupSegment:oe,shellHoverMotionClass:V?ee.shellHoverMotionClass:J.shellHoverMotionClass,className:t,slotClass:m.triggerGroup}),...D,children:n})});nl.displayName="SelectTriggerGroup";const ol=a.forwardRef(function({className:t,onKeyDown:n,onBlur:o,children:r,placeholder:s,...l},u){const d=Ot(),f=cr(),{selectId:m,open:p,setOpen:C,value:S,setValue:g,activeValue:h,setActiveValue:x,valueRef:A,anchorRef:b,options:_,optionValues:L,disabled:v,placeholder:R,size:T,formValueRef:E,formOnBlur:I}=f,O=s??R,N=a.useRef(or()),y=At(),w=a.useMemo(()=>LI(_),[_]),P=a.useMemo(()=>w.get(S),[w,S]),k=a.useCallback(()=>{const G=L.indexOf(S);x(G>=0?S:L[0]??null),requestAnimationFrame(()=>{var K;return(K=A.current)==null?void 0:K.focus()})},[L,x,S,A]),j=a.useCallback(()=>{bt({triggerRef:b,disabled:v,setOpen:C,onOpened:k,openingRef:y})},[b,v,k,C,y]),B=a.useCallback(G=>{const K=EI({optionValues:L,activeValue:h,optionsByValue:w,delta:G});K&&x(K)},[h,L,w,x]),D=a.useCallback(G=>{var V;const K=w.get(G);!K||K.disabled||(g(G),C(!1),(V=A.current)==null||V.focus())},[w,C,g,A]),F=a.useCallback(G=>{if(n==null||n(G),!(G.defaultPrevented||v)){if(!p){if(G.key==="ArrowDown"||G.key==="ArrowUp"){G.preventDefault(),j();return}if(G.key==="Enter"||G.key===" "){G.preventDefault(),j();return}return}if(G.key==="ArrowDown"){G.preventDefault(),B(1);return}if(G.key==="ArrowUp"){G.preventDefault(),B(-1);return}if(G.key==="Enter"||G.key===" "){G.preventDefault(),h&&D(h);return}if(G.key==="Escape"){G.preventDefault(),C(!1);return}if(G.key==="Home"){G.preventDefault();const K=RI(L,w);K&&x(K);return}if(G.key==="End"){G.preventDefault();const K=II(L,w);K&&x(K);return}if(ya(G.key,G)){G.preventDefault();const K=NI(L,w),V=h?L.indexOf(h):-1,oe=wa(K,Na(N.current,G.key),V);if(oe<0)return;const J=L[oe],ee=J?w.get(J):void 0;J&&ee&&!ee.disabled&&x(J)}}},[h,B,v,n,p,j,L,w,D,x,C]),H=a.useCallback(G=>{o==null||o(G),I==null||I()},[I,o]),U=r??(P?P.label:O);return c.jsx("button",{ref:$e(u,A,E),id:m,type:"button",disabled:v,className:XI({size:T,muted:!P,className:t,slotClass:d.value}),onKeyDown:F,onBlur:H,...l,children:U})});ol.displayName="SelectValue";const rl=a.forwardRef(function({className:t,onPointerDown:n,children:o,...r},s){const l=Ie(),u=Ot(),{open:d,setOpen:f,disabled:m,size:p,valueRef:C}=cr(),S=a.useRef(null),g=qt(d,S),h=a.useCallback(A=>{g(A),typeof s=="function"?s(A):s&&(s.current=A)},[g,s]),x=a.useCallback(A=>{if(n==null||n(A),A.stopPropagation(),!m){if(d){f(!1);return}A.button===0&&(f(!0),requestAnimationFrame(()=>{var b;return(b=C.current)==null?void 0:b.focus()}))}},[m,n,d,f,C]);return c.jsx("button",{type:"button",ref:h,tabIndex:-1,disabled:m,"aria-label":ey(d,l),className:KI({disabled:m,className:t,slotClass:u.trigger}),onPointerDown:x,...r,children:o??c.jsx(be.IoChevronDown,{className:i.cn(DI[p],u.triggerIcon),"aria-hidden":!0})})});rl.displayName="SelectTrigger";const sl=a.forwardRef(function({children:t,className:n,side:o="bottom",align:r,offset:s=Gn,listBoxProps:l,...u},d){const f=Ot(),{open:m,setOpen:p,anchorRef:C,listId:S,labelId:g,labelConnected:h,placeholder:x,menuMaxHeight:A,options:b,optionValues:_,value:L,setValue:v,activeValue:R,setActiveValue:T,variant:E,size:I}=cr(),{className:O,classNames:N,style:y,size:w,...P}=l??{},k=a.useCallback(B=>{const D=Array.isArray(B)?B[0]??"":B;v(D),p(!1)},[p,v]),j=t??(_.length===0?c.jsx(Ht.Empty,{}):_.map(B=>{const D=b.find(F=>F.value===B);return c.jsx(Ht.Item,{value:B,disabled:D.disabled,label:D.label,hint:D.hint,icon:D.icon},B)}));return c.jsx(ke,{open:m,onOpenChange:p,side:o,anchorRef:C,variant:E==="gloss"?"gloss":"default",children:c.jsx(ke.Content,{ref:d,matchAnchorWidth:!0,unstyled:!0,contentRole:void 0,align:r,offset:s,className:i.cn(HI,f.popover,n),...u,children:c.jsx(ke.Body,{className:i.cn(GI,f.popoverBody),children:c.jsx(Ht,{selectionIndicator:!0,size:w??I,...P,listId:S,"aria-labelledby":h?g:void 0,"aria-label":h?void 0:x,value:L,onValueChange:k,activeValue:R,onActiveValueChange:T,classNames:{item:f.listBoxItem,label:f.listBoxLabel,hint:f.listBoxHint,icon:f.listBoxIcon,empty:f.listBoxEmpty,header:f.listBoxHeader,headerText:f.listBoxHeaderText,...N},className:i.cn(VI,f.listBox,O),style:{maxHeight:A,...y},children:j})})})})});sl.displayName="SelectPopover";function ty({label:e,hint:t,error:n,labelId:o}){const r=Ot();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:o,classNames:{root:r.label},children:e}):null,c.jsxs(nl,{children:[c.jsx(ol,{}),c.jsx(rl,{})]}),c.jsx(sl,{}),t!=null?c.jsx(el,{children:t}):null,n!=null?c.jsx(tl,{children:n}):null]})}function ny({children:e,label:t,hint:n,error:o,id:r,name:s,required:l=!1,status:u="default",size:d="base",options:f=OI,value:m,defaultValue:p,onValueChange:C,open:S,defaultOpen:g=!1,onOpenChange:h,variant:x,disabled:A=!1,placeholder:b="Select a value",menuMaxHeight:_="min(24rem, 70vh)"}){const L=ed({name:s,value:m,disabled:A}),v=L.bound,R=L.disabled??A,T=a.useId(),E=et(),I=x??((E==null?void 0:E.variant)!=null?i.fieldShellVariantFromButtonGroup(E.variant):"default"),O=r??`select-${T}`,{hintId:N,errorId:y,labelId:w,listId:P}=QI(O),{isCompound:k,hasLabel:j,hasHint:B,hasError:D}=a.useMemo(()=>{const z=Ue(e);return{isCompound:z,hasLabel:t!=null||z&&ge(e,"Label"),hasHint:n!=null||z&&ge(e,"SelectHint"),hasError:o!=null||z&&ge(e,"SelectError")}},[e,o,n,t]),F=m!==void 0||v,[H,U]=a.useState(p??""),G=v?String(L.value??""):F?m??"":H,K=a.useCallback(z=>{F||U(z),C==null||C(z),v&&L.setValue(z)},[v,L,F,C]),[V,oe]=Re({value:S,defaultValue:g,onChange:h}),[J,ee]=a.useState(null),se=a.useRef(null),M=a.useRef(null),W=a.useMemo(()=>TI(f),[f]);a.useEffect(()=>{var z;!V||!J||(z=document.getElementById(`${P}-opt-${J}`))==null||z.scrollIntoView({block:"nearest"})},[J,P,V]);const Y=a.useMemo(()=>({selectId:O,hintId:N,errorId:y,labelId:w,labelConnected:j,hintConnected:B,errorConnected:D,required:l,status:u,size:d,errorMessage:o}),[O,o,y,D,B,j,N,l,w,d,u]),Z=a.useMemo(()=>({...Y,open:V,setOpen:oe,value:G,setValue:K,listId:P,activeValue:J,setActiveValue:ee,anchorRef:se,valueRef:M,variant:I,disabled:R,placeholder:b,menuMaxHeight:_,options:f,optionValues:W,formValueRef:v?L.ref:void 0,formOnBlur:v?L.onBlur:void 0}),[J,R,Y,v,L,P,_,V,W,f,b,K,G,I]),ce=a.useMemo(()=>({controlId:O,labelId:w,required:l}),[O,l,w]);return{isCompound:k,label:t,hint:n,error:o,children:e,fieldCtx:Y,selectCtx:Z,fieldLabelCtx:ce}}function em({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u,status:d,size:f,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:_,menuMaxHeight:L,name:v,...R}){const T=tt(),E=typeof v=="string"?v:void 0,I=E?T==null?void 0:T.getError(E):void 0,O=o??I,N=d==="default"&&I?"danger":d,y=f??(T==null?void 0:T.size)??"base",w=Vs(),P=ny({children:e,label:t,hint:n,error:O,id:l,name:v,required:u,status:N,size:y,options:m,value:p,defaultValue:C,onValueChange:S,open:g,defaultOpen:h,onOpenChange:x,variant:A,disabled:b,placeholder:_,menuMaxHeight:L});return c.jsx(vI,{value:P.fieldCtx,children:c.jsx(AI,{value:P.selectCtx,children:c.jsx(_I,{classNames:s,children:c.jsx(Ge.Provider,{value:P.fieldLabelCtx,children:c.jsx(le,{className:i.cn(w&&i.BUTTON_GROUP_RADIUS_BRIDGE_CLASS,r,s==null?void 0:s.root),...R,children:P.isCompound?e:c.jsx(ty,{label:P.label,hint:P.hint,error:P.error,labelId:P.fieldCtx.labelId})})})})})})}em.displayName="Select";const tm=Object.assign(em,{Label:Jf,TriggerGroup:nl,Value:ol,Trigger:rl,Popover:sl,Hint:el,Error:tl});function al(e){const t=[];return a.Children.forEach(e,n=>{if(a.isValidElement(n)){if(n.type===a.Fragment){const{children:o}=n.props;t.push(...al(o));return}t.push(n)}}),t}function nm(e){return e.type===Vt||e.type===Xf.Control||e.type===vf||e.type===tm||e.type===Ja||e.type===Gt||e.type.displayName==="ButtonGroupText"}function om(e,t){return t<=1?"only":e===0?"first":e===t-1?"last":"middle"}function rm(e,t){return{orientation:e,position:t}}function oy(e){return e.reduce((t,n)=>t+(nm(n)?1:0),0)}function ry({children:e,orientation:t="horizontal",segmented:n=!1,buttonSize:o="base",variant:r="default"}){const s=a.useMemo(()=>al(e),[e]),l=a.useMemo(()=>oy(s),[s]),u=a.useMemo(()=>({segmented:n}),[n]);return{flat:s,segmentCount:l,layoutValue:u,orientation:t,segmented:n,buttonSize:o,variant:r}}function sy({orientation:e}){const t=ou();return c.jsx("span",{..._v(),className:i.buttonGroupSeparatorClass(e,t.separator)})}const sm=a.forwardRef(function({children:t,className:n="",classNames:o,orientation:r="horizontal",segmented:s=!1,buttonSize:l="base",variant:u="default",...d},f){const{flat:m,segmentCount:p,layoutValue:C}=ry({children:t,orientation:r,segmented:s,buttonSize:l,variant:u});let S=-1;return c.jsx(zh,{value:C,children:c.jsx(Uh,{classNames:o,children:c.jsx("div",{ref:f,role:vv,className:i.buttonGroupRootClass({orientation:r,segmented:s,variant:u,className:i.cn(o==null?void 0:o.root,n)}),...d,children:m.map((g,h)=>{if(!nm(g))return c.jsx(a.Fragment,{children:g},g.key??`bg-wrap-${h}`);if(s)return c.jsx(a.Fragment,{children:g},g.key??`bg-item-${h}`);S+=1;const x=om(S,p),A=rm(r,x);return c.jsxs(a.Fragment,{children:[c.jsx(nu,{segment:A,buttonSize:l,variant:u,children:g}),u!=="gloss"&&x!=="last"&&x!=="only"?c.jsx(sy,{orientation:r}):null]},g.key??`bg-seg-${h}`)})})})})});sm.displayName="ButtonGroup";const am=a.forwardRef(function({children:t,className:n="",buttonSize:o,groupSegment:r,...s},l){const u=$t(),d=et(),f=ou(),m=o??(d==null?void 0:d.buttonSize)??"base",p=u!=null&&u.segmented?void 0:r??(d==null?void 0:d.segment),C=d==null?void 0:d.variant;return c.jsx("span",{ref:l,...s,className:i.buttonGroupTextClass({groupSegment:p,groupVariant:C,buttonSize:m,className:i.cn(f.text,n)}),children:c.jsx(q,{variant:i.BUTTON_GROUP_TEXT_VARIANT[m],inheritColor:!0,as:"span",className:i.cn(i.BUTTON_GROUP_TEXT_LABEL_CLASS,f.textLabel),children:t})})});am.displayName="ButtonGroupText";const ay=Object.assign(sm,{Text:am}),lm=a.createContext(null),im=a.createContext(null),es=a.createContext({});function ly({value:e,children:t}){return c.jsx(lm.Provider,{value:e,children:t})}function iy(){return a.useContext(lm)}function cy({classNames:e,children:t}){const n=a.useContext(es),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(es.Provider,{value:o,children:t})}function vn(){return a.useContext(es)}function zn(){return a.useContext(im)}function uy({value:e,children:t}){return c.jsx(im.Provider,{value:e,children:t})}function dy(e){return Array.from(e.querySelectorAll("[data-toggle-button-value]:not([disabled])")).filter(t=>t instanceof HTMLButtonElement)}function fy(e,t,n,o){if(e)return n!=null?n===t?0:-1:t===o?0:-1}function my(e,t,n,o){if(o===0)return null;const r=t==="horizontal";switch(e){case"ArrowRight":return r?n<0?0:(n+1)%o:null;case"ArrowLeft":return r?n<0?o-1:(n-1+o)%o:null;case"ArrowDown":return r?null:n<0?0:(n+1)%o;case"ArrowUp":return r?null:n<0?o-1:(n-1+o)%o;default:return null}}function py(e){return e?-1:0}function Cy({disabled:e,isSingle:t,orientation:n,onKeyDown:o,select:r}){return s=>{if(o==null||o(s),s.defaultPrevented||e||!t)return;const l=dy(s.currentTarget);if(l.length===0)return;const u=l.findIndex(p=>p===document.activeElement),d=my(s.key,n,u,l.length);if(d==null)return;s.preventDefault();const f=l[d];f.focus();const m=f.dataset.toggleButtonValue;m&&r(m)}}const cm="data-selection-fill",ll="data-selection-fill-ready";function um(e,t){i.killMotion(e),e.setAttribute(ll,""),e.dataset.pressed=t?"true":"false",$.set(e,{scale:t?1:0,autoAlpha:t?1:0})}function gy(e,t){return n=>{e.current=n,n&&!n.hasAttribute(ll)&&um(n,t)}}function cc(e,t,n=i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableToggleButtonFill")){if(i.killMotion(e),e.setAttribute(ll,""),e.dataset.pressed=t?"true":"false",n){$.set(e,{scale:t?1:0,autoAlpha:t?1:0});return}const o=i.motionSelectionFill();t?(i.setWillChangeTransform(e,!0),$.fromTo(e,{scale:0,autoAlpha:0},{scale:1,autoAlpha:1,...o,overwrite:"auto",onComplete:i.clearWillChangeOnComplete(e)})):(i.setWillChangeTransform(e,!0),$.to(e,{scale:0,autoAlpha:0,...o,overwrite:"auto",onComplete:i.clearWillChangeOnComplete(e)}))}function dm(e,t,n){const o=n==null?void 0:n.deferFillFromPressRef,r=n==null?void 0:n.onFillStart,s=a.useRef(e),l=a.useRef(void 0),u=i.usePrefersReducedMotion(),[d,f]=a.useState(e),m=a.useMemo(()=>gy(t,s.current),[t]),p=a.useCallback(C=>{const S=t.current;S&&l.current!==C&&(l.current=C,f(C),r==null||r(C),cc(S,C,u))},[t,r,u]);return a.useLayoutEffect(()=>{const C=t.current;if(C){if(l.current===void 0){l.current=e,f(e),um(C,e);return}l.current!==e&&(o!=null&&o.current||(l.current=e,f(e),r==null||r(e),cc(C,e,u)))}},[o,r,e,t,u]),{animateTo:p,bindFillRef:m,displayPressed:d}}function Sy({disabled:e,variant:t,groupSegment:n,forwardedRef:o,pressed:r,onFillStart:s,onPointerEnter:l,onPointerLeave:u,onPointerDown:d}){const f=a.useRef(null),m=a.useRef(!1),p=a.useRef(null),C=a.useRef(!1),{animateTo:S,bindFillRef:g,displayPressed:h}=dm(r,f,{deferFillFromPressRef:m,onFillStart:s}),x=a.useCallback(()=>{m.current=!1,p.current=null,C.current=!1},[]),A=a.useCallback(()=>{const I=p.current;I!==null&&(p.current=null,m.current=!1,S(I))},[S]),b=a.useCallback(()=>{C.current=!0,A()},[A]),_=i.usePrefersReducedMotion(),L=!e&&!_,v=Uo({isGloss:t==="gloss",enabled:!e,hasHoverShadow:t!=="gloss",useContentRef:!!n,forwardedRef:o,onPointerEnter:l,onPointerLeave:u,onPointerDown:d,onPressReleaseStart:L?b:void 0}),R=a.useCallback(I=>{L&&(m.current=!0,C.current=!1,p.current=null),v.handlePointerDown(I)},[v,L]),T=a.useCallback(I=>{v.handlePointerLeave(I),x()},[x,v]),E=a.useCallback(I=>{if(!L){S(I);return}p.current=I,C.current&&A()},[S,A,L]);return{setRefs:v.setRefs,contentMotionRef:v.contentMotionRef,handlePointerEnter:v.handlePointerEnter,handlePointerLeave:T,handlePointerDown:R,bindFillRef:g,queueFillOnClick:E,displayPressed:h}}const fm=new Set(["ToggleButtonContent","ToggleButtonFill","ToggleButtonLabel","ToggleButtonIconStart","ToggleButtonIconEnd","ToggleButtonText"]);function mm(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function hy(e){return mm(e,t=>t!=null&&fm.has(t))}function uc(e,t){return mm(e,n=>n===t)}function xy(e){if(e==null||e===!1)return!1;if(typeof e=="string"||typeof e=="number")return!0;const t=a.Children.toArray(e).filter(r=>r!=null);if(t.length!==1)return!1;const n=t[0];if(typeof n=="string"||typeof n=="number")return!0;if(!a.isValidElement(n))return!1;const o=n.type.displayName;return o==null||!fm.has(o)}const by={default:"border-token bg-surface text-foreground",outline:"bg-transparent border-token text-foreground",ghost:"bg-transparent border-token border-transparent text-foreground",gloss:"border-0 bg-transparent text-foreground"};function Ay(e){return e==="outline"||e==="ghost"?"transparent-hover":"default"}function vy(e){return e==="outline"||e==="ghost"?"group-hover/toggle:bg-transparent-hover":"group-hover/toggle:bg-default-hover"}const _y="group/toggle relative inline-flex origin-center items-center justify-center overflow-hidden outline-none text-foreground focus-ring",Ly="gloss-btn",Ty="bg-transparent",Ey="cursor-not-allowed opacity-50",Ry="cursor-pointer",Iy="pointer-events-none absolute -inset-px z-0 origin-center motion-reduce:transition-none",yy="relative z-[1] inline-flex w-full min-w-0 items-center justify-center gap-xsmall",Ny="origin-center",wy="inline-flex shrink-0 items-center justify-center [&_svg]:size-full",Oy="inline-flex w-full min-w-0 items-center gap-xsmall",Py="min-w-0 shrink",Dy={small:"small",base:"base",mid:"mid",large:"large"};function ky({slotClass:e,className:t}){return i.cn(Oy,e,t)}function By(e,t){return i.cn(Py,e,t)}function jy(e){return by[e]}function My({fillColor:e,pressed:t,variant:n,roundingClass:o,slotClass:r}){return i.cn(Iy,e,i.SURFACE_COLOR_TRANSITION,t?`group-hover/toggle:${e}/80`:vy(n),o,r)}function pm(e,t){return i.cn(wy,i.CONTROL_SIZE_LAYOUT[e].icon,t)}function Fy({variant:e,pressed:t,disabled:n,size:o,groupSegment:r,slotClass:s,className:l}){const u=e==="gloss",d=r?i.buttonGroupRoundingClasses(r):i.CONTROL_SIZE_LAYOUT[o].rounded,f=r?i.buttonGroupSegmentSurfaceClasses(r):"";return i.cn(_y,u?i.cn(Ly,!r&&i.GLOSS_INTERACTIVE_MOTION_CLASS):i.cn(!r&&i.SHADOW_LIFT_MOTION_CLASS),!u&&!t&&!n&&i.hoverVariant(Ay(e)),!u&&jy(e),t&&Ty,n?Ey:Ry,i.buttonRootClass(o,!0),d,f,s,l)}function Hy({groupSegment:e,slotClass:t}){return i.cn(yy,e&&Ny,t)}function Gy(e,t){return e?i.buttonGroupRoundingClasses(e):i.CONTROL_SIZE_LAYOUT[t].rounded}const il=a.forwardRef(function({className:t="",...n},o){const r=zn(),s=vn();return r?c.jsx("span",{ref:o??r.bindFillRef,"aria-hidden":!0,className:My({fillColor:r.fillColor,pressed:r.pressed,variant:r.variant,roundingClass:r.roundingClass,slotClass:i.cn(s.fill,t)}),...n,[cm]:"","data-pressed":r.pressed?"true":"false"}):null});il.displayName="ToggleButtonFill";const No=a.forwardRef(function({className:t="",children:n,...o},r){const s=zn(),l=vn();return c.jsx("span",{ref:r??(s==null?void 0:s.contentMotionRef),className:Hy({groupSegment:s==null?void 0:s.groupSegment,slotClass:i.cn(l.content,t)}),...o,children:n})});No.displayName="ToggleButtonContent";const Cm=a.forwardRef(function({className:t="",children:n,...o},r){const s=vn();return c.jsx("span",{ref:r,className:ky({slotClass:s.label,className:t}),...o,children:n})});Cm.displayName="ToggleButtonLabel";function cl({className:e="",children:t,...n}){const o=zn(),r=vn(),s=(o==null?void 0:o.size)??"base";return c.jsx("span",{className:pm(s,i.cn(r.icon,e)),"aria-hidden":!0,...n,children:t})}cl.displayName="ToggleButtonIconStart";function ul({className:e="",children:t,...n}){const o=zn(),r=vn(),s=(o==null?void 0:o.size)??"base";return c.jsx("span",{className:pm(s,i.cn(r.icon,e)),"aria-hidden":!0,...n,children:t})}ul.displayName="ToggleButtonIconEnd";function dl({className:e="",children:t,...n}){const o=zn(),r=vn(),s=(o==null?void 0:o.size)??"base";return c.jsx(q,{variant:Dy[s],as:"span",inheritColor:!0,className:By(r.text,e),...n,children:t})}dl.displayName="ToggleButtonText";function Vy({icon:e,iconPosition:t="start",children:n}){const r=xy(n)?c.jsx(dl,{children:n}):n,s=e==null?null:t==="end"?c.jsx(ul,{children:e}):c.jsx(cl,{children:e});return c.jsxs(c.Fragment,{children:[t==="start"?s:null,r,t==="end"?s:null]})}function zy({inGroup:e,isSingleGroup:t}){return e&&t?"radio":void 0}function Uy({inGroup:e,isSingleGroup:t,pressed:n}){return!e||!t?n:void 0}function Wy({inGroup:e,isSingleGroup:t,pressed:n}){return e&&t?n:void 0}function Yy({value:e,groupSegment:t,pressed:n,defaultPressed:o=!1,onPressedChange:r,onFillStart:s,variant:l,fillColor:u="bg-primary-tint",size:d,disabled:f=!1,className:m,classNames:p,children:C,onClick:S}){const g=iy(),h=et(),x=t??(h==null?void 0:h.segment),A=g!=null&&e!=null,b=(g==null?void 0:g.type)==="single",_=d??(g==null?void 0:g.size)??(h==null?void 0:h.buttonSize)??"base",L=l??(g==null?void 0:g.variant)??"default",v=f||!!(g!=null&&g.disabled),[R,T]=Re({value:A?void 0:n,defaultValue:!!(!A&&o)}),E=A?g.isSelected(e):R,I=A?n!==void 0?!!n:E:n!==void 0?!!n:R,O=Gy(x,_),N=a.useMemo(()=>hy(C),[C]),y=N?void 0:m,w=a.useCallback((P,k)=>{if(S==null||S(P),P.defaultPrevented||v)return;if(A&&e!=null){const B=g.type==="single"?!0:!g.isSelected(e);g.select(e),k(B);return}const j=!I;k(j),T(j),r==null||r(j)},[v,g,A,e,S,r,I,T]);return{itemValue:e,groupCtx:g,groupSegment:x,inGroup:A,isSingleGroup:b,size:_,variant:L,disabled:v,pressed:I,onFillStart:s,fillColor:u,classNames:p,roundingClass:O,role:zy({inGroup:A,isSingleGroup:b}),ariaPressed:Uy({inGroup:A,isSingleGroup:b,pressed:I}),ariaChecked:Wy({inGroup:A,isSingleGroup:b,pressed:I}),tabIndex:A&&b?g.tabIndexFor(e):void 0,isCompound:N,contentLayoutClass:y,children:C,handleClick:w}}const gm=a.forwardRef(function({className:t,classNames:n,value:o,groupSegment:r,pressed:s,defaultPressed:l,onPressedChange:u,onFillStart:d,variant:f,fillColor:m,size:p,type:C="button",icon:S,iconPosition:g,disabled:h,children:x,onClick:A,onPointerDown:b,onPointerEnter:_,onPointerLeave:L,...v},R){var w,P;const T=Yy({value:o,groupSegment:r,pressed:s,defaultPressed:l,onPressedChange:u,onFillStart:d,variant:f,fillColor:m,size:p,disabled:h,className:t,classNames:n,children:x,onClick:A}),E=Sy({disabled:T.disabled,variant:T.variant,groupSegment:T.groupSegment,pressed:T.pressed,onFillStart:T.onFillStart,forwardedRef:R,onPointerEnter:_,onPointerLeave:L,onPointerDown:b}),I=Fy({variant:T.variant,pressed:E.displayPressed,disabled:T.disabled,size:T.size,groupSegment:T.groupSegment,slotClass:(w=T.classNames)==null?void 0:w.root,className:t}),O={size:T.size,variant:T.variant,groupSegment:T.groupSegment,contentMotionRef:E.contentMotionRef,bindFillRef:E.bindFillRef,fillColor:T.fillColor,pressed:E.displayPressed,roundingClass:T.roundingClass},{hasCompoundFill:N,hasCompoundContent:y}=a.useMemo(()=>({hasCompoundFill:uc(x,"ToggleButtonFill"),hasCompoundContent:uc(x,"ToggleButtonContent")}),[x]);return c.jsx(uy,{value:O,children:c.jsx(cy,{classNames:T.classNames,children:c.jsxs("button",{ref:E.setRefs,type:C,disabled:T.disabled,"data-toggle-button-value":T.itemValue,role:T.role,"aria-pressed":T.ariaPressed,"aria-checked":T.ariaChecked,tabIndex:T.tabIndex,className:I,onPointerEnter:E.handlePointerEnter,onPointerLeave:E.handlePointerLeave,onPointerDown:E.handlePointerDown,onClick:k=>T.handleClick(k,E.queueFillOnClick),...v,children:[N?null:c.jsx(il,{}),T.isCompound?y?x:c.jsx(No,{children:x}):c.jsx(No,{className:i.cn((P=T.classNames)==null?void 0:P.content,T.contentLayoutClass),children:c.jsx(Vy,{icon:S,iconPosition:g,children:T.children})})]})})})});gm.displayName="ToggleButtonRoot";const Sm=Object.assign(gm,{Content:No,Fill:il,Label:Cm,IconStart:cl,IconEnd:ul,Text:dl});function fl(e){return e.type===Sm}function $y(e){return e.reduce((t,n)=>t+(fl(n)?1:0),0)}function Xy(e){return e.reduce((t,n)=>{if(!fl(n))return t;const o=n.props.value;return typeof o=="string"&&t.push(o),t},[])}function dc(e){return e==null?[]:Array.isArray(e)?e:[e]}function fc(e){if(e!=null)return Array.isArray(e)?e[0]:e}function Ky(e,t,n,o){return e==="single"?n===t:o.includes(t)}function qy(e,t,n,o){return e==="single"?n===t?null:{kind:"single",value:t}:{kind:"multiple",value:o.includes(t)?o.filter(s=>s!==t):[...o,t]}}const ts=a.createContext({});function Zy({classNames:e,children:t}){const n=a.useContext(ts),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ts.Provider,{value:o,children:t})}function Qy(){return a.useContext(ts)}function Jy({orientation:e}){const t=Qy();return c.jsx("span",{"aria-hidden":!0,className:i.buttonGroupSeparatorClass(e,t.separator)})}function eN({children:e,type:t="multiple",disabled:n=!1,size:o="base",variant:r="default",value:s,defaultValue:l,onValueChange:u,onKeyDown:d,orientation:f="horizontal"}){const m=t==="single",p=s!==void 0,[C,S]=a.useState(()=>fc(l)),[g,h]=a.useState(()=>dc(l)),x=m?p?fc(s):C:void 0,A=a.useMemo(()=>m?[]:p?dc(s):g,[g,p,m,s]),b=a.useRef(A);b.current=A;const _=a.useCallback(N=>Ky(t,N,x,A),[A,x,t]),L=a.useCallback(N=>{if(n)return;if(m){const w=qy(t,N,x,A);if(w==null||w.kind!=="single")return;p||S(w.value),u==null||u(w.value);return}const y=Ba(b.current,N,!0);b.current=y,p||h(y),u==null||u(y)},[n,p,m,A,u,x,t]),v=a.useMemo(()=>al(e),[e]),R=a.useMemo(()=>$y(v),[v]),T=a.useMemo(()=>Xy(v)[0],[v]),E=a.useCallback(N=>fy(m,N,x,T),[T,m,x]),I=a.useMemo(()=>({type:t,disabled:n,size:o,variant:r,isSelected:_,select:L,tabIndexFor:E}),[n,_,L,o,E,t,r]),O=a.useMemo(()=>Cy({disabled:n,isSingle:m,orientation:f,onKeyDown:d,select:L}),[n,m,d,f,L]);return{flat:v,segmentCount:R,contextValue:I,handleKeyDown:O,isSingle:m}}const hm=a.forwardRef(function(t,n){const{children:o,className:r="",classNames:s,orientation:l="horizontal",segmented:u=!1,disabled:d=!1,size:f="base",variant:m="default",type:p="multiple",value:C,defaultValue:S,onValueChange:g,onKeyDown:h,...x}=t,{flat:A,segmentCount:b,contextValue:_,handleKeyDown:L,isSingle:v}=eN(t);let R=-1;return c.jsx(ly,{value:_,children:c.jsx(Zy,{classNames:s,children:c.jsx("div",{ref:n,role:"toolbar",tabIndex:py(d),"aria-orientation":l,"aria-disabled":d||void 0,className:i.buttonGroupRootClass({orientation:l,segmented:u,variant:m,className:i.cn(s==null?void 0:s.root,r)}),...v?{onKeyDown:L}:{},...x,children:A.map((T,E)=>{if(!fl(T))return c.jsx(a.Fragment,{children:T},T.key??`tbg-wrap-${E}`);if(u)return c.jsx(a.Fragment,{children:T},T.key??`tbg-item-${E}`);R+=1;const I=om(R,b),O=rm(l,I);return c.jsxs(a.Fragment,{children:[c.jsx(nu,{segment:O,buttonSize:f,children:T}),m!=="gloss"&&I!=="last"&&I!=="only"?c.jsx(Jy,{orientation:l}):null]},T.key??`tbg-seg-${E}`)})})})})});hm.displayName="ToggleButtonGroup";const tN=hm,xm=a.createContext(null),ns=a.createContext({}),ml=a.createContext(null);function nN({value:e,children:t}){return c.jsx(xm.Provider,{value:e,children:t})}function _t(){const e=a.useContext(xm);if(!e)throw new Error("AlertDialog.* components must be used inside <AlertDialog>.");return e}function oN({classNames:e,children:t}){const n=a.useContext(ns),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ns.Provider,{value:o,children:t})}function Xe(){return a.useContext(ns)}function rN({value:e,children:t}){return c.jsx(ml.Provider,{value:e,children:t})}function sN(e){const t=a.useContext(ml);if(!t)throw new Error(`${e} must be used inside <AlertDialog.Header>.`);return t}function pl(){return a.useContext(ml)}const aN="alertdialog",lN="dialog";function iN(e,t){return e?t:void 0}function cN(e,t){return e?t:void 0}function mc(e){return{"aria-haspopup":lN,"aria-expanded":e}}function uN(){return{"aria-hidden":!0}}function dN(e){return"primary"}function fN(e){switch(e){case"danger":case"success":case"info":case"warning":return e;default:return"default"}}function ur(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function mN(e){return ur(e,t=>t==="AlertDialogTitle")}function pN(e){return ur(e,t=>t==="AlertDialogDescription")}function bm(e){return ur(e,t=>t==="AlertDialogIndicator")}function Am(e){return ur(e,t=>t==="AlertDialogClose")}function vm(e,t){return ea(e,t)}function _m(e,t){return ta(e,t)}function CN(e,t,n,o){return o?!0:n===null?!1:n!==void 0?!0:vm(e,t)&&_m(e,t)!==null}function gN(e,t,n,o,r,s=bm(r),l=Am(r)){return{hasIndicator:CN(e,t,n,s),hasTitle:mN(r),hasDescription:pN(r),hasAction:!1,hasClose:l||o}}function Lm(e,t){return a.Children.map(e,n=>{if(!a.isValidElement(n))return n;if(n.type===Vt){const o=n.props;return a.cloneElement(n,{size:o.size??t})}if(n.type===a.Fragment){const o=n;return a.cloneElement(o,{key:o.key??void 0},Lm(o.props.children,t))}return n})}function Cl({open:e,gloss:t=!1,contained:n=!1,onOpenChange:o,dismissOnBackdrop:r=!1,enableContainedEscape:s=!1,focusOnOpen:l=!0,getPanelOpen:u,getPanelExit:d,preparePanel:f,panelMotionKey:m}){const[p,C]=a.useState(!1),S=a.useRef(null),g=a.useRef(null),h=a.useRef(null),x=a.useRef(null),A=a.useRef(null),b=a.useRef(!1),_=a.useRef(u),L=a.useRef(d),v=a.useRef(f);_.current=u,L.current=d,v.current=f;const R=e||p,T=a.useMemo(()=>i.createGlossInteractiveRefCallback(x,t),[t]);a.useLayoutEffect(()=>{e&&(b.current=!1,C(!0))},[e]),a.useEffect(()=>{if(!R||n)return;const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[R,n]),a.useEffect(()=>{if(!e||!n||!s||!o)return;const I=O=>{O.key==="Escape"&&(O.preventDefault(),o(!1))};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,n,s,o]),a.useLayoutEffect(()=>{var j;if(e||!p)return;const I=g.current,O=h.current;let N=!1;const y=()=>{N||($L({dialog:S.current,focusReturn:A.current,unmount:()=>C(!1)}),A.current=null)};if(b.current){b.current=!1,y();return}if(!I||!O||Rt()){y();return}i.killMotion(I,O);const w={...i.motionModal(),overwrite:"auto"},P=(j=L.current)==null?void 0:j.call(L,O),k=UL({overlay:I,panel:O,vars:w,onComplete:y,...P?{panelExit:P}:{}});return()=>{N=!0,k.kill(),i.killMotion(I,O)}},[e,p,m]),a.useLayoutEffect(()=>{var w,P;if(!e)return;const I=S.current;I&&!I.open&&(A.current=YL(I),yL(I,{contained:n}));const O=g.current,N=h.current;if(!O||!N)return;if(Rt()){VL(O,N,{focusPanel:l});return}(w=v.current)==null||w.call(v,N);const y=(P=_.current)==null?void 0:P.call(_,N);zL({overlay:O,panel:N,vars:{...i.motionModal(),overwrite:"auto"},...y?{panelFrom:y.from,panelTo:y.to}:{}}),l&&N.focus()},[e,n,l,m]);const E=a.useCallback(I=>{!r||!o||I.target===I.currentTarget&&o(!1)},[r,o]);return{mounted:p,showPortal:R,dialogRef:S,overlayRef:g,panelRef:h,skipCloseAnimRef:b,bindGlossPanelRef:T,handleBackdropPointerDown:E}}function SN({open:e,variant:t,contained:n=!1}){const o=Cl({open:e,gloss:t==="gloss",contained:n});return{mounted:o.mounted,showPortal:o.showPortal,dialogRef:o.dialogRef,overlayRef:o.overlayRef,panelRef:o.panelRef,bindGlossPanelRef:o.bindGlossPanelRef}}const hN="flex min-h-0 flex-1 flex-col text-left";function lo(e){const t=zo[e];return{rounded:t.rounded,panelMax:t.panelMax,maxHeight:t.maxHeight,headerGap:t.headerGap,headerPadding:t.headerPadding,bodyPadding:t.bodyPadding,footerPadding:t.footerPadding,headingGap:t.headingGap,titleVariant:t.titleVariant,titleClassName:t.titleClassName,descVariant:t.descVariant,descClassName:t.descClassName,bodyVariant:t.bodyVariant,footerButtonSize:t.footerButtonSize,closeButtonSize:t.closeButtonSize}}const xN={small:lo("small"),base:lo("base"),mid:lo("mid"),large:lo("large")},bN="m-0 flex h-full w-full max-h-none max-w-none items-center justify-center border-0 bg-transparent p-large open:flex [&::backdrop]:bg-transparent",AN="fixed inset-0 z-dialog",vN="absolute inset-0 z-dialog";function _N(e){return i.cn(e?vN:AN,bN)}const LN="overlay-backdrop",TN="overlay-backdrop-scrim",EN="relative z-10 w-full outline-none",RN="flex min-h-0 flex-col overflow-hidden border-token bg-surface text-left text-foreground shadow-token-large",IN="gloss-panel gloss-deep flex min-h-0 w-full flex-col text-foreground",yN="flex shrink-0 items-start",NN="flex min-w-0 flex-1 flex-col text-left",wN="min-w-0",ON="min-h-0 flex-1 overflow-y-auto py-small",PN="flex shrink-0 flex-wrap items-center justify-end gap-base",DN="shrink-0",pc="outline-none focus-ring",Tm="gloss-content";function Em(){return uf()}function Rm(e,t){return i.cn("absolute inset-0",e?LN:TN,t)}function kN({variant:e,sizePreset:t,className:n,slotClass:o}){const r=e==="gloss";return i.cn(EN,t.panelMax,t.rounded,!r&&RN,!r&&t.maxHeight,o,n)}function BN({maxHeight:e,rounded:t,slotClass:n}){return i.cn(IN,t,e,n)}function Im(e,t=!1){return i.cn(hN,t&&Tm,e)}function jN(e,t){return i.cn(ON,e,t)}function MN(e){return Ee(e).footerButtonSize}const FN="flex min-h-0 flex-1 flex-col text-left";function io(e){const t=zo[e];return{rounded:t.rounded,panelMax:t.panelMax,maxHeight:t.maxHeight,headerGap:t.alertHeaderGap,headerPadding:t.headerPadding,bodyPadding:t.bodyPadding,footerPadding:t.footerPadding,iconClass:t.iconClass,titleVariant:t.alertTitleVariant,titleClassName:t.titleClassName,descVariant:t.descVariant,descClassName:t.descClassName,bodyVariant:t.bodyVariant,footerButtonSize:t.footerButtonSize,closeButtonSize:t.closeButtonSize}}const HN={small:io("small"),base:io("base"),mid:io("mid"),large:io("large")},GN="m-0 flex h-full w-full max-h-none max-w-none items-center justify-center border-0 bg-transparent p-large open:flex [&::backdrop]:bg-transparent",VN="fixed inset-0 z-dialog",zN="absolute inset-0 z-dialog";function UN(e){return i.cn(e?zN:VN,GN)}const WN="relative z-10 w-full outline-none",YN="flex min-h-0 flex-col overflow-hidden text-left",$N="gloss-panel gloss-deep flex min-h-0 w-full flex-col text-left text-foreground",XN="gloss-content",KN="shrink-0",Cc="outline-none focus-ring",qN="shrink-0 [&_svg]:block",ZN="shrink-0",QN="contents",JN="font-w-mid",ew="min-h-0 flex-1 overflow-y-auto py-small",tw="flex shrink-0 flex-wrap items-center justify-end gap-base";function nw(e){return i.cn(Lu(e,"default"),"shadow-token-large")}function ow(e,t){return Rm(e,t)}function rw(){return Em()}function sw(e,t){return i.cn(ew,e,"text-left",t)}function ym(e){return i.cn(FN,e)}function aw({variant:e,sizePreset:t,className:n,slotClass:o}){const r=e==="gloss";return i.cn(WN,t.panelMax,t.rounded,!r&&YN,!r&&t.maxHeight,!r&&nw(e),o,n)}function lw({maxHeight:e,rounded:t,slotClass:n}){return i.cn($N,t,e,n)}function iw(e){return Tu(e)}function Nm(e){return Ee(e).footerButtonSize}function gl({className:e,...t}){const n=Xe();return c.jsx("div",{className:ym(i.cn(n.content,e)),...t})}gl.displayName="AlertDialogContent";const Sl=a.forwardRef(function({className:t,onClick:n,size:o,...r},s){const{onOpenChange:l,sizePreset:u}=_t(),d=pl(),f=Xe();return c.jsx(Cn,{ref:s,variant:"secondary",size:o??u.closeButtonSize,className:i.cn(KN,d&&mu(d.gridSlots),f.close,t),onClick:m=>{n==null||n(m),m.defaultPrevented||l(!1)},...r})});Sl.displayName="AlertDialogClose";function hl({className:e,children:t,...n}){const{variant:o,status:r,sizePreset:s,gridSlots:l,headerIcon:u}=sN("AlertDialog.Indicator"),d=Xe();if(t===null)return null;const f=_m(o,r),m=t!==void 0?t:u!==void 0?u:vm(o,r)&&f!==null?c.jsx(f,{"aria-hidden":!0,className:s.iconClass}):null;return m===null?null:c.jsx("span",{className:i.cn(qN,iw(r),Ft(l),d.indicator,e),...n,children:m})}hl.displayName="AlertDialogIndicator";function wm({icon:e,showClose:t=!0,className:n,children:o,...r}){const{variant:s,status:l,sizePreset:u}=_t(),d=Xe(),{gridSlots:f,compoundHasIndicator:m,compoundHasClose:p}=a.useMemo(()=>{const h=bm(o),x=Am(o);return{compoundHasIndicator:h,compoundHasClose:x,gridSlots:gN(s,l,e,t,o,h,x)}},[o,e,t,l,s]),C=a.useMemo(()=>({variant:s,status:l,sizePreset:u,gridSlots:f,headerIcon:e}),[f,e,u,l,s]),S=f.hasIndicator&&!m,g=t&&!p;return c.jsx(rN,{value:C,children:c.jsxs("div",{className:i.cn(ZN,u.headerPadding,gn(f,u.headerGap),d.header,n),...r,children:[S?c.jsx(hl,{}):null,o,g?c.jsx(Sl,{}):null]})})}wm.displayName="AlertDialogHeader";const Om=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,setHasTitle:l,sizePreset:u}=_t(),d=pl(),f=Xe();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"h2",variant:u.titleVariant,id:n??s,className:i.cn(JN,u.titleClassName,d&&Sn(d.gridSlots),f.title,t),...o})});Om.displayName="AlertDialogTitle";function Pm({className:e,id:t,...n}){const{descriptionId:o,setHasDescription:r,sizePreset:s}=_t(),l=pl(),u=Xe();return a.useLayoutEffect(()=>(r(!0),()=>r(!1)),[r]),c.jsx(q,{as:"p",variant:s.descVariant,id:t??o,className:i.cn(s.descClassName,l&&kn(l.gridSlots),u.description,e),...n})}Pm.displayName="AlertDialogDescription";function Dm({className:e,...t}){const n=Xe();return c.jsx("div",{className:i.cn(QN,n.headingBlock,e),...t})}Dm.displayName="AlertDialogHeadingBlock";function km({className:e,children:t,...n}){const{sizePreset:o}=_t(),r=Xe();return c.jsx("div",{className:sw(o.bodyPadding,i.cn(r.body,e)),...n,children:c.jsx(q,{variant:o.bodyVariant,as:"div",children:t})})}km.displayName="AlertDialogBody";function Bm({className:e,children:t,...n}){const{footerButtonSize:o,sizePreset:r}=_t(),s=Xe(),l=a.useMemo(()=>Lm(t,o),[t,o]);return c.jsx("div",{className:i.cn(tw,r.footerPadding,s.footer,e),...n,children:l})}Bm.displayName="AlertDialogFooter";const jm=a.forwardRef(function({children:t,asChild:n,className:o,onClick:r,onPointerDown:s,...l},u){const{open:d,onOpenChange:f}=_t(),m=Xe(),p=a.useRef(null),C=At(),S=a.useCallback(A=>{p.current=A,ue(u,A)},[u]),g=a.useCallback(A=>{var b;d||C.current||A.button!==0||(A.preventDefault(),(b=p.current)==null||b.focus({preventScroll:!0}),bt({triggerRef:p,openingRef:C,setOpen:()=>f(!0)}))},[d,C,f]),h=a.useCallback(A=>{r==null||r(A),!A.defaultPrevented&&!d&&!C.current&&f(!0)},[r,d,C,f]);if(n&&a.isValidElement(t)){const A=a.Children.count(t)===1?t:null;if(A){const b=A;return a.cloneElement(b,yt(b,{...l,className:i.cn(Cc,m.trigger,o),onPointerDown:_=>{g(_),s==null||s(_)},onClick:h,...mc(d)},$e(_=>{p.current=_},u),{runBeforeChild:["onPointerDown"]}))}}const x=mc(d);return c.jsx("button",{type:"button",ref:S,...x,className:i.cn(Cc,m.trigger,o),onPointerDown:A=>{s==null||s(A),g(A)},onClick:h,...l,children:t})});jm.displayName="AlertDialog.Trigger";function Mm({className:e,themeAnchor:t,portalContainer:n,children:o}){const{open:r,titleId:s,descriptionId:l,hasTitle:u,hasDescription:d,variant:f,sizePreset:m,closeOnEscape:p,onOpenChange:C,portalContainer:S}=_t(),g=gt(n??S),h=fn(g),x=SN({open:r,variant:f,contained:h}),A=Fa(r,t??null),b=Ma(A),_=An(A);return typeof document>"u"||!x.showPortal||!g?null:Ut.createPortal(c.jsx(cw,{className:e,variant:f,sizePreset:m,portalTheme:_,lightUi:b,titleId:s,descriptionId:l,hasTitle:u,hasDescription:d,closeOnEscape:p,onOpenChange:C,dialogRef:x.dialogRef,overlayRef:x.overlayRef,panelRef:x.panelRef,bindGlossPanelRef:x.bindGlossPanelRef,contained:h,children:o}),g)}Mm.displayName="AlertDialog.Panel";function cw({children:e,className:t,variant:n,sizePreset:o,portalTheme:r,lightUi:s,titleId:l,descriptionId:u,hasTitle:d,hasDescription:f,closeOnEscape:m,onOpenChange:p,dialogRef:C,overlayRef:S,panelRef:g,bindGlossPanelRef:h,contained:x=!1}){const A=n==="gloss",b=Xe();return c.jsxs("dialog",{...r,ref:C,role:aN,onCancel:_=>{_.preventDefault(),m&&p(!1)},"aria-labelledby":cN(d,l),"aria-describedby":iN(f,u),className:i.cn(UN(x),b.dialog),children:[c.jsx("div",{ref:S,className:ow(s,b.overlay),style:rw(),...uN()}),c.jsx("div",{ref:g,tabIndex:-1,className:aw({variant:n,sizePreset:o,className:t,slotClass:b.panel}),children:A?c.jsx("div",{ref:h,className:lw({maxHeight:o.maxHeight,rounded:o.rounded,slotClass:b.glossPanel}),children:c.jsx("div",{className:ym(i.cn(XN,b.glossContent)),children:e})}):c.jsx(gl,{children:e})})]})}function uw({open:e,defaultOpen:t=!1,onOpenChange:n,status:o,variant:r="default",size:s="base",closeOnEscape:l=!0,portalContainer:u}){const[d,f]=Re({value:e,defaultValue:t,onChange:n}),m=a.useId(),p=a.useId(),[C,S]=a.useState(!1),[g,h]=a.useState(!1),x=a.useCallback(R=>{S(R)},[]),A=a.useCallback(R=>{h(R)},[]),b=Qs(r),_=Js(o),L=HN[s];return{contextValue:{open:d,titleId:m,descriptionId:p,hasTitle:C,setHasTitle:x,hasDescription:g,setHasDescription:A,onOpenChange:f,closeOnEscape:l,variant:b,status:_,size:s,sizePreset:L,footerButtonSize:Nm(s),portalContainer:u}}}function Fm({open:e,defaultOpen:t=!1,onOpenChange:n,children:o,status:r,variant:s="default",size:l="base",closeOnEscape:u=!0,classNames:d,portalContainer:f}){const m=uw({open:e,defaultOpen:t,onOpenChange:n,status:r,variant:s,size:l,closeOnEscape:u,portalContainer:f});return c.jsx(oN,{classNames:d,children:c.jsx(nN,{value:m.contextValue,children:o})})}Fm.displayName="AlertDialog";const dw=Object.assign(Fm,{Trigger:jm,Panel:Mm,Content:gl,Header:wm,Indicator:hl,HeadingBlock:Dm,Title:Om,Description:Pm,Body:km,Footer:Bm,Close:Sl}),Hm=a.createContext(null),os=a.createContext({});function fw({value:e,children:t}){return c.jsx(Hm.Provider,{value:e,children:t})}function mw({classNames:e,children:t}){const n=a.useContext(os),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(os.Provider,{value:o,children:t})}function ot(){const e=a.useContext(Hm);if(!e)throw new Error("Dialog.* components must be used inside <Dialog>.");return e}function rt(){return a.useContext(os)}function pw({open:e,onOpenChange:t,variant:n,dismissOnBackdrop:o=!0,contained:r=!1}){const s=Cl({open:e,gloss:n==="gloss",contained:r,onOpenChange:t,dismissOnBackdrop:o,enableContainedEscape:!0});return{mounted:s.mounted,showPortal:s.showPortal,dialogRef:s.dialogRef,overlayRef:s.overlayRef,panelRef:s.panelRef,bindGlossPanelRef:s.bindGlossPanelRef,handleBackdropPointerDown:s.handleBackdropPointerDown}}function Gm(e,t){return a.Children.map(e,n=>{if(!a.isValidElement(n))return n;if(n.type===Vt){const o=n.props;return a.cloneElement(n,{size:o.size??t})}if(n.type===a.Fragment){const o=n;return a.cloneElement(o,{key:o.key??void 0},Gm(o.props.children,t))}return n})}function Cw(e){const{footerButtonSize:t}=ot();return a.useMemo(()=>Gm(e,t),[e,t])}const xl=a.forwardRef(function({className:t,...n},o){const r=rt();return c.jsx("div",{ref:o,className:Im(i.cn(r.content,t)),...n})});xl.displayName="DialogContent";const Vm=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=ot(),s=rt();return c.jsx("div",{ref:o,className:i.cn(yN,r.headerGap,r.headerPadding,s.header,t),...n})});Vm.displayName="DialogHeader";const zm=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,setHasTitle:l,sizePreset:u}=ot(),d=rt();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"h2",variant:u.titleVariant,id:n??s,className:i.cn(wN,u.titleClassName,d.title,t),...o})});zm.displayName="DialogTitle";const Um=a.forwardRef(function({className:t,id:n,...o},r){const{descriptionId:s,setHasDescription:l,sizePreset:u}=ot(),d=rt();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"p",variant:u.descVariant,id:n??s,className:i.cn(u.descClassName,d.description,t),...o})});Um.displayName="DialogDescription";function Wm({className:e,...t}){const{sizePreset:n}=ot(),o=rt();return c.jsx("div",{className:i.cn(NN,n.headingGap,o.headingBlock,e),...t})}Wm.displayName="DialogHeadingBlock";const Ym=a.forwardRef(function({className:t,onClick:n,size:o,"aria-label":r,...s},l){const{onOpenChange:u,sizePreset:d}=ot(),f=rt();return c.jsx(Cn,{ref:l,variant:"secondary",size:o??d.closeButtonSize,"aria-label":r,className:i.cn(DN,f.close,t),onClick:m=>{n==null||n(m),m.defaultPrevented||u(!1)},...s})});Ym.displayName="DialogClose";const $m=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=ot(),s=rt();return c.jsx("div",{ref:o,className:jN(r.bodyPadding,i.cn(s.body,t)),...n})});$m.displayName="DialogBody";const Xm=a.forwardRef(function({className:t,children:n,...o},r){const{sizePreset:s}=ot(),l=rt(),u=Cw(n);return c.jsx("div",{ref:r,className:i.cn(PN,s.footerPadding,l.footer,t),...o,children:u})});Xm.displayName="DialogFooter";const Km=a.forwardRef(function({children:t,asChild:n,className:o,onClick:r,onPointerDown:s,...l},u){const{open:d,onOpenChange:f}=ot(),m=rt(),p=a.useRef(null),C=At(),S=a.useCallback(x=>{p.current=x,ue(u,x)},[u]),g=a.useCallback(x=>{var A;d||C.current||x.button!==0||(x.preventDefault(),(A=p.current)==null||A.focus({preventScroll:!0}),bt({triggerRef:p,openingRef:C,setOpen:()=>f(!0)}))},[d,C,p,f]),h=a.useCallback(x=>{r==null||r(x),!x.defaultPrevented&&!d&&!C.current&&f(!0)},[r,d,C,f]);if(n&&a.isValidElement(t)){const x=a.Children.count(t)===1?t:null;if(x){const A=x;return a.cloneElement(A,yt(A,{...l,className:i.cn(pc,m.trigger,o),onPointerDown:b=>{g(b),s==null||s(b)},onClick:h,"aria-haspopup":"dialog","aria-expanded":d},$e(b=>{p.current=b},u),{runBeforeChild:["onPointerDown"]}))}}return c.jsx("button",{type:"button",ref:S,"aria-haspopup":"dialog","aria-expanded":d,className:i.cn(pc,m.trigger,o),onPointerDown:x=>{s==null||s(x),g(x)},onClick:h,...l,children:t})});Km.displayName="Dialog.Trigger";const qm=a.forwardRef(function({variant:t="default",dismissOnBackdrop:n=!0,className:o,style:r,themeAnchor:s,portalContainer:l,children:u,...d},f){const{open:m,onOpenChange:p,titleId:C,descriptionId:S,hasTitle:g,hasDescription:h,sizePreset:x,portalContainer:A}=ot(),b=gt(l??A),_=fn(b),L=pw({open:m,onOpenChange:p,variant:t,dismissOnBackdrop:n,contained:_}),v=Fa(m,s??null),R=Ma(v),T=An(v);return typeof document>"u"||!L.showPortal||!b?null:Ut.createPortal(c.jsx(gw,{className:o,style:r,variant:t,sizePreset:x,portalTheme:T,lightUi:R,titleId:C,descriptionId:S,hasTitle:g,hasDescription:h,dialogRef:L.dialogRef,overlayRef:L.overlayRef,panelRef:L.panelRef,panelForwardedRef:f,panelRest:d,bindGlossPanelRef:L.bindGlossPanelRef,onBackdropMouseDown:L.handleBackdropPointerDown,onDialogClose:()=>p(!1),onDialogCancel:E=>{E.preventDefault(),p(!1)},contained:_,children:u}),b)});qm.displayName="Dialog.Panel";function gw({children:e,className:t,style:n,variant:o,sizePreset:r,portalTheme:s,lightUi:l,titleId:u,descriptionId:d,hasTitle:f,hasDescription:m,dialogRef:p,overlayRef:C,panelRef:S,panelForwardedRef:g,panelRest:h,bindGlossPanelRef:x,onBackdropMouseDown:A,onDialogClose:b,onDialogCancel:_,contained:L=!1}){const v=o==="gloss",R=rt();return c.jsxs("dialog",{...s,ref:p,onClose:b,onCancel:_,"aria-labelledby":f?u:void 0,"aria-describedby":m?d:void 0,className:i.cn(_N(L),R.dialog),children:[c.jsx("div",{ref:C,className:Rm(l,R.overlay),style:Em(),"aria-hidden":!0,onMouseDown:A}),c.jsx("div",{ref:$e(S,g),tabIndex:-1,className:kN({variant:o,sizePreset:r,className:t,slotClass:R.panel}),style:n,...h,children:v?c.jsx("div",{ref:x,className:BN({maxHeight:r.maxHeight,rounded:r.rounded,slotClass:R.glossPanel}),children:c.jsx("div",{className:Im(i.cn(Tm,R.glossContent),!0),children:e})}):c.jsx(xl,{children:e})})]})}function Sw({open:e,defaultOpen:t=!1,onOpenChange:n,size:o="base",portalContainer:r}){const[s,l]=Re({value:e,defaultValue:t,onChange:n}),u=a.useId(),d=a.useId(),[f,m]=a.useState(!1),[p,C]=a.useState(!1),S=a.useCallback(A=>{m(A)},[]),g=a.useCallback(A=>{C(A)},[]),h=xN[o];return{contextValue:{open:s,titleId:u,descriptionId:d,hasTitle:f,setHasTitle:S,hasDescription:p,setHasDescription:g,onOpenChange:l,size:o,sizePreset:h,footerButtonSize:MN(o),portalContainer:r}}}function Zm({open:e,defaultOpen:t=!1,onOpenChange:n,size:o="base",children:r,classNames:s,portalContainer:l}){const u=Sw({open:e,defaultOpen:t,onOpenChange:n,size:o,portalContainer:l});return c.jsx(fw,{value:u.contextValue,children:c.jsx(mw,{classNames:s,children:r})})}Zm.displayName="Dialog";const hw=Object.assign(Zm,{Trigger:Km,Panel:qm,Content:xl,Header:Vm,HeadingBlock:Wm,Title:zm,Description:Um,Close:Ym,Body:$m,Footer:Xm}),gc="sr-only absolute m-0 h-px w-px overflow-hidden whitespace-nowrap border-0 p-0";function xw(e){return e==="danger"||e==="warning"?"alert":"status"}function bw(e,t=Se.toastNotifications){return pn(t,{placement:e})}function Qm(e,t){const n=[];return typeof e=="string"&&e.trim()?n.push(e.trim()):typeof e=="number"&&n.push(String(e)),typeof t=="string"&&t.trim()?n.push(t.trim()):typeof t=="number"&&n.push(String(t)),n.join(". ")}function Aw(e,t){return Qm(e,t)||void 0}const bl=a.createContext(null),Jm=a.createContext(null),rs=a.createContext({});function ep({classNames:e,children:t}){const n=a.useContext(rs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(rs.Provider,{value:o,children:t})}function vw({value:e,children:t}){return c.jsx(Jm.Provider,{value:e,children:t})}function tp(){const e=a.useContext(bl);if(!e)throw new Error("Components Toast must be used inside <Toast.Provider>.");return e}function Un(){const e=a.useContext(Jm);if(!e)throw new Error("Toast.* must be inside <Toast>.");return e}function Pt(){return a.useContext(rs)}const np="Loading";function _w(e=np){return{role:"status","aria-live":"polite","aria-label":e}}function op(){return{"aria-hidden":!0}}const Lw={small:{icon:i.CONTROL_SIZE_LAYOUT.small.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.small.spinnerBorder},base:{icon:i.CONTROL_SIZE_LAYOUT.base.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.base.spinnerBorder},mid:{icon:i.CONTROL_SIZE_LAYOUT.mid.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.mid.spinnerBorder},large:{icon:i.CONTROL_SIZE_LAYOUT.large.spinnerIcon,border:i.CONTROL_SIZE_LAYOUT.large.spinnerBorder}},Tw={primary:"text-primary",foreground:"text-foreground",muted:"text-muted",secondary:"text-primary",danger:"text-danger",success:"text-success",info:"text-info",warning:"text-warning"},Ew="inline-flex shrink-0 items-center justify-center",Rw="box-border inline-block rounded-full border-current border-t-transparent animate-spin motion-reduce:animate-none",Iw="flex items-end",yw="block shrink-0 rounded-full origin-bottom",dr={small:{dotClass:"size-[calc(var(--icon-size-xsmall)*0.45)]",dotSizeVar:"calc(var(--icon-size-xsmall) * 0.45)",gapClass:"gap-[calc(var(--space-xsmall)*0.75)]",jumpPx:5,scalePeak:1.25},base:{dotClass:"size-[calc(var(--icon-size-xsmall)*0.6)]",dotSizeVar:"calc(var(--icon-size-xsmall) * 0.6)",gapClass:"gap-xsmall",jumpPx:7,scalePeak:1.3},mid:{dotClass:"size-[calc(var(--icon-size-xsmall)*0.75)]",dotSizeVar:"calc(var(--icon-size-xsmall) * 0.75)",gapClass:"gap-xsmall",jumpPx:9,scalePeak:1.35},large:{dotClass:"size-[calc(var(--icon-size-small)*0.75)]",dotSizeVar:"calc(var(--icon-size-small) * 0.75)",gapClass:"gap-small",jumpPx:12,scalePeak:1.4}},Nw={primary:"bg-primary",foreground:"bg-foreground",muted:"bg-muted-foreground",secondary:"bg-primary",danger:"bg-danger",success:"bg-success",info:"bg-info",warning:"bg-warning"};function ww(e,t,n){const o=Lw[e];return i.cn(Rw,o.icon,o.border,Tw[t],n)}function Ow(e,t){const n=dr[e];return i.cn(Iw,n.gapClass,t)}function Pw(e,t,n){return i.cn(yw,dr[e].dotClass,Nw[t],n)}function Dw(e){const{jumpPx:t,dotSizeVar:n}=dr[e];return{height:`calc(${n} + ${t}px)`}}const kw=3;function Bw(e,t){const{jumpPx:n,scalePeak:o}=dr[t],{staggerSec:r,halfCycleSec:s,easeUp:l,easeDown:u,enabled:d}=i.motionLoadingDots();for(const f of e)i.killMotion(f),$.set(f,{y:0,scale:1,transformOrigin:"50% 100%"});return d?e.map((f,m)=>$.to(f,{keyframes:[{y:-n,scale:o,duration:s,ease:l},{y:0,scale:1,duration:s,ease:u}],repeat:-1,delay:r*m,transformOrigin:"50% 100%"})):[]}function jw(e,t){const n=a.useSyncExternalStore(i.subscribeMotionConfig,i.getMotionConfigRevision,i.getMotionConfigRevision),o=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const r=e.current;if(!r)return;const s=Array.from(r.querySelectorAll("[data-loading-dot]")).slice(0,kw);if(s.length===0)return;let l=[];return o||(l=Bw(s,t)),()=>{for(const u of l)u.kill();for(const u of s)i.killMotion(u)}},[t,e,n,o])}const Mw=[0,1,2];function rp({size:e,color:t,className:n}){return c.jsx("span",{...op(),className:ww(e,t,n)})}function sp({size:e,color:t,className:n,dotClassName:o}){const r=a.useRef(null);return jw(r,e),c.jsx("span",{ref:r,className:Ow(e,n),style:Dw(e),...op(),children:Mw.map(s=>c.jsx("span",{"data-loading-dot":!0,className:Pw(e,t,o)},s))})}sp.displayName="LoadingDots";rp.displayName="LoadingSpinner";const Al=a.forwardRef(function({type:t="spinner",size:n="base",color:o="primary",label:r=np,className:s="",classNames:l,...u},d){return c.jsx("span",{ref:d,..._w(r),className:i.cn(Ew,l==null?void 0:l.root,s),...u,children:t==="dots"?c.jsx(sp,{size:n,color:o,className:l==null?void 0:l.dots,dotClassName:l==null?void 0:l.dot}):c.jsx(rp,{size:n,color:o,className:l==null?void 0:l.spinner})})});Al.displayName="Loading";const Fw="bg-surface border-token text-foreground",ap={default:"text-primary",success:"text-success",danger:"text-danger",info:"text-info",warning:"text-warning"},lp="contents",Hw="font-w-mid";function Gw(e){return i.cn(Hw,e!=="default"?ap[e]:"")}const Vw="text-muted",zw="-mx-xsmall",Uw="inline-flex shrink-0 items-center justify-center";function Ww(e,t,n){return i.cn(Uw,t,ap[e],n)}const Yw={default:"primary",success:"success",danger:"danger",info:"info",warning:"warning"},$w="fixed z-toast pointer-events-none",Xw="relative grid",Kw="pointer-events-none absolute",qw={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"};function Zw(e){return qw[e]}function Qw(e){return Yw[e]}function Jw({variant:e,size:t,gridSlots:n,slotClass:o,className:r}){const s=e==="gloss",l=Ct(t);return i.cn(gn(n,l.gridGap),`w-full ${l.shellPadding}`,s?i.cn("gloss-panel gloss-deep border-0 text-foreground",i.GLOSS_INTERACTIVE_MOTION_CLASS):i.cn("shadow-token-mid",Fw),o,r)}function eO({placement:e,slotClass:t}){return i.cn($w,Zw(e),t)}function tO(e){return i.cn(Xw,e)}function nO(e){return i.cn(Kw,e)}const vl=a.forwardRef(function({className:t,children:n,...o},r){const{status:s,loading:l,gridSlots:u,sizePreset:d}=Un(),f=Pt(),m=Ww(s,d.iconSvgClass);if(n!==void 0)return c.jsx("span",{ref:r,className:i.cn(m,Ft(u),f.indicator,t),...o,children:n});if(l)return c.jsx("span",{ref:r,className:i.cn(m,Ft(u),f.indicator,t),...o,children:c.jsx(Al,{size:d.loadingSize,color:Qw(s)})});if(s==="default")return null;const p=Zs[s];return p?c.jsx("span",{ref:r,className:i.cn(m,Ft(u),f.indicator,t),...o,children:c.jsx(p,{"aria-hidden":!0})}):null});vl.displayName="ToastIndicator";const ip=a.forwardRef(function({className:t,...n},o){const r=Pt();return c.jsx("div",{ref:o,className:i.cn(lp,r.message,t),...n})});ip.displayName="ToastMessage";const cp=a.forwardRef(function({className:t,...n},o){const r=Pt();return c.jsx("div",{ref:o,className:i.cn(lp,r.content,t),...n})});cp.displayName="ToastContent";const _l=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,gridSlots:l,sizePreset:u,status:d}=Un(),f=Pt();return c.jsx(q,{ref:r,as:"div",variant:u.titleVariant,id:n??s,className:i.cn(Gw(d),Sn(l),f.title,t),...o})});_l.displayName="ToastTitle";const Ll=a.forwardRef(function({className:t,id:n,...o},r){const{descriptionId:s,gridSlots:l,sizePreset:u}=Un(),d=Pt();return c.jsx(q,{ref:r,as:"div",variant:u.descVariant,id:n??s,className:i.cn(Vw,kn(l),d.description,t),...o})});Ll.displayName="ToastDescription";const Tl=a.forwardRef(function({className:t,...n},o){const{gridSlots:r}=Un(),s=Pt();return c.jsx("div",{ref:o,className:i.cn(Bn(r),s.action,t),...n})});Tl.displayName="ToastAction";const El=a.forwardRef(function({className:t,onClick:n,"aria-label":o,...r},s){const{dismiss:l,gridSlots:u}=Un(),d=Pt();return c.jsx(Cn,{ref:s,size:"small",variant:"ghost","aria-label":o,className:i.cn(zw,mu(u),d.close,t),onClick:f=>{n==null||n(f),f.defaultPrevented||l()},...r})});El.displayName="ToastClose";function oO({gridSlots:e,title:t,description:n,action:o,onClose:r}){return c.jsxs(c.Fragment,{children:[e.hasIndicator?c.jsx(vl,{}):null,t!=null?c.jsx(_l,{children:t}):null,n!=null?c.jsx(Ll,{children:n}):null,o!=null?c.jsx(Tl,{children:o}):null,r!=null?c.jsx(El,{}):null]})}const ss=8,rO=.04,ho=3,as=4e3,co=24;function sO(e,t){if(e<=0||t<=0)return 0;const n=Math.min(t-1,ho-1)*ss;return e+n}function aO(){return`toast-${Math.random().toString(36).slice(2)}`}function Wn(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function lO(e){return Wn(e,t=>t==="ToastTitle")}function iO(e){return Wn(e,t=>t==="ToastDescription")}function cO(e){return Wn(e,t=>t==="ToastIndicator")}function uO(e){return Wn(e,t=>t==="ToastAction")}function dO(e){return Wn(e,t=>t==="ToastClose")}function fO(e,t,n,o){return n?o:t?!0:e!=="default"}function mO(e,t,n,o,r,s,l,u){const d=t!=null||lO(u),f=n!=null||iO(u);return{hasIndicator:fO(e,s,l,cO(u)),hasTitle:d,hasDescription:f,hasAction:l?uO(u):o!=null,hasClose:l?dO(u):r!=null}}function pO({status:e="default",size:t,title:n,description:o,action:r,loading:s=!1,onClose:l,children:u}){const d=a.useId(),f=`${d}-title`,m=`${d}-description`,p=!!u,C=Ms(t),S=Ct(C),g=a.useMemo(()=>mO(e,n,o,r,l,s,p,u),[r,u,o,p,s,l,e,n]),h=a.useMemo(()=>({status:e,size:C,sizePreset:S,titleId:f,descriptionId:m,loading:s,dismiss:l??(()=>{}),gridSlots:g}),[m,g,s,l,C,S,e,f]);return{isCompound:p,titleId:f,size:C,itemCtx:h,gridSlots:g}}function CO({entry:e,reverseIdx:t,total:n,isTop:o,isDismissing:r,onDismiss:s,onRemoveFinal:l,onHeightChange:u,providerClassNames:d}){const f=a.useRef(null),m=a.useRef(null),p=a.useRef(null),C=a.useRef(!1),S=i.usePrefersReducedMotion(),g=Math.min(t,ho-1),h=1-g*rO,x=o?g*ss:-g*ss,A=t>=ho?0:1;a.useLayoutEffect(()=>{const v=p.current;if(!v)return;const R=S||!i.isMotionFeatureEnabled("enableToastStack"),T=!C.current;if(C.current=!0,i.killMotion(v),R){$.set(v,{y:x,scale:h,autoAlpha:A});return}T&&e.variant!=="gloss"?$.fromTo(v,{opacity:0},{opacity:A,...i.motionInteractive(),overwrite:"auto"}):(i.setWillChangeTransform(v,!0),$.to(v,{y:x,scale:h,autoAlpha:A,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(v)}))},[e.variant,x,S,A,h]),a.useLayoutEffect(()=>{const v=m.current;if(!v)return;u(e.id,v.offsetHeight);const R=new ResizeObserver(()=>{u(e.id,v.offsetHeight)});return R.observe(v),()=>R.disconnect()},[e.id,u]),a.useLayoutEffect(()=>{const v=f.current;if(!v)return;if(Rt()){ar(v);return}const R=o?-co:co;lr({surface:v,vars:{...i.motionInteractive(),overwrite:"auto"},from:{y:R,scale:sr},to:{y:0,scale:1}})},[o]),a.useEffect(()=>{if(!r)return;const v=f.current;if(!v)return;if(Rt()){l(e.id);return}const R=o?-co:co;i.killMotion(v),ir({surface:v,vars:{...i.motionToastDismiss(),overwrite:"auto"},exit:{y:R},onComplete:()=>l(e.id)})},[r,o,e.id,l]),a.useEffect(()=>{if(e.timeout===0||r||e.loading)return;let v=e.timeout,R=Date.now(),T,E=!1;const I=()=>{T!=null&&(window.clearTimeout(T),T=void 0)},O=()=>{I(),R=Date.now(),T=window.setTimeout(()=>s(e.id),v)},N=()=>{E||R==null||(E=!0,v=Math.max(0,v-(Date.now()-R)),R=null,I())},y=()=>{if(E){if(E=!1,v<=0){s(e.id);return}O()}};O();const w=p.current,P=()=>N(),k=()=>y(),j=()=>N(),B=D=>{w&&D.relatedTarget instanceof Node&&w.contains(D.relatedTarget)||y()};return w==null||w.addEventListener("pointerenter",P),w==null||w.addEventListener("pointerleave",k),w==null||w.addEventListener("focusin",j),w==null||w.addEventListener("focusout",B),()=>{I(),w==null||w.removeEventListener("pointerenter",P),w==null||w.removeEventListener("pointerleave",k),w==null||w.removeEventListener("focusin",j),w==null||w.removeEventListener("focusout",B)}},[e.id,e.timeout,r,e.loading,s]);const b=a.useCallback(()=>s(e.id),[e.id,s]),_=t<n,L={...d,...e.classNames};return c.jsx("div",{ref:p,"aria-hidden":!_||void 0,style:{gridColumn:1,gridRow:1,transformOrigin:o?"top center":"bottom center",zIndex:ho+1-t,pointerEvents:t===0?"auto":"none"},children:c.jsx("div",{ref:f,children:c.jsx(ep,{classNames:L,children:c.jsx(Rl,{ref:m,status:e.status,variant:e.variant,size:e.size,title:e.title,description:e.description,action:e.action,loading:e.loading,onClose:b})})})})}function gO(e,t){if(t<=0)return;const n=i.prefersReducedMotion()||!i.isMotionFeatureEnabled("enableToastStack");if(i.killMotion(e),n){e.style.height=`${t}px`;return}$.to(e,{height:t,...i.motionInteractive(),overwrite:"auto"})}function SO({placement:e,sorted:t,dismissingIds:n,onDismiss:o,onRemoveFinal:r,classNames:s,defaultSize:l="base"}){var A,b;const u=e.startsWith("top"),d=St("toastNotifications"),f=a.useRef(null);f.current||(f.current=new Map);const m=a.useRef(null),p=a.useRef(null),C=a.useRef(0),S=a.useRef({frontId:(A=t[0])==null?void 0:A.id,count:t.length});S.current={frontId:(b=t[0])==null?void 0:b.id,count:t.length};const g=i.usePrefersReducedMotion(),h=a.useCallback(()=>{const _=m.current;if(!_)return;const{frontId:L,count:v}=S.current,R=L!=null?f.current.get(L)??0:0,T=sO(R,v),E=T>0?T:C.current;T>0&&(C.current=T),gO(_,E)},[]),x=a.useCallback((_,L)=>{f.current.get(_)!==L&&(f.current.set(_,L),_===S.current.frontId&&h())},[h]);return a.useLayoutEffect(()=>{const _=new Set(t.map(L=>L.id));for(const L of f.current.keys())_.has(L)||f.current.delete(L);h()},[t,h]),a.useLayoutEffect(()=>{const _=p.current;_&&$.set(_,{opacity:0})},[]),a.useLayoutEffect(()=>{var R;const _=p.current;if(!_)return;const L=g,v=t.length===1&&n.has(((R=t[0])==null?void 0:R.id)??"");if(i.killMotion(_),L){$.set(_,{opacity:v?0:1});return}v?$.to(_,{opacity:0,...i.motionToastDismiss(),overwrite:"auto"}):$.to(_,{opacity:1,...i.motionInteractive(),overwrite:"auto"})},[t,n,g]),c.jsxs("div",{role:"region","aria-label":bw(e,d),className:eO({placement:e,slotClass:s==null?void 0:s.viewport}),style:{width:ih(t,l)},children:[c.jsx("div",{ref:p,"aria-hidden":!0,className:nO(s==null?void 0:s.scrim),style:{[u?"top":"bottom"]:`calc(-1 * ${mt(ft.offsetY)})`,left:`calc(-1 * ${mt(ft.insetX)})`,right:`calc(-1 * ${mt(ft.insetX)})`,height:mt(ft.height),background:mt(u?ft.gradientTop:ft.gradientBottom),maskImage:mt(ft.mask),WebkitMaskImage:mt(ft.mask)}}),c.jsx("div",{ref:m,className:tO(s==null?void 0:s.stack),style:{alignItems:u?"start":"end"},children:t.map((_,L)=>c.jsx(CO,{entry:_,reverseIdx:L,total:t.length,isTop:u,isDismissing:n.has(_.id),onDismiss:o,onRemoveFinal:r,onHeightChange:x,providerClassNames:s},_.id))})]})}function hO({defaultPlacement:e="bottom-center",defaultVariant:t="default",defaultSize:n="base",classNames:o}){const[r,s]=a.useState([]),[l,u]=a.useState(new Set),[d,f]=a.useState({text:"",assertive:!1,nonce:0}),m=a.useRef(0),p=a.useRef(0),C=a.useRef(r);C.current=r;const S=a.useCallback(v=>{const R=Qm(v.title,v.description);if(!R)return;const T=xw(v.status)==="alert";f({text:"",assertive:T,nonce:++p.current}),requestAnimationFrame(()=>{f({text:R,assertive:T,nonce:++p.current})})},[]),g=a.useCallback(v=>{const R=v.id??aO(),T={id:R,status:v.status??"default",variant:v.variant??t,size:v.size??n,title:v.title,description:v.description,action:v.action,timeout:v.timeout??as,placement:v.placement??e,createdAt:++m.current,loading:v.loading??!1,classNames:{...o,...v.classNames}};return s(E=>[...E,T]),S(T),R},[S,e,n,t,o]),h=a.useCallback((v,R)=>{const T=C.current.find(I=>I.id===v);if(!T)return;const E={...T,...R};s(I=>I.map(O=>O.id===v?E:O)),(R.title!==void 0||R.description!==void 0||R.status!==void 0||R.loading===!1)&&S(E)},[S]),x=a.useCallback(v=>{u(R=>new Set([...R,v]))},[]),A=a.useCallback(v=>{s(R=>R.filter(T=>T.id!==v)),u(R=>{const T=new Set(R);return T.delete(v),T})},[]),b=a.useMemo(()=>[...new Set(r.map(v=>v.placement))],[r]),_=a.useMemo(()=>({add:g,update:h,dismiss:x}),[g,x,h]),L=a.useCallback(v=>r.filter(R=>R.placement===v).toSorted((R,T)=>T.createdAt-R.createdAt),[r]);return{toasts:r,dismissingIds:l,placements:b,ctx:_,sortedByPlacement:L,dismiss:x,removeFinal:A,providerClassNames:o,defaultSize:n,liveAnnouncement:d}}function xO({announcement:e}){const t=e.assertive?"":e.text,n=e.assertive?e.text:"";return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:gc,"aria-live":"polite","aria-atomic":"true","aria-relevant":"additions text",children:t}),c.jsx("div",{className:gc,"aria-live":"assertive","aria-atomic":"true","aria-relevant":"additions text",children:n})]})}function bO({children:e,defaultPlacement:t="bottom-center",defaultVariant:n="default",defaultSize:o="base",portalContainer:r,classNames:s}){const l=hO({defaultPlacement:t,defaultVariant:n,defaultSize:o,classNames:s});return c.jsxs(bl.Provider,{value:l.ctx,children:[e,c.jsx(xO,{announcement:l.liveAnnouncement}),typeof document<"u"&&l.placements.map(u=>{const d=gt(r);return d?Ut.createPortal(c.jsx(SO,{placement:u,sorted:l.sortedByPlacement(u),dismissingIds:l.dismissingIds,onDismiss:l.dismiss,onRemoveFinal:l.removeFinal,classNames:s,defaultSize:l.defaultSize}),d,u):null})]})}const Rl=a.forwardRef(function({status:t="default",variant:n="default",size:o="base",title:r,description:s,action:l,loading:u=!1,onClose:d,className:f,classNames:m,children:p,onPointerOver:C,onPointerOut:S,...g},h){const x=pO({status:t,size:o,title:r,description:s,action:l,loading:u,onClose:d,children:p}),A=n==="gloss",b=a.useRef(null),_=a.useMemo(()=>i.createGlossInteractiveRefCallback(b,A),[A]),L=a.useCallback(w=>{_(w),b.current=w,typeof h=="function"?h(w):h&&(h.current=w)},[_,h]),v=i.useGlossInteractiveHandlers(b,A),R=Pt(),T=x.gridSlots.hasTitle,{"aria-label":E,"aria-labelledby":I,...O}=g,N=T?x.titleId:void 0,y=T?void 0:E??Aw(r,s);return c.jsx(vw,{value:x.itemCtx,children:c.jsx(ep,{classNames:m,children:c.jsx("div",{ref:L,role:"group","aria-labelledby":N,"aria-label":y,className:Jw({variant:n,size:x.size,gridSlots:x.gridSlots,slotClass:R.root,className:f}),onPointerOver:w=>{C==null||C(w),!w.defaultPrevented&&A&&v.onPointerOver(w)},onPointerOut:w=>{S==null||S(w),A&&v.onPointerOut(w)},...O,children:x.isCompound?p:c.jsx(oO,{gridSlots:x.gridSlots,title:r,description:s,action:l,onClose:d})})})})});Rl.displayName="ToastRoot";function AO(){const e=tp(),t=a.useCallback(s=>e.add(s),[e]),n=a.useCallback(s=>(l,u)=>e.add({...u,status:s,title:l}),[e]),o=a.useCallback((s,l)=>{const u=e.add({status:"default",title:l.loading??"Loading…",timeout:0,loading:!0,placement:l.placement,classNames:l.classNames});return s.then(d=>{const f=typeof l.success=="function"?l.success(d):l.success;e.update(u,{status:"success",title:f,loading:!1,timeout:l.timeout??as})},d=>{const f=l.error==null?"An error occurred":typeof l.error=="function"?l.error(d):l.error;e.update(u,{status:"danger",title:f,loading:!1,timeout:l.timeout??as})}),u},[e]);return{toast:{show:t,success:n("success"),danger:n("danger"),info:n("info"),warning:n("warning"),promise:o,dismiss:e.dismiss}}}const up=Object.assign(Rl,{Provider:bO,Message:ip,Indicator:vl,Content:cp,Title:_l,Description:Ll,Action:Tl,Close:El}),dp=a.createContext(null),ls=a.createContext({});function fp({value:e,children:t}){return c.jsx(dp.Provider,{value:e,children:t})}function vO({classNames:e,children:t}){const n=a.useContext(ls),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ls.Provider,{value:o,children:t})}function Ke(){const e=a.useContext(dp);if(!e)throw new Error("Drawer.* components must be used inside <Drawer>.");return e}function We(){return a.useContext(ls)}function _O(e,t=Se){switch(e){case"bottom":return t.drawerDragDownToClose;case"top":return t.drawerDragUpToClose;case"left":return t.drawerDragLeftToClose;case"right":return t.drawerDragRightToClose}}function LO(e){return e==="Enter"||e===" "}function TO(e){return e.displayName}function mp(e,t){return a.Children.map(e,n=>{if(!a.isValidElement(n))return n;if(n.type===Vt){const o=n.props;return a.cloneElement(n,{size:o.size??t})}if(n.type===a.Fragment){const o=n;return a.cloneElement(o,{key:o.key??void 0},mp(o.props.children,t))}return n})}function EO(e){let t=!0;const n=[];let o=[];const r=()=>{if(o.length===0)return;const s=o;o=[],n.push({kind:"content",children:s})};return a.Children.forEach(e,s=>{if(!a.isValidElement(s)){o.push(s);return}const l=TO(s.type);if(l==="DrawerBackdrop"){s.props.isDismissable===!1&&(t=!1);return}if(l==="DrawerHandle"){r(),n.push({kind:"handle",node:s});return}o.push(s)}),r(),{backdropIsDismissable:t,panelSegments:n}}function RO(e,t){return t==="left"||t==="right"?e.offsetWidth:e.offsetHeight}function pp(e,t){const n=RO(e,t);switch(t){case"left":return{x:-n,y:0};case"right":return{x:n,y:0};case"top":return{x:0,y:-n};case"bottom":return{x:0,y:n}}}function IO(){return{x:0,y:0}}function yO(e,t){return pp(e,t)}function NO(e){$.set(e,{xPercent:0,yPercent:0,x:0,y:0})}function wO(e,t){return{from:pp(e,t),to:IO()}}function OO({open:e,onOpenChange:t,variant:n,placement:o,backdropIsDismissable:r,contained:s=!1}){const l=Cl({open:e,gloss:n==="gloss",contained:s,onOpenChange:t,dismissOnBackdrop:r,enableContainedEscape:!0,panelMotionKey:o,preparePanel:NO,getPanelOpen:u=>wO(u,o),getPanelExit:u=>yO(u,o)});return{showPortal:l.showPortal,mounted:l.mounted,dialogRef:l.dialogRef,overlayRef:l.overlayRef,panelRef:l.panelRef,skipCloseAnimRef:l.skipCloseAnimRef,bindGlossPanelRef:l.bindGlossPanelRef,handleBackdropMouseDown:l.handleBackdropPointerDown}}const PO={left:"left-0 top-0 h-full",right:"right-0 top-0 h-full",bottom:"bottom-0 inset-x-0 w-full",top:"top-0 inset-x-0 w-full"},DO={default:{horizontal:"max-w-[min(100vw,24rem)] w-full",vertical:"max-h-[90dvh]"},mid:{horizontal:"w-[50vw] max-w-full",vertical:"max-h-[50dvh]"},full:{horizontal:"w-screen",vertical:"h-dvh"}},kO={small:{left:"rounded-r-small",right:"rounded-l-small",bottom:"rounded-t-small",top:"rounded-b-small"},base:{left:"rounded-r-base",right:"rounded-l-base",bottom:"rounded-t-base",top:"rounded-b-base"},mid:{left:"rounded-r-mid",right:"rounded-l-mid",bottom:"rounded-t-mid",top:"rounded-b-mid"},large:{left:"rounded-r-large",right:"rounded-l-large",bottom:"rounded-t-large",top:"rounded-b-large"}},BO={bottom:"pt-mid",top:"pb-mid",left:"pr-mid",right:"pl-mid"};function uo(e){const t=zo[e];return{rounded:t.rounded,headerGap:t.headerGap,headerPadding:t.headerPadding,bodyPadding:t.bodyPadding,footerPadding:t.footerPadding,headingGap:t.headingGap,titleVariant:t.titleVariant,titleClassName:t.titleClassName,descVariant:t.descVariant,descClassName:t.descClassName,bodyVariant:t.bodyVariant,footerButtonSize:t.footerButtonSize,closeButtonSize:t.closeButtonSize}}const jO={small:uo("small"),base:uo("base"),mid:uo("mid"),large:uo("large")},MO="flex min-h-0 flex-1 flex-col text-left",FO="m-0 h-full w-full max-h-none max-w-none border-0 bg-transparent p-0 open:block [&::backdrop]:bg-transparent",HO="fixed inset-0 z-dialog",GO="absolute inset-0 z-dialog";function VO(e){return i.cn(e?GO:HO,FO)}const zO="overlay-backdrop",UO="overlay-backdrop-scrim",WO="absolute z-10 flex flex-col outline-none overflow-hidden",YO="border-token bg-surface text-foreground shadow-token-large",$O="gloss-panel gloss-deep flex min-h-0 flex-1 flex-col text-foreground",XO="gloss-content flex min-h-0 min-w-0 flex-1 flex-col",KO="flex shrink-0 items-start text-left",qO="flex min-w-0 flex-1 flex-col text-left",ZO="min-w-0",QO="min-h-0 flex-1 overflow-y-auto",JO="flex shrink-0 flex-wrap items-center justify-end gap-base",e0="shrink-0",Sc="outline-none focus-ring",t0="flex touch-none select-none shrink-0 items-center justify-center cursor-grab active:cursor-grabbing box-content outline-none focus-ring",n0="h-1 w-10",o0="h-10 w-1",r0="rounded-full bg-tertiary";function s0(e,t){const n=DO[t];return e==="left"||e==="right"?n.horizontal:n.vertical}function Cp(e,t,n){if(n!=="full")return kO[t][e]}function a0(){return uf()}function l0({lightUi:e,dismissable:t,slotClass:n}){return i.cn("absolute inset-0",e?zO:UO,t?"cursor-pointer":"cursor-default",n)}function i0({variant:e,placement:t,extent:n,size:o,className:r,slotClass:s}){return i.cn(WO,e!=="gloss"&&YO,PO[t],s0(t,n),Cp(t,o,n),s,r)}function c0({placement:e,extent:t,size:n,slotClass:o}){return i.cn($O,Cp(e,n,t),o)}function u0(e){return i.cn(MO,e)}function d0(e){return i.cn(XO,e)}function f0(e,t){return i.cn(QO,e,t)}function m0({placement:e,slotClass:t,className:n}){const o=e==="left"||e==="right";return i.cn(t0,o?"self-stretch w-xsmall":"h-xsmall w-full",BO[e],t,n)}function p0({placement:e,slotClass:t}){const n=e==="left"||e==="right";return i.cn(r0,n?o0:n0,t)}function C0(e){return Ee(e).footerButtonSize}const g0=.38,hc=.45;function S0(e,t){return e==="left"?-t.offsetWidth:e==="right"?t.offsetWidth:e==="top"?-t.offsetHeight:t.offsetHeight}function h0(e){return e==="left"||e==="right"?"x":"y"}function x0(e,t,n){$.set(e,{[t]:n})}function b0(e,t){return 1-Math.min(Math.abs(e)/Math.abs(t),1)}function A0(e,t,n,o,r,s){return{onPointerDown:a.useCallback(u=>{const d=e.current,f=t.current;if(!d||i.prefersReducedMotion())return;const m=h0(n),p=m==="x",C=p?u.clientX:u.clientY;let S=C,g=performance.now(),h=0;const x=S0(n,d),A=u.currentTarget;A.setPointerCapture(u.pointerId),i.killMotion(d,f),d.style.willChange="transform";const b=L=>{if(L.pointerId!==u.pointerId)return;const v=p?L.clientX:L.clientY,R=v-C,T=performance.now(),E=T-g;E>0&&(h=(v-S)/E),S=v,g=T;const O=(n==="left"||n==="top"?-1:1)>0?Math.max(0,R):Math.min(0,R);x0(d,m,O),f&&$.set(f,{opacity:b0(O,x)})},_=L=>{if(L.pointerId!==u.pointerId)return;A.releasePointerCapture(u.pointerId),A.removeEventListener("pointermove",b),A.removeEventListener("pointerup",_),A.removeEventListener("pointercancel",_);const R=(p?L.clientX:L.clientY)-C,T=Math.abs(R)/Math.abs(x),E=n==="right"||n==="bottom"?h>hc:h<-hc,I={...i.motionInteractive(),overwrite:"auto"};if(T>=g0||E){i.killMotion(d,f);const O=$.timeline({onComplete:()=>{d.style.willChange="",s&&(s.current=!0),o()}});O.fromTo(d,{[m]:R},{[m]:x,...I},0),f&&O.to(f,{opacity:0,...I},0)}else{i.killMotion(d,f);const O=$.timeline({onComplete:()=>{d.style.willChange="",$.set(d,{clearProps:m}),f&&$.set(f,{opacity:1})}});O.fromTo(d,{[m]:R},{[m]:0,...I},0),f&&O.to(f,{opacity:1,...I},0)}};A.addEventListener("pointermove",b),A.addEventListener("pointerup",_),A.addEventListener("pointercancel",_)},[r,o,t,e,n,s])}}function gp(e){return null}gp.displayName="DrawerBackdrop";const wo=a.forwardRef(function({className:t,...n},o){const r=We();return c.jsx("div",{ref:o,className:u0(i.cn(r.content,t)),...n})});wo.displayName="DrawerContent";function v0({segment:e,variant:t}){const n=We();return e.kind==="handle"?e.node:t==="gloss"?c.jsx("div",{className:d0(n.glossContent),children:c.jsx(wo,{children:e.children})}):c.jsx(wo,{children:e.children})}function Sp({className:e,onPointerDown:t,onKeyDown:n,...o}){const{onOpenChange:r,placement:s,overlayRef:l,panelRef:u,skipCloseAnimRef:d}=Ke(),f=We(),m=Ie(),p=()=>r(!1),{onPointerDown:C}=A0(u,l,s,p,!1,d);return c.jsx("div",{role:"button",tabIndex:0,"aria-label":_O(s,m),className:m0({placement:s,slotClass:f.handle,className:e}),onPointerDown:S=>{t==null||t(S),C(S)},onKeyDown:S=>{n==null||n(S),!S.defaultPrevented&&LO(S.key)&&(S.preventDefault(),p())},...o,children:c.jsx("span",{"aria-hidden":!0,className:p0({placement:s,slotClass:f.handleGrip})})})}Sp.displayName="DrawerHandle";const hp=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=Ke(),s=We();return c.jsx("div",{ref:o,className:i.cn(KO,r.headerGap,r.headerPadding,s.header,t),...n})});hp.displayName="DrawerHeader";function xp({className:e,...t}){const{sizePreset:n}=Ke(),o=We();return c.jsx("div",{className:i.cn(qO,n.headingGap,o.headingBlock,e),...t})}xp.displayName="DrawerHeadingBlock";const bp=a.forwardRef(function({className:t,id:n,...o},r){const{titleId:s,setHasTitle:l,sizePreset:u}=Ke(),d=We();return a.useLayoutEffect(()=>(l(!0),()=>l(!1)),[l]),c.jsx(q,{ref:r,as:"h2",variant:u.titleVariant,id:n??s,className:i.cn(ZO,u.titleClassName,d.title,t),...o})});bp.displayName="DrawerTitle";function Ap({className:e,id:t,...n}){const{descriptionId:o,setHasDescription:r,sizePreset:s}=Ke(),l=We();return a.useLayoutEffect(()=>(r(!0),()=>r(!1)),[r]),c.jsx(q,{as:"p",variant:s.descVariant,id:t??o,className:i.cn(s.descClassName,l.description,e),...n})}Ap.displayName="DrawerDescription";const vp=a.forwardRef(function({className:t,onClick:n,size:o,"aria-label":r,...s},l){const{onOpenChange:u,sizePreset:d}=Ke(),f=We();return c.jsx(Cn,{ref:l,variant:"secondary",size:o??d.closeButtonSize,"aria-label":r,className:i.cn(e0,f.close,t),onClick:m=>{n==null||n(m),m.defaultPrevented||u(!1)},...s})});vp.displayName="DrawerClose";const _p=a.forwardRef(function({className:t,...n},o){const{sizePreset:r}=Ke(),s=We();return c.jsx("div",{ref:o,className:f0(r.bodyPadding,i.cn(s.body,t)),...n})});_p.displayName="DrawerBody";const Lp=a.forwardRef(function({className:t,children:n,...o},r){const{sizePreset:s,footerButtonSize:l}=Ke(),u=We(),d=a.useMemo(()=>mp(n,l),[n,l]);return c.jsx("div",{ref:r,className:i.cn(JO,s.footerPadding,u.footer,t),...o,children:d})});Lp.displayName="DrawerFooter";const Tp=a.forwardRef(function({children:t,asChild:n,className:o,onClick:r,onPointerDown:s,...l},u){const{open:d,onOpenChange:f}=Ke(),m=We(),p=a.useRef(null),C=At(),S=a.useCallback(x=>{p.current=x,ue(u,x)},[u]),g=a.useCallback(x=>{var A;d||C.current||x.button!==0||(x.preventDefault(),(A=p.current)==null||A.focus({preventScroll:!0}),bt({triggerRef:p,openingRef:C,setOpen:()=>f(!0)}))},[d,C,p,f]),h=a.useCallback(x=>{r==null||r(x),!x.defaultPrevented&&!d&&!C.current&&f(!0)},[r,d,C,f]);if(n&&a.isValidElement(t)){const x=a.Children.count(t)===1?t:null;if(x){const A=x;return a.cloneElement(A,yt(A,{...l,className:i.cn(Sc,m.trigger,o),onPointerDown:b=>{g(b),s==null||s(b)},onClick:h,"aria-haspopup":"dialog","aria-expanded":d},$e(b=>{p.current=b},u),{runBeforeChild:["onPointerDown"]}))}}return c.jsx("button",{type:"button",ref:S,"aria-haspopup":"dialog","aria-expanded":d,className:i.cn(Sc,m.trigger,o),onPointerDown:x=>{s==null||s(x),g(x)},onClick:h,...l,children:t})});Tp.displayName="Drawer.Trigger";const Ep=a.forwardRef(function({extent:t="default",variant:n="default",className:o,style:r,themeAnchor:s,portalContainer:l,children:u,...d},f){const m=Ke(),{open:p,onOpenChange:C,placement:S,portalContainer:g}=m,{backdropIsDismissable:h,panelSegments:x}=a.useMemo(()=>EO(u),[u]),A=gt(l??g),b=fn(A),_=OO({open:p,onOpenChange:C,variant:n,placement:S,backdropIsDismissable:h,contained:b}),L=Fa(p,s??null),v=Ma(L),R=An(L),T=a.useMemo(()=>({...m,overlayRef:_.overlayRef,panelRef:_.panelRef,skipCloseAnimRef:_.skipCloseAnimRef}),[m,_.overlayRef,_.panelRef,_.skipCloseAnimRef]);return typeof document>"u"||!_.showPortal||!A?null:Ut.createPortal(c.jsx(fp,{value:T,children:c.jsx(_0,{className:o,style:r,variant:n,placement:S,extent:t,portalTheme:R,lightUi:v,titleId:m.titleId,descriptionId:m.descriptionId,hasTitle:m.hasTitle,hasDescription:m.hasDescription,backdropIsDismissable:h,panelSegments:x,dialogRef:_.dialogRef,overlayRef:_.overlayRef,panelRef:_.panelRef,panelForwardedRef:f,panelRest:d,bindGlossPanelRef:_.bindGlossPanelRef,onBackdropMouseDown:_.handleBackdropMouseDown,onDialogClose:()=>C(!1),onDialogCancel:E=>{E.preventDefault(),C(!1)},contained:b})}),A)});Ep.displayName="Drawer.Panel";function _0({className:e,style:t,variant:n,placement:o,extent:r,portalTheme:s,lightUi:l,titleId:u,descriptionId:d,hasTitle:f,hasDescription:m,backdropIsDismissable:p,panelSegments:C,dialogRef:S,overlayRef:g,panelRef:h,panelForwardedRef:x,panelRest:A,bindGlossPanelRef:b,onBackdropMouseDown:_,onDialogClose:L,onDialogCancel:v,contained:R=!1}){const T=We(),{size:E}=Ke(),I=C.map((O,N)=>c.jsx(v0,{segment:O,variant:n},O.kind==="handle"?`handle-${N}`:`content-${N}`));return c.jsxs("dialog",{...s,ref:S,onClose:L,onCancel:v,"aria-labelledby":f?u:void 0,"aria-describedby":m?d:void 0,className:i.cn(VO(R),T.dialog),children:[c.jsx("div",{ref:g,className:l0({lightUi:l,dismissable:p,slotClass:T.overlay}),style:a0(),"aria-hidden":!0,onMouseDown:_}),c.jsx("div",{ref:$e(h,x),tabIndex:-1,className:i0({variant:n,placement:o,extent:r,size:E,className:e,slotClass:T.panel}),style:t,...A,children:n==="gloss"?c.jsx("div",{ref:b,className:c0({placement:o,extent:r,size:E,slotClass:T.glossPanel}),children:I}):I})]})}const L0="right";function T0({open:e,defaultOpen:t=!1,onOpenChange:n,placement:o=L0,size:r="base",portalContainer:s}){const[l,u]=Re({value:e,defaultValue:t,onChange:n}),d=a.useId(),f=a.useId(),[m,p]=a.useState(!1),[C,S]=a.useState(!1),g=a.useRef(null),h=a.useRef(null),x=a.useRef(!1),A=a.useCallback(v=>{p(v)},[]),b=a.useCallback(v=>{S(v)},[]),_=jO[r];return{contextValue:{open:l,titleId:d,descriptionId:f,hasTitle:m,setHasTitle:A,hasDescription:C,setHasDescription:b,onOpenChange:u,placement:o,size:r,sizePreset:_,footerButtonSize:C0(r),overlayRef:g,panelRef:h,skipCloseAnimRef:x,portalContainer:s}}}function Rp({open:e,defaultOpen:t=!1,onOpenChange:n,placement:o="right",size:r="base",children:s,classNames:l,portalContainer:u}){const d=T0({open:e,defaultOpen:t,onOpenChange:n,placement:o,size:r,portalContainer:u});return c.jsx(fp,{value:d.contextValue,children:c.jsx(vO,{classNames:l,children:s})})}Rp.displayName="Drawer";const E0=Object.assign(Rp,{Trigger:Tp,Panel:Ep,Backdrop:gp,Handle:Sp,Content:wo,Header:hp,HeadingBlock:xp,Title:bp,Description:Ap,Close:vp,Body:_p,Footer:Lp});function R0({forwardedRef:e,onPointerEnter:t,onPointerLeave:n,onPointerDown:o}){const r=a.useRef(null),s=a.useCallback(f=>{r.current=f,ue(e,f)},[e]),{handlePointerEnter:l,handlePointerLeave:u,handlePointerDown:d}=xt({isDisabled:!1,enabled:!0,textMotionRef:r,hoverLift:!0,onPointerEnter:t,onPointerLeave:n,onPointerDown:o});return{setAnchorRef:s,handlePointerEnter:l,handlePointerLeave:u,handlePointerDown:d}}const is=a.createContext({});function I0({classNames:e,children:t}){const n=a.useContext(is),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(is.Provider,{value:o,children:t})}function Il(){return a.useContext(is)}const y0=!0,N0=!0,w0="group/link inline-flex max-w-full min-w-0 items-center gap-xsmall rounded-mid no-underline outline-none w-fit text-primary focus-ring",O0="min-w-0 truncate font-w-mid",P0="underline decoration-current/70 underline-offset-[0.2em]",D0="text-muted group-hover/link:text-primary group-focus-visible/link:text-primary",k0="text-primary",B0="rotate-[-45deg]",j0={small:"small",base:"base",mid:"mid",large:"large"},Ip={small:"icon-small",base:"icon-base",mid:"icon-mid",large:"icon-large"};function yp({slotClass:e,className:t}){return i.cn(w0,e,t)}function M0({underline:e,slotClass:t}){return i.cn(O0,e&&P0,t)}function F0({size:e,muted:t,slotClass:n}){return i.cn(i.TEXT_COLOR_TRANSITION,Ip[e],"[&_svg]:size-full",t?D0:k0,n)}function H0(e){return i.cn(Ip[e],B0)}function xc({size:e}){return c.jsx(be.IoArrowForward,{"aria-hidden":y0,className:H0(e)})}function bc({children:e,size:t,muted:n=!1,slotClass:o}){return c.jsx("span",{className:F0({size:t,muted:n,slotClass:o}),"aria-hidden":N0,children:e})}function Np({size:e,underline:t,textVariant:n,textChildren:o,startIcon:r,endIcon:s,startIconMuted:l,endIconMuted:u,usesDefaultAtStart:d,usesDefaultAtEnd:f}){const m=Il(),p=r??(d?c.jsx(xc,{size:e}):null),C=s??(f?c.jsx(xc,{size:e}):null);return c.jsxs(c.Fragment,{children:[p?c.jsx(bc,{size:e,muted:l,slotClass:m.iconStart,children:p}):null,c.jsx(q,{as:"span",variant:n,inheritColor:!0,className:M0({underline:t,slotClass:m.text}),children:o}),C?c.jsx(bc,{size:e,muted:u,slotClass:m.iconEnd,children:C}):null]})}function G0({href:e,size:t,underline:n,textVariant:o,textChildren:r,startIcon:s,endIcon:l,startIconMuted:u,endIconMuted:d,usesDefaultAtStart:f,usesDefaultAtEnd:m,className:p="",setAnchorRef:C,handlePointerEnter:S,handlePointerLeave:g,handlePointerDown:h,...x}){const A=Il();return c.jsx("a",{ref:C,href:e,className:yp({slotClass:A.root,className:p}),onPointerEnter:S,onPointerLeave:g,onPointerDown:h,...x,children:c.jsx(Np,{size:t,underline:n,textVariant:o,textChildren:r,startIcon:s,endIcon:l,startIconMuted:u,endIconMuted:d,usesDefaultAtStart:f,usesDefaultAtEnd:m})})}function wp(e){return null}wp.displayName="Link.Icon";const Op="Link.Icon";function Pp(e){if(a.isValidElement(e))return e.type.displayName}function Dp(e){return a.Children.toArray(e).some(t=>{if(!a.isValidElement(t))return!1;if(Pp(t)===Op)return!0;const n=t.props.children;return n!=null&&Dp(n)})}function V0(e){const t=e.children!==void 0&&e.children!==null;return{node:t?e.children:"default",muted:!t}}function z0(e){const t=[];let n,o;return a.Children.forEach(e,r=>{if(a.isValidElement(r)&&Pp(r)===Op){const s=r.props,l=V0(s);(s.position??"end")==="start"?n=l:o=l;return}t.push(r)}),{textChildren:t.length===1?t[0]:a.createElement(a.Fragment,null,...t),startIcon:n,endIcon:o}}function Ac(e,t,n,o){return e?{node:e.node==="default"?null:e.node,muted:e.muted}:{node:null,muted:!1}}function U0({icon:e,showDefaultIcon:t=!1,defaultIconPosition:n="end"}){const o=t&&e==null;return{usesDefaultIcon:o,defaultIconAtStart:o&&n==="start",defaultIconAtEnd:o&&n==="end"}}function W0({icon:e,iconPosition:t="start",showDefaultIcon:n,defaultIconPosition:o,children:r}){var u,d;if(r!=null&&Dp(r)){const f=z0(r),m=Ac(f.startIcon),p=Ac(f.endIcon);return{textChildren:f.textChildren,startIcon:m.node,endIcon:p.node,startIconMuted:m.muted,endIconMuted:p.muted,usesDefaultAtStart:((u=f.startIcon)==null?void 0:u.node)==="default",usesDefaultAtEnd:((d=f.endIcon)==null?void 0:d.node)==="default"}}const l=U0({icon:e,showDefaultIcon:n,defaultIconPosition:o});return{textChildren:r??null,startIcon:e!=null&&t==="start"?e:null,endIcon:e!=null&&t==="end"?e:null,startIconMuted:l.defaultIconAtStart,endIconMuted:l.defaultIconAtEnd,usesDefaultAtStart:l.defaultIconAtStart,usesDefaultAtEnd:l.defaultIconAtEnd}}function Y0({size:e="base",underline:t=!1,icon:n,iconPosition:o="start",showDefaultIcon:r=!1,defaultIconPosition:s="end",children:l}){const u=W0({icon:n,iconPosition:o,showDefaultIcon:r,defaultIconPosition:s,children:l});return{size:e,underline:t,textVariant:j0[e],...u}}const kp=a.forwardRef(function({href:t,asChild:n=!1,children:o,className:r="",size:s,underline:l,icon:u,iconPosition:d,showDefaultIcon:f,defaultIconPosition:m,onPointerEnter:p,onPointerLeave:C,onPointerDown:S,...g},h){const x=n&&a.isValidElement(o)&&a.Children.count(o)===1?o:null,A=x?x.props.children:o,b=Y0({size:s,underline:l,icon:u,iconPosition:d,showDefaultIcon:f,defaultIconPosition:m,children:A}),_=R0({forwardedRef:h,onPointerEnter:p,onPointerLeave:C,onPointerDown:S}),L=Il(),v={size:b.size,underline:b.underline,textVariant:b.textVariant,textChildren:b.textChildren,startIcon:b.startIcon,endIcon:b.endIcon,startIconMuted:b.startIconMuted,endIconMuted:b.endIconMuted,usesDefaultAtStart:b.usesDefaultAtStart,usesDefaultAtEnd:b.usesDefaultAtEnd};return x?a.cloneElement(x,yt(x,{...g,...t!=null?{href:t}:{},className:yp({slotClass:L.root,className:r}),onPointerEnter:_.handlePointerEnter,onPointerLeave:_.handlePointerLeave,onPointerDown:_.handlePointerDown,children:c.jsx(Np,{...v})},_.setAnchorRef)):c.jsx(G0,{href:t,className:r,setAnchorRef:_.setAnchorRef,handlePointerEnter:_.handlePointerEnter,handlePointerLeave:_.handlePointerLeave,handlePointerDown:_.handlePointerDown,...v,...g})});kp.displayName="Link";const Bp=a.forwardRef(function({classNames:t,...n},o){return c.jsx(I0,{classNames:t,children:c.jsx(kp,{ref:o,...n})})});Bp.displayName="Link";const $0=Object.assign(Bp,{Icon:wp}),yl=a.createContext(null),cs=a.createContext({});function X0({value:e,children:t}){return c.jsx(yl.Provider,{value:e,children:t})}function K0({classNames:e,children:t}){const n=a.useContext(cs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(cs.Provider,{value:o,children:t})}function jp(){const e=a.useContext(yl);if(!e)throw new Error("TextArea compound parts must be inside <TextArea>.");return e}function q0(){return a.useContext(yl)}function Yn(){return a.useContext(cs)}function Z0(e=Se.resizeHeight){return e}function Q0({shellRef:e,blocked:t,variant:n,resizable:o,onPointerDown:r}){const s=n==="gloss",l=i.useFieldShellHoverLift(e,!t&&!s),u=i.useGlossFieldShellMotion(e,!t&&s),d=a.useCallback(m=>{e.current=m,m&&!o&&m.style.removeProperty("height"),!t&&s&&u.bindShellRef(m)},[t,u,s,o,e]),f=a.useCallback(m=>{if(r==null||r(m),m.defaultPrevented||t)return;const p=m.target;if(p instanceof HTMLElement&&p.closest("[data-textarea-resize-handle]"))return;const C=e.current;if(!(!C||i.prefersReducedMotion())){if(s){u.onShellPointerDown();return}i.animateInteractivePressSqueeze(C)}},[t,u,s,r,e]);return{isGloss:s,setShellRef:d,shellPointerDown:f,shellPointerEnter:s?u.onShellPointerEnter:l.onShellPointerEnter,shellPointerLeave:s?u.onShellPointerLeave:l.onShellPointerLeave,shellFocusCapture:s?u.onShellFocusIn:void 0,shellBlurCapture:s?u.onShellFocusOut:void 0,glossShellHoverMotionClass:u.shellHoverMotionClass,standardShellHoverMotionClass:l.shellHoverMotionClass}}const J0={small:"min-h-control-small",base:"min-h-control-base",mid:"min-h-control-mid",large:"min-h-control-large"},eP="flex flex-col items-stretch",tP=`box-border block min-h-0 w-full flex-1 resize-none overflow-auto bg-transparent font-inherit text-foreground outline-none placeholder:text-muted appearance-none [field-sizing:content] ${we}`,nP="absolute bottom-[length:calc(var(--border-width)*2)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*9)] origin-bottom-right rotate-[135deg] bg-muted-foreground",oP="absolute bottom-[length:calc(var(--border-width)*6)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*6)] origin-bottom-right rotate-[135deg] bg-muted-foreground",rP="relative block size-[length:var(--size-scale-small)] shrink-0",sP="absolute bottom-0 right-0 z-[2] m-0 flex touch-none select-none appearance-none border-0 bg-transparent items-end justify-end p-xsmall outline-none focus-ring-inset",aP="cursor-not-allowed opacity-45",lP="cursor-ns-resize";function iP(e){return i.CONTROL_SIZE_LAYOUT[e].controlPad}function cP({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e})}function uP({variant:e,status:t,blocked:n,size:o,shellSurface:r,glossShellHoverMotionClass:s,standardShellHoverMotionClass:l,slotClass:u,className:d}){const f=e==="gloss";return i.cn("relative w-full overflow-hidden rounded-base border-1",eP,f&&"relative",J0[o],r,i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),f?s:i.fieldShellHoverClass(!n,t,e),!f&&l,n?"cursor-not-allowed opacity-55 shadow-token-base":"",u,d)}function dP({size:e,resizable:t,slotClass:n}){return i.cn(tP,t&&"pr-large",iP(e),n,we)}function fP({disabled:e,slotClass:t}){return i.cn(sP,e?aP:lP,t)}const Or=640,vc=16;function mP(e,t,n,o){const r=a.useCallback(d=>{const f=e.current;f&&(d!=null?f.style.height=`${d}px`:f.style.removeProperty("height"))},[e]),s=a.useCallback(d=>{const f=e.current;if(!f)return;const m=i.readControlHeightPx(o),p=f.getBoundingClientRect().height,C=Math.min(Or,Math.max(m,p+d));r(C)},[r,e,o]),l=a.useCallback(d=>{if(n||!t)return;d.preventDefault(),d.stopPropagation();const f=e.current,m=d.currentTarget;if(!f)return;const p=d.clientY,C=f.getBoundingClientRect().height,S=i.readControlHeightPx(o);m.setPointerCapture(d.pointerId);const g=x=>{if(x.pointerId!==d.pointerId)return;const A=Math.min(Or,Math.max(S,C+(x.clientY-p)));r(A)},h=x=>{x.pointerId===d.pointerId&&(m.releasePointerCapture(d.pointerId),m.removeEventListener("pointermove",g),m.removeEventListener("pointerup",h),m.removeEventListener("pointercancel",h))};m.addEventListener("pointermove",g),m.addEventListener("pointerup",h),m.addEventListener("pointercancel",h)},[n,t,r,e,o]),u=a.useCallback(d=>{if(!(n||!t)){if(d.key==="ArrowDown"){d.preventDefault(),s(vc);return}if(d.key==="ArrowUp"){d.preventDefault(),s(-vc);return}if(d.key==="Home"){d.preventDefault(),r(i.readControlHeightPx(o));return}d.key==="End"&&(d.preventDefault(),r(Or))}},[s,n,t,r,o]);return{onResizePointerDown:l,onResizeKeyDown:u}}function pP(){return c.jsxs("span",{"aria-hidden":!0,className:rP,children:[c.jsx("span",{className:nP}),c.jsx("span",{className:oP})]})}function CP({disabled:e,className:t,onPointerDown:n,onKeyDown:o}){const r=Z0(St("resizeHeight"));return c.jsx("button",{type:"button","data-textarea-resize-handle":!0,"aria-label":r,disabled:e,onPointerDown:n,onKeyDown:o,className:fP({disabled:e,slotClass:t}),children:c.jsx(pP,{})})}const Nl=a.forwardRef(function({variant:t="default",status:n,size:o,rows:r=1,resizable:s=!0,placeholder:l,id:u,disabled:d,readOnly:f,className:m,onPointerDown:p,"aria-describedby":C,...S},g){const h=q0(),x=Yn(),A=a.useId(),b=u??(h==null?void 0:h.textareaId)??A,_=n??(h==null?void 0:h.status)??"default",L=o??(h==null?void 0:h.size)??"base",v=(h==null?void 0:h.required)??!1,R=(h==null?void 0:h.hintConnected)??!1,T=(h==null?void 0:h.errorConnected)??!1,E=h==null?void 0:h.hintId,I=h==null?void 0:h.errorId,O=C??je(R?E:void 0,T?I:void 0),N=a.useRef(null),y=a.useRef(null),w=a.useCallback(F=>{y.current=F,typeof g=="function"?g(F):g&&(g.current=F)},[g]),P=!!(d||f),k=cP({variant:t}),j=Q0({shellRef:N,blocked:P,variant:t,resizable:s,onPointerDown:p}),{onResizePointerDown:B,onResizeKeyDown:D}=mP(N,s,P,L);return c.jsxs("div",{ref:j.setShellRef,"data-slot":"textarea-shell",onPointerDown:j.shellPointerDown,onPointerEnter:j.shellPointerEnter,onPointerLeave:j.shellPointerLeave,onFocusCapture:j.shellFocusCapture,onBlurCapture:j.shellBlurCapture,className:uP({variant:t,status:_,blocked:P,size:L,shellSurface:k,glossShellHoverMotionClass:j.glossShellHoverMotionClass,standardShellHoverMotionClass:j.standardShellHoverMotionClass,slotClass:x.shell,className:m}),children:[c.jsx("textarea",{ref:w,id:b,rows:r,disabled:d,readOnly:f,placeholder:l,"aria-required":v||void 0,"aria-invalid":_==="danger"?!0:void 0,"aria-describedby":O,className:dP({size:L,resizable:s,slotClass:x.control}),...S}),s?c.jsx(CP,{disabled:P,className:x.resizeHandle,onPointerDown:B,onKeyDown:D}):null]})});Nl.displayName="TextAreaControl";function Mp({className:e,classNames:t,...n}){const o=Yn();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}Mp.displayName="TextAreaLabel";function wl({children:e,status:t,className:n,id:o,...r}){const s=jp(),l=Yn(),u=t??(s.status==="danger"||s.status==="default"?"default":s.status);return c.jsx(le.Hint,{id:o??s.hintId,status:u,className:i.cn(l.hint,n),...r,children:e})}wl.displayName="TextAreaHint";function Ol({children:e,className:t,id:n,...o}){const r=jp(),s=Yn();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Ol.displayName="TextAreaError";function gP({label:e,hint:t,error:n,textareaId:o,labelId:r,size:s,status:l,controlProps:u}){const d=Yn();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:r,classNames:{root:d.label},children:e}):null,c.jsx(Nl,{id:o,size:s,status:l,...u}),t!=null?c.jsx(wl,{children:t}):null,n!=null?c.jsx(Ol,{children:n}):null]})}function SP({children:e,label:t,hint:n,error:o,id:r,required:s=!1,status:l="default",size:u="base"}){const d=a.useId(),f=r??`textarea-${d}`,m=Ve(f),p=ze(f),C=`${f}-label`,{isCompound:S,hasHint:g,hasError:h}=a.useMemo(()=>{const b=Ue(e);return{isCompound:b,hasHint:n!=null||b&&ge(e,"TextAreaHint"),hasError:o!=null||b&&ge(e,"TextAreaError")}},[e,o,n]),x=a.useMemo(()=>({textareaId:f,hintId:m,errorId:p,labelId:C,hintConnected:g,errorConnected:h,required:s,status:l,size:u}),[p,h,g,m,s,C,u,l,f]),A=a.useMemo(()=>({controlId:f,labelId:C,required:s}),[s,C,f]);return{fieldCtx:x,fieldLabelCtx:A,isCompound:S,textareaId:f,label:t,hint:n,error:o,status:l,size:u}}function Fp({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u=!1,status:d="default",size:f="base",...m}){const p=SP({children:e,label:t,hint:n,error:o,id:l,required:u,status:d,size:f}),C=p.isCompound?e:c.jsx(gP,{label:p.label,hint:p.hint,error:p.error,textareaId:p.textareaId,labelId:p.fieldCtx.labelId,size:p.size,status:p.status,controlProps:m});return c.jsx(X0,{value:p.fieldCtx,children:c.jsx(K0,{classNames:s,children:c.jsx(Ge.Provider,{value:p.fieldLabelCtx,children:c.jsx(le,{className:i.cn(s==null?void 0:s.root,r),children:C})})})})}Fp.displayName="TextArea";const hP=Object.assign(Fp,{Label:Mp,Control:Nl,Hint:wl,Error:Ol}),Hp=a.createContext(null),us=a.createContext({});function _c({value:e,children:t}){return c.jsx(Hp.Provider,{value:e,children:t})}function Lc({classNames:e,children:t}){const n=a.useContext(us),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(us.Provider,{value:o,children:t})}function Jt(){const e=a.useContext(Hp);if(!e)throw new Error("Checkbox.* parts must be used inside <Checkbox>.");return e}function en(){return a.useContext(us)}function xP(){const e=Jt(),t=a.useRef(null),n=a.useRef(!0),o=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{const r=t.current;if(!r)return;if(o){i.killMotion(r),r.style.opacity=e.isDisabled?"0.48":"1";return}if(n.current){n.current=!1,r.style.opacity=e.isDisabled?"0.48":"1";return}i.killMotion(r);const s=Number.parseFloat(getComputedStyle(r).opacity),l=Number.isFinite(s)?s:1;$.fromTo(r,{autoAlpha:l},{autoAlpha:e.isDisabled?.48:1,...i.motionInteractive(),overwrite:"auto"})},[e.isDisabled,o]),t}function bP({isDisabled:e,enableTextMotion:t,textMotionRef:n,onPointerDown:o}){return xt({isDisabled:e,enabled:t,textMotionRef:n,onPointerDown:o})}function AP(e){return e==="default"?"default":e}function vP({slotClassNames:e,classNames:t,className:n}){return{root:i.cn(e.indicator,t==null?void 0:t.root,t==null?void 0:t.indicator,n),fill:i.cn(e.indicatorFill,t==null?void 0:t.fill,t==null?void 0:t.indicatorFill),mark:i.cn(e.indicatorMark,t==null?void 0:t.mark,t==null?void 0:t.indicatorMark)}}function _P(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;const s=r.props;if(s.htmlFor!=null){t=!0;return}n(s.children)}};return n(e),t}function LP(e){return!/\bflex-col\b/.test(e??"")}const $n=ye,TP="absolute m-[-1px] h-px w-px overflow-hidden border-0 p-0 opacity-0 [clip:rect(0,0,0,0)]",EP="absolute inset-0 z-[2] m-0 h-full w-full cursor-pointer opacity-0",RP="relative inline-flex shrink-0 items-center justify-center",IP="relative inline-flex items-center justify-center has-focus-ring";function yP(e){return i.cn(IP,Ye[e])}const NP="min-w-0",wP="cursor-pointer",OP="inline-flex flex-wrap items-center gap-x-xsmall gap-y-0 font-w-mid",PP="min-w-0",DP="origin-center",Gp="text-muted",Vp="text-danger",kP="text-danger",zp="text-muted",Up="text-muted",BP="origin-center",jP="min-w-0 font-w-mid",MP="relative cursor-pointer select-none rounded-small text-left",FP="cursor-not-allowed",HP="m-0 min-w-0 border-0 p-0",GP="contents";function VP(){return er()}function zP(e,t,n){return i.cn(MP,Ra(e,t),n)}function Wp(){return tr()}function Oo(e){return nr(e)}function Yp(e){return Ia(e)}const Pl=a.forwardRef(function({className:t,children:n,...o},r){const s=Jt(),l=en(),u=xP();return c.jsx("span",{ref:r,className:i.cn(RP,VP(),l.control,t),...o,children:c.jsxs("span",{ref:u,className:i.cn(yP(s.size),l.controlTrack),children:[c.jsx("input",{ref:s.inputProps.inputRef,id:s.inputId,type:"checkbox",className:s.isCompound?i.cn(EP,l.input):i.cn(TP,l.input),disabled:s.isDisabled,name:s.inputProps.name,value:s.inputProps.value,required:s.inputProps.required,form:s.inputProps.form,autoFocus:s.inputProps.autoFocus,tabIndex:s.inputProps.tabIndex,readOnly:s.inputProps.readOnly,onBlur:s.inputProps.onBlur,onFocus:s.inputProps.onFocus,"aria-invalid":s.inputProps.ariaInvalid,"aria-describedby":je(s.hintConnected?s.hintId:void 0,s.errorConnected?s.errorId:void 0),"aria-labelledby":s.labelConnected?s.labelId:void 0,"aria-label":s.labelConnected?void 0:s.accessibleName,...s.isControlled?{checked:s.mergedChecked,onChange:s.onChange}:{defaultChecked:s.inputProps.defaultChecked,onChange:s.onChange}}),n??c.jsx(Dl,{})]})})});Pl.displayName="CheckboxControl";function Dl({children:e,className:t,classNames:n,size:o,...r}){const s=Jt(),l=en();return c.jsx(Be,{variant:AP(s.variant),size:o??s.size,selected:s.mergedChecked,icon:s.icon??void 0,check:!0,classNames:vP({slotClassNames:l,classNames:n,className:t}),...r,children:e})}Dl.displayName="CheckboxIndicator";const $p=a.forwardRef(function({className:t,children:n,...o},r){const s=Jt(),l=en(),u=i.cn(GP,s.isCompound&&NP,l.content,t);return s.isCompound&&!_P(n)?c.jsx("label",{ref:r,htmlFor:s.inputId,id:s.labelId,className:i.cn(u,!s.isDisabled&&wP),...o,children:n}):c.jsx("div",{ref:r,className:u,...o,children:n})});$p.displayName="CheckboxContent";function Xp({children:e,className:t,required:n,id:o,...r}){const s=Jt(),l=en(),u=ua(),d=n??(u==null?void 0:u.required)??!1,f=$n[s.size];return c.jsxs("span",{id:o,ref:m=>{s.isCompound&&s.useInlineCompoundMotion&&(s.textMotionRef.current=m)},className:i.cn(OP,s.isCompound&&Wp(),s.isCompound&&(s.hasCompoundHint||s.hasCompoundError)&&PP,s.isCompound&&s.useInlineCompoundMotion&&DP,l.label,t),...r,children:[c.jsx(q,{as:"span",variant:f.title,inheritColor:!0,className:i.cn(s.isDisabled&&Gp,!s.isDisabled&&s.status==="danger"&&Vp,l.labelText),children:e}),d?c.jsx("span",{className:i.cn(kP,l.requiredMark),"aria-hidden":!0,children:"*"}):null]})}Xp.displayName="CheckboxLabel";function Kp({children:e,className:t,variant:n,...o}){const r=Jt(),s=en();return c.jsx(le.Hint,{as:"span",id:r.hintId,variant:n??$n[r.size].desc,className:i.cn(r.isCompound&&Oo(2),r.isDisabled&&zp,s.hint,t),...o,children:e})}Kp.displayName="CheckboxHint";function qp({children:e,className:t,...n}){const o=Jt(),r=en();return c.jsx(le.Error,{as:"span",id:o.errorId,variant:$n[o.size].desc,className:i.cn(o.isCompound&&Oo(Yp(o.hasCompoundHint)),o.isDisabled&&Up,r.error,t),...n,children:e})}qp.displayName="CheckboxError";function UP({label:e,hint:t,error:n,hasHint:o,hasError:r,secondaryLines:s,textColRef:l,size:u,isDisabled:d,status:f,hintId:m,errorId:p}){const C=en(),S=$n[u];return c.jsxs(c.Fragment,{children:[c.jsx(Pl,{}),c.jsx("span",{ref:l,className:i.cn(Wp(),!s&&BP,C.simpleLabelWrap,C.label),children:c.jsx(q,{as:"span",variant:S.title,inheritColor:!0,className:i.cn(jP,d&&Gp,!d&&f&&Vp,C.simpleLabelText,C.labelText),children:e})}),o?c.jsx(le.Hint,{as:"span",id:m,variant:S.desc,className:i.cn(Oo(2),d&&zp,C.hint),children:t}):null,r?c.jsx(le.Error,{as:"span",id:p,variant:S.desc,className:i.cn(Oo(Yp(o)),d&&Up,C.error),children:n}):null]})}function WP(e,t){return e??`checkbox-${t}`}function YP(e){return Ve(e)}function $P(e){return ze(e)}function XP(e){return`${e}-label`}function KP({size:e="base",variant:t="default",status:n="default",icon:o,disabled:r,checked:s,defaultChecked:l,onChange:u,id:d,name:f,value:m,required:p,form:C,autoFocus:S,tabIndex:g,readOnly:h,onBlur:x,onFocus:A,"aria-label":b,label:_,hint:L,error:v},R,T){const E=ov(),I=m!=null?String(m):void 0,O=(E==null?void 0:E.selection)==="single"&&E!=null&&I!=null,N=ca({name:f,value:s,onChange:u,onBlur:x,disabled:r,readOnly:h,type:"checkbox"}),y=N.bound&&E==null,w=a.useId(),P=WP(d,w),k=YP(P),j=$P(P),B=XP(P),D=s!==void 0,F=O?E.selectedValue===I:void 0,H=y?!!N.checked:void 0,U=D?s:H!==void 0?H:F!==void 0?F:void 0,[G,K,V]=Re({value:U,defaultValue:!!(!(O||D||y)&&l)}),oe=!!(r??(E==null?void 0:E.disabled)??N.disabled),{isCompound:J,hasCompoundLabel:ee,hasCompoundHint:se,hasCompoundError:M}=a.useMemo(()=>{const fe=Ue(R);return{isCompound:fe,hasCompoundLabel:fe&&ge(R,"Label"),hasCompoundHint:fe?ge(R,"CheckboxHint"):!1,hasCompoundError:fe?ge(R,"CheckboxError"):!1}},[R]),W=J&&LP(T),Y=!oe&&(!J||W),Z=$n[e],ce=n==="danger",z=L!=null,Q=v!=null,te=J?(se?1:0)+(M?1:0):(z?1:0)+(Q?1:0),me=a.useRef(null),Ae=a.useCallback(fe=>{const _e=fe.target.checked;if(!V&&!O&&!y&&K(_e),u==null||u(fe),!fe.defaultPrevented){if(O){E.selectSingleValue(I,_e);return}y&&N.onChange(fe)}},[y,N,E,O,V,u,I,K]),he=a.useCallback(fe=>{x==null||x(fe),y&&N.onBlur(fe)},[y,N,x]),X=p??(O&&E.required?E.claimRequiredAnchor():void 0),re=a.useMemo(()=>({inputId:P,hintId:k,errorId:j,labelId:B,size:e,variant:t,mergedChecked:G,isDisabled:oe,isControlled:V,isCompound:J,hasCompoundHint:se,hasCompoundError:M,hintConnected:J?se:z,errorConnected:J?M:Q,labelConnected:ee,accessibleName:b,useInlineCompoundMotion:W,textMotionRef:me,status:n,icon:o,onChange:Ae,inputProps:{name:N.name??f,value:m,defaultChecked:!V&&!y?l:void 0,required:X,form:C,autoFocus:S,tabIndex:g,readOnly:N.readOnly??h,onBlur:he,onFocus:A,inputRef:y?N.ref:void 0,ariaInvalid:y?N["aria-invalid"]:void 0}}),[b,o,n,l,C,N,y,S,j,he,Ae,k,M,se,ee,Q,z,P,J,V,oe,B,G,f,A,X,h,e,g,W,m,t]),pe=a.useMemo(()=>({controlId:P,labelId:B,required:!!p}),[P,B,p]);return{contextValue:re,fieldLabelContext:pe,isCompound:J,isDisabled:oe,mergedChecked:G,enableTextMotion:Y,textColRef:me,secondaryLines:te,sz:Z,hasHint:z,hasError:Q,label:_,hint:L,error:v,hintId:k,errorId:j,status:n,isDanger:ce}}const Zp=a.forwardRef(function({children:t,label:n,hint:o,error:r,size:s,variant:l,status:u,icon:d,disabled:f,checked:m,defaultChecked:p,onChange:C,id:S,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:_,readOnly:L,onBlur:v,onFocus:R,className:T,classNames:E,onPointerDown:I,"aria-label":O,...N},y){const w=tt(),P=typeof g=="string"?g:void 0,k=P?w==null?void 0:w.getError(P):void 0,D=KP({size:s,variant:l,status:k?"danger":u??"default",icon:d,disabled:f,checked:m,defaultChecked:p,onChange:C,id:S,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:_,readOnly:L,onBlur:v,onFocus:R,"aria-label":O,label:n,hint:o,error:r??k},t,T),{handlePointerDown:F}=bP({isDisabled:D.isDisabled,enableTextMotion:D.enableTextMotion,textMotionRef:D.textColRef,onPointerDown:I}),H=i.cn(zP(D.secondaryLines,D.sz.gridGap,T),D.isDisabled&&FP,E==null?void 0:E.root);return D.isCompound?c.jsx(_c,{value:D.contextValue,children:c.jsx(Lc,{classNames:E,children:c.jsx(Ge.Provider,{value:D.fieldLabelContext,children:c.jsx("fieldset",{ref:y,"aria-labelledby":D.contextValue.labelConnected?D.contextValue.labelId:void 0,"data-checked":D.mergedChecked?!0:void 0,className:i.cn(H,HP),onPointerDown:F,...N,children:t})})})}):c.jsx(_c,{value:D.contextValue,children:c.jsx(Lc,{classNames:E,children:c.jsx("label",{ref:y,htmlFor:D.contextValue.inputId,"data-checked":D.mergedChecked?!0:void 0,className:H,...N,onPointerDown:F,children:c.jsx(UP,{label:D.label,hint:D.hint,error:D.error,hasHint:D.hasHint,hasError:D.hasError,secondaryLines:D.secondaryLines,textColRef:D.textColRef,size:D.contextValue.size,isDisabled:D.isDisabled,status:D.isDanger,hintId:D.hintId,errorId:D.errorId})})})})});Zp.displayName="CheckboxRoot";const qP=Object.assign(Dl,{Fill:Be.Fill,Mark:Be.Mark}),ZP=Object.assign(Zp,{Control:Pl,Indicator:qP,Content:$p,Label:Xp,Hint:Kp,Error:qp});function Qp(){return{"aria-hidden":!0}}const QP="gloss-indicator size-full min-h-0 min-w-0 origin-center border-0",JP="size-full min-h-0 min-w-0 origin-center border border-primary bg-surface",eD="pointer-events-none z-[2] flex items-center justify-center",tD="inline-flex shrink-0 items-center justify-center [&_svg]:size-full";function nD({gloss:e,size:t,className:n,slotRoot:o}){return e?i.cn($r,Ye[t],QP,o,n):i.cn($r,Ye[t],JP,o,n)}function oD(e){return e?"text-foreground":"text-primary"}function rD({gloss:e,className:t,slotRoot:n}){return i.cn(eD,oD(e),n,t)}function sD(e,t){return i.cn(tD,Ta[e],t)}function Jp({size:e="base",gloss:t=!1,shellRef:n,className:o,classNames:r,children:s,...l}){return c.jsx("span",{ref:n,className:nD({gloss:t,size:e,className:o,slotRoot:r==null?void 0:r.root}),...Qp(),...l,children:s})}Jp.displayName="SelectionThumb";function eC({size:e="base",gloss:t=!1,iconRef:n,className:o,classNames:r,children:s,style:l,...u}){return c.jsx("span",{ref:n,...Qp(),className:rD({gloss:t,className:o,slotRoot:r==null?void 0:r.root}),style:l,...u,children:c.jsx("span",{className:sD(e,r==null?void 0:r.icon),children:s})})}eC.displayName="SelectionThumbIcon";const On=Object.assign(Jp,{Icon:eC}),tC=a.createContext(null),ds=a.createContext({});function aD({value:e,children:t}){return c.jsx(tC.Provider,{value:e,children:t})}function lD({classNames:e,children:t}){const n=a.useContext(ds),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ds.Provider,{value:o,children:t})}function tn(){const e=a.useContext(tC);if(!e)throw new Error("Radio.* parts must be used inside <Radio>.");return e}function nn(){return a.useContext(ds)}function iD(){const e=tn(),t=a.useRef(null),n=a.useRef(!0),o=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{const r=t.current;if(!r)return;if(o){i.killMotion(r),r.style.opacity=e.isDisabled?"0.48":"1";return}if(n.current){n.current=!1,r.style.opacity=e.isDisabled?"0.48":"1";return}i.killMotion(r);const s=Number.parseFloat(getComputedStyle(r).opacity),l=Number.isFinite(s)?s:1;$.fromTo(r,{autoAlpha:l},{autoAlpha:e.isDisabled?.48:1,...i.motionInteractive(),overwrite:"auto"})},[e.isDisabled,o]),t}function cD({isDisabled:e,enableTextMotion:t,textMotionRef:n,onPointerDown:o}){return xt({isDisabled:e,enabled:t,textMotionRef:n,onPointerDown:o})}function uD(e,t){return e??`radio-${t}`}function dD(e){return Ve(e)}function fD(e){return ze(e)}function mD(e,t){if(!t)return e!=null?String(e):"Option"}function pD({slotClassNames:e,classNames:t,className:n}){return{root:i.cn(e.indicator,t==null?void 0:t.root,t==null?void 0:t.indicator,n),fill:i.cn(e.indicatorFill,t==null?void 0:t.fill,t==null?void 0:t.indicatorFill),mark:i.cn(e.indicatorMark,t==null?void 0:t.mark,t==null?void 0:t.indicatorMark)}}function CD(e){return!/\bflex-col\b/.test(e??"")}const Xn=ye,gD="absolute m-[-1px] h-px w-px overflow-hidden border-0 p-0 opacity-0 [clip:rect(0,0,0,0)]",SD="relative inline-flex shrink-0 items-center justify-center has-focus-ring";function hD(e){return i.cn(SD,Ye[e])}const xD="relative inline-flex items-center justify-center",bD="min-w-0",AD="inline-flex flex-wrap items-center gap-x-xsmall gap-y-0",vD="min-w-0",_D="origin-center",nC="text-muted",oC="text-danger",LD="text-danger",rC="text-muted",sC="text-muted",TD="origin-center",ED="min-w-0",RD="relative cursor-pointer select-none rounded-small text-left",ID="cursor-not-allowed",yD="contents";function ND(){return er()}function wD(e,t,n){return i.cn(RD,Ra(e,t),n)}function aC(){return tr()}function Po(e){return nr(e)}function lC(e){return Ia(e)}const kl=a.forwardRef(function({className:t,children:n,...o},r){const s=tn(),l=nn(),u=iD();return c.jsxs("span",{ref:r,className:i.cn(hD(s.size),ND(),l.control,t),...o,children:[c.jsx("input",{id:s.inputId,type:"radio",className:i.cn(gD,l.input),checked:s.mergedChecked,disabled:s.isDisabled,name:s.inputName,value:s.inputProps.value,required:s.inputProps.required,form:s.inputProps.form,autoFocus:s.inputProps.autoFocus,tabIndex:s.inputProps.tabIndex,readOnly:s.inputProps.readOnly,onBlur:s.inputProps.onBlur,onFocus:s.inputProps.onFocus,"aria-describedby":je(s.hintConnected?s.hintId:void 0,s.errorConnected?s.errorId:void 0),"aria-label":mD(s.inputProps.value,s.hasLabel),onChange:s.onChange,onClick:s.onActivate}),c.jsx("span",{ref:u,className:i.cn(xD,l.controlTrack),children:n??c.jsx(Bl,{})})]})});kl.displayName="RadioControl";function Bl({children:e,className:t,classNames:n,size:o,...r}){const s=tn(),l=nn();return c.jsx(Be,{size:o??s.size,variant:s.variant,selected:s.mergedChecked,dot:!0,classNames:pD({slotClassNames:l,classNames:n,className:t}),...r,children:e})}Bl.displayName="RadioIndicator";const iC=a.forwardRef(function({className:t,children:n,...o},r){const s=tn(),l=nn();return c.jsx("div",{ref:r,className:i.cn(yD,s.isCompound&&bD,l.content,t),...o,children:n})});iC.displayName="RadioContent";function cC({children:e,className:t,required:n,...o}){const r=tn(),s=nn(),l=ua(),u=n??(l==null?void 0:l.required)??!1,d=Xn[r.size];return c.jsxs("span",{ref:f=>{r.isCompound&&r.useInlineCompoundMotion&&(r.textMotionRef.current=f)},className:i.cn(AD,r.isCompound&&aC(),r.isCompound&&(r.hasCompoundHint||r.hasCompoundError)&&vD,r.isCompound&&r.useInlineCompoundMotion&&_D,s.label,t),...o,children:[c.jsx(q,{as:"span",variant:d.title,inheritColor:!0,className:i.cn(r.isDisabled&&nC,!r.isDisabled&&r.danger&&oC,s.labelText),children:e}),u?c.jsx("span",{className:i.cn(LD,s.requiredMark),"aria-hidden":!0,children:"*"}):null]})}cC.displayName="RadioLabel";function uC({children:e,className:t,variant:n,...o}){const r=tn(),s=nn();return c.jsx(le.Hint,{as:"span",id:r.hintId,variant:n??Xn[r.size].desc,className:i.cn(r.isCompound&&Po(2),r.isDisabled&&rC,s.hint,t),...o,children:e})}uC.displayName="RadioHint";function dC({children:e,className:t,...n}){const o=tn(),r=nn();return c.jsx(le.Error,{as:"span",id:o.errorId,variant:Xn[o.size].desc,className:i.cn(o.isCompound&&Po(lC(o.hasCompoundHint)),o.isDisabled&&sC,r.error,t),...n,children:e})}dC.displayName="RadioError";function OD({label:e,hint:t,error:n,hasHint:o,hasError:r,secondaryLines:s,textColRef:l,size:u,isDisabled:d,danger:f,hintId:m,errorId:p}){const C=nn(),S=Xn[u];return c.jsxs(c.Fragment,{children:[c.jsx(kl,{}),c.jsx("span",{ref:l,className:i.cn(aC(),!s&&TD,C.simpleLabelWrap,C.label),children:c.jsx(q,{as:"span",variant:S.title,inheritColor:!0,className:i.cn(ED,d&&nC,!d&&f&&oC,C.simpleLabelText,C.labelText),children:e})}),o?c.jsx(le.Hint,{as:"span",id:m,variant:S.desc,className:i.cn(Po(2),d&&rC,C.hint),children:t}):null,r?c.jsx(le.Error,{as:"span",id:p,variant:S.desc,className:i.cn(Po(lC(o)),d&&sC,C.error),children:n}):null]})}function PD({size:e="base",variant:t="default",danger:n=!1,disabled:o,checked:r,defaultChecked:s,onChange:l,id:u,name:d,value:f,required:m,form:p,autoFocus:C,tabIndex:S,readOnly:g,onBlur:h,onFocus:x,label:A,hint:b,error:_},L,v,R){const T=pv(),E=f!=null?String(f):void 0,I=T!=null&&E!=null,O=a.useId(),N=uD(u,O),y=dD(N),w=fD(N),P=r!==void 0,k=I?T.selectedValue===E:void 0,j=P?r:k!==void 0?k:void 0,[B,D,F]=Re({value:j,defaultValue:!!(!(I||P)&&s)}),H=d??(T==null?void 0:T.name),U=!!(o??(T==null?void 0:T.disabled)),{isCompound:G,hasCompoundLabel:K,hasCompoundHint:V,hasCompoundError:oe}=a.useMemo(()=>{const he=Ue(L);return{isCompound:he,hasCompoundLabel:he?ge(L,"RadioLabel"):!1,hasCompoundHint:he?ge(L,"RadioHint"):!1,hasCompoundError:he?ge(L,"RadioError"):!1}},[L]),J=G?K:!!A,ee=G&&CD(v),se=!U&&(!G||ee),M=Xn[e],W=b!=null,Y=_!=null,Z=G?(V?1:0)+(oe?1:0):(W?1:0)+(Y?1:0),ce=a.useRef(null),z=a.useCallback(he=>{!P&&!I&&D(he.target.checked),l==null||l(he),!he.defaultPrevented&&I&&he.target.checked&&E!=null&&T.selectValue(E)},[T,I,P,l,E,D]),Q=!U&&!g&&!m&&!(I&&T.required),te=m??(I&&T.required?T.claimRequiredAnchor():void 0),me=a.useCallback(he=>{if(R==null||R(he),!(he.defaultPrevented||!Q||!B)){if(he.preventDefault(),I){T.selectValue(void 0);return}P||D(!1)}},[Q,T,I,P,B,R,D]);return{contextValue:a.useMemo(()=>({inputId:N,hintId:y,errorId:w,size:e,variant:t,mergedChecked:B,isDisabled:U,isControlled:F,isCompound:G,hasCompoundHint:V,hasCompoundError:oe,hintConnected:G?V:W,errorConnected:G?oe:Y,hasLabel:J,useInlineCompoundMotion:ee,textMotionRef:ce,danger:n,inputName:H,onChange:z,onActivate:me,inputProps:{value:f,defaultChecked:F?void 0:s,required:te,form:p,autoFocus:C,tabIndex:S,readOnly:g,onBlur:h,onFocus:x}}),[n,s,p,C,w,z,me,oe,V,Y,W,J,y,N,H,G,ee,F,U,B,h,x,te,g,e,S,f,t]),isCompound:G,isDisabled:U,mergedChecked:B,enableTextMotion:se,textColRef:ce,secondaryLines:Z,sz:M,hasHint:W,hasError:Y,label:A,hint:b,error:_,hintId:y,errorId:w,danger:n}}const fC=a.forwardRef(function({children:t,label:n,hint:o,error:r,size:s,variant:l,danger:u,disabled:d,checked:f,defaultChecked:m,onChange:p,id:C,name:S,value:g,required:h,form:x,autoFocus:A,tabIndex:b,readOnly:_,onBlur:L,onFocus:v,className:R,classNames:T,onPointerDown:E,onClick:I,...O},N){const y=PD({size:s,variant:l,danger:u,disabled:d,checked:f,defaultChecked:m,onChange:p,id:C,name:S,value:g,required:h,form:x,autoFocus:A,tabIndex:b,readOnly:_,onBlur:L,onFocus:v,label:n,hint:o,error:r},t,R,I),{handlePointerDown:w}=cD({isDisabled:y.isDisabled,enableTextMotion:y.enableTextMotion,textMotionRef:y.textColRef,onPointerDown:E}),P=i.cn(wD(y.secondaryLines,y.sz.gridGap,R),y.isDisabled&&ID,T==null?void 0:T.root);return c.jsx(aD,{value:y.contextValue,children:c.jsx(lD,{classNames:T,children:c.jsx("label",{ref:N,"data-selected":y.mergedChecked?!0:void 0,className:P,...O,onPointerDown:w,children:y.isCompound?t:c.jsx(OD,{label:y.label,hint:y.hint,error:y.error,hasHint:y.hasHint,hasError:y.hasError,secondaryLines:y.secondaryLines,textColRef:y.textColRef,size:y.contextValue.size,isDisabled:y.isDisabled,danger:y.danger,hintId:y.hintId,errorId:y.errorId})})})})});fC.displayName="RadioRoot";const DD=Object.assign(Bl,{Fill:Be.Fill,Mark:Be.Mark}),kD=Object.assign(fC,{Control:kl,Indicator:DD,Content:iC,Label:cC,Hint:uC,Error:dC});function BD(e){return!/\bflex-col\b/.test(e??"")}function jD(e,t){return a.Children.map(e,n=>a.isValidElement(n)&&n.type.displayName==="SwitchControl"?a.cloneElement(n,{...t,...n.props}):n)}function MD(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;const s=r.type.displayName;if(s==="SwitchLabel"||s==="SwitchContent"){t=!0;return}n(r.props.children)}};return n(e),t}function FD(e,t,n,o,r){return e?(o?1:0)+(r?1:0):(t?1:0)+(n?1:0)}function HD(e){let t=null;const n=[];for(const o of a.Children.toArray(e)){if(a.isValidElement(o)&&o.type.displayName==="SwitchTrack"){t==null&&(t=o);continue}n.push(o)}return n.length===0?{track:t,content:null}:n.length===1?{track:t,content:n[0]}:{track:t,content:n}}function GD(e){let t=!1;const n=o=>{if(!t)for(const r of a.Children.toArray(o)){if(!a.isValidElement(r))continue;if(r.type.displayName==="SwitchThumb"){t=!0;return}n(r.props.children)}};return n(e),t}const Tc={small:He("small"),base:He("base"),mid:He("mid"),large:He("large")};function VD(e,t){if(e==null)return Tc[t];if(typeof e=="number")return e;const n=e.trim(),o=/^([\d.]+)px$/i.exec(n);if(o)return Number.parseFloat(o[1]);const r=/^([\d.]+)rem$/i.exec(n);if(r&&typeof document<"u"){const s=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return Number.parseFloat(r[1])*s}return Tc[t]}function zD(e,t){const n=e.getBoundingClientRect().width,o=t.getBoundingClientRect().width;return Math.max(0,n-o)}const fo={small:"h-[var(--selection-indicator-small)] min-h-[var(--selection-indicator-small)] w-[calc(2*var(--selection-indicator-small))] min-w-[calc(2*var(--selection-indicator-small))]",base:"h-[var(--selection-indicator-base)] min-h-[var(--selection-indicator-base)] w-[calc(2*var(--selection-indicator-base))] min-w-[calc(2*var(--selection-indicator-base))]",mid:"h-[var(--selection-indicator-mid)] min-h-[var(--selection-indicator-mid)] w-[calc(2*var(--selection-indicator-mid))] min-w-[calc(2*var(--selection-indicator-mid))]",large:"h-[var(--selection-indicator-large)] min-h-[var(--selection-indicator-large)] w-[calc(2*var(--selection-indicator-large))] min-w-[calc(2*var(--selection-indicator-large))]"},_n={small:{track:fo.small,travelPx:He("small"),title:ye.small.title,desc:ye.small.desc,gap:ye.small.gridGap},base:{track:fo.base,travelPx:He("base"),title:ye.base.title,desc:ye.base.desc,gap:ye.base.gridGap},mid:{track:fo.mid,travelPx:He("mid"),title:ye.mid.title,desc:ye.mid.desc,gap:ye.mid.gridGap},large:{track:fo.large,travelPx:He("large"),title:ye.large.title,desc:ye.large.desc,gap:ye.large.gridGap}};function UD({isDisabled:e,enableTextMotion:t,textMotionRef:n,onPointerDown:o}){return xt({isDisabled:!!e,enabled:t,textMotionRef:n,onPointerDown:o})}function WD({checked:e,disabled:t,size:n,thickness:o,squeezeToken:r,trackRef:s,trackFillRef:l,thumbRef:u,thumbShellRef:d,iconOffRef:f,iconOnRef:m}){const C=i.usePrefersReducedMotion()||!i.isMotionFeatureEnabled("enableSwitchThumb"),S=VD(o,n),g=a.useRef(S),h=a.useRef(!0),x=a.useRef(!0),A=a.useCallback((b,_)=>{const L=u.current;if(!L)return;const v=b?_:0;if(C||x.current){x.current=!1,i.killMotion(L),L.style.transform=`translate(${v}px, 0)`;return}i.killMotion(L),i.setWillChangeTransform(L,!0),$.to(L,{x:v,...i.motionSwitchThumb(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(L)})},[C,u]);a.useLayoutEffect(()=>{g.current=S,A(e,g.current)},[e,S,A]),a.useLayoutEffect(()=>{const b=s.current,_=d.current;if(!b||!_)return;const L=()=>{g.current=zD(b,_),A(e,g.current)};L();const v=new ResizeObserver(L);return v.observe(b),v.observe(_),()=>v.disconnect()},[e,n,A,o,S,s,d]),a.useEffect(()=>{const b=[l.current,u.current,d.current,f.current,m.current,s.current];return()=>{for(const _ of b)_&&i.killMotion(_)}},[f,m,u,d,l,s]),a.useLayoutEffect(()=>{const b=l.current;if(b){if(C){i.killMotion(b),b.style.opacity=e?"1":"0";return}if(h.current){h.current=!1,i.killMotion(b),b.style.opacity=e?"1":"0";return}i.killMotion(b),e?$.fromTo(b,{autoAlpha:0},{autoAlpha:1,...i.motionInteractive(),overwrite:"auto"}):$.to(b,{autoAlpha:0,...i.motionInteractive(),overwrite:"auto"})}},[e,C,l]),a.useLayoutEffect(()=>{if(!(!f.current&&!m.current)){if(C){f.current&&(i.killMotion(f.current),f.current.style.opacity=e?"0":"1"),m.current&&(i.killMotion(m.current),m.current.style.opacity=e?"1":"0");return}f.current&&(i.killMotion(f.current),e?$.to(f.current,{autoAlpha:0,scale:.88,...i.motionInteractive(),overwrite:"auto"}):$.fromTo(f.current,{autoAlpha:0,scale:.88},{autoAlpha:1,scale:1,...i.motionInteractive(),overwrite:"auto"})),m.current&&(i.killMotion(m.current),e?$.fromTo(m.current,{autoAlpha:0,scale:.88},{autoAlpha:1,scale:1,...i.motionInteractive(),overwrite:"auto"}):$.to(m.current,{autoAlpha:0,scale:.88,...i.motionInteractive(),overwrite:"auto"}))}},[e,f,m,C]),a.useLayoutEffect(()=>{const b=s.current;b&&(i.killMotion(b),b.style.opacity=t?"0.48":"1")},[t,s]),a.useLayoutEffect(()=>{if(r===0||C)return;const b=d.current;b&&i.animateInteractivePressSqueeze(b)},[C,r,d])}const jl=a.createContext(null),fs=a.createContext({}),mC=a.createContext(null);function YD({value:e,children:t}){return c.jsx(jl.Provider,{value:e,children:t})}function fr(){const e=a.useContext(jl);if(!e)throw new Error("Switch components must be inside <Switch>.");return e}function $D(){return a.useContext(jl)}function XD({classNames:e,children:t}){const n=a.useContext(fs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(fs.Provider,{value:o,children:t})}function st(){return a.useContext(fs)}function KD({value:e,children:t}){return c.jsx(mC.Provider,{value:e,children:t})}function Ml(){const e=a.useContext(mC);if(!e)throw new Error("Switch.Track, Switch.Fill, Switch.Thumb, Switch.Icon must be inside <Switch.Track>");return e}function qD(e,t,n){return e??n??`switch-${t}`}function ZD(e){return Ve(e)}function QD(e){return ze(e)}function JD(e){return e?void 0:"Switch"}const Fl=a.createContext(null),ms=a.createContext({}),pC=a.createContext(null);function ek({value:e,children:t}){return c.jsx(Fl.Provider,{value:e,children:t})}function mr(){const e=a.useContext(Fl);if(!e)throw new Error("Slider components must be inside <Slider>.");return e}function tk(){return a.useContext(Fl)}function nk({classNames:e,children:t}){const n=a.useContext(ms),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ms.Provider,{value:o,children:t})}function qe(){return a.useContext(ms)}function ok({value:e,children:t}){return c.jsx(pC.Provider,{value:e,children:t})}function Kn(){const e=a.useContext(pC);if(!e)throw new Error("Slider.Rail, Slider.Fill, Slider.Thumb, Slider.Icon must be inside Slider.Track");return e}function Hl(e,t){return i.cn(e==="horizontal"?"w-full":"w-auto items-center",t)}function qn(e){return typeof e=="number"?`${e}px`:e}const Ec={small:He("small"),base:He("base"),mid:He("mid"),large:He("large")};function mn(e,t,n){return Math.min(n,Math.max(t,e))}function CC(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function gC(e,t,n){return n<=t?0:(e-t)/(n-t)}function ps(e,t,n,o,r){if(o<=0)return CC(e,t,n);if(o<=r)return 50;const s=r/2,l=o-r;return(s+gC(e,t,n)*l)/o*100}function Pr(e,t,n,o,r){return o<=r?o/2:r/2+gC(e,t,n)*(o-r)}function rk(e,t,n,o,r,s,l){if(e<=0)return{start:0,end:CC(s,n,o)};const u=t/2;if(r){const f=Pr(l[0],n,o,e,t),m=Pr(l[1],n,o,e,t);return{start:Math.max(0,f-u)/e*100,end:Math.min(e,m+u)/e*100}}const d=Pr(s,n,o,e,t);return{start:0,end:Math.min(e,d+u)/e*100}}function sk(e,t){const n=e.end-e.start;return t==="horizontal"?{left:`${e.start}%`,width:`${n}%`}:{bottom:`${e.start}%`,height:`${n}%`}}function ak(e,t,n,o){if(o<=0)return mn(e,t,n);const r=Math.round((e-t)/o);return mn(t+r*o,t,n)}function lk(e,t){if(t.length===0)return e;let n=t[0],o=Math.abs(e-n);for(const r of t){const s=Math.abs(e-r);s<o&&(o=s,n=r)}return n}function ik(e,t,n){if(e!=null&&e.length)return[...new Set(e.map(o=>mn(o,t,n)))].toSorted((o,r)=>o-r)}function Cs(e,t,n,o,r,s,l){const u=o==="horizontal"?n.width:n.height,d=l/2,f=u-l;if(f<=0)return r;const m=mn(o==="horizontal"?(e-n.left-d)/f:1-(t-n.top-d)/f,0,1);return r+m*(s-r)}function ck(e,t,n){const o=t.findIndex(r=>r===e);if(o>=0){const r=t[o+n];return r!==void 0?r:e}return n>0?t.find(r=>r>e)??t[t.length-1]:[...t].reverse().find(r=>r<e)??t[0]}function uk(e,t,n,o){const r=new Set(["ArrowRight","ArrowUp","PageUp"]),s=new Set(["ArrowLeft","ArrowDown","PageDown"]);if(e!=null&&e.length)return n==="Home"?"home":n==="End"?"end":r.has(n)?"mark-next":s.has(n)?"mark-prev":0;const l=t>0?t*10:10;return n==="Home"?"home":n==="End"?"end":n==="PageUp"?l:n==="PageDown"?-l:n==="ArrowRight"||n==="ArrowUp"?t:n==="ArrowLeft"||n==="ArrowDown"?-t:0}function dk(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function xo(e,t){const n=t==="horizontal"?e.width:e.height,o=t==="horizontal"?e.height:e.width;return{trackSpanPx:n,thumbSpanPx:o}}function SC(e,t){if(e==null)return Ec[t];if(typeof e=="number")return e;const n=e.trim(),o=/^([\d.]+)px$/i.exec(n);if(o)return Number.parseFloat(o[1]);const r=/^([\d.]+)rem$/i.exec(n);if(r&&typeof document<"u"){const s=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return Number.parseFloat(r[1])*s}return Ec[t]}function fk(e,t){return e===t?!0:e==null||t==null?!1:e.valueLabel===t.valueLabel&&e.min===t.min&&e.max===t.max&&e.range===t.range&&e.singleValue===t.singleValue&&e.rangeValue[0]===t.rangeValue[0]&&e.rangeValue[1]===t.rangeValue[1]&&e.label===t.label}function mk(e){let t=!1;const n=[];for(const o of a.Children.toArray(e)){if(!a.isValidElement(o)){n.push(o);continue}const r=o.type.displayName;(r==="SliderRail"||r==="SliderFill"||r==="SliderThumb"||r==="SliderIcon")&&(t=!0),n.push(o)}return t?{body:n,hasCompoundParts:!0}:{body:null,hasCompoundParts:!1}}function pk(e,t){if(e==null)return t;const n=a.Children.toArray(e);if(n.length===0)return t;if(n.length===1&&a.isValidElement(n[0])&&n[0].type.displayName==="SliderIcon"){const{children:r,className:s,...l}=n[0].props,u=r??t;return u==null?t:s||Object.keys(l).length>0?a.createElement("span",{className:s,...l},u):u}return e}const Ck="flex items-baseline justify-between gap-xsmall",gk="w-full",Sk="min-w-[8rem]",hk="tabular-nums text-muted",xk={small:"h-[var(--selection-indicator-small)] min-h-[var(--selection-indicator-small)]",base:"h-[var(--selection-indicator-base)] min-h-[var(--selection-indicator-base)]",mid:"h-[var(--selection-indicator-mid)] min-h-[var(--selection-indicator-mid)]",large:"h-[var(--selection-indicator-large)] min-h-[var(--selection-indicator-large)]"},bk={small:"w-[var(--selection-indicator-small)] min-w-[var(--selection-indicator-small)]",base:"w-[var(--selection-indicator-base)] min-w-[var(--selection-indicator-base)]",mid:"w-[var(--selection-indicator-mid)] min-w-[var(--selection-indicator-mid)]",large:"w-[var(--selection-indicator-large)] min-w-[var(--selection-indicator-large)]"},Ak="pointer-events-none absolute inset-0 overflow-hidden",vk="bg-primary-tint",_k="gloss-indicator border-0",Lk="overflow-hidden",Tk="opacity-48",Ek="absolute rounded-[inherit]",Rk="bg-primary",Ik="bg-primary-tint",yk="z-[1]",Nk="inset-y-0",wk="inset-x-0",Ok="relative touch-none select-none",Pk="w-full",Dk="h-48",kk="pointer-events-none absolute z-[1] size-1 rounded-[var(--selection-indicator-radius-xsmall)] bg-primary/30",Bk="absolute box-border flex shrink-0 origin-center items-center justify-center m-0 appearance-none border-0 bg-transparent p-0 focus-ring",jk="top-0 h-full w-auto -translate-x-1/2 aspect-square",Mk="left-0 w-full h-auto -translate-y-1/2 aspect-square",Fk="cursor-not-allowed",Hk="cursor-grab active:cursor-grabbing",Gk="z-[2]",Vk="z-[3]";function zk({orientation:e,slotClass:t,className:n}){return i.cn(Hl(e,n),t)}function Uk({size:e,disabled:t,gloss:n=!1,slotClass:o,className:r}){return i.cn(Ak,Ye[e],!n&&vk,t&&Tk,o,r)}function Wk({isHorizontal:e,gloss:t=!1,slotClass:n,className:o}){return i.cn(Ek,e?Nk:wk,t?Ik:Rk,t&&yk,n,o)}function hC({isHorizontal:e,size:t,thickness:n,gloss:o=!1,slotClass:r,className:s}){return i.cn(Ok,e?Pk:Dk,n==null&&(e?xk[t]:bk[t]),o&&Ye[t],o&&Lk,o&&_k,r,s)}function Yk({size:e,orientation:t,disabled:n,active:o,slotClass:r,className:s}){return i.cn(Bk,Ye[e],t==="horizontal"?jk:Mk,n?Fk:Hk,o?Vk:Gk,r,s)}function $k(e,t){return t==="horizontal"?{left:`${e}%`}:{top:`${100-e}%`}}function Xk(e,t){return t==="horizontal"?{left:`${e}%`,top:"50%",transform:"translate(-50%, -50%)"}:{bottom:`${e}%`,left:"50%",top:"auto",transform:"translate(-50%, 50%)"}}function Kk({isHorizontal:e,thickness:t}){if(t==null)return;const n=qn(t);return e?{height:n,minHeight:n}:{width:n,minWidth:n}}function qk({children:e,className:t,orientation:n="horizontal",...o}){return c.jsx("div",{className:i.cn(Ck,n==="horizontal"?gk:Sk,t),...o,children:e})}function Zk({children:e,fallback:t,className:n,...o}){const r=e??t;return r==null?null:c.jsx(q,{as:"span",variant:"base",className:i.cn(hk,n),...o,children:r})}function Qk({label:e,labelClassName:t,showValue:n,valueText:o,hint:r,hintId:s,error:l,errorId:u,Header:d,Value:f,track:m}){const p=e!=null||n||o!=null;return c.jsxs(c.Fragment,{children:[p?c.jsxs(d,{children:[e!=null?c.jsx(ve,{classNames:t?{root:t}:void 0,children:e}):null,o!=null?c.jsx(f,{children:o}):n?c.jsx(f,{}):null]}):null,m,r!=null?c.jsx(le.Hint,{id:s,children:r}):null,l!=null?c.jsx(le.Error,{id:u,children:l}):null]})}function Jk(e){const t=a.useRef(null);return a.useLayoutEffect(()=>{const n=t.current;n&&(i.killMotion(n),n.style.opacity=e?"0.48":"1")},[e]),t}function eB({disabled:e,onPointerDown:t}){const n=a.useRef(null),o=i.usePrefersReducedMotion();a.useEffect(()=>{const s=n.current;return()=>{s&&i.killMotion(s)}},[]);const r=a.useCallback(s=>{if(t(s),s.defaultPrevented||e||o)return;const l=n.current;l&&i.animateInteractivePressSqueeze(l)},[e,t,o]);return{squeezeRef:n,handlePointerDown:r}}function tB(e){a.useEffect(()=>{const t=e.current;return()=>{t&&i.killMotion(t)}},[e])}function nB(e,t,n){i.killMotion(e),e.style.left=t.left??"",e.style.width=t.width??"",e.style.bottom=t.bottom??"",e.style.height=t.height??"",n==="horizontal"?(e.style.bottom="",e.style.height=""):(e.style.left="",e.style.width="")}const yn=a.forwardRef(function({size:t,icon:n,gloss:o=!1,thumbClassName:r,className:s,style:l,percent:u,orientation:d,disabled:f,active:m,ariaValueNow:p,ariaValueMin:C,ariaValueMax:S,ariaValueText:g,ariaLabel:h,ariaLabelledBy:x,ariaDescribedBy:A,onPointerDown:b,onKeyDown:_,...L},v){const R=qe(),T=Jk(f),{squeezeRef:E,handlePointerDown:I}=eB({disabled:f,onPointerDown:b});return c.jsx("button",{ref:$e(E,v),type:"button",role:"slider",...x!=null?{"aria-labelledby":x}:h!=null?{"aria-label":h}:{},...A!=null?{"aria-describedby":A}:{},"aria-valuemin":C,"aria-valuemax":S,"aria-valuenow":p,"aria-valuetext":g,"aria-orientation":d,disabled:f,tabIndex:f?-1:0,className:Yk({size:t,orientation:d,disabled:f,active:m,slotClass:i.cn(R.thumb,s)}),style:{...$k(u,d),...l},onPointerDown:I,onKeyDown:_,...L,children:c.jsx(On,{size:t,gloss:o,shellRef:T,className:i.cn(R.thumbShell,r),children:n!=null?c.jsx(On.Icon,{size:t,gloss:o,children:n}):null})})});yn.displayName="SliderThumbButton";function xC(){const e=Kn(),t=qe();return e.markItems.length?c.jsx(c.Fragment,{children:e.markItems.map(n=>c.jsx("span",{"aria-hidden":!0,className:i.cn(kk,e.markSlotClass,t.mark),style:Xk(n.percent,e.orientation)},n.value))}):null}xC.displayName="SliderTrackMarks";function Gl({className:e,...t}){const n=Kn(),o=qe();return c.jsx("span",{ref:n.fillRef,className:i.cn(n.fillClassResolved,o.fill,e),...t})}Gl.displayName="SliderFill";function Vl({className:e,children:t,...n}){const o=Kn(),r=qe();return c.jsx("div",{className:i.cn(o.railClass,r.rail,e),"aria-hidden":!0,...n,children:t??c.jsxs(c.Fragment,{children:[c.jsx(Gl,{}),c.jsx(xC,{})]})})}Vl.displayName="SliderRail";function oB({kind:e,icon:t,className:n,style:o,forwardedRef:r,...s}){const l=Kn();return e==="start"?c.jsx(yn,{ref:r,size:l.size,icon:t,gloss:l.gloss,thumbClassName:l.thumbClassName,className:n,style:o,percent:l.thumbPercent("start"),orientation:l.orientation,disabled:l.disabled,active:l.activeThumb==="start",ariaValueNow:l.rangeValue[0],ariaValueMin:l.min,ariaValueMax:l.rangeValue[1],ariaValueText:l.formatValue(l.rangeValue[0]),...l.resolveThumbA11y("start"),onPointerDown:l.onThumbPointerDown("start"),onKeyDown:l.onThumbKeyDown("start"),...s}):e==="end"?c.jsx(yn,{ref:r,size:l.size,icon:t,gloss:l.gloss,thumbClassName:l.thumbClassName,className:n,style:o,percent:l.thumbPercent("end"),orientation:l.orientation,disabled:l.disabled,active:l.activeThumb==="end",ariaValueNow:l.rangeValue[1],ariaValueMin:l.rangeValue[0],ariaValueMax:l.max,ariaValueText:l.formatValue(l.rangeValue[1]),...l.resolveThumbA11y("end"),onPointerDown:l.onThumbPointerDown("end"),onKeyDown:l.onThumbKeyDown("end"),...s}):c.jsx(yn,{ref:r,size:l.size,icon:t,gloss:l.gloss,thumbClassName:l.thumbClassName,className:n,style:o,percent:l.thumbPercent("single"),orientation:l.orientation,disabled:l.disabled,active:l.activeThumb==="single",ariaValueNow:l.singleValue,ariaValueMin:l.min,ariaValueMax:l.max,ariaValueText:l.formatValue(l.singleValue),...l.resolveThumbA11y("single"),onPointerDown:l.onThumbPointerDown("single"),onKeyDown:l.onThumbKeyDown("single"),...s})}const Nn=a.forwardRef(function({thumb:t="single",children:n,className:o,style:r,...s},l){const u=Kn();return c.jsx(oB,{kind:t,icon:u.resolveThumbIcon(n),className:o,style:r,forwardedRef:l,...s})});Nn.displayName="SliderThumb";const wn=a.forwardRef(function({children:t,className:n,...o},r){return c.jsx("span",{ref:r,className:n,...o,children:t})});wn.displayName="SliderIcon";function rB({range:e,icon:t}){return c.jsxs(c.Fragment,{children:[c.jsx(Vl,{}),e?c.jsxs(c.Fragment,{children:[c.jsx(Nn,{thumb:"start",children:t!=null?c.jsx(wn,{children:t}):null}),c.jsx(Nn,{thumb:"end",children:t!=null?c.jsx(wn,{children:t}):null})]}):c.jsx(Nn,{thumb:"single",children:t!=null?c.jsx(wn,{children:t}):null})]})}function sB(e){return`${e}-label`}function aB({kind:e,explicitLabel:t,labelConnected:n,labelId:o,hintConnected:r,hintId:s,errorConnected:l,errorId:u}){const d=je(r?s:void 0,l?u:void 0);return t?e==="start"?{ariaLabel:`${t}, minimum`,ariaLabelledBy:void 0,ariaDescribedBy:d}:e==="end"?{ariaLabel:`${t}, maximum`,ariaLabelledBy:void 0,ariaDescribedBy:d}:{ariaLabel:t,ariaLabelledBy:void 0,ariaDescribedBy:d}:e==="start"?{ariaLabel:"Minimum range",ariaLabelledBy:void 0,ariaDescribedBy:d}:e==="end"?{ariaLabel:"Maximum range",ariaLabelledBy:void 0,ariaDescribedBy:d}:n&&o?{ariaLabel:void 0,ariaLabelledBy:o,ariaDescribedBy:d}:{ariaLabel:t??"Value",ariaLabelledBy:void 0,ariaDescribedBy:d}}function lB(e,t){const{orientation:n,size:o="base",thickness:r,min:s=0,max:l=100,step:u=1,marks:d,formatValue:f=dk,icon:m,gloss:p=!1,thumbClassName:C,disabled:S=!1,className:g,style:h,classNames:x,ariaLabel:A,range:b=!1,children:_,onPointerDown:L,value:v,defaultValue:R,onValueChange:T,...E}=e,I=tk(),O=qe(),N=a.useMemo(()=>({...O,...x}),[O,x]),y=n??(I==null?void 0:I.orientation)??"horizontal",w=I==null?void 0:I.labelId,P=(I==null?void 0:I.labelConnected)??!1,k=A,j=a.useCallback(ne=>aB({kind:ne,explicitLabel:k,labelConnected:P,labelId:w,hintConnected:(I==null?void 0:I.hintConnected)??!1,hintId:(I==null?void 0:I.hintId)??"",errorConnected:(I==null?void 0:I.errorConnected)??!1,errorId:(I==null?void 0:I.errorId)??""}),[k,I==null?void 0:I.errorConnected,I==null?void 0:I.errorId,I==null?void 0:I.hintConnected,I==null?void 0:I.hintId,P,w]),B=a.useRef(null),D=a.useRef(null),[F,H]=a.useState(0),U=a.useMemo(()=>SC(r,o),[r,o]),[G,K]=a.useState(U),V=a.useRef(null),[oe,J]=a.useState(null),ee=a.useMemo(()=>ik(d,s,l),[d,s,l]),se=a.useCallback(ne=>{const ae=mn(ne,s,l);return ee!=null&&ee.length?lk(ae,ee):ak(ae,s,l,u)},[ee,s,l,u]),[M,W]=Re({value:b?void 0:e.value,defaultValue:(b?void 0:e.defaultValue)??s}),[Y,Z]=Re({value:b?e.value:void 0,defaultValue:(b?e.defaultValue:void 0)??[s,l]}),ce=b?void 0:e.onValueChange,z=b?e.onValueChange:void 0,Q=a.useCallback(ne=>{const ae=se(ne);ae!==M&&(W(ae),ce==null||ce(ae))},[ce,W,M,se]),te=a.useCallback(ne=>{let[ae,Ce]=ne.map(se);ae>Ce&&([ae,Ce]=[Ce,ae]);const[Te,Oe]=Y;ae===Te&&Ce===Oe||(Z([ae,Ce]),z==null||z([ae,Ce]))},[z,Y,Z,se]),me=a.useCallback((ne=M,ae=Y)=>{const Ce=B.current,Te=D.current;if(!Ce||!Te)return;const Oe=Ce.getBoundingClientRect(),{trackSpanPx:ct,thumbSpanPx:Fe}=xo(Oe,y);H(dt=>dt===ct?dt:ct),Fe>0&&K(dt=>dt===Fe?dt:Fe);const ut=rk(ct,Fe>0?Fe:U,s,l,b,ne,ae);nB(Te,sk(ut,y),y)},[U,l,s,y,b,Y,M]);a.useLayoutEffect(()=>{me()},[me]),a.useEffect(()=>{const ne=B.current;if(!ne)return;const ae=new ResizeObserver(()=>me());return ae.observe(ne),()=>ae.disconnect()},[y,me]),tB(D);const Ae=a.useCallback((ne,ae,Ce)=>{const Te=B.current;if(!Te||S)return;const Oe=Te.getBoundingClientRect(),{thumbSpanPx:ct}=xo(Oe,y),Fe=Cs(ne,ae,Oe,y,s,l,ct>0?ct:U);if(b){const[ut,dt]=Y;if(Ce==="start"){const Rn=se(Math.min(Fe,dt));te([Rn,dt]),me(M,[Rn,dt])}else if(Ce==="end"){const Rn=se(Math.max(Fe,ut));te([ut,Rn]),me(M,[ut,Rn])}}else{const ut=se(Fe);Q(Fe),me(ut,Y)}},[S,te,Q,U,l,s,y,b,Y,M,se,me]),he=a.useCallback((ne,ae)=>{const Ce=B.current;if(!Ce)return"start";const Te=Ce.getBoundingClientRect(),{thumbSpanPx:Oe}=xo(Te,y),ct=Cs(ne,ae,Te,y,s,l,Oe>0?Oe:U),[Fe,ut]=Y;return Math.abs(ct-Fe)<=Math.abs(ct-ut)?"start":"end"},[U,l,s,y,Y]);a.useEffect(()=>{const ne=Ce=>{const Te=V.current;Te&&Ae(Ce.clientX,Ce.clientY,Te)},ae=()=>{V.current=null,J(null)};return window.addEventListener("pointermove",ne),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),()=>{window.removeEventListener("pointermove",ne),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae)}},[Ae]);const X=a.useCallback(ne=>{if(L==null||L(ne),ne.defaultPrevented||S||ne.button!==0)return;ne.preventDefault();const ae=b?he(ne.clientX,ne.clientY):"single";V.current=ae,J(ae),Ae(ne.clientX,ne.clientY,ae)},[S,L,he,b,Ae]),re=a.useCallback(ne=>ae=>{S||ae.button!==0||(ae.preventDefault(),ae.stopPropagation(),V.current=ne,J(ne),ae.currentTarget.setPointerCapture(ae.pointerId))},[S]),pe=a.useCallback((ne,ae)=>{if(b){const[Ce,Te]=Y;te(ne==="start"?[Ce+ae,Te]:[Ce,Te+ae])}else Q(M+ae)},[te,Q,b,Y,M]),fe=a.useCallback(ne=>ae=>{if(S)return;const Ce=uk(ee,u,ae.key);if(Ce===0)return;ae.preventDefault();const Te=ne==="start"?Y[0]:ne==="end"?Y[1]:M;if(Ce==="home"){b?te(ne==="start"?[s,Y[1]]:[Y[0],s]):Q(s);return}if(Ce==="end"){b?te(ne==="start"?[l,Y[1]]:[Y[0],l]):Q(l);return}if(Ce==="mark-next"||Ce==="mark-prev"){if(!(ee!=null&&ee.length))return;const Oe=ck(Te,ee,Ce==="mark-next"?1:-1);b?te(ne==="start"?[Oe,Y[1]]:[Y[0],Oe]):Q(Oe);return}typeof Ce=="number"&&Ce!==0&&pe(ne,Ce)},[S,te,Q,ee,l,s,pe,y,b,Y,M,u]),_e=a.useCallback(ne=>{const ae=ne==="start"?Y[0]:ne==="end"?Y[1]:M;return ps(ae,s,l,F,G)},[l,s,Y,M,G,F]),Lt=a.useCallback(ne=>pk(ne,m),[m]),it=a.useMemo(()=>{if(b){const[ne,ae]=Y;return`${f(ne)} — ${f(ae)}`}return f(M)},[f,b,Y,M]),Qe=I==null?void 0:I.setDisplay;a.useLayoutEffect(()=>{Qe==null||Qe({valueLabel:it,min:s,max:l,range:b,singleValue:M,rangeValue:Y,label:k})},[k,l,s,b,Y,Qe,M,it]);const de=y==="horizontal",Le=Wk({isHorizontal:de,gloss:p,slotClass:N.fill}),ie=Uk({size:o,disabled:S,gloss:p,slotClass:N.rail}),xe=a.useMemo(()=>(ee??[]).map(ne=>({value:ne,percent:ps(ne,s,l,F,G)})),[ee,l,s,G,F]),Je=a.useCallback(ne=>{B.current=ne,typeof t=="function"?t(ne):t&&(t.current=ne)},[t]),Ir=a.useMemo(()=>({fillRef:D,fillClassResolved:Le,railClass:ie,markSlotClass:N.mark,markItems:xe,size:o,orientation:y,disabled:S,icon:m,range:b,gloss:p,thumbClassName:C,activeThumb:oe,singleValue:M,rangeValue:Y,min:s,max:l,formatValue:f,thumbPercent:_e,resolveThumbIcon:Lt,resolveThumbA11y:j,onThumbPointerDown:re,onThumbKeyDown:fe}),[oe,S,Le,f,p,m,xe,l,s,fe,re,y,ie,b,Y,j,Lt,M,o,N.mark,C,_e]),{body:oo,hasCompoundParts:Bt}=a.useMemo(()=>mk(_),[_]),yr=a.useMemo(()=>({...Kk({isHorizontal:de,thickness:r}),...h}),[de,h,r]),oh=hC({isHorizontal:de,size:o,thickness:r,gloss:p,slotClass:N.track,className:g});return{setTrackRef:Je,trackHitClass:oh,trackCrossStyle:yr,trackRest:E,handleTrackPointerDown:X,trackContextValue:Ir,compoundBody:oo,hasCompoundParts:Bt,range:b,icon:m}}function iB({label:e,showValue:t,valueText:n,hint:o,error:r,hintId:s,errorId:l,trackProps:u}){const d=qe();return Qk({label:e,labelClassName:d.label,showValue:t,valueText:n,hint:o,hintId:s,error:r,errorId:l,Header:zl,Value:Ul,track:c.jsx(Wl,{...u})})}function bC({className:e,classNames:t,...n}){const o=qe();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}bC.displayName="SliderLabel";function zl({children:e,className:t,...n}){const{orientation:o}=mr(),r=qe();return c.jsx(qk,{orientation:o,className:i.cn(r.header,t),...n,children:e})}zl.displayName="Slider.Header";function Ul({children:e,className:t,...n}){const{display:o}=mr(),r=qe();return c.jsx(Zk,{fallback:o==null?void 0:o.valueLabel,className:i.cn(r.value,t),...n,children:e})}Ul.displayName="Slider.Value";function AC({children:e,className:t,id:n,...o}){const r=mr(),s=qe();return c.jsx(le.Hint,{id:n??r.hintId,className:i.cn(s.hint,t),...o,children:e})}AC.displayName="Slider.Hint";function vC({children:e,className:t,id:n,...o}){const r=mr(),s=qe();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}vC.displayName="Slider.Error";const Wl=a.forwardRef(function(t,n){const o=lB(t,n);return c.jsx("div",{...o.trackRest,ref:o.setTrackRef,role:"presentation",className:o.trackHitClass,style:o.trackCrossStyle,onPointerDown:o.handleTrackPointerDown,children:c.jsx(ok,{value:o.trackContextValue,children:o.hasCompoundParts?o.compoundBody:c.jsx(rB,{range:o.range,icon:o.icon})})})});Wl.displayName="SliderTrack";function cB({children:e,id:t,orientation:n="horizontal",label:o,showValue:r,valueText:s,hint:l,error:u,range:d,value:f,defaultValue:m,onValueChange:p,min:C,max:S,step:g,marks:h,size:x,thickness:A,formatValue:b,icon:_,disabled:L,ariaLabel:v,gloss:R,thumbClassName:T}){const E=a.useId(),I=t??`slider-${E}`,O=Ve(I),N=ze(I),y=sB(I),[w,P]=a.useState(null),k=a.useCallback(K=>{P(V=>fk(V,K)?V:K)},[]),{isCompound:j,hasLabel:B,hasHint:D,hasError:F}=a.useMemo(()=>{const K=Ue(e);return{isCompound:K,hasLabel:o!=null||K&&ge(e,"Label"),hasHint:l!=null||K&&ge(e,"Slider.Hint"),hasError:u!=null||K&&ge(e,"Slider.Error")}},[e,u,l,o]),H=a.useMemo(()=>({sliderId:I,labelId:y,hintId:O,errorId:N,hintConnected:D,errorConnected:F,labelConnected:B,orientation:n,display:w,setDisplay:k}),[w,N,F,D,B,O,y,n,k,I]),U=a.useMemo(()=>({labelId:y,required:!1}),[y]);return{sliderId:I,isCompound:j,fieldCtx:H,fieldLabelCtx:U,trackProps:{range:d,value:f,defaultValue:m,onValueChange:p,min:C,max:S,step:g,marks:h,size:x,thickness:A,formatValue:b,icon:_,disabled:L,ariaLabel:v,gloss:R,thumbClassName:T,orientation:n},label:o,showValue:r,valueText:s,hint:l,error:u,hasHint:D,hasError:F,hintId:O,errorId:N}}function _C({children:e,className:t,classNames:n,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,range:m,value:p,defaultValue:C,onValueChange:S,min:g,max:h,step:x,marks:A,size:b,thickness:_,formatValue:L,icon:v,disabled:R,ariaLabel:T,gloss:E,thumbClassName:I,...O}){const N=cB({children:e,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,range:m,value:p,defaultValue:C,onValueChange:S,min:g,max:h,step:x,marks:A,size:b,thickness:_,formatValue:L,icon:v,disabled:R,ariaLabel:T,gloss:E,thumbClassName:I}),y=N.isCompound?e:c.jsx(iB,{label:N.label,showValue:N.showValue,valueText:N.valueText,hint:N.hint,error:N.error,hintId:N.hasHint?N.hintId:void 0,errorId:N.hasError?N.errorId:void 0,trackProps:N.trackProps});return c.jsx(ek,{value:N.fieldCtx,children:c.jsx(nk,{classNames:n,children:c.jsx(Ge.Provider,{value:N.fieldLabelCtx,children:c.jsx(le,{id:N.sliderId,className:zk({orientation:N.fieldCtx.orientation,slotClass:n==null?void 0:n.root,className:t}),...O,children:y})})})})}_C.displayName="Slider";const uB=Object.assign(_C,{Header:zl,Label:bC,Value:Ul,Hint:AC,Error:vC,Track:Wl,Rail:Vl,Fill:Gl,Thumb:Nn,Icon:wn}),dB="absolute m-[-1px] h-px w-px overflow-hidden border-0 p-0 opacity-0 [clip:rect(0,0,0,0)]",fB="relative inline-flex shrink-0 items-center justify-center has-focus-ring";function mB(e){return i.cn(fB,Ye[e])}const pB="min-w-0",CB="contents",gB="inline-flex flex-wrap items-center gap-x-xsmall gap-y-0",SB="min-w-0",hB="origin-center",xB="font-w-mid",LC="text-muted",TC="text-muted",EC="text-muted",bB="origin-center",AB="min-w-0 font-w-mid",vB="relative cursor-pointer select-none rounded-small text-left",_B="cursor-not-allowed",LB="inline-grid grid-cols-[auto] grid-rows-[auto]",TB="relative box-border inline-flex shrink-0",EB="gloss-indicator border-0",RB="bg-primary-tint",IB="pointer-events-none absolute inset-0 rounded-[inherit]",yB="z-[1]",NB="bg-primary",wB="bg-primary-tint",OB="absolute inset-y-0 left-0 aspect-square h-full w-auto flex",PB="z-[2]",DB="absolute inset-0 flex items-center justify-center";function pr(e){return e==="left"?"left":"right"}function RC(e){return er(pr(e))}function IC(e){return tr(pr(e))}function Do(e,t){return nr(e,pr(t))}function kB(e){return Ia(e)}function BB({hasTextColumn:e,secondaryLines:t,gap:n,labelPosition:o,slotClass:r,className:s}){return i.cn(vB,e?Ra(t,n,pr(o),"inline-grid"):LB,r,s)}function jB({size:e,thickness:t,gloss:n,slotClass:o,className:r}){return i.cn(TB,Ye[e],t==null&&_n[e].track,n?EB:RB,o,r)}function MB(e){if(e==null)return;const t=qn(e);return{height:t,minHeight:t,width:`calc(2 * (${t}))`,minWidth:`calc(2 * (${t}))`}}function FB(e){if(e)return{background:e}}function ko({size:e,thickness:t,checked:n=!1,disabled:o,color:r,gloss:s=!1,squeezeToken:l=0,iconOff:u,iconOn:d,className:f,classNames:m,children:p,...C}){const S=st(),g=a.useMemo(()=>({...S,...m}),[S,m]),h=a.useRef(null),x=a.useRef(null),A=a.useRef(null),b=a.useRef(null),_=a.useRef(null),L=a.useRef(null);WD({checked:n,disabled:o,size:e,thickness:t,squeezeToken:l,trackRef:h,trackFillRef:x,thumbRef:A,thumbShellRef:b,iconOffRef:_,iconOnRef:L});const v=a.useMemo(()=>({checked:n,disabled:o,size:e,color:r,gloss:s,trackFillRef:x,thumbRef:A,thumbShellRef:b,iconOffRef:_,iconOnRef:L}),[n,r,o,s,e]),R=c.jsxs(c.Fragment,{children:[c.jsx(Cr,{}),c.jsxs(Yl,{children:[u!=null?c.jsx(Bo,{when:"off",children:u}):null,d!=null?c.jsx(Bo,{when:"on",children:d}):null]})]});return c.jsx(KD,{value:v,children:c.jsx("span",{ref:h,className:jB({size:e,thickness:t,gloss:s,slotClass:g.track,className:f}),style:MB(t),"aria-hidden":!0,...C,children:p??R})})}ko.displayName="SwitchTrack";function Cr({className:e,style:t,...n}){const o=Ml(),r=st(),s=FB(o.color);return c.jsx("span",{ref:o.trackFillRef,"aria-hidden":!0,className:i.cn(IB,o.gloss&&yB,!o.color&&(o.gloss?wB:NB),r.fill,e),style:{opacity:0,...s,...t},...n})}Cr.displayName="SwitchFill";function Yl({className:e,children:t,...n}){const o=Ml(),r=st();return c.jsx("span",{ref:o.thumbRef,className:i.cn(OB,o.gloss&&PB,r.thumb,e),...n,children:c.jsx(On,{size:o.size,gloss:o.gloss,shellRef:o.thumbShellRef,className:r.thumbShell,children:t})})}Yl.displayName="SwitchThumb";function Bo({when:e,children:t,className:n,...o}){const r=Ml(),s=st(),l=e==="off"?r.iconOffRef:r.iconOnRef,u=e==="off"?!r.checked:r.checked;return c.jsx(On.Icon,{iconRef:l,size:r.size,gloss:r.gloss,className:i.cn(DB,s.icon,n),style:{opacity:u?1:0},...o,children:t})}Bo.displayName="SwitchIcon";const $l=a.forwardRef(function({size:t,iconOff:n,iconOn:o,color:r,gloss:s=!1,thickness:l,className:u,classNames:d,disabled:f,checked:m,defaultChecked:p,onChange:C,id:S,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:_,readOnly:L,onBlur:v,onFocus:R,onPointerDown:T,children:E,...I},O){const N=$D(),y=st(),w=a.useMemo(()=>({...y,...d}),[d,y]),P=a.useId(),k=qD(S,P,N==null?void 0:N.switchId),j=(N==null?void 0:N.hintId)??`${k}-hint`,B=(N==null?void 0:N.errorId)??`${k}-error`,D=t??(N==null?void 0:N.size)??"base",[F,H,U]=Re({value:m,defaultValue:!!p}),[G,K]=a.useState(0),V=a.useCallback(Z=>{const ce=Z.target.checked;U||H(ce),C==null||C(Z)},[U,C,H]),oe=a.useCallback(Z=>{T==null||T(Z),!(Z.defaultPrevented||f)&&(K(ce=>ce+1),N==null||N.setSqueezeToken(ce=>ce+1))},[f,N,T]),{"aria-label":J,...ee}=I,se={size:D,thickness:l,checked:F,disabled:f,color:r,gloss:s,squeezeToken:G,iconOff:n,iconOn:o,classNames:{track:w.track,fill:w.fill,thumb:w.thumb,thumbShell:w.thumbShell,icon:w.icon}},{compoundTrack:M,hasThumbChild:W}=a.useMemo(()=>{const{track:Z}=HD(E);return{compoundTrack:Z,hasThumbChild:E!=null&&GD(E)}},[E]);let Y;return M!=null?Y=a.isValidElement(M)?a.cloneElement(M,se):M:W?Y=c.jsxs(ko,{...se,children:[c.jsx(Cr,{}),E]}):E!=null?Y=E:Y=c.jsx(ko,{...se}),c.jsxs("span",{className:i.cn(mB(D),N!=null?RC(N.labelPosition):void 0,w.control,u),children:[c.jsx("input",{ref:O,id:k,type:"checkbox",role:"switch","aria-checked":F,className:i.cn(dB,w.input),disabled:f,name:g,value:h,required:x,form:A,autoFocus:b,tabIndex:_,readOnly:L??(U&&C===void 0),onBlur:v,onFocus:R,"aria-describedby":je(N!=null&&N.hintConnected?j:void 0,N!=null&&N.errorConnected?B:void 0),"aria-label":J??JD((N==null?void 0:N.hasTextColumn)??!1),onPointerDown:oe,...U?{checked:F,onChange:V}:{defaultChecked:p,onChange:V},...ee}),Y]})});$l.displayName="SwitchControl";const yC=a.forwardRef(function({className:t,children:n,...o},r){const s=fr(),l=st();return c.jsx("div",{ref:r,className:i.cn(CB,s.isCompound&&pB,l.content,t),...o,children:n})});yC.displayName="SwitchContent";function NC({children:e,className:t,...n}){const o=fr(),r=st(),s=_n[o.size];return c.jsx("span",{ref:l=>{o.isCompound&&o.useInlineCompoundMotion&&(o.textMotionRef.current=l)},className:i.cn(gB,o.isCompound&&IC(o.labelPosition),o.isCompound&&(o.hasCompoundHint||o.hasCompoundError)&&SB,o.isCompound&&o.useInlineCompoundMotion&&hB,r.label,t),...n,children:c.jsx(q,{as:"span",variant:s.title,inheritColor:!0,className:i.cn(xB,o.disabled&&LC,r.labelText),children:e})})}NC.displayName="SwitchLabel";function wC({children:e,className:t,variant:n,...o}){const r=fr(),s=st();return c.jsx(le.Hint,{as:"span",id:r.hintId,variant:n??_n[r.size].desc,className:i.cn(r.isCompound&&Do(2,r.labelPosition),r.disabled&&TC,s.hint,t),...o,children:e})}wC.displayName="Switch.Hint";function OC({children:e,className:t,...n}){const o=fr(),r=st();return c.jsx(le.Error,{as:"span",id:o.errorId,variant:_n[o.size].desc,className:i.cn(o.isCompound&&Do(kB(o.hasCompoundHint),o.labelPosition),o.disabled&&EC,r.error,t),...n,children:e})}OC.displayName="Switch.Error";function HB({label:e,hint:t,error:n,hasTextColumn:o,hasHint:r,hasError:s,secondaryLines:l,textColRef:u,size:d,disabled:f,labelPosition:m,hintId:p,errorId:C,controlProps:S}){const g=st(),h=_n[d];return c.jsxs(c.Fragment,{children:[c.jsx($l,{size:d,disabled:f,className:RC(m),...S}),o?c.jsxs(c.Fragment,{children:[c.jsx("span",{ref:u,className:i.cn(IC(m),!l&&bB,g.simpleLabelWrap,g.label),children:c.jsx(q,{as:"span",variant:h.title,inheritColor:!0,className:i.cn(AB,f&&LC,g.simpleLabelText,g.labelText),children:e})}),r?c.jsx(le.Hint,{as:"span",id:p,variant:h.desc,className:i.cn(Do(2,m),f&&TC,g.hint),children:t}):null,s?c.jsx(le.Error,{as:"span",id:C,variant:h.desc,className:i.cn(Do(r?3:2,m),f&&EC,g.error),children:n}):null]}):null]})}function GB({children:e,label:t,hint:n,error:o,labelPosition:r="right",size:s="base",disabled:l,className:u,...d}){const m=`switch-${a.useId()}`,p=ZD(m),C=QD(m),[,S]=a.useState(0),{isCompound:g,hasCompoundHint:h,hasCompoundError:x,hasCompoundLabel:A}=a.useMemo(()=>{const y=Ue(e);return{isCompound:y,hasCompoundHint:y?ge(e,"Switch.Hint"):!1,hasCompoundError:y?ge(e,"Switch.Error"):!1,hasCompoundLabel:y?MD(e):!1}},[e]),b=g&&BD(u),_=n!=null,L=o!=null,v=FD(g,_,L,h,x),R=g?A:t!=null,T=l,E=!T&&R&&(!g||b),I=a.useRef(null),O=_n[s];return{fieldCtx:a.useMemo(()=>({switchId:m,hintId:p,errorId:C,size:s,labelPosition:r,disabled:T,isCompound:g,hasCompoundHint:h,hasCompoundError:x,hasTextColumn:R,hintConnected:g?h:_,errorConnected:g?x:L,useInlineCompoundMotion:b,textMotionRef:I,setSqueezeToken:S}),[T,h,x,_,L,R,p,C,g,r,s,m,b]),isCompound:g,hasTextColumn:R,secondaryLines:v,sz:O,label:t,hint:n,error:o,hasHint:_,hasError:L,hintId:p,errorId:C,disabled:T,enableTextMotion:E,textColRef:I,labelPosition:r,controlRest:d}}const PC=a.forwardRef(function({children:t,label:n,hint:o,error:r,labelPosition:s="right",size:l="base",disabled:u,className:d,classNames:f,onPointerDown:m,...p},C){const S=GB({children:t,label:n,hint:o,error:r,labelPosition:s,size:l,disabled:u,className:d,...p}),{handlePointerDown:g}=UD({isDisabled:S.disabled,enableTextMotion:S.enableTextMotion,textMotionRef:S.textColRef,onPointerDown:m}),h=i.cn(BB({hasTextColumn:S.hasTextColumn,secondaryLines:S.secondaryLines,gap:S.sz.gap,labelPosition:S.labelPosition,slotClass:f==null?void 0:f.root,className:d}),S.disabled&&_B);return c.jsx(YD,{value:S.fieldCtx,children:c.jsx(XD,{classNames:f,children:c.jsx("label",{ref:C,className:h,onPointerDown:g,children:S.isCompound?jD(t,S.controlRest):c.jsx(HB,{label:S.label,hint:S.hint,error:S.error,hasTextColumn:S.hasTextColumn,hasHint:S.hasHint,hasError:S.hasError,secondaryLines:S.secondaryLines,textColRef:S.textColRef,size:S.fieldCtx.size,disabled:S.disabled,labelPosition:S.labelPosition,hintId:S.hintId,errorId:S.errorId,controlProps:S.controlRest})})})})});PC.displayName="SwitchRoot";const VB=Object.assign(PC,{Control:$l,Track:ko,Fill:Cr,Thumb:Yl,Icon:Bo,Content:yC,Label:NC,Hint:wC,Error:OC}),DC=a.createContext(null),gs=a.createContext({});function zB({classNames:e,children:t}){const n=a.useContext(gs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(gs.Provider,{value:o,children:t})}function gr(){const e=a.useContext(DC);if(!e)throw new Error("Components Tabs must be inside <Tabs>.");return e}function Xl(){return a.useContext(gs)}function kC(e,t){return`${e}-tab-${t}`}function BC(e,t){return`${e}-panel-${t}`}function UB({isSelected:e,isDisabled:t,panelId:n}){return{"aria-selected":e,"aria-controls":n,tabIndex:e?0:-1,disabled:t}}function WB({isSelected:e,tabId:t}){return{"aria-labelledby":t,hidden:!e,tabIndex:e?0:-1}}function jC(e){return Array.from(e.querySelectorAll('[role="tab"]:not([disabled])')).filter(t=>t instanceof HTMLButtonElement)}function YB(e,t){const n=jC(e);if(n.length===0)return null;const o=n[Math.max(0,Math.min(t,n.length-1))];return o.focus(),o}const $B={default:"",outline:"bg-transparent border-token rounded-mid p-xsmall",secondary:"bg-secondary border-token rounded-mid p-xsmall",gloss:"border-0 p-small"},XB={default:"bg-primary",outline:"bg-secondary",secondary:"bg-tertiary",gloss:"bg-tertiary"};function KB({orientation:e,slotClass:t,className:n}){return i.cn("flex min-w-0 text-left",e==="horizontal"?"flex-col gap-large":"flex-row gap-large",t,n)}function qB({orientation:e,variant:t,slotClass:n,className:o}){const r=t==="gloss",s=t==="outline"||t==="secondary"||t==="gloss";return i.cn("relative box-border min-w-0 w-fit",e==="horizontal"?i.cn("flex flex-row flex-wrap gap-xsmall",s?"items-center":"items-stretch border-b-token"):i.cn("flex flex-col gap-xsmall",s?"items-start":"items-stretch border-l-token"),r&&"gloss-panel rounded-mid text-foreground",$B[t],n,o)}function ZB({variant:e,slotClass:t}){return i.cn("pointer-events-none absolute z-0 motion-reduce:transition-none",e==="default"?"rounded-full":"rounded-mid",XB[e],t)}function QB({size:e,variant:t,isSelected:n,isDisabled:o,slotClass:r,className:s}){const l=i.CONTROL_SIZE_LAYOUT[e],u=t==="outline"||t==="secondary"||t==="gloss";return i.cn("relative z-[1] m-0 inline-flex shrink-0 appearance-none items-center justify-center border-0 bg-transparent outline-none",l.padX,l.padY,u&&"rounded-mid","focus-ring-inset",o?"cursor-not-allowed opacity-45":"cursor-pointer",n?"text-primary":"text-muted hover:text-primary",!n&&!o&&i.TEXT_COLOR_TRANSITION,r,s)}const JB="relative z-[1] shrink-0";function ej(e){return i.cn("inline-flex origin-center items-center gap-xsmall",e)}function tj(e){return i.CONTROL_SIZE_LAYOUT[e].controlText}function nj({slotClass:e,className:t}){return i.cn("min-w-0 outline-none focus-ring-inset",e,t)}function oj(e){const t=getComputedStyle(e);return{borderTop:Number.parseFloat(t.borderTopWidth)||0,borderLeft:Number.parseFloat(t.borderLeftWidth)||0}}function rj(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),{borderTop:r,borderLeft:s}=oj(e),l=n.left+s,u=n.top+r;return{left:o.left-l+e.scrollLeft,top:o.top-u+e.scrollTop,width:o.width,height:o.height}}function sj(e,t,n,o){const r=e.getBoundingClientRect(),s=t.getBoundingClientRect(),l=s.left-r.left+e.scrollLeft,u=s.top-r.top+e.scrollTop,d=s.width,f=s.height;return o==="default"?n==="horizontal"?{left:l,top:u+f-2,width:d,height:2}:{left:l,top:u,width:2,height:f}:rj(e,t)}function aj(e,t){e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}function lj(e){$.set(e,{x:0,y:0,scaleX:1,scaleY:1,transformOrigin:"0 0"})}function ij(e,t){const n=Number($.getProperty(e,"x"))||0,o=Number($.getProperty(e,"y"))||0,r=Number($.getProperty(e,"scaleX"))||1,s=Number($.getProperty(e,"scaleY"))||1;return{left:t.left+n,top:t.top+o,width:t.width*r,height:t.height*s}}function cj(e,t,n,o,r,s,l){const u=a.useRef(!0),d=a.useRef(null),f=i.usePrefersReducedMotion(),m=a.useCallback(()=>{var R;const p=e.current,C=t.current,S=(R=s.current)==null?void 0:R.get(n);if(!p||!C||!S){C&&(C.style.opacity="0");return}const g=sj(p,S,o,r),h=f||!i.isMotionFeatureEnabled("enableTabsIndicator");C.style.opacity="1";const x=d.current,A=x?ij(C,x):g;if(i.killMotion(C),aj(C,g),d.current=g,h||u.current){lj(C);return}const b=A.left-g.left,_=A.top-g.top,L=g.width>0?A.width/g.width:1,v=g.height>0?A.height/g.height:1;i.setWillChangeTransform(C,!0),$.fromTo(C,{x:b,y:_,scaleX:L,scaleY:v,transformOrigin:"0 0"},{x:0,y:0,scaleX:1,scaleY:1,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(C)})},[n,t,e,o,f,s,r]);a.useLayoutEffect(()=>{m(),u.current=!1},[m]),a.useLayoutEffect(()=>{var S;const p=e.current;if(!p||typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>m());C.observe(p);for(const g of((S=s.current)==null?void 0:S.values())??[])C.observe(g);return()=>C.disconnect()},[n,l,e,s,m])}function uj({motionRef:e,isDisabled:t,isSelected:n,onPointerEnter:o,onPointerLeave:r,onPointerDown:s}){return xt({isDisabled:!!t,enabled:!t&&!n,textMotionRef:e,hoverLift:!0,onPointerEnter:o,onPointerLeave:r,onPointerDown:s})}const MC=a.forwardRef(function({value:t,children:n,asChild:o,className:r,disabled:s,onClick:l,onPointerDown:u,onPointerEnter:d,onPointerLeave:f,...m},p){const{value:C,setValue:S,size:g,variant:h,baseId:x,disabled:A,tabElementsRef:b,notifyTabLayout:_}=gr(),L=Xl(),v=a.useRef(null),R=C===t,T=A||s,E=kC(x,t),I=BC(x,t),O=UB({isSelected:R,isDisabled:T,panelId:I}),N=a.useCallback(B=>{B?b.current.set(t,B):b.current.delete(t),_(),typeof p=="function"?p(B):p&&(p.current=B)},[_,p,b,t]);a.useLayoutEffect(()=>{const B=b.current;return()=>{B.delete(t),_()}},[_,b,t]);const y=a.useCallback(B=>{l==null||l(B),!(B.defaultPrevented||T)&&S(t)},[T,l,S,t]),{handlePointerEnter:w,handlePointerLeave:P,handlePointerDown:k}=uj({motionRef:v,isDisabled:T,isSelected:R,onPointerEnter:d,onPointerLeave:f,onPointerDown:u}),j=QB({size:g,variant:h,isSelected:R,isDisabled:T,slotClass:L.tab,className:r});if(o&&a.isValidElement(n)){const B=n;return a.cloneElement(B,{...m,role:"tab",id:E,"data-tab-value":t,"aria-selected":O["aria-selected"],"aria-controls":O["aria-controls"],tabIndex:O.tabIndex,disabled:T||B.props.disabled,ref:D=>{N(D),B.props.ref&&ue(B.props.ref,D)},className:i.cn(B.props.className,JB,r),onClick:D=>{var F,H;(H=(F=B.props).onClick)==null||H.call(F,D),y(D)},onPointerEnter:D=>{var F,H;(H=(F=B.props).onPointerEnter)==null||H.call(F,D),w(D)},onPointerLeave:D=>{var F,H;(H=(F=B.props).onPointerLeave)==null||H.call(F,D),P(D)},onPointerDown:D=>{var F,H;(H=(F=B.props).onPointerDown)==null||H.call(F,D),k(D)}})}return c.jsx("button",{ref:N,type:"button",role:"tab",id:E,"data-tab-value":t,"aria-selected":O["aria-selected"],"aria-controls":O["aria-controls"],tabIndex:O.tabIndex,disabled:O.disabled,className:j,onClick:y,onPointerEnter:w,onPointerLeave:P,onPointerDown:k,...m,children:c.jsx(q,{as:"span",inheritColor:!0,ref:v,variant:tj(g),className:ej(L.tabText),children:n})})});MC.displayName="TabsTab";const FC=a.forwardRef(function({value:t,children:n,className:o,...r},s){const{value:l,baseId:u}=gr(),d=Xl(),f=l===t,m=kC(u,t),p=BC(u,t),C=WB({isSelected:f,tabId:m});return c.jsx("div",{ref:s,role:"tabpanel",id:p,"aria-labelledby":C["aria-labelledby"],hidden:C.hidden,tabIndex:C.tabIndex,className:nj({slotClass:d.panel,className:o}),...r,children:n})});FC.displayName="TabsPanel";const HC=a.forwardRef(function({className:t,children:n,onKeyDown:o,...r},s){const{value:l,setValue:u,orientation:d,variant:f,disabled:m,tabElementsRef:p,layoutEpoch:C}=gr(),S=Xl(),g=a.useRef(null),h=a.useRef(null),x=f==="gloss",A=i.useMergedGlossPanelRef(s,x),b=a.useCallback(L=>{A(L),g.current=L},[A]);cj(g,h,l,d,f,p,C);const _=a.useCallback(L=>{if(o==null||o(L),L.defaultPrevented||m)return;const v=g.current;if(!v)return;const R=jC(v);if(R.length===0)return;const T=R.findIndex(y=>y===document.activeElement),E=d==="horizontal";let I=null;switch(L.key){case"ArrowRight":E&&(I=T<0?0:(T+1)%R.length);break;case"ArrowLeft":E&&(I=T<0?R.length-1:(T-1+R.length)%R.length);break;case"ArrowDown":E||(I=T<0?0:(T+1)%R.length);break;case"ArrowUp":E||(I=T<0?R.length-1:(T-1+R.length)%R.length);break;case"Home":I=0;break;case"End":I=R.length-1;break;default:return}if(I==null)return;L.preventDefault();const O=YB(v,I),N=O==null?void 0:O.dataset.tabValue;N&&u(N)},[m,o,d,u]);return c.jsxs("div",{ref:b,role:"tablist","aria-orientation":d,"aria-disabled":m||void 0,className:qB({orientation:d,variant:f,slotClass:S.list,className:t}),onKeyDown:_,...r,children:[c.jsx("span",{ref:h,"aria-hidden":!0,className:ZB({variant:f,slotClass:S.indicator}),style:{left:0,top:0,width:0,height:0,opacity:0}}),n]})});HC.displayName="TabsList";function dj({value:e,defaultValue:t,onValueChange:n,orientation:o="horizontal",size:r="base",variant:s="default",disabled:l=!1}){const u=a.useId(),[d,f]=Re({value:e,defaultValue:t??""}),m=a.useRef(null);m.current||(m.current=new Map);const[p,C]=a.useState(0),S=a.useCallback(x=>{f(x),n==null||n(x)},[n,f]),g=a.useCallback(()=>{C(x=>x+1)},[]);return{contextValue:a.useMemo(()=>({value:d,setValue:S,orientation:o,size:r,variant:s,baseId:u,disabled:l,tabElementsRef:m,layoutEpoch:p,notifyTabLayout:g}),[d,S,o,r,s,u,l,m,p,g])}}const GC=a.forwardRef(function({children:t,className:n,classNames:o,value:r,defaultValue:s,onValueChange:l,orientation:u="horizontal",size:d="base",variant:f="default",disabled:m=!1,...p},C){const{contextValue:S}=dj({value:r,defaultValue:s,onValueChange:l,orientation:u,size:d,variant:f,disabled:m});return c.jsx(DC.Provider,{value:S,children:c.jsx(zB,{classNames:o,children:c.jsx("div",{ref:C,className:KB({orientation:S.orientation,slotClass:o==null?void 0:o.root,className:n}),"data-orientation":S.orientation,...p,children:t})})})});GC.displayName="Tabs";const fj=Object.assign(GC,{List:HC,Tab:MC,Panel:FC}),Kl=a.createContext(null),Ss=a.createContext({});function mj({value:e,children:t}){return c.jsx(Kl.Provider,{value:e,children:t})}function pj({classNames:e,children:t}){const n=a.useContext(Ss),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ss.Provider,{value:o,children:t})}function Sr(){const e=a.useContext(Kl);if(!e)throw new Error("Meter.* components must be inside <Meter>.");return e}function Cj(){return a.useContext(Kl)}function on(){return a.useContext(Ss)}function gj({fillTargetStyle:e,isHorizontal:t}){const n=a.useRef(null),o=a.useRef(!0),r=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{const s=n.current;if(s){if(r||o.current){o.current=!1,i.killMotion(s),s.style.width=e.width!=null?String(e.width):"",s.style.height=e.height!=null?String(e.height):"";return}i.killMotion(s),$.to(s,{...t?{width:e.width}:{height:e.height},...i.motionInteractive(),overwrite:"auto"})}},[e.height,e.width,t,r]),a.useEffect(()=>{const s=n.current;return()=>{s&&i.killMotion(s)}},[]),{fillRef:n}}const Sj={small:"h-small",base:"h-base",mid:"h-mid",large:"h-large"},hj={small:"w-small",base:"w-base",mid:"w-mid",large:"w-large"},xj="relative overflow-hidden rounded-full bg-primary-tint",bj="w-full",Aj="h-48",vj="absolute rounded-full",_j="inset-y-0 left-0",Lj="inset-x-0 bottom-0",Tj="bg-primary",Ej="flex items-baseline justify-between gap-xsmall",Rj="w-full",Ij="min-w-[8rem]",yj="tabular-nums text-muted";function Nj({orientation:e,slotClass:t,className:n}){return i.cn(Hl(e),t,n)}function wj({orientation:e,slotClass:t,className:n}){return i.cn(Ej,e==="horizontal"?Rj:Ij,t,n)}function Oj({slotClass:e,className:t}){return i.cn(yj,e,t)}function Pj({isHorizontal:e,size:t,thickness:n,slotClass:o,className:r}){return i.cn(xj,e?bj:Aj,n==null&&(e?Sj[t]:hj[t]),o,r)}function Dj({isHorizontal:e,hasCustomColor:t,slotClass:n}){return i.cn(vj,e?_j:Lj,!t&&Tj,n)}function kj({isHorizontal:e,thickness:t}){if(t==null)return;const n=qn(t);return e?{height:n}:{width:n}}function Bj(e){if(e)return{background:e}}function jj({isHorizontal:e,percent:t}){return e?{width:`${t}%`,height:"100%"}:{width:"100%",height:`${t}%`}}function Mj({isHorizontal:e,percent:t,fillColorStyle:n}){return{width:e?`${t}%`:"100%",height:e?"100%":`${t}%`,...n}}function VC(e,t,n){return Math.min(n,Math.max(t,e))}function Fj(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function Hj(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Gj(e,t){return e===t?!0:e==null||t==null?!1:e.clampedValue===t.clampedValue&&e.statusText===t.statusText&&e.min===t.min&&e.max===t.max}function zC(e){return`${e}-label`}function Vj({clampedValue:e,min:t,max:n,statusText:o,labelConnected:r,labelId:s,ariaDescribedBy:l}){return{"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-valuetext":o,"aria-labelledby":r?s:void 0,"aria-describedby":l,"aria-label":r?void 0:o}}function zj({ariaDescribedByProp:e,hintConnected:t,hintId:n,errorConnected:o,errorId:r}){return e??je(t?n:void 0,o?r:void 0)}function Uj({value:e,min:t=0,max:n=100,size:o="base",thickness:r,color:s,formatValue:l=Hj,orientation:u,"aria-describedby":d}){const f=Cj(),m=u??(f==null?void 0:f.orientation)??"horizontal",p=f==null?void 0:f.meterId,C=p!=null?zC(p):void 0,S=(f==null?void 0:f.labelConnected)??!1,g=(f==null?void 0:f.hintConnected)??!1,h=(f==null?void 0:f.errorConnected)??!1,x=a.useMemo(()=>VC(e,t,n),[n,t,e]),A=a.useMemo(()=>Fj(x,t,n),[x,n,t]),b=m==="horizontal",_=a.useMemo(()=>l(x),[x,l]),L=zj({ariaDescribedByProp:d,hintConnected:g,hintId:f==null?void 0:f.hintId,errorConnected:h,errorId:f==null?void 0:f.errorId}),v=Vj({clampedValue:x,min:t,max:n,statusText:_,labelConnected:S,labelId:C,ariaDescribedBy:L}),R=a.useMemo(()=>kj({isHorizontal:b,thickness:r}),[b,r]),T=a.useMemo(()=>Bj(s),[s]),E=a.useMemo(()=>jj({isHorizontal:b,percent:A}),[b,A]),I=a.useMemo(()=>Mj({isHorizontal:b,percent:A,fillColorStyle:T}),[T,b,A]),O=f==null?void 0:f.setDisplay;return a.useLayoutEffect(()=>{O==null||O({clampedValue:x,statusText:_,min:t,max:n})},[x,n,t,O,_]),{size:o,thickness:r,color:s,isHorizontal:b,percent:A,aria:v,trackCrossStyle:R,fillColorStyle:T,fillTargetStyle:E,fillInitialStyle:I}}function Wj({label:e,showValue:t,valueText:n,hint:o,error:r,trackProps:s}){const l=on(),u=e!=null||t||n!=null;return c.jsxs(c.Fragment,{children:[u?c.jsxs(ql,{children:[e!=null?c.jsx(ve,{classNames:{root:l.label},children:e}):null,n!=null?c.jsx(jo,{children:n}):t?c.jsx(jo,{}):null]}):null,s.value!=null?c.jsx(Jl,{...s,value:s.value}):null,o!=null?c.jsx(Zl,{children:o}):null,r!=null?c.jsx(Ql,{children:r}):null]})}function UC({className:e,classNames:t,...n}){const o=on();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}UC.displayName="MeterLabel";function ql({children:e,className:t,...n}){const{orientation:o}=Sr(),r=on();return c.jsx("div",{className:wj({orientation:o,slotClass:r.header,className:t}),...n,children:e})}ql.displayName="Meter.Header";function jo({children:e,className:t,...n}){const{display:o}=Sr(),r=on(),s=e??(o==null?void 0:o.statusText);return s==null?null:c.jsx(q,{as:"span",variant:"base",className:Oj({slotClass:r.value,className:t}),...n,children:s})}jo.displayName="Meter.Value";function Zl({children:e,className:t,id:n,...o}){const r=Sr(),s=on();return c.jsx(le.Hint,{id:n??r.hintId,className:i.cn(s.hint,t),...o,children:e})}Zl.displayName="Meter.Hint";function Ql({children:e,className:t,id:n,...o}){const r=Sr(),s=on();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}Ql.displayName="Meter.Error";const Jl=a.forwardRef(function({value:t,min:n,max:o,size:r,thickness:s,color:l,formatValue:u,orientation:d,className:f,"aria-describedby":m,...p},C){const S=on(),{size:g,isHorizontal:h,aria:x,trackCrossStyle:A,fillTargetStyle:b,fillInitialStyle:_}=Uj({value:t,min:n,max:o,size:r,thickness:s,color:l,formatValue:u,orientation:d,"aria-describedby":m}),{fillRef:L}=gj({fillTargetStyle:b,isHorizontal:h});return c.jsx("div",{ref:C,role:"meter","aria-valuenow":x["aria-valuenow"],"aria-valuemin":x["aria-valuemin"],"aria-valuemax":x["aria-valuemax"],"aria-valuetext":x["aria-valuetext"],"aria-labelledby":x["aria-labelledby"],"aria-describedby":x["aria-describedby"],"aria-label":x["aria-label"],className:Pj({isHorizontal:h,size:g??"base",thickness:s,slotClass:S.track,className:f}),style:A,...p,children:c.jsx("span",{ref:L,"aria-hidden":!0,className:Dj({isHorizontal:h,hasCustomColor:!!l,slotClass:S.fill}),style:_})})});Jl.displayName="Meter.Track";function Yj({children:e,id:t,orientation:n="horizontal",label:o,showValue:r,valueText:s,hint:l,error:u,value:d,min:f,max:m,size:p,thickness:C,color:S,formatValue:g}){const h=a.useId(),x=t??`meter-${h}`,A=Ve(x),b=ze(x),_=zC(x),[L,v]=a.useState(null),R=a.useCallback(P=>{v(k=>Gj(k,P)?k:P)},[]),{isCompound:T,hasLabel:E,hasHint:I,hasError:O}=a.useMemo(()=>{const P=Ue(e);return{isCompound:P,hasLabel:o!=null||P&&ge(e,"Label"),hasHint:l!=null||P&&ge(e,"Meter.Hint"),hasError:u!=null||P&&ge(e,"Meter.Error")}},[e,u,l,o]),N=a.useMemo(()=>({meterId:x,hintId:A,errorId:b,hintConnected:I,errorConnected:O,labelConnected:E,orientation:n,display:L,setDisplay:R}),[L,b,O,I,E,A,x,n,R]),y=a.useMemo(()=>({labelId:_}),[_]);return{meterId:x,isCompound:T,fieldCtx:N,fieldLabelCtx:y,trackProps:{value:d,min:f,max:m,size:p,thickness:C,color:S,formatValue:g,orientation:n},label:o,showValue:r,valueText:s,hint:l,error:u}}function WC({children:e,className:t,classNames:n,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,min:p,max:C,size:S,thickness:g,color:h,formatValue:x,...A}){const b=Yj({children:e,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,min:p,max:C,size:S,thickness:g,color:h,formatValue:x}),_=b.isCompound?e:c.jsx(Wj,{label:b.label,showValue:b.showValue,valueText:b.valueText,hint:b.hint,error:b.error,trackProps:b.trackProps});return c.jsx(mj,{value:b.fieldCtx,children:c.jsx(pj,{classNames:n,children:c.jsx(Ge.Provider,{value:b.fieldLabelCtx,children:c.jsx(le,{id:b.meterId,className:Nj({orientation:b.fieldCtx.orientation,slotClass:n==null?void 0:n.root,className:t}),...A,children:_})})})})}WC.displayName="Meter";const $j=Object.assign(WC,{Header:ql,Label:UC,Value:jo,Hint:Zl,Error:Ql,Track:Jl}),ei=a.createContext(null),hs=a.createContext({});function Xj({value:e,children:t}){return c.jsx(ei.Provider,{value:e,children:t})}function Kj({classNames:e,children:t}){const n=a.useContext(hs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(hs.Provider,{value:o,children:t})}function hr(){const e=a.useContext(ei);if(!e)throw new Error("ProgressBar.* components must be inside <ProgressBar>.");return e}function qj(){return a.useContext(ei)}function rn(){return a.useContext(hs)}function Zj(e){return Number.isNaN(e)?0:Math.min(1,Math.max(0,e))}function Qj({indeterminate:e,percent:t,isHorizontal:n}){const o=a.useRef(null),r=a.useRef(!0),s=i.usePrefersReducedMotion();return a.useLayoutEffect(()=>{if(e)return;const l=o.current;if(!l)return;const u=Zj(t/100),d=n?"left center":"bottom center",f=n?{scaleX:u,scaleY:1,x:0,y:0}:{scaleX:1,scaleY:u,x:0,y:0};l.style.width="100%",l.style.height="100%";const m=()=>{i.killMotion(l),$.set(l,{...f,transformOrigin:d})};if(s||!i.isMotionFeatureEnabled("enableProgressFill")||r.current){r.current=!1,m();return}r.current=!1,i.killMotion(l),i.setWillChangeTransform(l,!0),$.to(l,{...f,transformOrigin:d,...i.motionProgressFill(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(l)})},[e,n,t,s]),a.useLayoutEffect(()=>{if(!e)return;const l=o.current,u=l==null?void 0:l.parentElement;if(!l||!u)return;if(i.killMotion(l),s||!i.isMotionFeatureEnabled("enableProgressFill")){$.set(l,{clearProps:"transform"});return}const d=()=>{const m=n?u.offsetWidth:u.offsetHeight,p=n?l.offsetWidth:l.offsetHeight;m<=0||p<=0||(i.killMotion(l),i.setWillChangeTransform(l,!0),$.fromTo(l,n?{x:-p}:{y:p},{...n?{x:m}:{y:-m},...i.motionProgressIndeterminate(),repeat:-1,overwrite:"auto"}))};if(d(),typeof ResizeObserver>"u")return;const f=new ResizeObserver(()=>d());return f.observe(u),f.observe(l),()=>f.disconnect()},[e,n,s]),a.useEffect(()=>{const l=o.current;return()=>{l&&i.killMotion(l)}},[]),{fillRef:o,reduceMotion:s}}const Jj={small:"h-small",base:"h-base",mid:"h-mid",large:"h-large"},eM={small:"w-small",base:"w-base",mid:"w-mid",large:"w-large"},tM="relative overflow-hidden rounded-full bg-primary-tint",nM="w-full",oM="h-48",rM="absolute rounded-full",sM="inset-y-0 left-0",aM="inset-x-0 bottom-0",YC="bg-primary",lM="absolute rounded-full",iM="inset-y-0 left-0 w-1/4",cM="inset-x-0 bottom-0 h-1/4",uM="left-1/4 w-1/2",dM="bottom-1/4 h-1/2",fM="flex items-baseline justify-between gap-xsmall",mM="w-full",pM="min-w-[8rem]",CM="tabular-nums text-muted";function gM({orientation:e,slotClass:t,className:n}){return i.cn(Hl(e),t,n)}function SM({orientation:e,slotClass:t,className:n}){return i.cn(fM,e==="horizontal"?mM:pM,t,n)}function hM({slotClass:e,className:t}){return i.cn(CM,e,t)}function xM({isHorizontal:e,size:t,thickness:n,slotClass:o,className:r}){return i.cn(tM,e?nM:oM,n==null&&(e?Jj[t]:eM[t]),o,r)}function bM({isHorizontal:e,hasCustomColor:t,slotClass:n}){return i.cn(rM,e?sM:aM,!t&&YC,n)}function AM({isHorizontal:e,hasCustomColor:t,reduceMotion:n,slotClass:o}){return i.cn(lM,e?iM:cM,!t&&YC,n&&(e?uM:dM),o)}function vM({isHorizontal:e,thickness:t}){if(t==null)return;const n=qn(t);return e?{height:n}:{width:n}}function _M(e){if(e)return{background:e}}function LM({isHorizontal:e,fillColorStyle:t}){return{width:"100%",height:"100%",transformOrigin:e?"left center":"bottom center",...t}}function TM(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function EM(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function RM(e,t){return e===t?!0:e==null||t==null?!1:e.clampedValue===t.clampedValue&&e.statusText===t.statusText&&e.min===t.min&&e.max===t.max&&e.indeterminate===t.indeterminate}const IM="Loading…";function $C(e){return`${e}-label`}function yM({clampedValue:e,min:t,max:n,statusText:o,indeterminate:r,labelId:s,ariaDescribedBy:l}){return{"aria-valuenow":r?void 0:e,"aria-valuemin":r?void 0:t,"aria-valuemax":r?void 0:n,"aria-valuetext":o,"aria-busy":r||void 0,"aria-labelledby":s,"aria-describedby":l,"aria-label":s==null?o:void 0}}function NM({ariaDescribedByProp:e,hintConnected:t,hintId:n,errorConnected:o,errorId:r}){return e??je(t?n:void 0,o?r:void 0)}function wM({value:e=0,indeterminate:t=!1,min:n=0,max:o=100,size:r="base",thickness:s,color:l,formatValue:u=EM,orientation:d,"aria-describedby":f}){const m=qj(),p=d??(m==null?void 0:m.orientation)??"horizontal",C=m==null?void 0:m.progressId,S=C!=null?$C(C):void 0,g=(m==null?void 0:m.hintConnected)??!1,h=(m==null?void 0:m.errorConnected)??!1,x=a.useMemo(()=>VC(e,n,o),[o,n,e]),A=a.useMemo(()=>TM(x,n,o),[x,o,n]),b=p==="horizontal",_=a.useMemo(()=>t?IM:u(x),[x,u,t]),L=NM({ariaDescribedByProp:f,hintConnected:g,hintId:m==null?void 0:m.hintId,errorConnected:h,errorId:m==null?void 0:m.errorId}),v=yM({clampedValue:x,min:n,max:o,statusText:_,indeterminate:t,labelId:S,ariaDescribedBy:L}),R=a.useMemo(()=>vM({isHorizontal:b,thickness:s}),[b,s]),T=a.useMemo(()=>_M(l),[l]),E=m==null?void 0:m.setDisplay;return a.useLayoutEffect(()=>{E==null||E({clampedValue:x,statusText:_,min:n,max:o,indeterminate:t})},[x,t,o,n,E,_]),{size:r,thickness:s,color:l,indeterminate:t,isHorizontal:b,percent:A,aria:v,trackCrossStyle:R,fillColorStyle:T}}function OM({label:e,showValue:t,valueText:n,hint:o,error:r,trackProps:s}){const l=rn(),u=e!=null||t||n!=null;return c.jsxs(c.Fragment,{children:[u?c.jsxs(ti,{children:[e!=null?c.jsx(ve,{classNames:{root:l.label},children:e}):null,n!=null?c.jsx(Mo,{children:n}):t?c.jsx(Mo,{}):null]}):null,c.jsx(ri,{...s}),o!=null?c.jsx(ni,{children:o}):null,r!=null?c.jsx(oi,{children:r}):null]})}function XC({className:e,classNames:t,...n}){const o=rn();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}XC.displayName="ProgressBarLabel";function ti({children:e,className:t,...n}){const{orientation:o}=hr(),r=rn();return c.jsx("div",{className:SM({orientation:o,slotClass:r.header,className:t}),...n,children:e})}ti.displayName="ProgressBar.Header";function Mo({children:e,className:t,...n}){const{display:o}=hr(),r=rn(),s=e??(o==null?void 0:o.statusText);return s==null?null:c.jsx(q,{as:"span",variant:"base",className:hM({slotClass:r.value,className:t}),...n,children:s})}Mo.displayName="ProgressBar.Value";function ni({children:e,className:t,id:n,...o}){const r=hr(),s=rn();return c.jsx(le.Hint,{id:n??r.hintId,className:i.cn(s.hint,t),...o,children:e})}ni.displayName="ProgressBar.Hint";function oi({children:e,className:t,id:n,...o}){const r=hr(),s=rn();return c.jsx(le.Error,{id:n??r.errorId,className:i.cn(s.error,t),...o,children:e})}oi.displayName="ProgressBar.Error";const ri=a.forwardRef(function({value:t,indeterminate:n,min:o,max:r,size:s,thickness:l,color:u,formatValue:d,orientation:f,className:m,"aria-describedby":p,...C},S){const g=rn(),{size:h,indeterminate:x,isHorizontal:A,aria:b,trackCrossStyle:_,fillColorStyle:L,percent:v}=wM({value:t,indeterminate:n,min:o,max:r,size:s,thickness:l,color:u,formatValue:d,orientation:f,"aria-describedby":p}),{fillRef:R,reduceMotion:T}=Qj({indeterminate:x,percent:v,isHorizontal:A});return c.jsx("div",{ref:S,role:"progressbar","aria-valuenow":b["aria-valuenow"],"aria-valuemin":b["aria-valuemin"],"aria-valuemax":b["aria-valuemax"],"aria-valuetext":b["aria-valuetext"],"aria-busy":b["aria-busy"],"aria-labelledby":b["aria-labelledby"],"aria-describedby":b["aria-describedby"],"aria-label":b["aria-label"],className:xM({isHorizontal:A,size:h??"base",thickness:l,slotClass:g.track,className:m}),style:_,...C,children:x?c.jsx("span",{ref:R,"aria-hidden":!0,className:AM({isHorizontal:A,hasCustomColor:!!u,reduceMotion:T,slotClass:g.indeterminateFill}),style:L}):c.jsx("span",{ref:R,"aria-hidden":!0,className:bM({isHorizontal:A,hasCustomColor:!!u,slotClass:g.fill}),style:LM({isHorizontal:A,fillColorStyle:L})})})});ri.displayName="ProgressBar.Track";function PM({children:e,id:t,orientation:n="horizontal",label:o,showValue:r,valueText:s,hint:l,error:u,value:d,indeterminate:f,min:m,max:p,size:C,thickness:S,color:g,formatValue:h}){const x=a.useId(),A=t??`progress-${x}`,b=Ve(A),_=ze(A),L=$C(A),[v,R]=a.useState(null),T=a.useCallback(P=>{R(k=>RM(k,P)?k:P)},[]),{isCompound:E,hasHint:I,hasError:O}=a.useMemo(()=>{const P=Ue(e);return{isCompound:P,hasHint:l!=null||P&&ge(e,"ProgressBar.Hint"),hasError:u!=null||P&&ge(e,"ProgressBar.Error")}},[e,u,l]),N=a.useMemo(()=>({progressId:A,hintId:b,errorId:_,hintConnected:I,errorConnected:O,orientation:n,display:v,setDisplay:T}),[v,_,O,I,b,n,A,T]),y=a.useMemo(()=>({labelId:L}),[L]);return{progressId:A,isCompound:E,fieldCtx:N,fieldLabelCtx:y,trackProps:{value:d,indeterminate:f,min:m,max:p,size:C,thickness:S,color:g,formatValue:h,orientation:n},label:o,showValue:r,valueText:s,hint:l,error:u}}function KC({children:e,className:t,classNames:n,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,indeterminate:p,min:C,max:S,size:g,thickness:h,color:x,formatValue:A,...b}){const _=PM({children:e,id:o,orientation:r,label:s,showValue:l,valueText:u,hint:d,error:f,value:m,indeterminate:p,min:C,max:S,size:g,thickness:h,color:x,formatValue:A}),L=_.isCompound?e:c.jsx(OM,{label:_.label,showValue:_.showValue,valueText:_.valueText,hint:_.hint,error:_.error,trackProps:_.trackProps});return c.jsx(Xj,{value:_.fieldCtx,children:c.jsx(Kj,{classNames:n,children:c.jsx(Ge.Provider,{value:_.fieldLabelCtx,children:c.jsx(le,{id:_.progressId,className:gM({orientation:_.fieldCtx.orientation,slotClass:n==null?void 0:n.root,className:t}),...b,children:L})})})})}KC.displayName="ProgressBar";const DM=Object.assign(KC,{Header:ti,Label:XC,Value:Mo,Hint:ni,Error:oi,Track:ri});function kM({pressable:e,isGloss:t,onPress:n,onClick:o,onKeyDown:r,onPointerDown:s,onPointerOver:l,onPointerOut:u,forwardedRef:d}){const f=a.useRef(null),m=a.useRef(!1),p=e&&t,C=a.useMemo(()=>i.createGlossInteractiveRefCallback(f,t),[t]),S=a.useCallback(v=>{C(v),f.current=v,ue(d,v)},[C,d]),g=i.useGlossInteractiveHandlers(f,p,{pointerInsideRef:m}),h=i.useSecondLevelShadowContainer(f,e&&!t,{pointerInsideRef:m});a.useEffect(()=>{if(e)return;const v=f.current;v&&i.killMotion(v),m.current=!1},[e]);const x=a.useCallback(v=>{if(s==null||s(v),!e||v.defaultPrevented||i.prefersReducedMotion())return;const R=f.current;if(R){if(t){i.animateGlossInteractivePressSqueeze(R,m.current);return}i.animateInteractivePressSqueeze(R,{pointerInside:m.current,shadow:h.shadow})}},[t,s,e,h.shadow]),A=a.useCallback(v=>{o==null||o(v),!(!e||v.defaultPrevented)&&(n==null||n(v))},[o,n,e]),b=a.useCallback(v=>{r==null||r(v)},[r]),_=a.useCallback(v=>{l==null||l(v),!(!e||v.defaultPrevented)&&(t?g.onPointerOver(v):h.onPointerOver(v))},[g,t,l,e,h]),L=a.useCallback(v=>{u==null||u(v),e&&(t?g.onPointerOut(v):h.onPointerOut(v))},[g,t,u,e,h]);return{setRootRef:S,pressableLiftMotionClass:h.motionClass,handlePointerDown:x,handleClick:A,handleKeyDown:b,onPointerOver:_,onPointerOut:L,onPointerDownProp:s,onClickProp:o,onKeyDownProp:r}}function BM(){return"h3"}const jM={default:"bg-surface border-token",outline:"bg-transparent border-token",secondary:"bg-secondary border-token"},MM="shadow-token-base",FM="gloss-panel flex min-w-0 flex-col text-foreground outline-none",HM="gloss-content flex min-w-0 flex-1 flex-col",GM="flex min-w-0 flex-col overflow-hidden text-foreground outline-none",VM="relative cursor-pointer focus-ring",mo="w-full border-0 p-0 text-left",zM="relative flex min-w-0 flex-1 flex-col",UM="flex shrink-0 flex-col text-left",WM="flex min-w-0 flex-1 flex-col text-left",YM="min-w-0",$M="min-w-0",XM="min-w-0 text-muted",KM="mt-auto border-t-token text-muted";function qM(e,t){return i.cn(FM,Ee(e).rounded,i.SURFACE_COLOR_TRANSITION,t)}function ZM(e){return e?i.cn(i.GLOSS_INTERACTIVE_MOTION_CLASS,"cursor-pointer focus-ring"):""}function QM(e,t,n,o,r){return i.cn(GM,Ee(o).rounded,t&&i.cn(VM,n),i.SURFACE_COLOR_TRANSITION,jM[e],!t&&MM,r)}function JM(e,t){const n=Ee(e);return i.cn(UM,n.headerPadding,n.headingGap,t)}function eF(e,t){return i.cn(WM,Ee(e).headingGap,t)}function tF(e,t){return i.cn(YM,Ee(e).bodyPadding,t)}function nF(e,t){return i.cn(KM,Ee(e).footerPadding,t)}const xs=a.createContext({classNames:{},size:"base"});function oF({classNames:e,size:t,children:n}){const o=a.useContext(xs),r=$c(t),s=a.useMemo(()=>({classNames:{...o.classNames,...e},size:r}),[e,o.classNames,r]);return c.jsx(xs.Provider,{value:s,children:n})}function qC(){return a.useContext(xs)}function sn(){return qC().classNames}function Ln(){return qC().size}function rF({className:e="",...t}){const n=sn(),o=Ln();return c.jsx("div",{className:JM(o,i.cn(n.header,e)),...t})}function sF({className:e="",...t}){const n=sn(),o=Ln();return c.jsx("div",{className:eF(o,i.cn(n.headingBlock,e)),...t})}function aF({className:e="",...t}){const n=sn(),o=Ln();return c.jsx("div",{className:tF(o,i.cn(n.body,e)),...t})}const ZC=a.forwardRef(function({className:t="",...n},o){const r=sn(),s=Ln();return c.jsx(q,{ref:o,as:BM(),variant:Ee(s).titleVariant,className:i.cn($M,Ee(s).titleClassName,r.title,t),...n})}),QC=a.forwardRef(function({className:t="",...n},o){const r=sn(),s=Ln();return c.jsx(q,{ref:o,as:"p",variant:Ee(s).descVariant,className:i.cn(XM,r.description,t),...n})});function lF({className:e="",...t}){const n=sn(),o=Ln();return c.jsx("div",{className:nF(o,i.cn(n.footer,e)),...t})}function iF({pressable:e,isGloss:t,renderAsButton:n,glossPanelClass:o,rootClassName:r,setRootRef:s,rest:l,children:u,onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C}){const S=sn();if(t){const g=c.jsx("div",{className:i.cn(HM,S.glossContent),children:u});return e?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,o,ZM(e)),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:g}):n?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,o),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:g}):c.jsx("div",{...l,ref:s,className:o,onPointerOver:d,onPointerOut:f,children:g})}return e?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,r),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:c.jsx("div",{className:i.cn(zM,S.content),children:u})}):n?c.jsx("button",{type:"button",...l,ref:s,className:i.cn(mo,r),onPointerOver:d,onPointerOut:f,onPointerDown:m,onClick:p,onKeyDown:C,children:u}):c.jsx("div",{...l,ref:s,className:r,onPointerOver:d,onPointerOut:f,children:u})}ZC.displayName="CardTitle";QC.displayName="CardDescription";function cF(e,t){return e||t}function uF(e){return!!(e.onClick||e.onKeyDown||e.onPointerDown)}function dF({variant:e="default",size:t,pressable:n=!1,onClick:o,onKeyDown:r,onPointerDown:s}){const l=$c(t),u=e==="gloss",d=n&&u,f=cF(n,uF({onClick:o,onKeyDown:r,onPointerDown:s}));return{variant:e,size:l,pressable:n,isGloss:u,glossPressable:d,renderAsButton:f}}const JC=a.forwardRef(function({className:t="",variant:n="default",size:o="base",pressable:r=!1,classNames:s,onPress:l,onPointerOver:u,onPointerOut:d,onPointerDown:f,onClick:m,onKeyDown:p,children:C,...S},g){const h=dF({variant:n,size:o,pressable:r,onClick:m,onKeyDown:p,onPointerDown:f}),x=kM({pressable:r,isGloss:h.isGloss,onPress:l,onClick:m,onKeyDown:p,onPointerDown:f,onPointerOver:u,onPointerOut:d,forwardedRef:g}),A=qM(h.size,i.cn(s==null?void 0:s.root,t)),b=h.isGloss?"":QM(h.variant,r,x.pressableLiftMotionClass,h.size,i.cn(s==null?void 0:s.root,t));return c.jsx(oF,{classNames:s,size:h.size,children:c.jsx(iF,{pressable:r,isGloss:h.isGloss,renderAsButton:h.renderAsButton,glossPanelClass:A,rootClassName:b,setRootRef:x.setRootRef,rest:S,onPointerOver:x.onPointerOver,onPointerOut:x.onPointerOut,onPointerDown:r?x.handlePointerDown:x.onPointerDownProp,onClick:r?x.handleClick:x.onClickProp,onKeyDown:r?x.handleKeyDown:x.onKeyDownProp,children:C})})});JC.displayName="Card";const fF=Object.assign(JC,{Header:rF,HeadingBlock:sF,Title:ZC,Description:QC,Body:aF,Footer:lF}),eg=a.createContext(null),tg=a.createContext("top"),bs=a.createContext(null),As=a.createContext({});function mF({classNames:e,children:t}){const n=a.useContext(As),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(As.Provider,{value:o,children:t})}function Dt(){return a.useContext(As)}function si(e){const t=a.useContext(eg);if(!t)throw new Error(`${e} must be used inside <Tooltip>.`);return t}function pF(){return a.useContext(tg)}function ai(e){const t=a.useContext(bs);if(!t)throw new Error(`${e} must be inside <Tooltip.Panel> or <Tooltip.Content>.`);return t}function CF(e,t,n){return n?e?e.split(/\s+/).includes(t)?e:`${e} ${t}`:t:e}function Rc(e,t){return{onPointerEnter:n=>{var o,r;(o=e.onPointerEnter)==null||o.call(e,n),(r=t==null?void 0:t.onPointerEnter)==null||r.call(t,n)},onPointerLeave:n=>{var o,r;(o=e.onPointerLeave)==null||o.call(e,n),(r=t==null?void 0:t.onPointerLeave)==null||r.call(t,n)},onFocus:n=>{var o,r;(o=e.onFocus)==null||o.call(e,n),(r=t==null?void 0:t.onFocus)==null||r.call(t,n)},onBlur:n=>{var o,r;(o=e.onBlur)==null||o.call(e,n),(r=t==null?void 0:t.onBlur)==null||r.call(t,n)}}}const gF=new Set(["TooltipIndicator","TooltipIcon","TooltipTitle","TooltipDescription","TooltipMessage"]);function xr(e,t){let n=!1;const o=r=>{if(!n)for(const s of a.Children.toArray(r)){if(!a.isValidElement(s))continue;const l=s.type.displayName;if(t(l)){n=!0;return}o(s.props.children)}};return o(e),n}function SF(e){return xr(e,t=>t!=null&&gF.has(t))}function hF(e){return xr(e,t=>t==="TooltipTitle")}function xF(e){return xr(e,t=>t==="TooltipDescription")}function bF(e){return xr(e,t=>t==="TooltipIndicator"||t==="TooltipIcon")}function ng(e,t){for(const n of a.Children.toArray(e)){if(!a.isValidElement(n))continue;const o=n.type.displayName;(o==="TooltipIndicator"||o==="TooltipIcon")&&t(n.props),ng(n.props.children,t)}}function AF(e,t,n,o){return n===!1||o===null?!1:o!==void 0||t!=null?!0:e!=="default"}function vF(e,t,n,o){if(!bF(e))return!1;let r=!1;return ng(e,s=>{AF(t,n,s.showIcon??o,s.children)&&(r=!0)}),r}function _F(e,t,n,o,r){return n===!1?!1:o?vF(r,e,t,n):t!=null?!0:e!=="default"}function LF({status:e,icon:t,showIcon:n,title:o,description:r,isCompound:s,children:l}){const u=o!=null||(s?hF(l):l!=null&&r==null),d=r!=null||s&&xF(l);return{hasIndicator:_F(e,t,n,s,l),hasTitle:u,hasDescription:d,hasAction:!1,hasClose:!1}}function Ic(e){return e.type.displayName==="TooltipArrow"}function TF({open:e,portalMounted:t,setPortalMounted:n,tipRef:o}){a.useLayoutEffect(()=>{if(!t)return;const r=o.current;if(!r)return;const s=Rt();let l=!1;if(s)return i.killMotion(r),e?ar(r):n(!1),()=>{l=!0};if(i.killMotion(r),e)return lr({surface:r,vars:{...i.motionTooltip(),overwrite:"auto"}}),()=>{l=!0,i.killMotion(r)};const u=ir({surface:r,vars:{...i.motionTooltip(),overwrite:"auto"},onComplete:()=>{l||n(!1)}});return()=>{l=!0,i.killMotion(r),u.kill()}},[e,t,n,o])}const EF=8,RF={default:"border-token bg-surface text-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground",gloss:""},og={small:"max-w-component-xsmall p-small",base:"max-w-component-small p-base",mid:"max-w-component-base p-mid",large:"max-w-component-mid p-large"},IF={small:"xsmall",base:"small",mid:"base",large:"mid"},yF={small:"xsmall",base:"xsmall",mid:"small",large:"base"},NF={small:"icon-small",base:"icon-base",mid:"icon-mid",large:"icon-large"},wF={small:"[&_svg]:icon-small",base:"[&_svg]:icon-base",mid:"[&_svg]:icon-mid",large:"[&_svg]:icon-large"},li={default:"text-primary",danger:i.SEMANTIC_STATUS_TEXT.danger,success:i.SEMANTIC_STATUS_TEXT.success,info:i.SEMANTIC_STATUS_TEXT.info,warning:i.SEMANTIC_STATUS_TEXT.warning},rg={small:"gap-x-xsmall gap-y-0",base:"gap-x-small gap-y-xsmall",mid:"gap-x-base gap-y-xsmall",large:"gap-x-mid gap-y-small"},OF="inline-flex shrink-0 outline-none focus-ring",PF="inline-flex shrink-0 [&_svg]:shrink-0",DF="font-w-mid",kF="text-muted",BF="pointer-events-none absolute z-0 size-2 rotate-45",jF="border-0 bg-[var(--color-surface)]",MF={default:"bg-surface",outline:"bg-transparent",secondary:"bg-secondary"},FF="pointer-events-none z-tooltip w-max min-w-0 overflow-visible text-left outline-none",HF="relative overflow-visible",GF="gloss-panel gloss-deep relative z-[1] w-max min-w-0 origin-center overflow-hidden rounded-mid text-left text-foreground",VF="gloss-content",zF="contents",UF="relative z-[1] w-max min-w-0 rounded-mid text-left animate-shadow";function WF(e){return i.cn(DF,e!=="default"?li[e]:"")}function YF(e,t,n){return i.cn(PF,li[e],t,n)}function $F({size:e,slotClass:t,className:n}){return i.cn(GF,i.GLOSS_INTERACTIVE_MOTION_CLASS,og[e],t,n)}function XF({gridSlots:e,size:t,slotClass:n}){return i.cn(gn(e,rg[t]),VF,n)}function KF({variant:e,size:t,gridSlots:n,slotClass:o,className:r}){return e==="gloss"?$F({size:t,slotClass:o,className:r}):i.cn(gn(n,rg[t]),UF,RF[e],og[t],o,r)}function qF({variant:e,resolvedSide:t,slotClass:n,className:o}){const r=e==="gloss";return i.cn(BF,r?jF:MF[e],lf[t],n,o)}function ZF({resolvedSide:e,showArrow:t,slotClass:n,className:o}){return i.cn(FF,t&&cf[e],n,o)}function QF({status:e,size:t,showIcon:n,icon:o,children:r,iconClass:s}){if(r===null)return null;if(r!==void 0)return r;if(n===!1)return null;if(o!=null)return o;if(e==="default")return null;const l=Zs[e];return c.jsx(l,{"aria-hidden":!0,className:i.cn("shrink-0",NF[t],li[e],s)})}function JF(e,t,n,o){return t!=null||n!=null?c.jsxs(c.Fragment,{children:[o.hasIndicator?c.jsx(un,{}):null,t!=null?c.jsx(Fo,{children:t}):null,n!=null?c.jsx(ii,{children:n}):null]}):e==null?null:typeof e=="string"||typeof e=="number"?c.jsxs(c.Fragment,{children:[o.hasIndicator?c.jsx(un,{}):null,c.jsx(Fo,{children:e})]}):a.isValidElement(e)?c.jsxs(c.Fragment,{children:[o.hasIndicator?c.jsx(un,{}):null,c.jsx("div",{className:Sn(o),children:e})]}):e}function un({className:e,children:t,showIcon:n,...o}){const r=Dt(),{status:s,size:l,icon:u,showIcon:d,gridSlots:f}=ai("Tooltip.Indicator"),m=QF({status:s,size:l,showIcon:n??d,icon:u,children:t,iconClass:r.icon});return m==null?null:c.jsx("span",{className:i.cn(YF(s,r.indicator,e),wF[l],Ft(f)),...o,children:m})}un.displayName="TooltipIndicator";function sg(e){return c.jsx(un,{...e})}sg.displayName="TooltipIcon";function ag({className:e,...t}){const n=Dt();return c.jsx("div",{className:i.cn(zF,n.message,e),...t})}ag.displayName="TooltipMessage";function Fo({className:e,...t}){const n=Dt(),{size:o,status:r,gridSlots:s}=ai("Tooltip.Title");return c.jsx(q,{as:"div",variant:IF[o],className:i.cn(WF(r),Sn(s),n.title,e),...t})}Fo.displayName="TooltipTitle";function ii({className:e,...t}){const n=Dt(),{size:o,gridSlots:r}=ai("Tooltip.Description");return c.jsx(q,{as:"div",variant:yF[o],className:i.cn(kF,kn(r),n.description,e),...t})}ii.displayName="TooltipDescription";function ci({variant:e="default",status:t="default",size:n="base",icon:o,showIcon:r,title:s,description:l,className:u,children:d,glossPanelRef:f,...m}){const p=Dt(),C=e==="gloss",S=d!=null&&SF(d),g=a.useMemo(()=>LF({status:t,icon:o,showIcon:r,title:s,description:l,isCompound:S,children:d}),[d,l,o,S,r,t,s]),h=a.useMemo(()=>({variant:e,status:t,size:n,icon:o,showIcon:r,gridSlots:g}),[g,o,r,n,t,e]),x=S?d:JF(d,s,l,g),A=KF({variant:e,size:n,gridSlots:g,slotClass:C?i.cn(p.panel,p.glossPanel):p.panel,className:u});return C?c.jsx(bs.Provider,{value:h,children:c.jsx("div",{ref:f,className:A,...m,children:c.jsx("div",{className:XF({gridSlots:g,size:n,slotClass:p.glossContent}),children:x})})}):c.jsx(bs.Provider,{value:h,children:c.jsx("div",{className:A,...m,children:x})})}ci.displayName="TooltipPanel";const lg=a.forwardRef(function({asChild:t=!0,className:n,children:o,onPointerEnter:r,onPointerLeave:s,onFocus:l,onBlur:u,...d},f){const m=Dt(),{scheduleShow:p,hide:C,tooltipId:S,open:g,triggerRef:h}=si("Tooltip.Trigger"),x=a.useMemo(()=>({onPointerEnter:()=>p(),onPointerLeave:()=>C(),onFocus:()=>p(),onBlur:()=>C()}),[C,p]),A=a.useCallback(_=>{h.current=_,typeof f=="function"?f(_):f&&(f.current=_)},[f,h]),b=a.Children.count(o)===1&&a.isValidElement(o)?o:null;if(t&&b){const _=b,L=_.props["aria-describedby"];return a.cloneElement(_,yt(_,{...d,...Rc(x,{onPointerEnter:r,onPointerLeave:s,onFocus:l,onBlur:u}),className:i.cn(m.root,m.trigger,n),"aria-describedby":CF(L,S,g)},A))}return c.jsx("span",{ref:A,className:i.cn(OF,m.root,m.trigger,n),"aria-describedby":g?S:void 0,tabIndex:d.tabIndex??0,...Rc(x,{onPointerEnter:r,onPointerLeave:s,onFocus:l,onBlur:u}),...d,children:o})});lg.displayName="TooltipTrigger";function ui({className:e,...t}){const n=Dt(),o=pF(),{variant:r}=si("Tooltip.Arrow");return c.jsx("span",{"aria-hidden":!0,className:qF({variant:r,resolvedSide:o,slotClass:n.arrow,className:e}),...t})}ui.displayName="TooltipArrow";const ig=a.forwardRef(function({className:t,children:n,showArrow:o=!1,offset:r=EF,portalContainer:s,...l},u){const d=Dt(),{open:f,tooltipId:m,variant:p,status:C,size:S,side:g,icon:h,showIcon:x,triggerRef:A,portalContainer:b}=si("Tooltip.Content"),_=a.useRef(null),L=a.useRef(null),v=p==="gloss",R=a.useMemo(()=>i.createGlossInteractiveRefCallback(L,v),[v]),[T,E]=a.useState(!1),[I,O]=a.useState(g);f&&!T&&E(!0);const N=a.useCallback(H=>{_.current=H,ue(u,H)},[u]),y=a.Children.toArray(n),w=y.find(H=>a.isValidElement(H)&&Ic(H)),P=y.filter(H=>!(a.isValidElement(H)&&Ic(H))),k=a.useCallback(()=>{const H=A.current,U=_.current;if(!H||!U)return;const G=af(H.getBoundingClientRect(),U.getBoundingClientRect(),g,r);O(G.resolvedSide),sf(U,G,s??b),U.style.transform=""},[r,b,s,g,A]);if(i.usePersistentElShadow(_,!v,i.shadowBase),a.useLayoutEffect(()=>{if(!f||!T)return;k();const H=window.requestAnimationFrame(()=>k()),U=()=>k();window.addEventListener("scroll",U,!0),window.addEventListener("resize",U);const G=_.current,K=gt(s??b),V=typeof ResizeObserver<"u"?new ResizeObserver(()=>k()):null;return G&&V&&V.observe(G),K&&K!==document.body&&V&&V.observe(K),()=>{window.cancelAnimationFrame(H),window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U),V==null||V.disconnect()}},[f,T,b,s,k,n,o,r]),TF({open:f,portalMounted:T,setPortalMounted:E,tipRef:_}),!T||typeof document>"u")return null;const j=gt(s??b);if(!j)return null;const B=An(A.current),D=c.jsx(ci,{variant:p,status:C,size:S,icon:h,showIcon:x,glossPanelRef:R,children:P.length===1?P[0]:P}),F=c.jsx(tg.Provider,{value:I,children:c.jsx("div",{ref:N,...B,role:"tooltip",id:m,"data-side":I,className:ZF({resolvedSide:I,showArrow:o,slotClass:d.content,className:t}),...l,children:c.jsxs("div",{className:HF,children:[o?w??c.jsx(ui,{}):null,D]})})});return Ut.createPortal(F,j)});ig.displayName="TooltipContent";function eH({size:e="base",variant:t="default",status:n="default",delayShowMs:o=240,side:r="top",icon:s,showIcon:l,portalContainer:u}){const[d,f]=a.useState(!1),m=a.useRef(null),p=a.useRef(null),C=a.useId(),S=a.useCallback(()=>{p.current!=null&&(clearTimeout(p.current),p.current=null)},[]),g=a.useCallback(()=>{S(),p.current=globalThis.setTimeout(()=>{p.current=null,f(!0)},o)},[S,o]),h=a.useCallback(()=>{S(),f(!1)},[S]);return a.useEffect(()=>()=>S(),[S]),a.useEffect(()=>{if(!d)return;const A=b=>{b.key==="Escape"&&h()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[h,d]),{contextValue:a.useMemo(()=>({open:d,tooltipId:C,variant:t,status:n,size:e,side:r,icon:s,showIcon:l,triggerRef:m,scheduleShow:g,hide:h,portalContainer:u}),[h,s,d,u,g,l,r,e,n,C,t])}}function cg({children:e,classNames:t,size:n="base",variant:o="default",status:r="default",delayShowMs:s=240,side:l="top",icon:u,showIcon:d,portalContainer:f}){const{contextValue:m}=eH({size:n,variant:o,status:r,delayShowMs:s,side:l,icon:u,showIcon:d,portalContainer:f});return c.jsx(mF,{classNames:t,children:c.jsx(eg.Provider,{value:m,children:e})})}cg.displayName="TooltipRoot";const bo=Object.assign(cg,{Trigger:lg,Content:ig,Arrow:ui,Panel:ci,Indicator:un,Icon:sg,Message:ag,Title:Fo,Description:ii}),ug=a.createContext(null),vs=a.createContext({});function dg(e){const t=a.useContext(ug);if(!t)throw new Error(`${e} must be used inside <Avatar>`);return t}function fg({classNames:e,children:t}){const n=a.useContext(vs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(vs.Provider,{value:o,children:t})}function Tn(){return a.useContext(vs)}function tH(e){const t=e==null?void 0:e.trim();if(!t)return"?";const n=[...t][0];return n?n.toLocaleUpperCase():"?"}function nH(e){return e??"default"}function oH(e){return e??"base"}function rH(e){return(e==null?void 0:e.trim())||void 0}function sH(e){return!!(e!=null&&e.trim())}function aH(e){return e??"group"}function lH(e,t){const n=e==null?void 0:e.trim();return n||(t==null?void 0:t.trim())||void 0}function iH(){return"group"}const cH=!0,yc=-10,Nc=1.08;function uH(e,t){const n=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const o=t.current;if(!o)return;const r=n||!i.isMotionFeatureEnabled("enableContentFade");if(i.killMotion(o),r){$.set(o,{autoAlpha:e?1:0});return}$.to(o,{autoAlpha:e?1:0,...i.motionContentFade(),overwrite:"auto"})},[t,n,e])}function dH(e){const t=i.usePrefersReducedMotion(),n=a.useCallback(()=>{const r=e.current;if(r){if(i.killMotion(r),t){r.style.transform="";return}i.setWillChangeTransform(r,!0),$.to(r,{y:0,scale:1,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(r)})}},[t,e]),o=a.useCallback(()=>{const r=e.current;if(r){if(i.killMotion(r),t){r.style.transform=`translateY(${yc}px) scale(${Nc})`;return}i.setWillChangeTransform(r,!0),$.to(r,{y:yc,scale:Nc,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(r)})}},[t,e]);return a.useEffect(()=>{const r=e.current;return()=>{r&&i.killMotion(r)}},[e]),{applyLift:o,applyRest:n}}const _s={small:{root:"avatar-size-small"},base:{root:"avatar-size-base"},mid:{root:"avatar-size-mid"},large:{root:"avatar-size-large"}},fH={small:{variant:"small",className:"font-w-strong uppercase"},base:{variant:"base",className:"font-w-strong uppercase"},mid:{variant:"mid",className:"font-w-strong uppercase"},large:{variant:"header-2",className:"font-w-strong uppercase"}};function mg(e,t,n){return i.cn("relative inline-flex shrink-0 select-none overflow-hidden text-left",t?i.cn("gloss-panel size-full rounded-full border-token",_s[e].root):i.cn("rounded-full bg-surface border-token",_s[e].root),!t&&n)}function mH(e,t){return i.cn("gloss-wrap inline-flex shrink-0 rounded-full",_s[e].root,t)}const pH="gloss-shadow rounded-full";function CH(e,t){return i.cn("absolute inset-0 z-[1] size-full object-cover",!e&&"pointer-events-none",t)}function gH(e,t){return i.cn("absolute inset-0 z-0 flex items-center justify-center bg-primary-tint text-primary",e?"opacity-100":"pointer-events-none opacity-0",t)}function SH(e){return i.cn("flex flex-row flex-nowrap items-center text-left",e)}function hH(e,t){return i.cn("relative inline-flex",e>0&&"-ml-mid",t)}const xH="center bottom",di=a.forwardRef(function({className:t="",onLoad:n,onError:o,...r},s){const{imageStatus:l,onImageLoad:u,onImageError:d}=dg("Avatar.Image"),f=Tn(),m=a.useRef(null),p=a.useCallback(h=>{m.current=h,typeof s=="function"?s(h):s&&(s.current=h)},[s]),C=a.useCallback(h=>{n==null||n(h),h.defaultPrevented||u()},[n,u]),S=a.useCallback(h=>{o==null||o(h),h.defaultPrevented||d()},[o,d]),g=l==="loaded";return uH(g,m),c.jsx("img",{ref:p,className:CH(g,i.cn(f.image,t)),alt:r.alt??"",onLoad:C,onError:S,...r})});di.displayName="AvatarImage";const fi=a.forwardRef(function({className:t="",children:n,...o},r){const{label:s,imageStatus:l,size:u}=dg("Avatar.Fallback"),d=Tn(),f=l!=="loaded",p=n!=null&&n!==!1&&n!==""?n:tH(s),C=fH[u];return c.jsx("span",{ref:r,className:gH(f,i.cn(d.fallback,t)),"aria-hidden":cH,...o,children:c.jsx(q,{as:"span",variant:C.variant,inheritColor:!0,className:C.className,children:p})})});fi.displayName="AvatarFallback";function bH({src:e,alt:t="",loading:n}){return c.jsxs(c.Fragment,{children:[e?c.jsx(di,{src:e,alt:t,loading:n}):null,c.jsx(fi,{})]})}const pg=a.forwardRef(function({className:t="",classNames:n,children:o,...r},s){const l=Tn(),u=a.Children.toArray(o).filter(a.isValidElement);return c.jsx(fg,{classNames:n,children:c.jsx("div",{ref:s,role:iH(),className:SH(i.cn(l.group,t)),...r,children:u.map((d,f)=>c.jsx(AH,{stackIndex:f,children:d},d.key??f))})})});pg.displayName="AvatarGroup";function AH({stackIndex:e,children:t}){const n=a.useRef(null),o=Tn(),{applyLift:r,applyRest:s}=dH(n);return c.jsx("div",{ref:n,style:{transformOrigin:xH},className:hH(e,o.groupItem),onPointerEnter:r,onPointerLeave:s,children:t})}const Cg=a.forwardRef(function({size:t,className:n,role:o,children:r,...s},l){const u=Tn();return c.jsx("div",{ref:l,role:o,className:mg(t,!1,i.cn(u.root,n)),...s,children:r})});Cg.displayName="AvatarDefaultShell";const gg=a.forwardRef(function({size:t,className:n,role:o,children:r,...s},l){const u=Tn(),{"aria-label":d,...f}=s;return c.jsxs("div",{ref:l,className:mH(t,u.glossWrap),...f,children:[c.jsx("div",{className:pH,"aria-hidden":!0}),c.jsx("div",{role:o,className:mg(t,!0,i.cn(u.root,n)),"aria-label":d,children:r})]})});gg.displayName="AvatarGlossShell";function vH({variant:e,size:t,label:n,nickname:o,tooltipSize:r="base",tooltipVariant:s="default",tooltipStatus:l="default",tooltipSide:u="top",children:d,role:f,"aria-label":m}){const p=nH(e),C=oH(t),[S,g]=a.useState("idle"),h=a.useCallback(()=>{g("loaded")},[]),x=a.useCallback(()=>{g("error")},[]),A=a.useMemo(()=>({size:C,label:n,imageStatus:S,onImageLoad:h,onImageError:x}),[C,n,S,h,x]),b=a.useMemo(()=>Ue(d),[d]),_=sH(n),L=rH(o),v=p==="gloss",R=aH(f),T=lH(m,n);return{variant:p,size:C,ctx:A,isCompound:b,hasLabel:_,isGloss:v,rootRole:R,ariaLabel:T,tooltip:L?{size:r,variant:s,status:l,side:u,content:L}:null}}const Sg=a.forwardRef(function({variant:t,size:n,label:o,src:r,alt:s="",loading:l,nickname:u,tooltipSize:d="base",tooltipVariant:f="default",tooltipStatus:m="default",tooltipSide:p="top",classNames:C,className:S="",children:g,role:h,"aria-label":x,...A},b){const{size:_,ctx:L,isCompound:v,isGloss:R,rootRole:T,ariaLabel:E,tooltip:I}=vH({variant:t,size:n,label:o,nickname:u,tooltipSize:d,tooltipVariant:f,tooltipStatus:m,tooltipSide:p,children:g,role:h,"aria-label":x}),N={size:_,className:S,role:T,"aria-label":E,children:v?g:c.jsx(bH,{src:r,alt:s,loading:l}),...A},y=R?c.jsx(gg,{ref:b,...N}):c.jsx(Cg,{ref:b,...N}),w=I?c.jsxs(bo,{size:I.size,variant:I.variant,side:I.side,children:[c.jsx(bo.Trigger,{children:y}),c.jsx(bo.Content,{children:I.content})]}):y;return c.jsx(ug.Provider,{value:L,children:c.jsx(fg,{classNames:C,children:w})})});Sg.displayName="AvatarRoot";const _H=Object.assign(Sg,{Image:di,Fallback:fi,Group:pg}),hg=a.createContext(!0),Ls=a.createContext({});function LH({collapse:e,children:t}){return c.jsx(hg.Provider,{value:e,children:t})}function xg(){return a.useContext(hg)}function bg({classNames:e,children:t}){const n=a.useContext(Ls),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ls.Provider,{value:o,children:t})}function En(){return a.useContext(Ls)}function TH(e,t=Se.breadcrumbs){return e??t}function EH(e,t=Se.breadcrumbsShowHidden){return pn(t,{count:e})}function RH(e=Se.breadcrumbsHiddenSections){return e}const IH="Breadcrumbs.Item",yH="Breadcrumbs.List";function Ag(e){if(a.isValidElement(e))return e.type.displayName}function vg(e){return a.isValidElement(e)?e.props.children:null}function _g(e,t){return a.Children.toArray(e).some(n=>a.isValidElement(n)?Ag(n)===t?!0:_g(vg(n),t):!1)}function Lg(e,t){a.Children.forEach(e,n=>{if(a.isValidElement(n)){if(Ag(n)===IH){const o=n.props;t.push({label:o.children,href:o.href,onClick:o.onClick,current:o.current,className:o.className});return}Lg(vg(n),t)}})}function NH(e){return _g(e,yH)}function wH(e){const t=[];return Lg(e,t),t}function OH(e){return e.length<=3?[]:e.slice(1,-2)}function PH(e){const t=e.length;return t===0?[]:t<=3?e.map((n,o)=>({kind:"segment",item:n,isLast:n.current??o===t-1})):[{kind:"segment",item:e[0],isLast:!1},{kind:"ellipsis",hiddenItems:OH(e)},{kind:"segment",item:e[t-2],isLast:!1},{kind:"segment",item:e[t-1],isLast:!0}]}function DH(e){return e.map((t,n)=>({kind:"segment",item:t,isLast:t.current??n===e.length-1}))}function kH(e,t){if(e.kind==="ellipsis")return"ellipsis";const n=e.item.label;return`segment-${t}-${typeof n=="string"?n:t}`}function Tg(){const e=a.useRef(null),{handlePointerDown:t}=xt({isDisabled:!1,enabled:!0,textMotionRef:e});return{textRef:e,handlePointerDown:t}}const Eg=i.cn("inline-flex max-w-[min(12rem,46vw)] min-w-0 cursor-pointer truncate rounded-mid px-xsmall py-xsmall text-muted no-underline outline-none focus-ring",i.TEXT_COLOR_TRANSITION,"hover:text-foreground"),BH=i.cn(Eg,"border-0 bg-transparent font-[inherit]"),jH=i.cn("inline-flex min-w-0 cursor-pointer rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted outline-none focus-ring",i.TEXT_COLOR_TRANSITION,"hover:text-foreground aria-expanded:text-foreground");function MH(e){return i.cn("m-0 flex list-none flex-wrap items-center gap-xsmall gap-y-xsmall p-0 text-left",e)}function FH(e){return i.cn(e)}function HH(e){return i.cn("flex items-center gap-xsmall",e)}function GH(e){return i.cn("min-w-0 max-w-[min(14rem,50vw)] truncate px-xsmall py-xsmall font-w-mid text-foreground",e)}function VH(e){return i.cn("max-w-[min(12rem,46vw)] truncate px-xsmall py-xsmall text-muted",e)}function Rg(e){return i.cn("shrink-0 text-muted opacity-75 icon-small",e)}function zH(e){return i.cn(Eg,e)}function UH(e){return i.cn(BH,e)}function WH(e){return i.cn("inline-flex min-w-0",e)}function wc(e){return i.cn("inline-flex origin-center min-w-0 truncate",e)}function YH(e){return i.cn(jH,e)}function $H(e){return i.cn("inline-flex origin-center",e)}function XH(e){return i.cn("tabular-nums",e)}function KH(e){return i.cn("text-small",e)}function qH(e){return i.cn("p-small",e)}function ZH(e){return i.cn("inline-flex",e)}function Ig(e){const t=xg();return a.useMemo(()=>t?PH(e):DH(e),[t,e])}function QH({children:e}={}){return{isCompound:NH(e)}}function JH(e){const t=xg(),n=a.useMemo(()=>wH(e),[e]),o=Ig(n);return{collapse:t,items:n,pieces:o}}function eG(e){return{pieces:Ig(e)}}function yg(e){return null}yg.displayName="Breadcrumbs.Item";const Ng=a.forwardRef(function({className:t,classNames:n,children:o,...r},s){const{pieces:l}=JH(o);return c.jsx(bg,{classNames:n,children:c.jsx(mi,{ref:s,pieces:l,className:t,...r})})});Ng.displayName="Breadcrumbs.List";const mi=a.forwardRef(function({pieces:t,className:n,...o},r){const s=En();return c.jsx("ol",{ref:r,className:MH(i.cn("",s.list,n)),...o,children:t.map((l,u)=>c.jsx(tG,{piece:l,showSeparator:u>0},kH(l,u)))})});mi.displayName="BreadcrumbsPiecesList";function tG({piece:e,showSeparator:t}){const n=En();return c.jsxs("li",{className:HH(n.item),children:[t?c.jsx(oG,{}):null,e.kind==="ellipsis"?c.jsx(rG,{hiddenItems:e.hiddenItems}):c.jsx(nG,{piece:e})]})}function wg({className:e,iconClassName:t,...n}){const o=En();return c.jsx("span",{className:ZH(i.cn("",o.separatorWrapper,e)),...n,children:c.jsx(be.IoChevronForward,{className:Rg(i.cn("",o.separator,t)),"aria-hidden":!0})})}wg.displayName="Breadcrumbs.Separator";function nG({piece:e}){const t=En(),{item:n,isLast:o}=e;return o?c.jsx(q,{as:"span",variant:"small","aria-current":"page",className:GH(i.cn("",t.itemCurrent,n.className)),children:n.label}):n.href||n.onClick?c.jsx(Og,{href:n.href,onClick:n.onClick,className:t.itemLinkWrapper,innerClassName:i.cn("",t.itemLink,n.className),textClassName:t.itemLinkText,children:n.label}):c.jsx(q,{as:"span",variant:"small",className:VH(i.cn("",t.itemStatic,n.className)),children:n.label})}function oG(){const e=En();return c.jsx(be.IoChevronForward,{className:Rg(e.separator),"aria-hidden":!0})}const Og=a.forwardRef(function({href:t,onClick:n,children:o,className:r="",innerClassName:s,textClassName:l,"aria-current":u},d){const{textRef:f,handlePointerDown:m}=Tg(),p=a.useCallback(S=>{f.current=S,ue(d,S)},[d,f]),C=t?zH(s):UH(s);return c.jsx("span",{className:WH(r),children:t?c.jsx("a",{href:t,onClick:n,"aria-current":u,className:C,onPointerDown:m,children:c.jsx(q,{ref:p,variant:"small",inheritColor:!0,as:"span",className:wc(l),children:o})}):c.jsx("button",{type:"button",onClick:n,"aria-current":u,className:C,onPointerDown:m,children:c.jsx(q,{ref:p,variant:"small",inheritColor:!0,as:"span",className:wc(l),children:o})})})});Og.displayName="BreadcrumbsInteractiveCrumb";function rG({hiddenItems:e}){const t=En(),n=Ie(),o=e.length,{textRef:r,handlePointerDown:s}=Tg();return o===0?null:c.jsxs(Gt,{children:[c.jsx(Gt.Trigger,{"aria-label":EH(o,n.breadcrumbsShowHidden),className:YH(t.ellipsisTrigger),onPointerDown:s,children:c.jsx("span",{ref:r,className:$H(t.ellipsisLiftWrapper),children:c.jsx(q,{as:"span",variant:"small",className:XH(t.ellipsisText),children:"…"})})}),c.jsx(Gt.Popover,{"aria-label":RH(n.breadcrumbsHiddenSections),bodyClassName:qH(t.ellipsisPopover),children:e.map(l=>{const u=l.href??`hidden-${String(l.label)}`;return c.jsx(sG,{item:l,className:KH(i.cn("",t.dropdownItem,l.className))},u)})})]})}function sG({item:e,className:t}){const n=e.href??`hidden-${String(e.label)}`;return e.href?c.jsx(Gt.Item,{href:e.href,selection:!1,onClick:e.onClick,className:t,children:e.label}):c.jsx(Gt.Item,{value:n,selection:!1,onClick:e.onClick,className:t,children:e.label})}function aG({items:e,className:t,...n}){const{pieces:o}=eG(e);return c.jsx(mi,{pieces:o,className:t,...n})}const Pg=a.forwardRef(function({collapse:t=!0,className:n,classNames:o,items:r,children:s,"aria-label":l,...u},d){const{isCompound:f}=QH({children:s}),m=St("breadcrumbs");return c.jsx(LH,{collapse:t,children:c.jsx(bg,{classNames:o,children:c.jsx("nav",{ref:d,"aria-label":TH(l,m),className:FH(i.cn("",o==null?void 0:o.root,n)),...u,children:f?s:r!=null?c.jsx(aG,{items:r}):s})})})});Pg.displayName="Breadcrumbs";const lG=Object.assign(Pg,{List:Ng,Item:yg,Separator:wg}),pi=a.createContext(null),Ts=a.createContext({});function iG({value:e,children:t}){return c.jsx(pi.Provider,{value:e,children:t})}function cG({classNames:e,children:t}){const n=a.useContext(Ts),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ts.Provider,{value:o,children:t})}function uG(){const e=a.useContext(pi);if(!e)throw new Error("Pagination components must be inside <Pagination>.");return e}function br(){return a.useContext(pi)}function at(){return a.useContext(Ts)}const dG=!0,Dg=!0;function fG(e,t=Se.pagination){return e??t}function mG({ariaLabel:e,children:t,pageNumber:n,pageTemplate:o=Se.paginationPage}){if(e!=null)return e;if(t!=null)return pn(o,{n})}function pG(e,t,n){if(t<=0)return[];if(t===1)return[1];if(t<=7)return Array.from({length:t},(l,u)=>u+1);const o=Math.max(e-n,2),r=Math.min(e+n,t-1),s=[1];if(o>2)s.push("ellipsis");else for(let l=2;l<o;l++)s.push(l);for(let l=o;l<=r;l++)s.push(l);if(r<t-1)s.push("ellipsis");else for(let l=r+1;l<t;l++)s.push(l);return s.push(t),s}function CG({disabled:e,page:t}){return e??(t!=null?t<=1:!1)}function gG({disabled:e,page:t,totalPages:n}){return e??(t!=null&&n!=null?t>=n:!1)}function SG(e,{page:t,totalPages:n,siblingCount:o,children:r}){const s=a.useRef(null);s.current||(s.current=new Map);const l=a.useRef(!0),u=i.usePrefersReducedMotion();a.useLayoutEffect(()=>{const d=e.current;if(!d)return;const f=Array.from(d.children).filter(h=>h instanceof HTMLElement);let m=0;const p=h=>h.dataset.flipKey??`__keyless_${m++}`,C=u||!i.isMotionFeatureEnabled("enablePaginationFlip"),S=new Map,g=s.current;for(const h of f){const x=p(h),A=h.getBoundingClientRect(),b={x:A.left,y:A.top};if(S.set(x,b),C||l.current)continue;const _=g.get(x);if(_){const L=_.x-b.x;Math.abs(L)>.5&&(i.killMotion(h),i.setWillChangeTransform(h,!0),$.fromTo(h,{x:L},{x:0,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(h)}))}else i.killMotion(h),i.setWillChangeTransform(h,!0),$.fromTo(h,{autoAlpha:0,scale:.82},{autoAlpha:1,scale:1,...i.motionInteractive(),overwrite:"auto",onComplete:i.clearWillChangeOnComplete(h)})}s.current=S,l.current=!1},[e,u,t,n,o,r]),a.useLayoutEffect(()=>{const d=e.current;return()=>{if(d)for(const f of Array.from(d.children))f instanceof HTMLElement&&i.killMotion(f)}},[e])}function hG(e,t){const n=a.useRef(null),o=a.useCallback(r=>{n.current=r,ue(e,r)},[e]);return SG(n,t),{olRef:n,setRefs:o}}const xG="flex w-full min-w-0 flex-wrap items-center justify-between gap-xsmall gap-y-xsmall text-left",bG="flex min-w-0 flex-1 basis-component-xsmall",AG="min-w-0 truncate text-muted",vG="m-0 ms-auto flex max-w-full min-w-0 list-none flex-nowrap items-center justify-start gap-xsmall overflow-x-auto overscroll-x-contain p-0",_G="flex shrink-0 items-center",LG="inline-flex min-w-0 origin-center cursor-pointer items-center justify-center gap-xsmall rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted no-underline outline-none hover:text-foreground focus-ring disabled:cursor-not-allowed disabled:opacity-48 disabled:hover:text-muted disabled:hover:bg-transparent motion-reduce:animate-none",TG="inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall font-w-mid text-foreground tabular-nums text-base",EG="min-w-[length:var(--size-scale-2xlarge)] tabular-nums",RG="inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall text-muted tabular-nums",IG="",yG="shrink-0 icon-small opacity-75",NG="shrink-0 icon-small opacity-75";function wG({slotClass:e,className:t}){return i.cn(xG,e,t)}function OG({slotClass:e,className:t}){return i.cn(bG,e,t)}function PG({slotClass:e,className:t}){return i.cn(AG,e,t)}function DG({slotClass:e,className:t}){return i.cn(vG,e,t)}function kG({slotClass:e,className:t}){return i.cn(_G,e,t)}function BG({slotClass:e,className:t}){return i.cn(LG,i.hoverVariant(),e,t)}function jG({slotClass:e,className:t}){return i.cn(TG,e,t)}function MG({slotClass:e,className:t}){return i.cn(EG,e,t)}function FG({slotClass:e,className:t}){return i.cn(RG,e,t)}function kg({slotClass:e,className:t}){return i.cn(IG,e,t)}function HG({slotClass:e,className:t}){return i.cn(yG,e,t)}function GG({slotClass:e,className:t}){return i.cn(NG,e,t)}const Bg=a.forwardRef(function({children:t,className:n,page:o,totalPages:r,onPageChange:s,siblingCount:l,"aria-label":u,...d},f){const m=at();return c.jsx("nav",{ref:f,"aria-label":u,className:wG({slotClass:m.root,className:n}),...d,children:t})});Bg.displayName="Pagination";const Ar=a.forwardRef(function({children:t,className:n,disabled:o,onPointerDown:r,...s},l){const u=a.useRef(null),d=a.useCallback(m=>{u.current=m,ue(l,m)},[l]),{handlePointerDown:f}=xt({isDisabled:!!o,enabled:!o,textMotionRef:u,onPointerDown:r});return c.jsx("button",{ref:d,type:"button",disabled:o,className:BG({className:n}),onPointerDown:f,...s,children:t})});Ar.displayName="PaginationInteractive";const jg=a.forwardRef(function({className:t,children:n,...o},r){const s=at();return c.jsx("div",{ref:r,className:OG({slotClass:s.summary,className:t}),...o,children:c.jsx(q,{as:"span",variant:"small",className:PG({slotClass:s.summaryText}),children:n})})});jg.displayName="Pagination.Summary";const Mg=a.forwardRef(function({className:t,children:n,...o},r){const s=at(),l=br(),{setRefs:u}=hG(r,{page:l==null?void 0:l.page,totalPages:l==null?void 0:l.totalPages,siblingCount:l==null?void 0:l.siblingCount,children:n});return c.jsx("ol",{ref:u,className:DG({slotClass:s.content,className:t}),...o,children:n})});Mg.displayName="Pagination.Content";const Ho=a.forwardRef(function({className:t,children:n,...o},r){const s=at();return c.jsx("li",{ref:r,className:kG({slotClass:s.item,className:t}),...o,children:n})});Ho.displayName="Pagination.Item";const Fg=a.forwardRef(function({disabled:t,onClick:n,children:o,className:r,"aria-label":s,...l},u){const d=Ie(),f=br(),m=at(),p=f==null?void 0:f.page,C=CG({disabled:t,page:p}),S=a.useCallback(g=>{n==null||n(g),!(g.defaultPrevented||C)&&f!=null&&f.onPageChange&&p!=null&&p>1&&f.onPageChange(p-1)},[f,n,p,C]);return c.jsx(Ar,{ref:u,disabled:C,className:i.cn(m.previous,r),...s!=null?{"aria-label":s}:{},onClick:S,...l,children:o??c.jsxs(c.Fragment,{children:[c.jsx(Ci,{}),c.jsx(q,{variant:"small",inheritColor:!0,as:"span",className:kg({slotClass:m.previousText}),children:d.paginationPrevious})]})})});Fg.displayName="Pagination.Previous";const Hg=a.forwardRef(function({disabled:t,onClick:n,children:o,className:r,"aria-label":s,...l},u){const d=Ie(),f=br(),m=at(),p=f==null?void 0:f.page,C=f==null?void 0:f.totalPages,S=gG({disabled:t,page:p,totalPages:C}),g=a.useCallback(h=>{n==null||n(h),!(h.defaultPrevented||S)&&f!=null&&f.onPageChange&&p!=null&&C!=null&&p<C&&f.onPageChange(p+1)},[f,n,p,S,C]);return c.jsx(Ar,{ref:u,disabled:S,className:i.cn(m.next,r),...s!=null?{"aria-label":s}:{},onClick:g,...l,children:o??c.jsxs(c.Fragment,{children:[c.jsx(q,{variant:"small",inheritColor:!0,as:"span",className:kg({slotClass:m.nextText}),children:d.paginationNext}),c.jsx(gi,{})]})})});Hg.displayName="Pagination.Next";const VG=be.IoChevronBack,zG=be.IoChevronForward,Ci=a.forwardRef(function({className:t,...n},o){const r=at();return c.jsx(VG,{ref:o,"aria-hidden":Dg,className:HG({slotClass:r.previousIcon,className:t}),...n})});Ci.displayName="Pagination.PreviousIcon";const gi=a.forwardRef(function({className:t,...n},o){const r=at();return c.jsx(zG,{ref:o,"aria-hidden":Dg,className:GG({slotClass:r.nextIcon,className:t}),...n})});gi.displayName="Pagination.NextIcon";const Si=a.forwardRef(function({page:t,active:n,children:o,onClick:r,className:s,"aria-label":l,...u},d){const f=Ie(),m=br(),p=at(),C=n??((m==null?void 0:m.page)!=null?m.page===t:!1),S=a.useCallback(x=>{var A;r==null||r(x),!(x.defaultPrevented||C)&&((A=m==null?void 0:m.onPageChange)==null||A.call(m,t))},[C,m,r,t]),g=o??t;if(C)return c.jsx(q,{ref:d,as:"span",variant:"small","aria-current":"page",className:jG({slotClass:p.pageActive,className:s}),onClick:r,...l!=null?{"aria-label":l}:{},...u,children:g});const h=mG({ariaLabel:l,children:o,pageNumber:t,pageTemplate:f.paginationPage});return c.jsx(Ar,{ref:d,...h!=null?{"aria-label":h}:{},onClick:S,className:i.cn(p.page,s),...u,children:c.jsx(q,{variant:"small",inheritColor:!0,as:"span",className:MG({slotClass:p.pageText}),children:g})})});Si.displayName="Pagination.Page";const hi=a.forwardRef(function({className:t,children:n,...o},r){const s=at();return c.jsx(q,{ref:r,as:"span",variant:"small","aria-hidden":dG,className:FG({slotClass:s.ellipsis,className:t}),...o,children:n??"…"})});hi.displayName="Pagination.Ellipsis";function Gg(){const{page:e,totalPages:t,siblingCount:n}=uG();if(e==null||t==null)throw new Error("Pagination.Pages requires `page` and `totalPages` on the root <Pagination>.");const o=a.useMemo(()=>pG(e,t,n),[e,n,t]);let r=0;return c.jsx(c.Fragment,{children:o.map(s=>{if(s==="ellipsis"){const l=r===0?"left":"right";r+=1;const u=`ellipsis-${l}`;return c.jsx(Ho,{"data-flip-key":u,children:c.jsx(hi,{})},u)}return c.jsx(Ho,{"data-flip-key":`page-${s}`,children:c.jsx(Si,{page:s})},s)})})}Gg.displayName="Pagination.Pages";function UG({page:e,defaultPage:t,totalPages:n,onPageChange:o,siblingCount:r=1,"aria-label":s}){const l=St("pagination"),[u,d]=Re({value:e,defaultValue:t,onChange:o?p=>{p!==void 0&&o(p)}:void 0}),f=a.useCallback(p=>{d(p)},[d]);return{contextValue:a.useMemo(()=>({page:u,totalPages:n,onPageChange:f,siblingCount:r}),[u,f,r,n]),ariaLabel:fG(s,l)}}const Vg=a.forwardRef(function({children:t,className:n,classNames:o,page:r,defaultPage:s,totalPages:l,onPageChange:u,siblingCount:d,"aria-label":f,...m},p){const{contextValue:C,ariaLabel:S}=UG({page:r,defaultPage:s,totalPages:l,onPageChange:u,siblingCount:d,"aria-label":f});return c.jsx(iG,{value:C,children:c.jsx(cG,{classNames:o,children:c.jsx(Bg,{ref:p,className:n,page:r,totalPages:l,onPageChange:u,siblingCount:d,"aria-label":S,...m,children:t})})})});Vg.displayName="Pagination";const WG=Object.assign(Vg,{Summary:jg,Content:Mg,Item:Ho,Previous:Fg,Next:Hg,PreviousIcon:Ci,NextIcon:gi,Page:Si,Pages:Gg,Ellipsis:hi}),YG={default:"bg-surface",secondary:"bg-secondary",tertiary:"bg-tertiary"},$G={none:"",base:"shadow-token-base",mid:"shadow-token-mid",large:"shadow-token-large"},XG={none:"",small:"p-small",base:"p-base",mid:"p-mid",large:"p-large"},KG={base:"rounded-base",mid:"rounded-mid",large:"rounded-large"},qG="min-w-0 text-left text-foreground",ZG="gloss-panel min-w-0 text-left text-foreground",QG="gloss-content";function JG({variant:e,shadow:t,padding:n,radius:o,className:r}){const s=e==="gloss";return i.cn(s?ZG:qG,!s&&YG[e],KG[o],$G[t],XG[n],r)}const zg=a.forwardRef(function({className:t="",classNames:n,variant:o="default",shadow:r="none",padding:s="none",radius:l="mid",children:u,...d},f){const m=i.useMergedGlossPanelRef(f,o==="gloss"),p=JG({variant:o,shadow:r,padding:s,radius:l,className:i.cn(n==null?void 0:n.root,t)}),C=void 0;return o==="gloss"?c.jsx("div",{ref:m,role:C,className:p,...d,children:c.jsx("div",{className:i.cn(QG,n==null?void 0:n.glossContent),children:u})}):c.jsx("div",{ref:f,role:C,className:p,...d,children:u})});zg.displayName="Surface";const Ug=a.createContext(null),Wg=a.createContext(!1),Es=a.createContext({});function e1(){return a.useContext(Ug)}function t1({value:e,children:t}){return c.jsx(Ug.Provider,{value:e,children:t})}function n1(){return a.useContext(Wg)}function o1({children:e}){return c.jsx(Wg.Provider,{value:!0,children:e})}function Yg({classNames:e,children:t}){const n=a.useContext(Es),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Es.Provider,{value:o,children:t})}function vr(){return a.useContext(Es)}function r1({variant:e,hoverLift:t=!0,forwardedRef:n,isDirectAnchorChild:o,placement:r,onPointerOver:s,onPointerOut:l,syncDeps:u}){const d=e1(),f=a.useRef(null),m=a.useRef(null),p=e==="gloss",C=!!(o&&(d!=null&&d.hoverLift)&&!p),S=t&&!C,g=a.useMemo(()=>i.createGlossInteractiveRefCallback(f,S&&p),[p,S]),h=i.useGlossInteractiveHandlers(f,S&&p),x=i.useSecondLevelShadow(f,S&&!p),A=a.useMemo(()=>({onPointerOver:N=>{s==null||s(N),!N.defaultPrevented&&S&&(p?h.onPointerOver(N):x.onPointerEnter(N))},onPointerOut:N=>{l==null||l(N),S&&(p?h.onPointerOut(N):x.onPointerLeave(N))}}),[h.onPointerOut,h.onPointerOver,p,l,s,S,x.onPointerEnter,x.onPointerLeave]),b=S?p?i.GLOSS_INTERACTIVE_MOTION_CLASS:x.motionClass:"",_=C&&!p?i.SHADOW_LIFT_MOTION_CLASS:"",L=a.useCallback(()=>{if(!d||!o||!d.hoverLift){d==null||d.registerLiftTarget(null);return}d.registerLiftTarget(m.current)},[o,d]),v=a.useCallback(N=>{g(N),f.current=N,N===null&&(d==null||d.registerLiftTarget(null)),ue(n,N)},[g,n,d]),{meaningChild:R,icon:T,dot:E,iconOnly:I,children:O}=u;return a.useLayoutEffect(()=>{L(),queueMicrotask(()=>{L()})},[o,d==null?void 0:d.anchorCommitGen,d==null?void 0:d.hoverLift,r,L,R,T,E,I,O]),{isGloss:p,splitLift:C,selfLiftEnabled:S,innerLiftRef:m,setMergedRef:v,pointerHandlers:A,selfLiftMotionCls:b,splitLiftMotionCls:_}}function s1(e,t){return i.useSecondLevelShadowContainer(e,t,{liftScale:i.getMotionConfig().badgeAnchorHoverLiftScale})}function a1(e,t){e&&t&&i.initElementShadow(e,i.shadowBase())}function l1(e){return typeof e["aria-label"]=="string"||typeof e["aria-labelledby"]=="string"}function i1(e){return l1(e)?{role:"img"}:{"aria-hidden":!0,role:"presentation"}}function Rs(e){const t=e.props;return t["aria-hidden"]===!0||t["aria-label"]?e:a.cloneElement(e,{"aria-hidden":!0})}function xi(e){const t=e.props["data-icon"];return t==="inline-start"||t==="start"?"inline-start":t==="inline-end"||t==="end"?"inline-end":null}function c1(e){return a.isValidElement(e)&&xi(e)!=null}const u1={default:"bg-surface border-token text-foreground",primary:"bg-primary border-token text-primary-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground"},d1={"top-right":"absolute right-0 top-0 z-10 translate-x-[38%] -translate-y-[38%]","top-left":"absolute left-0 top-0 z-10 -translate-x-[38%] -translate-y-[38%]","bottom-right":"absolute bottom-0 right-0 z-10 translate-x-[38%] translate-y-[38%]","bottom-left":"absolute bottom-0 left-0 z-10 -translate-x-[38%] translate-y-[38%]"},f1={small:"gap-xsmall px-small py-xsmall",base:"gap-xsmall px-base py-xsmall",mid:"gap-xsmall px-mid py-xsmall",large:"gap-small px-mid py-xsmall"},bi={small:"min-h-3 min-w-3",base:"min-h-4 min-w-4",mid:"min-h-4 min-w-4",large:"min-h-5 min-w-5"},Is={small:"xsmall",base:"small",mid:"base",large:"mid"},m1={small:"shrink-0 p-xsmall [&_svg]:icon-small",base:"shrink-0 p-small [&_svg]:icon-base",mid:"shrink-0 p-base [&_svg]:icon-base",large:"shrink-0 p-mid [&_svg]:icon-large"},p1={small:"icon-small shrink-0 p-0",base:"icon-small shrink-0 p-0",mid:"icon-base shrink-0 p-0",large:"icon-large shrink-0 p-0"},C1={small:"[&_svg]:icon-small",base:"[&_svg]:icon-small",mid:"[&_svg]:icon-base",large:"[&_svg]:icon-large"},g1="box-border isolate inline-flex max-w-full shrink-0 select-none items-center justify-center truncate rounded-full whitespace-nowrap motion-reduce:transition-none",S1="box-border isolate inline-flex items-center justify-center rounded-full whitespace-nowrap",h1="box-border isolate inline-flex shrink-0 rounded-full ring-2 ring-background motion-reduce:ring-1",po={default:"bg-foreground",primary:"bg-primary",outline:"bg-transparent border-token",secondary:"bg-secondary",danger:"bg-danger",success:"bg-success",info:"bg-info",warning:"bg-warning"};function x1(e,t){return e==="gloss"?t!=="default"?po[t]:po.default:t!=="default"?po[t]:po[e]}function b1(e,t){if(e==="gloss")return i.cn("gloss-panel border-0 text-foreground",t!=="default"?i.SEMANTIC_STATUS_TEXT[t]:"");if(t==="default")return u1[e];switch(e){case"default":return i.cn(i.SEMANTIC_STATUS_SURFACE_TINT[t],i.SEMANTIC_STATUS_TEXT[t]);case"primary":return i.SEMANTIC_STATUS_FILL[t];case"outline":return i.cn("bg-transparent",i.SEMANTIC_STATUS_OUTLINE_BORDER[t],i.SEMANTIC_STATUS_TEXT[t]);case"secondary":return i.cn("bg-secondary border-token",i.SEMANTIC_STATUS_TEXT[t])}}function A1(e){return e!=="default"?i.SEMANTIC_STATUS_TEXT[e]:""}function v1(e,t,n){return n?i.cn("gloss-panel border-0",A1(t)):x1(e,t)}const _1="inline-flex shrink-0 [&_svg]:shrink-0";function $g(e){return i.cn(_1,C1[e])}const L1="relative isolate inline-grid w-fit shrink-0 [&>*]:col-start-1 [&>*]:row-start-1",T1="pointer-events-none",E1="pointer-events-none";function R1(e,t,n,o,r=""){return i.cn(h1,p1[e],bi[e],v1(t,n,o),r)}function I1(e,t,n=""){return i.cn(S1,t,m1[e],bi[e],n)}function y1(e,t,n=""){return i.cn(g1,t,f1[e],bi[e],n)}function N1(e,t){return e&&!t?E1:""}function w1({node:e,size:t}){return e==null||e===!1?null:typeof e=="string"?e.trim()?c.jsx(q,{as:"span",variant:Is[t],inheritColor:!0,children:e}):null:typeof e=="number"?c.jsx(q,{as:"span",variant:Is[t],inheritColor:!0,children:e}):a.isValidElement(e)?xi(e)?c.jsx("span",{className:$g(t),children:Rs(e)}):e:null}function O1(e){return a.Children.toArray(e).some(c1)}function P1(e){return typeof e=="string"?e.trim().length>0:typeof e=="number"?!0:a.isValidElement(e)?xi(e)==null:!1}function D1(e){return a.Children.toArray(e).some(P1)}function Xg(e){return e==null||e===!1?!1:typeof e=="string"?e.trim().length>0:typeof e=="number"?!0:Array.isArray(e)?e.some(Xg):a.isValidElement(e)}function k1(e,t){return a.Children.map(a.Children.toArray(e),(n,o)=>c.jsx(a.Fragment,{children:c.jsx(w1,{node:n,size:t})},o))}function B1(e){return e.type.displayName==="BadgeRoot"}function j1({size:e,children:t,icon:n,iconOnly:o,iconPosition:r,inlineIconMode:s,meaningChild:l,dot:u}){if(u)return{layoutKind:"dot",bodyContent:null,iconOnlyBody:null,dataIcon:void 0};const d=s?null:n,f=!!d&&!l,m=s&&!l&&a.Children.toArray(t).length>0,p=!l&&(f||!!(o&&d)||m),C=d?c.jsx("span",{className:$g(e),children:a.isValidElement(d)?Rs(d):d}):null,S=l&&!s?c.jsx(q,{as:"span",variant:Is[e],inheritColor:!0,children:t}):null,g=s?k1(t,e):null,h=s?g:c.jsxs(c.Fragment,{children:[r==="start"&&C,S,r==="end"&&C]}),x=m?g:d?a.isValidElement(d)?Rs(d):d:t,b=!!(!s&&C&&S)?r:void 0;return p?{layoutKind:"iconOnly",bodyContent:h,iconOnlyBody:x,dataIcon:b}:{layoutKind:"text",bodyContent:h,iconOnlyBody:x,dataIcon:b}}function Ai({setMergedRef:e,splitLift:t,placementClass:n,splitLiftMotionCls:o,selfLiftMotionCls:r,isDirectAnchorChild:s,isGloss:l,innerLiftRef:u,pointerHandlers:d,rest:f,className:m,dataIcon:p,children:C,withA11y:S=!1}){const g=S?i1(f):void 0;return t?c.jsx("span",{ref:e,"data-badge-root":!0,className:i.cn(T1,n),...f,...g,children:c.jsx("span",{ref:u,"data-badge-lift-target":!0,"data-icon":p,className:i.cn(o,m),children:C})}):c.jsx("span",{ref:e,"data-icon":p,"data-badge-root":!0,className:i.cn(o,r,N1(s,l),n,m),...d,...f,...g,children:C})}function M1({size:e,variant:t,status:n,shell:o,className:r,rest:s}){const l=vr(),u=R1(e,t,n,o.isGloss,i.cn(l.root,l.dot,r));return c.jsx(Ai,{...o,className:u,rest:s,withA11y:!0,children:null})}function F1({size:e,surfaceClass:t,shell:n,className:o,rest:r,iconOnlyBody:s}){const l=vr(),u=I1(e,t,i.cn(l.root,l.iconOnly,o));return c.jsx(Ai,{...n,className:u,rest:r,withA11y:!0,children:s})}function H1({size:e,surfaceClass:t,shell:n,className:o,rest:r,bodyContent:s,dataIcon:l}){const u=vr(),d=y1(e,t,i.cn(u.root,u.text,o));return c.jsx(Ai,{...n,className:d,rest:r,dataIcon:l,children:s})}const Kg=a.forwardRef(function({className:t="",classNames:n,children:o,hoverLift:r=!0,onPointerOver:s,onPointerOut:l,...u},d){const f=a.useRef(null),m=a.useRef(null),[p]=a.useState(1),C=a.useCallback(A=>{f.current=A,typeof d=="function"?d(A):d&&(d.current=A)},[d]),S=a.useCallback(A=>{m.current=A,a1(A,r)},[r]),g=a.useMemo(()=>({registerLiftTarget:S,anchorRef:f,anchorCommitGen:p,hoverLift:r}),[S,p,r]),h=s1(m,r),x=vr();return c.jsx(Yg,{classNames:n,children:c.jsx(t1,{value:g,children:c.jsx("div",{ref:C,"data-badge-anchor":!0,className:i.cn(L1,x.anchor,n==null?void 0:n.anchor,t),onPointerOver:A=>{s==null||s(A),A.defaultPrevented||h.onPointerOver(A)},onPointerOut:A=>{l==null||l(A),h.onPointerOut(A)},...u,children:a.Children.map(o,(A,b)=>a.isValidElement(A)&&B1(A)?c.jsx(o1,{children:A},A.key??`badge-anchor-child-${b}`):A)})})})});Kg.displayName="BadgeAnchor";function G1({variant:e,status:t,size:n,children:o,icon:r,iconOnly:s,iconPosition:l,dot:u,placement:d}){const f=n1(),m=b1(e,t),p=O1(o),C=a.useMemo(()=>p?D1(o):Xg(o),[o,p]),S=f?d??"top-right":void 0,g=S?d1[S]:"",h=a.useMemo(()=>j1({size:n,children:o,icon:r,iconOnly:s,iconPosition:l,inlineIconMode:p,meaningChild:C,dot:u}),[o,u,r,s,l,p,C,n]);return{size:n,surfaceClass:m,inlineIconMode:p,meaningChild:C,placementClass:g,isDirectAnchorChild:f,layoutKind:h.layoutKind,bodyContent:h.bodyContent,iconOnlyBody:h.iconOnlyBody,dataIcon:h.dataIcon}}const qg=a.forwardRef(function({variant:t="default",status:n="default",size:o="base",icon:r,iconPosition:s="start",iconOnly:l=!1,dot:u=!1,placement:d,classNames:f,className:m="",children:p,hoverLift:C=!0,onPointerOver:S,onPointerOut:g,...h},x){const A=u,{surfaceClass:b,meaningChild:_,placementClass:L,isDirectAnchorChild:v,layoutKind:R,bodyContent:T,iconOnlyBody:E,dataIcon:I}=G1({variant:t,status:n,size:o,children:p,icon:r,iconOnly:l,iconPosition:s,dot:A,placement:d}),O=r1({variant:t,hoverLift:C,forwardedRef:x,isDirectAnchorChild:v,placement:d,onPointerOver:S,onPointerOut:g,syncDeps:{meaningChild:_,icon:r,dot:A,iconOnly:l,children:p}}),N={setMergedRef:O.setMergedRef,splitLift:O.splitLift,placementClass:L,splitLiftMotionCls:O.splitLiftMotionCls,selfLiftMotionCls:O.selfLiftMotionCls,isDirectAnchorChild:v,isGloss:O.isGloss,innerLiftRef:O.innerLiftRef,pointerHandlers:O.pointerHandlers,rest:h},y=w=>c.jsx(Yg,{classNames:f,children:w});return y(R==="dot"?c.jsx(M1,{size:o,variant:t,status:n,shell:N,className:m,rest:h}):R==="iconOnly"?c.jsx(F1,{size:o,surfaceClass:b,shell:N,className:m,rest:h,iconOnlyBody:E}):c.jsx(H1,{size:o,surfaceClass:b,shell:N,className:m,rest:h,bodyContent:T,dataIcon:I}))});qg.displayName="BadgeRoot";const V1=Object.assign(qg,{Anchor:Kg});function z1({variant:e,hoverLift:t=!0,forwardedRef:n,onPointerOver:o,onPointerOut:r}){const s=a.useRef(null),l=e==="gloss",u=t,d=a.useMemo(()=>i.createGlossInteractiveRefCallback(s,u&&l),[l,u]),f=i.useGlossInteractiveHandlers(s,u&&l),m=i.useSecondLevelShadow(s,u&&!l),p=a.useCallback(h=>{d(h),s.current=h,ue(n,h)},[d,n]),C=a.useMemo(()=>({onPointerOver:h=>{o==null||o(h),!(!u||h.defaultPrevented)&&(l?f.onPointerOver(h):m.onPointerEnter(h))},onPointerOut:h=>{r==null||r(h),u&&(l?f.onPointerOut(h):m.onPointerLeave(h))}}),[f.onPointerOut,f.onPointerOver,l,u,r,o,m.onPointerEnter,m.onPointerLeave]),S=u&&!l?m.motionClass:"",g=u&&l?i.GLOSS_INTERACTIVE_MOTION_CLASS:"";return{setMergedRef:p,motionClass:S,glossMotionClass:g,pointerHandlers:C}}const ys=a.createContext({});function U1({classNames:e,children:t}){const n=a.useContext(ys),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ys.Provider,{value:o,children:t})}function Zg(){return a.useContext(ys)}const W1={default:"bg-surface border-token text-foreground",primary:"bg-primary border border-transparent text-primary-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary border-token text-secondary-foreground"},Y1={small:"xsmall",base:"xsmall",mid:"small",large:"base"},$1={small:"min-h-4 px-xsmall py-0.5",base:"min-h-4 px-small py-xsmall",mid:"min-h-5 px-base py-xsmall",large:"min-h-5 px-base py-xsmall"},X1="box-border isolate inline-flex max-w-full shrink-0 select-none items-center justify-center whitespace-nowrap rounded-small font-mono motion-reduce:transition-none",K1="inline-flex items-center gap-xsmall",q1="select-none text-muted text-xsmall";function Z1(e){return e==="gloss"?"gloss-panel gloss-deep border-0 text-foreground":W1[e]}function Q1({variant:e,size:t,motionClass:n,slotRoot:o,className:r}){return i.cn(X1,Z1(e),$1[t],n,o,r)}function J1(e,t){return i.cn(K1,t,e)}function eV(e){return i.cn(q1,e)}function vi({size:e,className:t,children:n}){const o=Zg();return c.jsx(q,{as:"span",variant:Y1[e],inheritColor:!0,className:i.cn(o.text,t),children:n})}vi.displayName="Kbd.Text";function Qg({size:e,children:t}){return t==null||t===!1?null:a.isValidElement(t)?t:c.jsx(vi,{size:e,children:t})}Qg.displayName="KbdBody";function tV({variant:e,size:t,className:n,classNames:o}){const r=a.useMemo(()=>Q1({variant:e,size:t,slotRoot:o==null?void 0:o.root,className:n}),[n,o==null?void 0:o.root,t,e]);return{variant:e,size:t,rootClass:r}}const Jg=a.forwardRef(function({variant:t="default",size:n="base",classNames:o,className:r="",children:s,hoverLift:l=!0,onPointerOver:u,onPointerOut:d,...f},m){const p=tV({variant:t,size:n,className:r,classNames:o}),C=z1({variant:p.variant,hoverLift:l,forwardedRef:m,onPointerOver:u,onPointerOut:d});return c.jsx(U1,{classNames:o,children:c.jsx("kbd",{ref:C.setMergedRef,className:i.cn(p.rootClass,C.motionClass,C.glossMotionClass),...C.pointerHandlers,...f,children:c.jsx(Qg,{size:p.size,children:s})})})});Jg.displayName="KbdRoot";function nV(e){return e.type.displayName==="KbdRoot"}function oV(e){const t=[];for(const n of a.Children.toArray(e)){if(!a.isValidElement(n)){n!=null&&t.push(n);continue}if(nV(n)){t.push(n);continue}t.push(n)}return t}const rV=!0;function eS({className:e,classNames:t,separator:n="+",children:o,...r}){const s=Zg(),l=oV(o);return c.jsx("span",{className:J1(e,(t==null?void 0:t.group)??s.group),...r,children:l.map((u,d)=>c.jsxs(a.Fragment,{children:[d>0&&n!=null?c.jsx(q,{as:"span",variant:"xsmall","aria-hidden":rV,className:eV((t==null?void 0:t.separator)??s.separator),children:n}):null,u]},d))})}eS.displayName="KbdGroup";const sV=Object.assign(Jg,{Group:eS,Text:vi});function aV(e,t){if(e)return t==="ascending"?"ascending":t==="descending"?"descending":"none"}function lV(e,t){return e!=="none"?t:void 0}function iV(e){return e!=="none"?"grid":void 0}function Zn(e){return e!=="none"}function cV(e){return e==="multiple"?!0:void 0}function _i(e){return e?"row":void 0}function uV(e,t){if(e)return t?"rowheader":"columnheader"}function tS(e){return e?"gridcell":void 0}const nS=new Set,Oc="secondary",dV="Table.Label";function fV(e){return a.Children.toArray(e).some(t=>a.isValidElement(t)&&t.type.displayName===dV)}function mV(e,t){if(Object.is(e,t))return!0;if(e==="all"||t==="all")return e===t;if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function pV({selectionMode:e,selectedKeys:t,key:n}){if(e==="none")return null;if(e==="single")return new Set([n]);if(t==="all")return new Set([n]);const o=new Set(t);return o.has(n)?o.delete(n):o.add(n),o}function CV(e,t){if(!(!e||(t==null?void 0:t.column)!==e))return t.direction}function gV(e,t){return{column:e,direction:(t==null?void 0:t.column)===e&&t.direction==="ascending"?"descending":"ascending"}}const In="data-table-row-key";function SV(e){return Array.from(e.querySelectorAll(`tbody tr[${In}]`))}function hV(e){const t=e.closest("table")??e.closest("[role='grid']");return t?Array.from(t.querySelectorAll("thead button[type='button']")):[]}function xV(e,t,n){if(e.length===0)return null;const o=e.indexOf(t);if(o<0)return e[0]??null;const r=o+n;return r<0||r>=e.length?e[o]??null:e[r]??null}function bV(e,t,n){if(e.length===0)return null;const o=e.indexOf(t);if(o<0)return e[0]??null;const r=o+n;return r<0||r>=e.length?e[o]??null:e[r]??null}const AV={subscribeSelection:()=>()=>{},subscribeFocus:()=>()=>{},getSelectedKeys:()=>nS,isSelected:()=>!1,getFocusedRowKey:()=>null,isFocusTarget:()=>!1,setSelectedKeys:()=>{},setFocusedRowKey:()=>{},claimFocusedRowKey:()=>{}},oS=a.createContext("default"),Ns=a.createContext({}),rS=a.createContext({selectionMode:"none",onRowSelect:()=>{},sortDescriptor:void 0,onSortChange:void 0,setFocusedRowKey:()=>{},claimFocusedRowKey:()=>{},rowStore:AV}),sS=a.createContext(null);function vV({variant:e,children:t}){return c.jsx(oS.Provider,{value:e,children:t})}function _V({classNames:e,children:t}){const n=a.useContext(Ns),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ns.Provider,{value:o,children:t})}function LV({value:e,children:t}){return c.jsx(rS.Provider,{value:e,children:t})}function TV({value:e,children:t}){return c.jsx(sS.Provider,{value:e,children:t})}function Qn(){return a.useContext(oS)}function Ze(){return a.useContext(Ns)}function an(){return a.useContext(rS)}function EV(){return a.useContext(sS)}function RV(e){const{rowStore:t}=an();return a.useSyncExternalStore(t.subscribeSelection,()=>e===void 0?!1:t.isSelected(e),()=>!1)}function IV(e){const{rowStore:t,selectionMode:n}=an();return a.useSyncExternalStore(t.subscribeFocus,()=>n==="none"||e===void 0?!1:t.isFocusTarget(e),()=>!1)}const yV="w-full",NV={default:"rounded-mid border-token bg-surface overflow-clip",secondary:"",toned:"overflow-visible bg-transparent",gloss:"gloss-panel gloss-deep rounded-mid overflow-clip border-0"},wV="gloss-content w-full min-w-0",OV="w-full overflow-x-auto outline-none focus-ring",PV="w-full",DV={default:"border-collapse",secondary:"border-collapse",toned:"border-separate border-spacing-y-xsmall",gloss:"border-collapse"},kV={default:"border-b-token",secondary:"border-b-token",toned:"",gloss:"border-b-token"},BV="group/col",jV={default:"bg-secondary px-large py-mid text-secondary-foreground whitespace-nowrap",secondary:"px-large py-mid text-secondary-foreground whitespace-nowrap",toned:"px-large py-mid text-muted whitespace-nowrap bg-transparent",gloss:"bg-transparent px-large py-mid text-muted whitespace-nowrap"},MV="select-none",FV="inline-flex w-full min-w-0 items-center gap-xsmall border-0 bg-transparent text-inherit cursor-pointer outline-none focus-ring-inset rounded-small hover:text-foreground -mx-large -my-mid px-large py-mid box-border",aS="inline-flex items-center gap-xsmall",HV="min-w-0 text-small text-left font-w-mid",GV="shrink-0 origin-center",VV="icon-xsmall",zV="text-primary opacity-100",UV="opacity-0 group-hover/col:opacity-40 text-muted",WV="px-large py-large text-center",YV="outline-none",$V={default:"border-b-token last:border-b-0",secondary:"border-b-token last:border-b-0",toned:"",gloss:"border-b-token last:border-b-0"},XV="cursor-pointer",KV="bg-default-hover",qV="bg-primary-tint hover:bg-primary-tint-strong",ZV=i.cn(i.SURFACE_COLOR_TRANSITION,"hover:bg-primary-tint focus-visible:bg-primary-tint"),QV="focus-ring-inset",JV="text-small",ez={default:"px-large py-mid",secondary:"px-large py-mid",toned:"px-large py-mid first:rounded-l-mid last:rounded-r-mid",gloss:"px-large py-mid"},tz="ring-2 ring-inset ring-primary",nz="hover:brightness-[0.97] motion-reduce:hover:brightness-100",oz="flex flex-wrap items-center justify-between gap-base border-t-token px-large py-mid",lS={default:"bg-surface text-foreground",outline:"bg-transparent border-token text-foreground",secondary:"bg-secondary text-secondary-foreground",danger:"bg-surface-tint-danger text-foreground",success:"bg-surface-tint-success text-foreground",info:"bg-surface-tint-info text-foreground",warning:"bg-surface-tint-warning text-foreground"};function rz({variant:e,slotClass:t,className:n}){return i.cn(yV,NV[e],t,n)}function sz({variant:e,slotClass:t,className:n}){return i.cn(PV,DV[e],t,n)}function az({variant:e,allowsSorting:t,slotClass:n,className:o}){return i.cn(BV,jV[e],t&&i.cn(MV,i.TEXT_COLOR_TRANSITION),n,o)}function lz({slotClass:e,className:t}){return i.cn(FV,aS,i.TEXT_COLOR_TRANSITION,e,t)}function iz({slotClass:e,className:t}){return i.cn(HV,e,t)}function cz({variant:e,isToned:t,isSelectable:n,isSelected:o,slotClass:r,className:s}){return i.cn(YV,$V[e],n&&XV,e==="gloss"&&!t&&(o?qV:ZV),e!=="gloss"&&!t&&(o?KV:i.hoverVariant()),n&&QV,r,s)}function uz({variant:e,tone:t,isSelected:n,slotClass:o,className:r}){const s=e==="toned",l=t?lS[t]:void 0;return i.cn(JV,ez[e],s&&l,s&&n&&tz,s&&!n&&nz,o,r)}function dz(e){return i.cn(GV,e?zV:UV)}function fz({direction:e,children:t}){const n=Ze(),o=a.useRef(null),r=qt(e==="descending",o,()=>!0);return c.jsx("span",{ref:r,"aria-hidden":!0,className:i.cn(dz(!!e),n.columnSortChevron),children:t??c.jsx(be.IoChevronUp,{className:VV})})}function mz(e){let t=e,n=null;const o=new Set,r=new Set;return{subscribeSelection(s){return o.add(s),()=>{o.delete(s)}},subscribeFocus(s){return r.add(s),()=>{r.delete(s)}},getSelectedKeys(){return t},isSelected(s){return t==="all"||t.has(s)},getFocusedRowKey(){return n},isFocusTarget(s){return n!=null&&String(n)===String(s)},setSelectedKeys(s){mV(t,s)||(t=s,o.forEach(l=>l()))},setFocusedRowKey(s){n!=null&&String(n)===String(s)||(n=s,r.forEach(l=>l()))},claimFocusedRowKey(s){n==null&&(n=s,r.forEach(l=>l()))}}}function pz({selectionMode:e="none",selectedKeys:t,defaultSelectedKeys:n,onSelectionChange:o,sortDescriptor:r,defaultSortDescriptor:s,onSortChange:l}){const u=a.useRef(null);u.current==null&&(u.current=mz(t??n??nS));const d=u.current,f=t!==void 0,m=a.useRef(o);m.current=o;const p=a.useRef(e);p.current=e,a.useLayoutEffect(()=>{t!==void 0&&d.setSelectedKeys(t)},[t,d]);const[C,S]=Re({value:r,defaultValue:s,onChange:l?A=>{A!==void 0&&l(A)}:void 0}),g=a.useCallback(A=>{var _;const b=pV({selectionMode:p.current,selectedKeys:d.getSelectedKeys(),key:A});b&&(f||d.setSelectedKeys(b),(_=m.current)==null||_.call(m,b))},[f,d]),h=a.useCallback(A=>{d.setFocusedRowKey(A)},[d]),x=a.useCallback(A=>{d.claimFocusedRowKey(A)},[d]);return a.useMemo(()=>({selectionMode:e,onRowSelect:g,sortDescriptor:C,onSortChange:S,setFocusedRowKey:h,claimFocusedRowKey:x,rowStore:d}),[x,g,e,h,S,C,d])}function Cz(e){return a.Children.toArray(e).some(t=>a.isValidElement(t)&&t.type.displayName==="Table.HeaderRow")}const iS=a.forwardRef(function({className:t,tabIndex:n,...o},r){const s=Ze();return c.jsx("div",{ref:r,tabIndex:n,className:i.cn(OV,s.scrollContainer,t),...o})});iS.displayName="TableScrollContainer";const cS=a.forwardRef(function({selectionMode:t="none",selectedKeys:n,defaultSelectedKeys:o,onSelectionChange:r,sortDescriptor:s,defaultSortDescriptor:l,onSortChange:u,className:d,children:f,...m},p){const C=Qn(),S=Ze(),g=pz({selectionMode:t,selectedKeys:n,defaultSelectedKeys:o,onSelectionChange:r,sortDescriptor:s,defaultSortDescriptor:l,onSortChange:u});return c.jsx(LV,{value:g,children:c.jsx("table",{ref:p,role:iV(t),"aria-multiselectable":cV(t),className:sz({variant:C,slotClass:S.content,className:d}),...m,children:f})})});cS.displayName="TableContent";const Li=a.forwardRef(function({className:t,...n},o){const r=Qn(),s=Ze(),{selectionMode:l}=an(),u=Zn(l);return c.jsx("tr",{ref:o,role:_i(u),className:i.cn(kV[r],s.headerRow,t),...n})});Li.displayName="Table.HeaderRow";const uS=a.forwardRef(function({columns:t,children:n,className:o,...r},s){const l=Ze(),u=t&&typeof n=="function"?t.map(f=>n(f)):n,d=Cz(u)?u:c.jsx(Li,{children:u});return c.jsx("thead",{ref:s,className:i.cn(l.header,o),...r,children:d})});uS.displayName="TableHeader";const Ti=a.forwardRef(function({className:t,...n},o){const r=Ze();return c.jsx("span",{ref:o,className:iz({slotClass:r.columnLabel,className:t}),...n})});Ti.displayName="Table.Label";const dS=a.forwardRef(function({id:t,allowsSorting:n=!1,isRowHeader:o=!1,sortIcon:r,children:s,className:l,onClick:u,...d},f){const m=Qn(),p=Ze(),{sortDescriptor:C,onSortChange:S,selectionMode:g}=an(),h=Zn(g),x=CV(t,C),A=a.useCallback(E=>{u==null||u(E),!(!t||!S)&&S(gV(t,C))},[t,u,S,C]),b=a.useCallback(E=>{if(E.key!=="ArrowLeft"&&E.key!=="ArrowRight")return;const I=hV(E.currentTarget),O=bV(I,E.currentTarget,E.key==="ArrowRight"?1:-1);!O||O===E.currentTarget||(E.preventDefault(),O.focus())},[]),_=a.useCallback(E=>{u==null||u(E)},[u]),L=typeof s=="function"?s({sortDirection:x}):s,v=fV(L)?L:c.jsx(Ti,{children:L});let R=null;n&&(r!==void 0?R=typeof r=="function"?r({sortDirection:x}):r:R=c.jsx(fz,{direction:x}));const T=c.jsxs(c.Fragment,{children:[v,R]});return c.jsx("th",{ref:f,role:uV(h,o),scope:o?"row":"col","aria-sort":aV(n,x),"data-allows-sorting":n||void 0,className:az({variant:m,allowsSorting:n,slotClass:p.column,className:l}),onClick:n?void 0:_,...d,children:n?c.jsx("button",{type:"button",className:lz({slotClass:p.columnInner}),onClick:A,onKeyDown:b,children:T}):c.jsx("span",{className:i.cn(aS,p.columnInner),children:T})})});dS.displayName="TableColumn";const fS=a.forwardRef(function({items:t,children:n,renderEmptyState:o,className:r,...s},l){const u=Ze(),{selectionMode:d}=an(),f=Zn(d);let m;if(t!==void 0)if(t.length===0&&o){const p=o();m=c.jsx("tr",{role:_i(f),children:c.jsx("td",{role:tS(f),colSpan:9999,className:i.cn(WV,u.emptyCell),children:p})})}else typeof n=="function"&&(m=t.map(n));else m=n;return c.jsx("tbody",{ref:l,className:i.cn(u.body,r),...s,children:m})});fS.displayName="TableBody";const gz=a.forwardRef(function({id:t,tone:n,children:o,className:r,onClick:s,onKeyDown:l,...u},d){const f=Qn(),m=Ze(),{selectionMode:p,onRowSelect:C,setFocusedRowKey:S,claimFocusedRowKey:g}=an(),h=RV(t),x=IV(t),A=p!=="none"&&t!==void 0,b=Zn(p),_=f==="toned",L=n??(_?Oc:void 0);a.useLayoutEffect(()=>{!A||t===void 0||g(t)},[g,t,A]);const v=a.useMemo(()=>({tone:L??Oc,isSelected:h}),[h,L]),R=a.useCallback(E=>{s==null||s(E),!(E.defaultPrevented||!A||t===void 0)&&(S(t),C(t))},[t,A,s,C,S]),T=a.useCallback(E=>{if(l==null||l(E),E.defaultPrevented||!A||t===void 0)return;if(E.key==="Enter"||E.key===" "){E.preventDefault(),S(t),C(t);return}const I=E.currentTarget.closest("table");if(!I)return;const O=SV(I);if(E.key==="ArrowDown"||E.key==="ArrowUp"){E.preventDefault();const N=xV(O,E.currentTarget,E.key==="ArrowDown"?1:-1);if(!N)return;const y=N.getAttribute(In);if(y==null)return;S(y),N.focus();return}if(E.key==="Home"){E.preventDefault();const N=O[0];if(!N)return;const y=N.getAttribute(In);if(y==null)return;S(y),N.focus();return}if(E.key==="End"){E.preventDefault();const N=O[O.length-1];if(!N)return;const y=N.getAttribute(In);if(y==null)return;S(y),N.focus()}},[t,A,l,C,S]);return c.jsx(TV,{value:_||L?v:null,children:c.jsx("tr",{ref:d,role:_i(b),...t!==void 0?{[In]:String(t)}:{},"data-selected":h||void 0,"data-tone":L,"aria-selected":lV(p,h),tabIndex:A?x?0:-1:void 0,className:cz({variant:f,isToned:_,isSelectable:A,isSelected:h,slotClass:m.row,className:r}),onClick:R,onKeyDown:T,...u,children:o})})}),mS=a.memo(gz);mS.displayName="TableRow";const Sz=a.forwardRef(function({className:t,...n},o){const r=Qn(),s=Ze(),l=EV(),{selectionMode:u}=an(),d=Zn(u);return c.jsx("td",{ref:o,role:tS(d),className:uz({variant:r,tone:l==null?void 0:l.tone,isSelected:(l==null?void 0:l.isSelected)??!1,slotClass:s.cell,className:t}),...n})}),pS=a.memo(Sz);pS.displayName="TableCell";const CS=a.forwardRef(function({className:t,...n},o){const r=Ze();return c.jsx("div",{ref:o,className:i.cn(oz,r.footer,t),...n})});CS.displayName="TableFooter";function hz({variant:e="default"}){return{variant:e,isGloss:e==="gloss"}}const gS=a.forwardRef(function({variant:t="default",className:n,classNames:o,children:r,...s},l){const{variant:u,isGloss:d}=hz({variant:t}),f=i.useMergedGlossPanelRef(l,d);return c.jsx(vV,{variant:u,children:c.jsx(_V,{classNames:o,children:c.jsx("div",{ref:f,className:rz({variant:u,slotClass:o==null?void 0:o.root,className:n}),...s,children:d?c.jsx("div",{className:i.cn(wV,o==null?void 0:o.glossContent),children:r}):r})})})});gS.displayName="TableRoot";const xz=Object.assign(gS,{ScrollContainer:iS,Content:cS,Header:uS,HeaderRow:Li,Column:dS,Label:Ti,Body:fS,Row:mS,Cell:pS,Footer:CS}),SS=a.createContext(null),ws=a.createContext({});function bz({value:e,children:t}){return c.jsx(SS.Provider,{value:e,children:t})}function Az({classNames:e,children:t}){const n=a.useContext(ws),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(ws.Provider,{value:o,children:t})}function Ne(){const e=a.useContext(SS);if(!e)throw new Error("Calendar compound parts must be inside <Calendar>.");return e}function lt(){return a.useContext(ws)}function vz(){return"Previous"}function _z(){return"Next"}function Lz(e,t,n,o){return`${e} ${o.months[t]} ${n}`}function Tz(e,t,n){return`${n.months[e]} ${t}`}function Ez(e){return String(e)}function Rz(e){return`${e}–${e+9}`}function Pc(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function De(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Et(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function _r(e,t){return new Date(e,t+1,0).getDate()}function Iz(e,t){return(new Date(e,t,1).getDay()+6)%7}function yz(e,t,n){const o=t.getFullYear(),r=t.getMonth();if(e==="days")return`${n.months[r]} ${o}`;if(e==="months")return String(o);const s=Math.floor(o/10)*10;return`${s}–${s+9}`}function Nz(e,t,n,o){if(e)return new Date(e.getFullYear(),e.getMonth(),1);let r=null;return t==="single"&&n instanceof Date?r=n:t==="range"?r=(n==null?void 0:n.start)??null:t==="multiple"&&(r=(n==null?void 0:n[0])??null),r?new Date(r.getFullYear(),r.getMonth(),1):new Date(o.getFullYear(),o.getMonth(),1)}function hS(e,t){if(e==="single"){const n=t;return n?[n]:[]}if(e==="multiple"){const n=t;return Array.isArray(n)?n:[]}return[]}function xS(e,t,n){return e!=="range"?null:t||((n==null?void 0:n.start)??null)}function wz(e,t,n){return e!=="range"||t?null:(n==null?void 0:n.end)??null}function Oz(e,t,n){return t==="days"?new Date(e.getFullYear(),e.getMonth()+n,1):t==="months"?new Date(e.getFullYear()+n,e.getMonth(),1):new Date(e.getFullYear()+n*10,e.getMonth(),1)}function Pz({viewDate:e,selectedDates:t,rangeStart:n,rangeEnd:o,hoverDate:r,mode:s,locale:l,minDate:u,maxDate:d,today:f}){const m=e.getFullYear(),p=e.getMonth(),C=_r(m,p),S=Iz(m,p),g=o??(n&&r?r:null),h=n&&g?n<=g?n:g:null,x=n&&g?n<=g?g:n:null,A=[...Array(S).fill(null),...Array.from({length:C},(_,L)=>L+1)],b=A.length%7;return b!==0&&A.push(...Array(7-b).fill(null)),A.map((_,L)=>{if(_===null)return{key:`empty-${m}-${p}-${L}`,day:null};const v=new Date(m,p,_),R=`${m}-${p}-${_}`,T=De(v,f),E=s!=="range"&&t.some(B=>De(B,v)),I=s==="range"&&!!n&&De(v,n),O=s==="range"&&!!g&&De(v,g),N=s==="range"&&h&&x?v>h&&v<x:!1,y=s==="range"&&!!n&&!!g&&De(n,g),w=!y&&(N||O),P=!y&&(N||I),k=!!u&&v<u||!!d&&v>d;return{key:R,day:_,date:v,isToday:T,isSelected:E,isRangeStart:I,isRangeEnd:O,showLeftBg:w,showRightBg:P,isDisabled:k,circleActive:E||I||O,ariaLabel:Lz(_,p,m,l)}})}function Dz(e,t,n,o){const r=e.getFullYear();return n.monthsShort.map((s,l)=>({month:l,name:s,isCurrentMonth:o.getFullYear()===r&&o.getMonth()===l,isSelected:t.some(u=>u.getFullYear()===r&&u.getMonth()===l)}))}function kz(e,t,n){const o=Math.floor(e.getFullYear()/10)*10;return Array.from({length:12},(s,l)=>o-1+l).map(s=>({year:s,isCurrentYear:n.getFullYear()===s,isSelected:t.some(l=>l.getFullYear()===s),outOfDecade:s<o||s>o+9}))}function Bz(e,t){return t!==void 0?t:e==="range"?{start:null,end:null}:e==="multiple"?[]:null}function jt(e,t){const n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return Et(n)}function Os(e,t){const n=new Date(e.getFullYear(),e.getMonth()+t,1),o=_r(n.getFullYear(),n.getMonth());return Et(new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),o)))}function Go(e,t){const n=new Date(e.getFullYear()+t,e.getMonth(),1),o=_r(n.getFullYear(),n.getMonth());return Et(new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),o)))}function Dc(e,t,n){return!!t&&e<t||!!n&&e>n}function Pe(e,t,n){let o=Et(e);return t&&o<t&&(o=Et(t)),n&&o>n&&(o=Et(n)),o}function jz({mode:e,resolvedValue:t,today:n,minDate:o,maxDate:r}){const s=hS(e,t)[0];if(s)return Pe(s,o,r);if(e==="range"){const l=xS(e,null,t);if(l)return Pe(l,o,r)}return Pe(n,o,r)}function Mz(e,t,n,o,r){let s=null;switch(t){case"ArrowLeft":s=jt(e,-1);break;case"ArrowRight":s=jt(e,1);break;case"ArrowUp":s=jt(e,-7);break;case"ArrowDown":s=jt(e,7);break;case"Home":{const l=(e.getDay()+6)%7;s=jt(e,-l);break}case"End":{const l=(e.getDay()+6)%7;s=jt(e,6-l);break}case"PageUp":s=n?Go(e,-1):Os(e,-1);break;case"PageDown":s=n?Go(e,1):Os(e,1);break;default:return null}if(s=Pe(s,o,r),Dc(s,o,r)){const l=t==="ArrowLeft"||t==="ArrowUp"||t==="Home"||t==="PageUp"?-1:1;let u=s;for(let d=0;d<366;d++){if(u=jt(u,l),u=Pe(u,o,r),!Dc(u,o,r))return u;if(l<0&&o&&De(u,o)||l>0&&r&&De(u,r))break}return e}return s}function Fz(e,t){switch(t){case"ArrowLeft":return e>0?e-1:11;case"ArrowRight":return e<11?e+1:0;case"ArrowUp":return(e-3+12)%12;case"ArrowDown":return(e+3)%12;case"Home":return 0;case"End":return 11;default:return null}}function Hz(e,t){switch(t){case"ArrowLeft":return e>0?e-1:11;case"ArrowRight":return e<11?e+1:0;case"ArrowUp":return(e-4+12)%12;case"ArrowDown":return(e+4)%12;case"Home":return 0;case"End":return 11;default:return null}}function Ei(e,t){const n=[];for(let o=0;o<e.length;o+=t)n.push(e.slice(o,o+t));return n}function bS(e=!1){const t=a.useRef(null),{handlePointerEnter:n,handlePointerLeave:o,handlePointerDown:r}=xt({isDisabled:e,enabled:!e,textMotionRef:t,hoverLift:!0,hoverLiftScale:"adaptive"});return{buttonRef:t,handlePointerEnter:n,handlePointerLeave:o,handlePointerDown:r}}const Gz={small:"mx-auto flex aspect-square w-full max-w-control-small items-center justify-center text-xsmall",base:"mx-auto flex aspect-square w-full max-w-control-base items-center justify-center text-small",mid:"mx-auto flex aspect-square w-full max-w-control-mid items-center justify-center text-base",large:"mx-auto flex aspect-square w-full max-w-control-large items-center justify-center text-mid"},Vz={small:"h-control-small w-control-small",base:"h-control-base w-control-base",mid:"h-control-mid w-control-mid",large:"h-control-large w-control-large"},zz={small:"p-small gap-xsmall",base:"p-large gap-small",mid:"p-large gap-small",large:"p-xlarge gap-base"},Uz={small:"min-w-component-small",base:"min-w-component-base",mid:"min-w-component-mid",large:"min-w-component-large"},Wz={small:"text-small",base:"text-base",mid:"text-mid",large:"text-mid"},Yz={default:"rounded-large border-token bg-surface shadow-token-base",secondary:"rounded-large border-token bg-secondary shadow-token-base",outline:"rounded-large bg-transparent border-token shadow-token-base",gloss:"rounded-large border-0"},AS={small:"gap-xsmall",base:"gap-xsmall",mid:"gap-small",large:"gap-small"},$z={small:"small",base:"base",mid:"mid",large:"mid"},vS={small:"mx-auto aspect-square w-full max-w-control-small",base:"mx-auto aspect-square w-full max-w-control-base",mid:"mx-auto aspect-square w-full max-w-control-mid",large:"mx-auto aspect-square w-full max-w-control-large"},Xz={small:"small",base:"base",mid:"mid",large:"mid"},Kz={small:"min-h-control-small w-full px-small py-xsmall",base:"min-h-control-base w-full px-mid py-small",mid:"min-h-control-mid w-full px-large py-mid",large:"min-h-control-large w-full px-large py-mid"},qz="inline-flex flex-col select-none text-left text-foreground",Zz="gloss-panel gloss-deep rounded-large",Qz="gloss-content flex flex-col",Jz="pointer-events-none absolute inset-y-0 bg-default-hover",eU="flex items-center gap-xsmall",tU="flex-1 rounded-base py-xsmall text-center font-w-mid",nU="cursor-pointer hover:text-primary focus-ring",oU="cursor-default",rU="min-w-0",sU="grid grid-cols-7 gap-xsmall",aU="grid grid-cols-7 gap-xsmall",lU="flex items-center justify-center font-w-mid text-muted",iU="relative flex items-center justify-center",cU="relative z-10",uU="grid grid-cols-3",dU="grid grid-cols-4",fU="flex items-center justify-between border-t-token pt-small",mU=i.cn(i.hoverVariant(),"flex shrink-0 origin-center items-center justify-center rounded-base","text-muted focus-ring","disabled:cursor-not-allowed disabled:opacity-40"),pU="group/calendar-cell relative inline-flex origin-center items-center justify-center overflow-hidden outline-none focus-ring rounded-mid",CU=i.cn("pointer-events-none absolute -inset-px z-0 origin-center bg-primary",i.SURFACE_COLOR_TRANSITION,"motion-reduce:transition-none group-hover/calendar-cell:bg-primary-hover rounded-mid"),gU=i.cn(tU,i.TEXT_COLOR_TRANSITION),SU="relative z-[1] min-w-0 shrink-0 leading-none",hU="absolute bottom-[length:calc(var(--border-width)*3)] left-1/2 z-[1] h-[length:calc(var(--border-width)*3)] w-[length:calc(var(--border-width)*3)] -translate-x-1/2 rounded-full bg-primary",kc="icon-xsmall",xU="bg-transparent font-w-mid text-primary-foreground",bU="font-w-mid text-primary",AU="text-foreground",vU="cursor-not-allowed opacity-35",_U="cursor-pointer",LU="text-muted",TU="text-muted",EU={opacity:0};function RU(e){return i.cn(mU,Vz[e])}function IU(e,t,n){return i.cn(vS[e],t,n)}function yU(e,t,n,o){return i.cn(qz,n?Zz:Yz[e],zz[t],Uz[t],o)}function NU(e){return e==="left"?"left-0 right-1/2":"left-1/2 right-0"}function wU(e,t){return t==="day"?vS[e]:Kz[e]}function OU(e,t){return t==="day"?$z[e]:Xz[e]}function PU({selected:e,isToday:t,isCurrent:n}){return e?xU:t||n?bU:AU}function DU(e,t,n,o){return i.cn(pU,wU(e,t),PU({selected:n.selected,isToday:n.isToday,isCurrent:n.isCurrent}),!n.selected&&!n.disabled&&i.hoverVariant(),n.disabled?vU:_U,o)}function kU(e){return i.cn(lU,Gz[e])}function BU(e){return i.cn(uU,AS[e])}function jU(e){return i.cn(dU,AS[e])}function MU(e,t){return e&&!t?LU:void 0}function FU(e,t){return i.cn(gU,Wz[e],t!=="years"?nU:oU)}function HU(){const{viewDate:e,selectedDates:t,rangeStart:n,rangeEnd:o,hoverDate:r,mode:s,locale:l,minDate:u,maxDate:d,today:f}=Ne();return a.useMemo(()=>Pz({viewDate:e,selectedDates:t,rangeStart:n,rangeEnd:o,hoverDate:r,mode:s,locale:l,minDate:u,maxDate:d,today:f}),[e,t,n,o,r,s,l,u,d,f])}function GU(){const{viewDate:e,selectedDates:t,locale:n,today:o}=Ne();return a.useMemo(()=>Dz(e,t,n,o),[e,t,n,o])}function VU(){const{viewDate:e,selectedDates:t,today:n}=Ne();return a.useMemo(()=>kz(e,t,n),[e,t,n])}function zU(){const{view:e,viewDate:t,locale:n}=Ne();return a.useMemo(()=>yz(e,t,n),[e,t,n])}function Bc({visible:e,side:t}){const n=lt(),o=a.useRef(null),r=a.useRef(!0);return a.useLayoutEffect(()=>{const s=o.current;if(!s)return;const l=u=>{s.style.opacity=u?"1":"0"};if(i.prefersReducedMotion()){i.killMotion(s),l(e);return}if(r.current){r.current=!1,i.killMotion(s),l(e);return}i.killMotion(s),$.to(s,{autoAlpha:e?1:0,...i.motionContentFade(),overwrite:"auto"})},[e]),c.jsx("div",{ref:o,"aria-hidden":!0,className:i.cn(i.cn(Jz,NU(t)),n.rangeHalfFill),style:EU})}const Ri=a.forwardRef(function({direction:t,size:n,onClick:o,disabled:r,children:s,className:l,...u},d){const{navPrevIcon:f,navNextIcon:m}=Ne(),p=lt(),C=bS(r),S=t==="prev"?vz():_z(),g=t==="prev"?p.navPrev:p.navNext,h=t==="prev"?f:m,x=a.useCallback(b=>{C.buttonRef.current=b,ue(d,b)},[C.buttonRef,d]),A=t==="prev"?c.jsx(be.IoChevronBack,{className:i.cn(kc,p.navIcon)}):c.jsx(be.IoChevronForward,{className:i.cn(kc,p.navIcon)});return c.jsx("button",{ref:x,type:"button","aria-label":S,disabled:r,onClick:o,onPointerEnter:C.handlePointerEnter,onPointerLeave:C.handlePointerLeave,onPointerDown:C.handlePointerDown,className:i.cn(RU(n),g,l),...u,children:s??(h!==void 0?h:A)})});Ri.displayName="Calendar.NavButton";const Ii=a.forwardRef(function({size:t,onClick:n,...o},r){const{navigate:s,size:l}=Ne();return c.jsx(Ri,{ref:r,direction:"prev",size:t??l,onClick:u=>{n==null||n(u),u.defaultPrevented||s(-1)},...o})});Ii.displayName="Calendar.NavPrev";const yi=a.forwardRef(function({size:t,onClick:n,...o},r){const{navigate:s,size:l}=Ne();return c.jsx(Ri,{ref:r,direction:"next",size:t??l,onClick:u=>{n==null||n(u),u.defaultPrevented||s(1)},...o})});yi.displayName="Calendar.NavNext";const UU=a.forwardRef(function({selected:t,disabled:n=!1,size:o,ariaLabel:r,tabIndex:s,rovingKey:l,rounded:u="day",cellKind:d="day",isToday:f=!1,isCurrent:m=!1,className:p="",onPress:C,onMouseEnter:S,onMouseLeave:g,children:h},x){const A=a.useRef(null),b=a.useRef(C),_=a.useRef(S),L=a.useRef(g);b.current=C,_.current=S,L.current=g;const{bindFillRef:v}=dm(t,A),R=bS(n),T=lt(),E=d==="month"?T.monthCell:d==="year"?T.yearCell:T.dayCell,I=OU(o,u),O=a.useCallback(P=>{R.buttonRef.current=P,ue(x,P)},[R.buttonRef,x]),N=a.useCallback(()=>{n||b.current()},[n]),y=a.useCallback(P=>{var k;(k=_.current)==null||k.call(_),R.handlePointerEnter(P)},[R]),w=a.useCallback(P=>{var k;(k=L.current)==null||k.call(L),R.handlePointerLeave(P)},[R]);return c.jsxs("button",{ref:O,type:"button","aria-label":r,"aria-disabled":n||void 0,disabled:n,tabIndex:n?-1:s,"data-calendar-roving":l,onClick:N,onPointerEnter:y,onPointerLeave:w,onPointerDown:R.handlePointerDown,className:DU(o,u,{selected:t,disabled:n,isToday:f,isCurrent:m},i.cn(T.cell,E,p)),children:[c.jsx("span",{ref:v,"aria-hidden":!0,[cm]:"","data-pressed":t?"true":"false",className:i.cn(CU,T.cellFill)}),c.jsx(q,{variant:I,as:"span",inheritColor:!0,className:i.cn(SU,T.cellText),children:h}),f&&!t&&c.jsx("span",{"aria-hidden":!0,className:i.cn(hU,T.cellTodayDot)})]})});function WU(e,t){return e.selected===t.selected&&e.disabled===t.disabled&&e.size===t.size&&e.rounded===t.rounded&&e.cellKind===t.cellKind&&e.isToday===t.isToday&&e.isCurrent===t.isCurrent&&e.ariaLabel===t.ariaLabel&&e.tabIndex===t.tabIndex&&e.rovingKey===t.rovingKey&&e.className===t.className&&e.children===t.children}const Jn=a.memo(UU,WU),_S=a.forwardRef(function({size:t,...n},o){const{size:r}=Ne();return c.jsx(Jn,{ref:o,size:t??r,...n})});_S.displayName="Calendar.Day";function YU(){var v;const e=lt(),{setHoverDate:t,onDayPress:n,size:o,mode:r,locale:s,renderDay:l,focusedDate:u,moveDayFocus:d,viewDate:f,minDate:m,maxDate:p}=Ne(),C=HU(),S=a.useRef(null),g=a.useRef(!1),h=Pc(u),x=a.useMemo(()=>Ei(C,7),[C]),A=Tz(f.getMonth(),f.getFullYear(),s),_=C.some(R=>!!R.date&&!R.isDisabled&&De(R.date,u))?null:((v=C.find(R=>R.date&&!R.isDisabled))==null?void 0:v.date)??null;a.useLayoutEffect(()=>{var I;if(g.current){g.current=!1;const O=(I=S.current)==null?void 0:I.querySelector(`[data-calendar-roving="${h}"]`);O==null||O.focus({preventScroll:!0});return}const R=S.current;if(!R)return;const T=document.activeElement;if(T&&T!==document.body&&T!==document.documentElement&&R.contains(T)||T&&T!==document.body&&T!==document.documentElement)return;const E=R.querySelector(`[data-calendar-roving="${h}"]`);E==null||E.focus({preventScroll:!0})},[h,f]);const L=a.useCallback(R=>{const T=Mz(u,R.key,R.shiftKey,m,p);T&&(R.preventDefault(),g.current=!0,d(T))},[u,m,p,d]);return c.jsxs("div",{ref:S,role:"grid","aria-label":A,onKeyDown:L,children:[c.jsx("div",{role:"row",className:i.cn(sU,e.weekdayGrid),children:s.weekDays.map(R=>c.jsx("div",{role:"columnheader",className:i.cn(kU(o),e.weekdayCell),children:R},R))}),c.jsx("div",{className:i.cn(aU,e.daysGrid),children:x.map((R,T)=>c.jsx("div",{role:"row",className:"contents",children:R.map(E=>{if(E.day===null)return c.jsx("div",{role:"gridcell",className:IU(o,e.dayEmpty)},E.key);const I=l&&E.date?l(E.date,{day:E.day,selected:!!E.isSelected,disabled:!!E.isDisabled,isToday:!!E.isToday,isRangeStart:!!E.isRangeStart,isRangeEnd:!!E.isRangeEnd,circleActive:!!E.circleActive}):E.day,N=!!E.date&&De(E.date,u)||!!_&&!!E.date&&De(E.date,_);return c.jsxs("div",{role:"gridcell","aria-selected":E.circleActive?!0:void 0,className:i.cn(iU,e.dayCellWrapper),children:[E.showLeftBg?c.jsx(Bc,{visible:!0,side:"left"}):null,E.showRightBg?c.jsx(Bc,{visible:!0,side:"right"}):null,c.jsx(Jn,{selected:!!E.circleActive,disabled:E.isDisabled,isToday:E.isToday,size:o,cellKind:"day",ariaLabel:E.ariaLabel,tabIndex:N?0:-1,rovingKey:E.date?Pc(E.date):void 0,onPress:()=>E.date&&n(E.date),onMouseEnter:()=>r==="range"&&!E.isDisabled&&E.date&&t(E.date),onMouseLeave:()=>r==="range"&&t(null),className:cU,children:I})]},E.key)})},`week-${T}`))})]})}function $U(){const e=lt(),{onMonthPress:t,size:n,viewDate:o,focusedDate:r}=Ne(),s=GU(),l=a.useRef(null),u=a.useRef(!1),[d,f]=a.useState(()=>Math.min(11,Math.max(0,r.getMonth()))),m=a.useMemo(()=>Ei(s,3),[s]);a.useLayoutEffect(()=>{var S;if(!u.current)return;u.current=!1;const C=(S=l.current)==null?void 0:S.querySelector(`[data-calendar-roving="${d}"]`);C==null||C.focus({preventScroll:!0})},[d]);const p=a.useCallback(C=>{if(C.key==="Enter"||C.key===" "){C.preventDefault(),t(d);return}const S=Fz(d,C.key);S!=null&&(C.preventDefault(),u.current=!0,f(S))},[d,t]);return c.jsx("div",{ref:l,role:"grid","aria-label":Ez(o.getFullYear()),className:i.cn(BU(n),e.monthsGrid),onKeyDown:p,children:m.map((C,S)=>c.jsx("div",{role:"row",className:"contents",children:C.map(g=>c.jsx("div",{role:"gridcell","aria-selected":g.isSelected?!0:void 0,className:"contents",children:c.jsx(Jn,{selected:g.isSelected,isCurrent:g.isCurrentMonth,size:n,cellKind:"month",rounded:"picker",tabIndex:d===g.month?0:-1,rovingKey:String(g.month),ariaLabel:g.name,onPress:()=>{f(g.month),t(g.month)},children:g.name})},g.month))},`months-${S}`))})}function XU(){const e=lt(),{onYearPress:t,size:n,viewDate:o,focusedDate:r}=Ne(),s=VU(),l=a.useRef(null),u=a.useRef(!1),d=Math.max(0,s.findIndex(g=>g.year===r.getFullYear())),[f,m]=a.useState(d>=0?d:1),p=a.useMemo(()=>Ei(s,4),[s]),C=Math.floor(o.getFullYear()/10)*10;a.useLayoutEffect(()=>{var x,A;if(!u.current)return;u.current=!1;const g=(x=s[f])==null?void 0:x.year;if(g==null)return;const h=(A=l.current)==null?void 0:A.querySelector(`[data-calendar-roving="${g}"]`);h==null||h.focus({preventScroll:!0})},[f,s]);const S=a.useCallback(g=>{var A;const h=(A=s[f])==null?void 0:A.year;if((g.key==="Enter"||g.key===" ")&&h!=null){g.preventDefault(),t(h);return}const x=Hz(f,g.key);x!=null&&(g.preventDefault(),u.current=!0,m(x))},[f,t,s]);return c.jsx("div",{ref:l,role:"grid","aria-label":Rz(C),className:i.cn(jU(n),e.yearsGrid),onKeyDown:S,children:p.map((g,h)=>c.jsx("div",{role:"row",className:"contents",children:g.map((x,A)=>{const b=h*4+A;return c.jsx("div",{role:"gridcell","aria-selected":x.isSelected?!0:void 0,className:"contents",children:c.jsx(Jn,{selected:x.isSelected,isCurrent:x.isCurrentYear,size:n,cellKind:"year",rounded:"picker",tabIndex:f===b?0:-1,rovingKey:String(x.year),ariaLabel:String(x.year),onPress:()=>{m(b),t(x.year)},className:MU(x.outOfDecade,x.isSelected),children:x.year})},x.year)})},`years-${h}`))})}const Ni=a.forwardRef(function({className:t="",children:n,onClick:o,...r},s){const l=lt(),{view:u,setView:d,size:f}=Ne(),m=zU();return c.jsx("button",{ref:s,type:"button",disabled:u==="years",onClick:p=>{o==null||o(p),!p.defaultPrevented&&(u==="days"?d("months"):u==="months"&&d("years"))},className:i.cn(FU(f,u),l.headerTitle,t),...r,children:n??m})});Ni.displayName="Calendar.Title";const wi=a.forwardRef(function({className:t="",children:n,...o},r){const s=lt();return c.jsx("div",{ref:r,className:i.cn(eU,s.header,t),...o,children:n??c.jsxs(c.Fragment,{children:[c.jsx(Ii,{}),c.jsx(Ni,{}),c.jsx(yi,{})]})})}),Oi=a.forwardRef(function({className:t="",...n},o){const r=lt(),{view:s}=Ne();return c.jsxs("div",{ref:o,className:i.cn(rU,r.grid,t),...n,children:[s==="days"&&c.jsx(YU,{}),s==="months"&&c.jsx($U,{}),s==="years"&&c.jsx(XU,{})]})}),LS=a.forwardRef(function({className:t="",...n},o){const r=lt(),{onClear:s,onToday:l,locale:u}=Ne();return c.jsxs("div",{ref:o,className:i.cn(fU,r.footer,t),...n,children:[c.jsx(Vt,{variant:"ghost",size:"small",className:i.cn(TU,r.footerToday),onClick:l,children:u.today}),c.jsx(Vt,{variant:"ghost",size:"small",status:"danger",className:r.footerClear,onClick:s,children:u.clear})]})});wi.displayName="Calendar.Header";Oi.displayName="Calendar.Grid";LS.displayName="Calendar.Footer";Jn.displayName="CalendarInteractiveCell";function KU(){return c.jsxs(c.Fragment,{children:[c.jsx(wi,{}),c.jsx(Oi,{})]})}const TS={weekDays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"};function qU(e){const{mode:t="single",variant:n="default",size:o="base",defaultMonth:r,initialView:s="days",locale:l=TS,minDate:u,maxDate:d,navPrevIcon:f,navNextIcon:m,renderDay:p,value:C,defaultValue:S,onValueChange:g}=e,h=n==="gloss",x=a.useMemo(()=>Et(new Date),[]),A=C!==void 0,[b,_]=a.useState(()=>Bz(t,S)),L=A?C:b,v=a.useRef(L);v.current=L;const R=a.useCallback(M=>{const W=v.current,Y=typeof M=="function"?M(W):M;v.current=Y,A||_(Y),g==null||g(Y)},[A,g]),[T,E]=a.useState(s),[I,O]=a.useState(()=>Nz(r,t,L,x)),[N,y]=a.useState(null),[w,P]=a.useState(null),[k,j]=a.useState(()=>jz({mode:t,resolvedValue:L,today:x,minDate:u,maxDate:d})),B=a.useCallback(M=>{j(Pe(M,u,d))},[u,d]),D=a.useCallback(M=>{const W=Pe(M,u,d);j(W),O(new Date(W.getFullYear(),W.getMonth(),1))},[u,d]),F=a.useMemo(()=>hS(t,L),[t,L]),H=a.useMemo(()=>xS(t,N,L),[t,N,L]),U=a.useMemo(()=>wz(t,N,L),[t,N,L]),G=a.useCallback(M=>{O(W=>Oz(W,T,M)),j(W=>Pe(T==="days"?Os(W,M):T==="months"?Go(W,M):Go(W,M*10),u,d))},[T,u,d]),K=a.useCallback(M=>{const W=Et(M);if(j(W),t==="single")R(Y=>{const Z=Y instanceof Date?Y:null;return Z&&De(Z,W)?null:W});else if(t==="multiple")R(Y=>{const Z=Array.isArray(Y)?Y:[],ce=Z.findIndex(z=>De(z,W));return ce>=0?Z.filter((z,Q)=>Q!==ce):[...Z,W]});else if(!N)y(W),R({start:null,end:null});else if(De(W,N))y(null);else{const Y=W<=N?W:N,Z=W<=N?N:W;y(null),P(null),R({start:Y,end:Z})}},[t,N,R]),V=a.useCallback(M=>{const W=I.getFullYear();O(new Date(W,M,1)),j(Y=>{const Z=_r(W,M);return Pe(new Date(W,M,Math.min(Y.getDate(),Z)),u,d)}),E("days")},[I,u,d]),oe=a.useCallback(M=>{O(new Date(M,I.getMonth(),1)),j(W=>Pe(new Date(M,W.getMonth(),W.getDate()),u,d)),E("months")},[I,u,d]),J=a.useCallback(()=>{y(null),P(null),R(t==="single"?null:t==="multiple"?[]:{start:null,end:null})},[t,R]),ee=a.useCallback(()=>{O(new Date(x.getFullYear(),x.getMonth(),1)),j(Pe(x,u,d)),E("days")},[x,u,d]),se=a.useMemo(()=>({mode:t,view:T,setView:E,viewDate:I,navigate:G,focusedDate:k,setFocusedDate:B,moveDayFocus:D,selectedDates:F,rangeStart:H,rangeEnd:U,hoverDate:w,setHoverDate:P,onDayPress:K,onMonthPress:V,onYearPress:oe,onClear:J,onToday:ee,size:o,variant:n,locale:l,minDate:u,maxDate:d,today:x,navPrevIcon:f,navNextIcon:m,renderDay:p}),[t,T,I,G,k,B,D,F,H,U,w,K,V,oe,J,ee,o,n,l,u,d,x,f,m,p]);return{isGloss:h,variant:n,size:o,contextValue:se,today:x}}const ES=a.forwardRef(function(t,n){const{mode:o,variant:r,size:s,defaultMonth:l,initialView:u,locale:d,minDate:f,maxDate:m,navPrevIcon:p,navNextIcon:C,renderDay:S,value:g,defaultValue:h,onValueChange:x,classNames:A,children:b,className:_="",...L}=t,{isGloss:v,contextValue:R}=qU(t),T=i.useMergedGlossPanelRef(n,v),E=b??c.jsx(KU,{});return c.jsx(bz,{value:R,children:c.jsx(Az,{classNames:A,children:c.jsx("div",{ref:T,className:yU(R.variant,R.size,v,i.cn("",A==null?void 0:A.root,_)),...L,children:v?c.jsx("div",{className:i.cn(Qz,A==null?void 0:A.glossContent),children:E}):E})})})});ES.displayName="Calendar";const ZU=Object.assign(ES,{Header:wi,Grid:Oi,Footer:LS,NavPrev:Ii,NavNext:yi,Title:Ni,Day:_S}),RS=a.createContext(null),Ps=a.createContext({});function QU({value:e,children:t}){return c.jsx(RS.Provider,{value:e,children:t})}function JU({classNames:e,children:t}){const n=a.useContext(Ps),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ps.Provider,{value:o,children:t})}function kt(){const e=a.useContext(RS);if(!e)throw new Error("ColorPicker compound parts must be inside <ColorPicker>.");return e}function ln(){return a.useContext(Ps)}const e2=1,Dr=10;function t2(e=Se.colorPickerArea){return e}function n2(e,t,n=Se.colorPickerAreaValue){return pn(n,{saturation:e,brightness:t})}function o2(e=Se.colorPickerContent){return e}function r2(e=Se.colorPickerHex){return e}function s2(e=Se.colorPickerAlpha){return e}function a2(e,t=Se.colorPickerSelected){return pn(t,{hex:e})}function Mt(e,t,n){return Math.max(t,Math.min(n,e))}function zt({h:e,s:t,v:n,a:o}){const r=t/100,s=n/100,u=(e%360+360)%360/60,d=Math.floor(u),f=u-d,m=s*(1-r),p=s*(1-r*f),C=s*(1-r*(1-f));let S=0,g=0,h=0;switch(d%6){case 0:S=s,g=C,h=m;break;case 1:S=p,g=s,h=m;break;case 2:S=m,g=s,h=C;break;case 3:S=m,g=p,h=s;break;case 4:S=C,g=m,h=s;break;case 5:S=s,g=m,h=p;break}return{r:Math.round(S*255),g:Math.round(g*255),b:Math.round(h*255),a:o}}function IS({r:e,g:t,b:n,a:o}){const r=e/255,s=t/255,l=n/255,u=Math.max(r,s,l),d=Math.min(r,s,l),f=u-d;let m=0;return f>0&&(u===r?m=((s-l)/f+6)%6:u===s?m=(l-r)/f+2:m=(r-s)/f+4,m=Math.round(m*60)),{h:m,s:u===0?0:Math.round(f/u*100),v:Math.round(u*100),a:o}}function yS({r:e,g:t,b:n,a:o}){const r=l=>Math.round(Mt(l,0,255)).toString(16).padStart(2,"0"),s=`#${r(e)}${r(t)}${r(n)}`;return o<100?s+r(Math.round(o/100*255)):s}function NS(e){const t=e.replace(/^#/,"");return t.length===3?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:100}:t.length===6?{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:100}:t.length===8?{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:Math.round(parseInt(t.slice(6,8),16)/255*100)}:null}function Ao(e){return yS(zt(e))}function jc(e){const t=e.trim().replace(/^#/,"").toLowerCase();return t.length===3?`#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`:`#${t}`}function eo(e){const t=NS(e);return t?IS(t):null}function wS(e){const{r:t,g:n,b:o}=zt(e);return e.a<100?`rgba(${t},${n},${o},${(e.a/100).toFixed(2)})`:`rgb(${t},${n},${o})`}function Vo(e){const{r:t,g:n,b:o}=zt({h:e,s:100,v:100,a:100});return`rgb(${t},${n},${o})`}function l2(e,t){const n=t?"to right":"to top",{r:o,g:r,b:s}=zt(e);return{background:`linear-gradient(${n}, rgba(${o},${r},${s},0), rgb(${o},${r},${s}))`}}function i2({hsva:e,setHsva:t}){const n=a.useRef(null),o=a.useRef(null),r=a.useRef(!1),s=a.useCallback((d,f)=>{const m=n.current;if(!m)return;const p=m.getBoundingClientRect(),C=Mt((d-p.left)/p.width*100,0,100),S=Mt(100-(f-p.top)/p.height*100,0,100);t({...e,s:Math.round(C),v:Math.round(S)})},[e,t]);a.useEffect(()=>{const d=m=>{r.current&&s(m.clientX,m.clientY)},f=()=>{r.current=!1};return window.addEventListener("pointermove",d),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f),()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)}},[s]);const l=a.useCallback(d=>{var f;d.preventDefault(),r.current=!0,s(d.clientX,d.clientY),(f=o.current)==null||f.focus({preventScroll:!0})},[s]),u=a.useCallback(d=>{const m=d.shiftKey?Dr:e2;let p=e.s,C=e.v;switch(d.key){case"ArrowLeft":p=e.s-m;break;case"ArrowRight":p=e.s+m;break;case"ArrowUp":C=e.v+m;break;case"ArrowDown":C=e.v-m;break;case"Home":p=0;break;case"End":p=100;break;case"PageUp":C=e.v+Dr;break;case"PageDown":C=e.v-Dr;break;default:return}d.preventDefault(),t({...e,s:Math.round(Mt(p,0,100)),v:Math.round(Mt(C,0,100))})},[e,t]);return{areaRef:n,thumbRef:o,handlePointerDown:l,handleThumbKeyDown:u}}const OS="#3b82f6",c2={h:217,s:90,v:96,a:100};function u2(e,t){return eo(e??t??OS)??c2}const PS={small:"small",base:"base",mid:"mid",large:"large"},d2={small:"small",base:"base",mid:"mid",large:"large"},f2={small:"w-52",base:"w-64",mid:"w-72",large:"w-80"},m2={small:"h-32",base:"h-40",mid:"h-48",large:"h-56"},p2={small:"p-small gap-small",base:"p-mid gap-mid",mid:"p-large gap-large",large:"p-xlarge gap-xlarge"},C2="relative w-full touch-none select-none rounded-small cursor-crosshair overflow-hidden",g2="absolute z-10 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white [box-shadow:0_0_0_1px_var(--color-foreground),var(--shadow-mid)] focus-ring",S2="flex items-center gap-small",h2="flex min-w-0 flex-1 flex-col gap-xsmall",x2="flex min-w-0 items-center gap-small",b2="flex min-w-0 shrink items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring",A2="text-small text-muted select-none",v2=`w-[8ch] bg-transparent text-small font-mono uppercase text-foreground outline-none ${we}`,_2="flex shrink-0 items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring",L2=`w-8 bg-transparent text-right text-small font-mono text-foreground outline-none ${we}`,T2="text-small text-muted select-none",E2="flex flex-wrap gap-xsmall border-t-token pt-small",R2="flex flex-col text-foreground";function I2(e,t){return i.cn(R2,Ee(e).rounded,f2[e],p2[e],t)}function y2(e,t){return i.cn(C2,m2[e],t)}const N2="overflow-hidden",w2="opacity-48",Mc="flex flex-col gap-xsmall",O2="flex items-center justify-between",P2="text-muted",D2="font-w-mid text-foreground",k2={hue:"Hue",saturation:"Saturation",value:"Value",alpha:"Alpha",red:"Red",green:"Green",blue:"Blue"};function B2({size:e,orientation:t,disabled:n,className:o}){const r=t==="horizontal";return i.cn(hC({isHorizontal:r,size:e,className:o}),N2,Ye[e],n&&w2)}function j2(e,t,n){const o=n==="horizontal";if(e==="alpha")return l2(t,o);const r=o?"to right":"to top",{r:s,g:l,b:u}=zt(t);switch(e){case"hue":return{background:`linear-gradient(${r}, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)`};case"saturation":{const d=zt({...t,s:0}),f=Vo(t.h);return{background:`linear-gradient(${r}, rgb(${d.r},${d.g},${d.b}), ${f})`}}case"value":{const d=Vo(t.h);return{background:`linear-gradient(${r}, #000, ${d})`}}case"red":return{background:`linear-gradient(${r}, rgb(0,${l},${u}), rgb(255,${l},${u}))`};case"green":return{background:`linear-gradient(${r}, rgb(${s},0,${u}), rgb(${s},255,${u}))`};case"blue":return{background:`linear-gradient(${r}, rgb(${s},${l},0), rgb(${s},${l},255))`}}}const M2={hue:{min:0,max:360,step:1},saturation:{min:0,max:100,step:1},value:{min:0,max:100,step:1},alpha:{min:0,max:100,step:1},red:{min:0,max:255,step:1},green:{min:0,max:255,step:1},blue:{min:0,max:255,step:1}},DS={hue:0,saturation:100,value:100,alpha:100,red:255,green:0,blue:0},Pn=a.forwardRef(function({channel:t,color:n={h:0,s:100,v:100,a:100},value:o,defaultValue:r,onValueChange:s,size:l="base",orientation:u="horizontal",disabled:d=!1,className:f="",...m},p){const{min:C,max:S,step:g}=M2[t],[h,x]=Re({value:o,defaultValue:r??DS[t]}),A=a.useRef(!1),b=a.useRef(null),[_,L]=a.useState(!1),[v,R]=a.useState(0),T=a.useMemo(()=>SC(void 0,l),[l]),[E,I]=a.useState(T);a.useLayoutEffect(()=>{const D=b.current;if(!D)return;const F=()=>{const U=D.getBoundingClientRect(),{trackSpanPx:G,thumbSpanPx:K}=xo(U,u);R(G),K>0&&I(V=>V===K?V:K)};F();const H=new ResizeObserver(F);return H.observe(D),()=>H.disconnect()},[u]);const O=a.useCallback(D=>{b.current=D,typeof p=="function"?p(D):p&&(p.current=D)},[p]),N=a.useCallback(D=>{const F=Mt(Math.round(D/g)*g,C,S);x(F),s==null||s(F)},[C,S,g,x,s]),y=E>0?E:T,w=a.useCallback((D,F)=>{const H=b.current;if(!H||d)return;const U=H.getBoundingClientRect();N(Cs(D,F,U,u,C,S,y))},[d,y,N,S,C,u]);a.useEffect(()=>{const D=H=>{A.current&&w(H.clientX,H.clientY)},F=()=>{A.current=!1,L(!1)};return window.addEventListener("pointermove",D),window.addEventListener("pointerup",F),window.addEventListener("pointercancel",F),()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",F),window.removeEventListener("pointercancel",F)}},[w]);const P=a.useCallback(D=>{d||D.button!==0||(D.preventDefault(),A.current=!0,L(!0),w(D.clientX,D.clientY))},[d,w]),k=a.useCallback(D=>{d||D.button!==0||(D.stopPropagation(),A.current=!0,L(!0),D.currentTarget.setPointerCapture(D.pointerId))},[d]),j=a.useCallback(D=>{if(d)return;let F=0;if(u==="horizontal"){if(D.key==="ArrowRight")F=g;else if(D.key==="ArrowLeft")F=-g;else if(D.key==="PageUp")F=g*10;else if(D.key==="PageDown")F=-g*10;else if(D.key==="Home"){N(C);return}else if(D.key==="End"){N(S);return}}else if(D.key==="ArrowUp")F=g;else if(D.key==="ArrowDown")F=-g;else if(D.key==="Home"){N(C);return}else if(D.key==="End"){N(S);return}F!==0&&(D.preventDefault(),N(h+F))},[d,u,g,C,S,h,N]),B=ps(h,C,S,v,y);return c.jsx("div",{ref:O,role:"presentation",className:B2({size:l,orientation:u,disabled:d,className:f}),style:j2(t,n,u),onPointerDown:P,...m,children:c.jsx(yn,{size:l,percent:B,orientation:u,disabled:d,active:_,ariaLabel:k2[t],ariaValueNow:h,ariaValueMin:C,ariaValueMax:S,onPointerDown:k,onKeyDown:j})})});Pn.displayName="ColorSliderTrack";const kS=a.forwardRef(function({channel:t,color:n,label:o,size:r="base",orientation:s="horizontal",className:l="",children:u,...d},f){return u?c.jsx("div",{ref:f,className:i.cn(Mc,l),children:u}):c.jsxs("div",{ref:f,className:i.cn(Mc,l),children:[o?c.jsxs("div",{className:O2,children:[c.jsx(q,{as:"span",variant:"small",className:P2,children:o}),c.jsx(q,{as:"span",variant:"small",className:D2,children:d.value??d.defaultValue??DS[t]})]}):null,c.jsx(Pn,{channel:t,color:n,size:r,orientation:s,...d})]})});kS.displayName="ColorSliderRoot";const Fc={small:"h-5 w-5",base:"h-6 w-6",mid:"h-7 w-7",large:"h-8 w-8"},Hc={circle:"rounded-full",rounded:"rounded-small",square:"rounded-none"};function F2(e,t){if(typeof t["aria-label"]=="string")return t["aria-label"];if(typeof t["aria-labelledby"]!="string")return`Select color ${e}`}const to=a.forwardRef(function({color:t="transparent",size:n="base",shape:o="rounded",selected:r=!1,disabled:s=!1,className:l="",onClick:u,onPointerEnter:d,onPointerLeave:f,onPointerDown:m,...p},C){const{setRefs:S,handlePointerEnter:g,handlePointerLeave:h,handlePointerDown:x}=Uo({isGloss:!1,enabled:!s,hasHoverShadow:!0,forwardedRef:C,onPointerEnter:d,onPointerLeave:f,onPointerDown:m}),{"aria-label":A,...b}=p,_=!!u,L=typeof A=="string"||typeof b["aria-labelledby"]=="string";if(!_&&!L)return c.jsx("span",{"aria-hidden":!0,className:i.cn("relative shrink-0 overflow-hidden",Fc[n],Hc[o],l),style:{backgroundColor:t}});const v=A??(_?F2(t,p):void 0);return c.jsx("button",{ref:S,type:"button",disabled:s,onClick:u,onPointerEnter:g,onPointerLeave:h,onPointerDown:x,"aria-label":v,className:i.cn("relative shrink-0 origin-center overflow-hidden","outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",i.SHADOW_LIFT_MOTION_CLASS,Fc[n],Hc[o],r&&"ring-2 ring-primary ring-offset-2 ring-offset-background",s?"cursor-not-allowed opacity-40":u?"cursor-pointer":"cursor-default",l),style:{backgroundColor:t},...b})});to.displayName="ColorSwatch";const Pi=a.forwardRef(function({className:t,onPointerDown:n,style:o,...r},s){const l=Ie(),{hsva:u,setHsva:d,size:f}=kt(),m=ln(),{areaRef:p,thumbRef:C,handlePointerDown:S,handleThumbKeyDown:g}=i2({hsva:u,setHsva:d}),h=a.useCallback(b=>{p.current=b,ue(s,b)},[p,s]),x=Vo(u.h),A=wS(u);return c.jsx("div",{ref:h,role:"group",className:y2(f,i.cn(m.area,t)),style:{background:`linear-gradient(to bottom, transparent, #000), linear-gradient(to right, #fff, ${x})`,...o},onPointerDown:b=>{n==null||n(b),b.defaultPrevented||S(b)},...r,children:c.jsx("button",{ref:C,type:"button",role:"slider",tabIndex:0,"aria-label":t2(l.colorPickerArea),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u.s,"aria-valuetext":n2(u.s,u.v,l.colorPickerAreaValue),className:i.cn(g2,m.areaThumb),style:{left:`${u.s}%`,top:`${100-u.v}%`,width:"14px",height:"14px",backgroundColor:A},onKeyDown:g,onPointerDown:b=>{b.stopPropagation(),S(b)}})})});Pi.displayName="ColorPicker.Area";const Di=a.forwardRef(function({className:t,...n},o){const r=Ie(),{hex:s,setHsva:l}=kt(),u=ln(),[d,f]=a.useState(!1),[m,p]=a.useState(""),C=a.useCallback(g=>{const h=`#${g}`,x=eo(h);x&&l(x)},[l]),S=d?m:s.slice(1);return c.jsxs("div",{ref:o,className:i.cn(b2,u.hexInput,t),...n,children:[c.jsx("span",{className:i.cn(A2,u.hexPrefix),children:"#"}),c.jsx("input",{type:"text",value:S,maxLength:8,spellCheck:!1,"aria-label":r2(r.colorPickerHex),className:i.cn(v2,u.hexInputField,we),onFocus:()=>{f(!0),p(s.slice(1))},onChange:g=>p(g.target.value.replace(/[^0-9a-fA-F]/g,"").toUpperCase()),onBlur:()=>{C(m),f(!1)},onKeyDown:g=>{g.key==="Enter"&&(C(m),f(!1))}})]})});Di.displayName="ColorPicker.HexInput";const ki=a.forwardRef(function({className:t,...n},o){const r=Ie(),{hsva:s,setHsva:l}=kt(),u=ln();return c.jsxs("div",{ref:o,className:i.cn(_2,u.alphaInput,t),...n,children:[c.jsx("input",{type:"text",value:Math.round(s.a),"aria-label":s2(r.colorPickerAlpha),className:i.cn(L2,u.alphaInputField,we),onChange:d=>{const f=parseInt(d.target.value,10);Number.isNaN(f)||l({...s,a:Mt(f,0,100)})}}),c.jsx("span",{className:i.cn(T2,u.alphaSuffix),children:"%"})]})});ki.displayName="ColorPicker.AlphaInput";const Bi=a.forwardRef(function({presets:t,className:n,...o},r){const{hex:s,setHsva:l,size:u}=kt(),d=ln();return c.jsx("div",{ref:r,className:i.cn(E2,d.presets,n),...o,children:t.map(f=>c.jsx(to,{color:f,size:PS[u],shape:"rounded",selected:s.toLowerCase()===f.toLowerCase(),className:d.presetSwatch,onClick:()=>{const m=eo(f);m&&l(m)}},f))})});Bi.displayName="ColorPicker.Presets";function H2({showAlpha:e,presets:t}){const{hsva:n,setHsva:o,hex:r,size:s}=kt(),l=ln(),u=d2[s];return c.jsxs(c.Fragment,{children:[c.jsx(Pi,{}),c.jsxs("div",{className:i.cn(S2,l.slidersRow),children:[c.jsx(to,{color:r,size:"mid",shape:"circle",className:i.cn("shrink-0",l.previewSwatch)}),c.jsxs("div",{className:i.cn(h2,l.slidersStack),children:[c.jsx(Pn,{channel:"hue",color:n,value:n.h,size:u,className:l.hueSlider,onValueChange:d=>o({...n,h:d})}),e?c.jsx(Pn,{channel:"alpha",color:n,value:n.a,size:u,className:l.alphaSlider,onValueChange:d=>o({...n,a:d})}):null]})]}),c.jsxs("div",{className:i.cn(x2,l.inputsRow),children:[c.jsx(Di,{}),e?c.jsx(ki,{}):null]}),t&&t.length>0?c.jsx(Bi,{presets:t}):null]})}const BS=a.forwardRef(function({swatchSize:t,className:n,children:o,asChild:r,...s},l){const u=Ie(),{hex:d,disabled:f,size:m}=kt(),p=ln();return c.jsx(ke.Trigger,{ref:l,asChild:r,className:i.cn(p.trigger,n),...s,children:o??c.jsx(to,{color:d,size:t??PS[m],shape:"rounded",disabled:f,"aria-label":a2(d,u.colorPickerSelected)})})});BS.displayName="ColorPicker.Trigger";const jS=a.forwardRef(function({showAlpha:t=!1,presets:n,className:o,children:r,...s},l){const u=Ie(),{size:d}=kt(),f=ln();return c.jsx(ke.Content,{ref:l,unstyled:!0,offset:Gn,align:"start","aria-label":o2(u.colorPickerContent),className:i.cn(f.content,o),...s,children:c.jsx("div",{className:I2(d,f.contentPanel),children:r??c.jsx(H2,{showAlpha:t,presets:n})})})});jS.displayName="ColorPicker.Content";function G2({value:e,defaultValue:t=OS,onValueChange:n,size:o="base",disabled:r=!1}){const s=e!==void 0,[l,u]=a.useState(()=>u2(e,t));a.useLayoutEffect(()=>{!s||e==null||u(p=>jc(e)===jc(Ao(p))?p:eo(e)??p)},[s,e]);const d=a.useCallback(p=>{u(p),n==null||n(Ao(p))},[n]),f=Ao(l);return{contextValue:a.useMemo(()=>({hsva:l,setHsva:d,hex:f,disabled:r,size:o}),[l,d,f,r,o])}}function MS({children:e,value:t,defaultValue:n,onValueChange:o,open:r,defaultOpen:s=!1,onOpenChange:l,size:u="base",variant:d="default",side:f="bottom",disabled:m=!1,classNames:p}){const{contextValue:C}=G2({value:t,defaultValue:n,onValueChange:o,size:u,disabled:m});return c.jsx(QU,{value:C,children:c.jsx(JU,{classNames:p,children:c.jsx(ke,{open:r,defaultOpen:s,onOpenChange:l,size:u,side:f,variant:d==="gloss"?"gloss":"default",children:e})})})}MS.displayName="ColorPicker";const V2=Object.assign(MS,{Trigger:BS,Content:jS,Area:Pi,HexInput:Di,AlphaInput:ki,Presets:Bi}),z2=Object.assign(kS,{Track:Pn}),ji=a.createContext(null),Ds=a.createContext({});function U2({value:e,children:t}){return c.jsx(ji.Provider,{value:e,children:t})}function W2({classNames:e,children:t}){const n=a.useContext(Ds),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Ds.Provider,{value:o,children:t})}function FS(){const e=a.useContext(ji);if(!e)throw new Error("Components TimeField must be inside <TimeField>.");return e}function Y2(){return a.useContext(ji)}function no(){return a.useContext(Ds)}function $2({labelConnected:e,labelId:t,timeLabel:n=Se.time}){return{"aria-label":e?void 0:n,"aria-labelledby":e?t:void 0}}function X2(e,t=Se){switch(e){case"h":return t.timeHours;case"m":return t.timeMinutes;case"s":return t.timeSeconds}}function K2({seg:e,value:t,required:n,isDanger:o,isFirstSegment:r,disabled:s,segLabel:l}){return{role:"spinbutton","aria-label":l,"aria-valuemin":0,"aria-valuemax":e==="h"?23:59,"aria-valuenow":t,"aria-valuetext":String(t).padStart(2,"0"),"aria-required":r&&n?!0:void 0,"aria-invalid":r&&o?!0:void 0,tabIndex:s?-1:0}}function q2(e){return e==="danger"||e==="default"?"default":e}function Z2(e){return e==="segmented"||e==="gloss"?"default":e}const Q2="bg-primary-tint",J2="border-r-token",eW="border-l-token",tW=`pointer-events-none absolute h-px w-px opacity-0 ${we}`,nW="inline-flex min-w-[2ch] select-none items-center justify-center outline-none",oW="h-[1.65em] min-w-[2.25ch] rounded-xsmall px-xsmall bg-default-hover",rW="rounded-xsmall px-[length:calc(var(--border-width)*2)]",sW="bg-primary text-primary-foreground",aW="cursor-not-allowed",lW="cursor-default",iW="inline-flex w-[0.45em] shrink-0 select-none items-center justify-center self-center text-muted",cW="mx-[length:var(--border-width)]",uW="inline-flex items-center",dW="relative flex min-w-0 flex-1 items-center font-mono tabular-nums leading-none",fW="flex min-w-0 w-full items-stretch",mW="gap-xsmall",pW={small:i.affixSlotClass("small"),base:i.affixSlotClass("base"),mid:i.affixSlotClass("mid"),large:i.affixSlotClass("large")};function CW(e="default"){return Q2}function gW({side:e,status:t,size:n,slotClass:o}){return i.cn(pW[n],CW(t),e==="prefix"?J2:eW,o)}function SW({variant:e}){return i.resolveFieldShellSurfaceClass({variant:e==="segmented"?"default":e})}function hW({variant:e,status:t,disabled:n,compact:o,shellSurface:r,glossShellHoverMotionClass:s,standardShellHoverMotionClass:l,slotClass:u,className:d}){const f=e==="gloss";return i.cn("m-0 min-w-0 overflow-hidden rounded-base p-0",f?"relative":i.cn("border-1"),o?"w-fit shrink-0":"w-full min-w-0",r,i.FIELD_SHELL_TRANSITION_CLASS,i.fieldShellFocusRingClass(t),f?"":i.fieldShellHoverClass(!n,t,Z2(e)),f?s:l,n?"cursor-not-allowed opacity-55 shadow-token-base":"",u,d)}function xW({variant:e,slotClass:t}){const n=e==="gloss";return i.cn(fW,!n&&i.cn("min-h-full"),t)}function bW({slotClass:e}={}){return i.cn(uW,e)}function AW({variant:e,size:t,compact:n,slotClass:o}){const r=i.CONTROL_SIZE_LAYOUT[t],s=r.controlText==="small"?"text-small":r.controlText==="mid"?"text-mid":"text-base";return i.cn(dW,n?"justify-center px-small":r.padX,r.padY,e==="segmented"&&mW,s,o)}function vW({variant:e,focused:t,disabled:n,slotClass:o}){return i.cn(nW,e==="segmented"?oW:rW,t&&sW,n?aW:lW,o)}function _W({variant:e,slotClass:t}){return i.cn(iW,e==="segmented"&&cW,t)}function LW({compact:e,slotClass:t,className:n}){return i.cn(e&&"w-fit",t,n)}const ks={h:23,m:59,s:59};function Gc(e){const t=e.split(":").map(Number);return{h:Number.isFinite(t[0])?Math.max(0,Math.min(23,t[0])):0,m:Number.isFinite(t[1])?Math.max(0,Math.min(59,t[1])):0,s:Number.isFinite(t[2])?Math.max(0,Math.min(59,t[2])):0}}function TW(e,t){const n=String(e.h).padStart(2,"0"),o=String(e.m).padStart(2,"0"),r=String(e.s).padStart(2,"0");return t==="HH:mm:ss"?`${n}:${o}:${r}`:`${n}:${o}`}function Vc(e,t){return e[t]}function Tt(e,t,n){const o=Math.max(0,Math.min(ks[t],n));return{...e,[t]:o}}function EW(e){return e==="HH:mm:ss"?["h","m","s"]:["h","m"]}function RW({shellRef:e,disabled:t,variant:n,onPointerDown:o,onPointerEnter:r,onPointerLeave:s}){const l=n==="gloss",u=i.useFieldShellHoverLift(e,!t&&!l),d=i.useGlossFieldShellMotion(e,!t&&l),f=a.useCallback((S,g)=>{g(S),!t&&l&&d.bindShellRef(S)},[t,d,l]),m=a.useCallback(S=>{if(o==null||o(S),S.defaultPrevented||t||l)return;const g=e.current;!g||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(g)},[t,l,o,e]),p=a.useCallback(S=>{r==null||r(S),!S.defaultPrevented&&(l?d.onShellPointerEnter(S):u.onShellPointerEnter(S))},[d,l,r,u]),C=a.useCallback(S=>{s==null||s(S),l?d.onShellPointerLeave(S):u.onShellPointerLeave(S)},[d,l,s,u]);return{isGloss:l,bindShellRef:f,shellPointerDown:l&&!t?d.onShellPointerDown:m,shellPointerEnter:p,shellPointerLeave:C,shellFocusCapture:l&&!t?d.onShellFocusIn:void 0,shellBlurCapture:l&&!t?d.onShellFocusOut:void 0,glossShellHoverMotionClass:d.shellHoverMotionClass,standardShellHoverMotionClass:u.shellHoverMotionClass}}function IW({value:e,defaultValue:t="00:00",onValueChange:n,format:o="HH:mm",disabled:r=!1,size:s,status:l,variant:u,compact:d,id:f,onPointerDown:m,onPointerEnter:p,onPointerLeave:C,ref:S}){const g=St("time"),h=Y2(),x=s??(h==null?void 0:h.size)??"base",A=l??(h==null?void 0:h.status)??"default",b=u??(h==null?void 0:h.variant)??"default",_=d??(h==null?void 0:h.compact)??!1,L=b==="gloss",v=h==null?void 0:h.fieldId,R=(h==null?void 0:h.labelId)??"",T=(h==null?void 0:h.labelConnected)??!1,E=(h==null?void 0:h.required)??!1,[I,O]=Re({value:e!==void 0?Gc(e):void 0,defaultValue:()=>Gc(t),onChange:X=>n==null?void 0:n(TW(X,o))}),N=a.useRef(null),[y,w]=a.useState(null),P=a.useRef(null),k=a.useRef(null),j=a.useRef(null),B=a.useRef(null),D=a.useRef(null),F=a.useMemo(()=>({h:j,m:B,s:D}),[]),H=a.useMemo(()=>EW(o),[o]),U=a.useCallback(X=>{P.current=X,typeof S=="function"?S(X):S&&(S.current=X)},[S]),G=RW({shellRef:P,disabled:r,variant:b,onPointerDown:m,onPointerEnter:p,onPointerLeave:C}),K=a.useCallback(X=>{G.bindShellRef(X,U)},[U,G]),V=a.useCallback(X=>{var re,pe;N.current=null,w(X),(re=P.current)==null||re.scrollIntoView({block:"nearest",inline:"center"}),(pe=k.current)==null||pe.focus({preventScroll:!0})},[]),oe=a.useCallback((X,re)=>{const pe=H.indexOf(X);re==="next"&&pe<H.length-1&&V(H[pe+1]),re==="prev"&&pe>0&&V(H[pe-1])},[H,V]),J=a.useCallback(()=>{const X=N.current;X&&(O(Tt(I,X.seg,X.digit)),N.current=null)},[I,O]),ee=a.useCallback((X,re)=>{const pe=ks[X],fe=N.current;if(fe&&fe.seg===X){const _e=fe.digit*10+re;_e>pe?(O(Tt(I,X,fe.digit)),re*10>pe?(O(Tt(I,X,Math.min(re,pe))),N.current=null,oe(X,"next")):N.current={seg:X,digit:re}):(O(Tt(I,X,_e)),N.current=null,oe(X,"next"))}else re*10>pe?(O(Tt(I,X,Math.min(re,pe))),N.current=null,oe(X,"next")):(N.current={seg:X,digit:re},O(Tt(I,X,re)))},[I,oe,O]),se=a.useCallback((X,re)=>{if(r)return;const pe=ks[re],fe=parseInt(X.key,10);if(!Number.isNaN(fe))X.preventDefault(),ee(re,fe);else if(X.key==="ArrowUp"){X.preventDefault(),N.current=null;const _e=Vc(I,re);O(Tt(I,re,_e>=pe?0:_e+1))}else if(X.key==="ArrowDown"){X.preventDefault(),N.current=null;const _e=Vc(I,re);O(Tt(I,re,_e<=0?pe:_e-1))}else X.key==="ArrowLeft"||X.key==="Backspace"?(X.preventDefault(),J(),oe(re,"prev")):X.key==="ArrowRight"?(X.preventDefault(),J(),oe(re,"next")):X.key==="Tab"&&J()},[ee,J,r,I,oe,O]),M=a.useCallback(X=>{const re=P.current,pe=X.relatedTarget;if(!(re&&pe&&re.contains(pe))){if(re&&pe==null){requestAnimationFrame(()=>{const fe=document.activeElement;re.contains(fe)||(J(),w(null))});return}J(),w(null)}},[J]),W=a.useCallback(X=>{N.current=null,w(X)},[]),Y=a.useCallback(X=>{const re=X.currentTarget.value;if(X.currentTarget.value="",!(r||!y))for(const pe of re){const fe=parseInt(pe,10);Number.isNaN(fe)||ee(y,fe)}},[ee,r,y]),Z=a.useCallback(X=>{r||!y||se(X,y)},[r,y,se]),ce=a.useCallback((X,re)=>{X.stopPropagation(),V(re)},[V]),z=a.useCallback(X=>{if(r)return;const re=H[0];re&&(X.target instanceof Element&&X.target.closest('[role="spinbutton"]')||V(re))},[r,V,H]),Q=X=>{var re;return((re=N.current)==null?void 0:re.seg)===X&&y===X},te=X=>Q(X)?String(N.current.digit):String(I[X]).padStart(2,"0"),me=SW({variant:b}),Ae=$2({labelConnected:T,labelId:R,timeLabel:g}),he=je(h!=null&&h.hintConnected?h.hintId:void 0,h!=null&&h.errorConnected?h.errorId:void 0);return{size:x,status:A,variant:b,compact:_,disabled:r,isGloss:L,format:o,fieldId:v,controlId:f??v,shellAria:Ae,ariaDescribedBy:he,required:E,hms:I,segments:H,segRefById:F,keyboardInputRef:k,bindShellRef:K,shellMotion:G,shellSurface:me,focusedSeg:y,handleSegKeyDown:se,handleFieldBlur:M,handleSegFocus:W,handleKeyboardInput:Y,handleKeyboardInputKeyDown:Z,handleSegClick:ce,handleShellClick:z,segDisplay:te}}function zc({side:e,status:t,size:n,className:o,children:r}){return c.jsx("span",{className:gW({side:e,status:t,size:n,slotClass:o}),children:r})}const Mi=a.forwardRef(function(t,n){const{value:o,defaultValue:r,onValueChange:s,format:l,disabled:u,size:d,status:f,variant:m,compact:p,prefix:C,suffix:S,segmentSeparator:g,className:h,id:x,onPointerDown:A,onPointerEnter:b,onPointerLeave:_,...L}=t,v=Ie(),R=no(),T=IW({value:o,defaultValue:r,onValueChange:s,format:l,disabled:u,size:d,status:f,variant:m,compact:p,id:x,onPointerDown:A,onPointerEnter:b,onPointerLeave:_,ref:n});return c.jsx("fieldset",{ref:T.bindShellRef,id:T.controlId,"aria-label":T.shellAria["aria-label"],"aria-labelledby":T.shellAria["aria-labelledby"],"aria-describedby":T.ariaDescribedBy,"data-slot":"timefield-shell",onPointerDown:T.shellMotion.shellPointerDown,onPointerEnter:T.shellMotion.shellPointerEnter,onPointerLeave:T.shellMotion.shellPointerLeave,onFocusCapture:T.shellMotion.shellFocusCapture,onBlurCapture:T.shellMotion.shellBlurCapture,...T.disabled&&T.isGloss?{"data-gloss-disabled":""}:{},className:hW({variant:T.variant,status:T.status,disabled:T.disabled,size:T.size,compact:T.compact,shellSurface:T.shellSurface,glossShellHoverMotionClass:T.shellMotion.glossShellHoverMotionClass,standardShellHoverMotionClass:T.shellMotion.standardShellHoverMotionClass,slotClass:R.shell,className:h}),...L,children:c.jsxs("div",{className:xW({variant:T.variant,slotClass:R.shellInner}),onClick:T.handleShellClick,children:[C!=null?c.jsx(zc,{side:"prefix",status:T.status,size:T.size,className:R.prefix,children:C}):null,c.jsxs("div",{className:AW({variant:T.variant,size:T.size,compact:T.compact,slotClass:R.segments}),children:[c.jsx("input",{ref:T.keyboardInputRef,type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"off","aria-hidden":!0,tabIndex:-1,disabled:T.disabled,className:i.cn(tW,R.keyboardInput,we),onInput:T.handleKeyboardInput,onKeyDown:T.handleKeyboardInputKeyDown,onBlur:T.handleFieldBlur}),T.segments.map((E,I)=>c.jsxs("span",{className:bW({slotClass:R.segmentGroup}),children:[I>0&&c.jsx("span",{"aria-hidden":!0,className:_W({variant:T.variant,slotClass:R.segmentSeparator}),children:g??":"}),c.jsx("span",{ref:T.segRefById[E],...K2({seg:E,value:T.hms[E],required:T.required,isDanger:T.status==="danger",isFirstSegment:E===T.segments[0],disabled:T.disabled,segLabel:X2(E,v)}),className:vW({variant:T.variant,focused:T.focusedSeg===E,disabled:T.disabled,slotClass:R.segment}),onKeyDown:O=>T.handleSegKeyDown(O,E),onFocus:()=>T.handleSegFocus(E),onBlur:T.handleFieldBlur,onClick:O=>T.handleSegClick(O,E),children:T.segDisplay(E)})]},E))]}),S!=null?c.jsx(zc,{side:"suffix",status:T.status,size:T.size,className:R.suffix,children:S}):null]})})});Mi.displayName="TimeFieldControl";function HS({className:e,classNames:t,...n}){const o=no();return c.jsx(ve,{className:e,classNames:{...t,root:i.cn(o.label,t==null?void 0:t.root)},...n})}HS.displayName="TimeFieldLabel";function Fi({children:e,id:t,className:n,...o}){const r=FS(),s=no();return c.jsx(le.Hint,{id:t??r.hintId,status:q2(r.status),className:i.cn(s.hint,n),...o,children:e})}Fi.displayName="TimeFieldHint";function Hi({children:e,id:t,className:n,...o}){const r=FS(),s=no();return c.jsx(le.Error,{id:t??r.errorId,role:"alert",className:i.cn(s.error,n),...o,children:e})}Hi.displayName="TimeFieldError";function yW({label:e,hint:t,error:n,labelId:o,controlProps:r}){const s=no();return c.jsxs(c.Fragment,{children:[e!=null?c.jsx(ve,{id:o,classNames:{root:s.label},children:e}):null,c.jsx(Mi,{...r}),t!=null&&c.jsx(Fi,{children:t}),n!=null&&c.jsx(Hi,{children:n})]})}function NW({children:e,label:t,hint:n,error:o,id:r,required:s=!1,status:l="default",size:u="base",variant:d="default",compact:f=!1}){const m=a.useId(),p=r??`timefield-${m}`,C=Ve(p),S=ze(p),g=`${p}-label`,{isCompound:h,hasLabel:x,hasHint:A,hasError:b}=a.useMemo(()=>{const v=Ue(e);return{isCompound:v,hasLabel:t!=null||v&&ge(e,"Label"),hasHint:n!=null||v&&ge(e,"TimeFieldHint"),hasError:o!=null||v&&ge(e,"TimeFieldError")}},[e,o,n,t]),_=a.useMemo(()=>({fieldId:p,labelId:g,labelConnected:x,hintId:C,errorId:S,hintConnected:A,errorConnected:b,required:s,status:l,size:u,variant:d,compact:f}),[f,S,p,b,A,x,C,s,g,u,l,d]),L=a.useMemo(()=>({labelId:g,required:s}),[g,s]);return{fieldCtx:_,fieldLabelCtx:L,isCompound:h,fieldId:p,label:t,hint:n,error:o,status:l,size:u,variant:d,compact:f}}function GS({children:e,label:t,hint:n,error:o,className:r,classNames:s,id:l,required:u=!1,status:d="default",size:f="base",variant:m="default",value:p,defaultValue:C,onValueChange:S,format:g,disabled:h,compact:x=!1,prefix:A,suffix:b,segmentSeparator:_,...L}){const v=NW({children:e,label:t,hint:n,error:o,id:l,required:u,status:d,size:f,variant:m,compact:x}),R=v.isCompound?e:c.jsx(yW,{label:v.label,hint:v.hint,error:v.error,labelId:v.fieldCtx.labelId,controlProps:{id:v.fieldId,value:p,defaultValue:C,onValueChange:S,format:g,disabled:h,size:v.size,status:v.status,variant:v.variant,compact:v.compact,prefix:A,suffix:b,segmentSeparator:_}});return c.jsx(U2,{value:v.fieldCtx,children:c.jsx(W2,{classNames:s,children:c.jsx(Ge.Provider,{value:v.fieldLabelCtx,children:c.jsx(le,{className:LW({compact:v.compact,slotClass:s==null?void 0:s.root,className:r}),...L,children:R})})})})}GS.displayName="TimeField";const wW=Object.assign(GS,{Label:HS,Control:Mi,Hint:Fi,Error:Hi});function Lr(){return{"aria-hidden":!0,role:"presentation"}}function OW(e){return{"aria-busy":e,"aria-live":"polite"}}const Tr="relative overflow-hidden bg-primary-tint",PW="pointer-events-none absolute inset-0 -translate-x-full",DW="rounded-full",kW="h-control-base w-control-base",BW="flex flex-col gap-small",jW="h-[1em] rounded-small",MW="w-3/5",FW="w-full",HW="rounded-mid px-large py-mid",GW={none:"rounded-none",small:"rounded-small",mid:"rounded-mid",full:"rounded-full"},VW="skeleton-pulse 1.6s ease-in-out infinite",zW="skeleton-wave-slide 2s linear 0.2s infinite",UW="skeleton-shimmer 2s linear infinite",WW="linear-gradient(90deg, transparent 0%, var(--color-primary-tint-strong) 50%, transparent 100%)",YW="linear-gradient(90deg, var(--color-primary-tint) 0%, var(--color-primary-tint-strong) 50%, var(--color-primary-tint) 100%)";function $W(){return{animation:VW}}function XW(){return{backgroundImage:YW,backgroundSize:"400% 100%",animation:UW}}function Er(e){return e==="pulse"?$W():e==="shimmer"?XW():{}}function KW(){return{animation:zW,background:WW}}function qW(e){return GW[e]}function ZW(e){return`${e*.06}s`}function Rr({className:e,style:t}){return c.jsx("span",{"aria-hidden":!0,className:i.cn(PW,e),style:{...KW(),...t}})}const VS=a.forwardRef(function({animation:t="wave",size:n=kW,className:o,classNames:r,style:s,...l},u){return c.jsx("div",{ref:u,className:i.cn(Tr,DW,n,r==null?void 0:r.root,o),style:{...Er(t),...s},...Lr(),...l,children:t==="wave"?c.jsx(Rr,{className:r==null?void 0:r.wave}):null})});VS.displayName="SkeletonCircle";const zS=a.forwardRef(function({animation:t="wave",lines:n=3,lastShort:o=!0,className:r,classNames:s,style:l,...u},d){const f=Array.from({length:n},(m,p)=>o&&p===n-1?MW:FW);return c.jsx("div",{ref:d,className:i.cn(BW,s==null?void 0:s.root,r),style:l,...Lr(),...u,children:f.map((m,p)=>c.jsx("div",{className:i.cn(Tr,jW,m,s==null?void 0:s.line),style:{...Er(t),animationDelay:ZW(p)},children:t==="wave"?c.jsx(Rr,{className:s==null?void 0:s.wave}):null},p))})});zS.displayName="SkeletonText";const US=a.forwardRef(function({animation:t="wave",className:n,classNames:o,style:r,children:s,...l},u){return c.jsxs("div",{ref:u,className:i.cn(Tr,HW,o==null?void 0:o.root,n),style:{...Er(t),...r},...Lr(),...l,children:[t==="wave"?c.jsx(Rr,{className:o==null?void 0:o.wave}):null,s]})});US.displayName="SkeletonBlock";const WS=a.forwardRef(function({busy:t=!0,className:n,classNames:o,children:r,...s},l){return c.jsx("div",{ref:l,className:i.cn(o==null?void 0:o.root,n),...OW(t),...s,children:r})});WS.displayName="SkeletonRegion";function QW({animation:e="wave",radius:t="small"}){return{animation:e,radius:t,isWave:e==="wave"}}const YS=a.forwardRef(function({animation:t="wave",radius:n="small",className:o,classNames:r,style:s,children:l,...u},d){const{animation:f,radius:m,isWave:p}=QW({animation:t,radius:n});return c.jsxs("div",{ref:d,className:i.cn(Tr,qW(m),r==null?void 0:r.root,o),style:{...Er(f),...s},...Lr(),...u,children:[p?c.jsx(Rr,{className:r==null?void 0:r.wave}):null,l]})});YS.displayName="Skeleton";const JW=Object.assign(YS,{Circle:VS,Text:zS,Block:US,Region:WS}),$S=a.createContext(null),XS=a.createContext(null),Bs=a.createContext({});function eY({value:e,children:t}){return c.jsx($S.Provider,{value:e,children:t})}function Gi(){const e=a.useContext($S);if(!e)throw new Error("Disclosure parts must be inside <Disclosure>.");return e}function tY({value:e,children:t}){return c.jsx(XS.Provider,{value:e,children:t})}function nY(){return a.useContext(XS)}function KS({classNames:e,children:t}){const n=a.useContext(Bs),o=a.useMemo(()=>({...n,...e}),[e,n]);return c.jsx(Bs.Provider,{value:o,children:t})}function Vi(){return a.useContext(Bs)}function oY(e){return e==="outline"||e==="secondary"||e==="default"}function rY(e){return e.displayName}function sY(e){const t=[],n=[],o=[],r=[];return a.Children.forEach(e,s=>{if(!a.isValidElement(s)){r.push(s);return}const l=rY(s.type);l==="DisclosureTrigger"?t.push(s):l==="DisclosureContent"?n.push(s):l==="DisclosureHandle"?o.push(s):r.push(s)}),[...t,...n,...o,...r]}const aY={default:"flex flex-col",outline:"flex flex-col",secondary:"flex flex-col",card:"overflow-hidden rounded-base border-token bg-surface shadow-token-base",ghost:"flex flex-col",gloss:"flex flex-col"},Uc={outline:"bg-transparent border-token rounded-mid text-foreground",secondary:"bg-secondary border-token rounded-mid text-secondary-foreground"},cn=i.cn("bg-transparent text-foreground",i.hoverVariant()),lY={default:i.cn("rounded-mid",cn),outline:i.cn("rounded-mid",cn),secondary:i.cn("rounded-mid",cn),card:cn,ghost:i.cn("rounded-mid",cn),gloss:i.cn("rounded-mid",cn)},iY="flex w-full select-none items-center gap-small text-left outline-none focus-ring",cY="cursor-not-allowed opacity-48",uY="cursor-pointer",dY="min-w-0 flex-1 origin-center",fY="block",mY="inline-flex shrink-0 origin-center items-center justify-center text-muted",pY="size-full",CY="text-primary",gY="overflow-hidden",SY="flex touch-none select-none shrink-0 cursor-grab items-center justify-center border-t-token py-xsmall active:cursor-grabbing",hY="pointer-events-none opacity-48",xY="h-1 w-10 rounded-full bg-tertiary",bY="gloss-panel gloss-deep rounded-mid text-foreground",AY="gloss-content text-muted";function qS(e){const t=It(e);return{pad:t.triggerPadding,text:t.titleVariant,titleClassName:t.titleClassName,chevron:i.CONTROL_SIZE_LAYOUT[e].chevronIcon}}function vY({variant:e,groupedCardShell:t,className:n,slotClass:o}){const r=e==="card"&&t?"":aY[e];return i.cn(r,o,n)}function _Y({variant:e,size:t,disabled:n,className:o,slotClass:r}){const s=qS(t);return i.cn(iY,s.pad,lY[e],n?cY:uY,r,o)}function LY(e){if(e==="outline"||e==="secondary"||e==="gloss")return"pt-xsmall"}function TY({variant:e,size:t,className:n,slotClass:o}){const r=oY(e);return i.cn(It(t).contentPadding,r&&e==="outline"&&Uc.outline,r&&e==="secondary"&&Uc.secondary,e==="card"&&"border-t-token",e==="ghost"&&"text-muted",e==="default"&&"text-muted",o,n)}function EY(e,t){return i.cn(AY,It(e).contentPadding,t)}function RY({separated:e,variant:t,className:n,slotClass:o}){return i.cn("flex w-full flex-col",e&&"gap-large",!e&&t==="default"&&"divide-y-token border-t-token border-b-token",!e&&t==="card"&&"overflow-hidden rounded-mid border-token bg-surface shadow-token-base divide-y-token",!e&&(t==="outline"||t==="secondary"||t==="ghost"||t==="gloss")&&"gap-small",o,n)}function IY(e){return e!=null&&!e.separated&&e.variant==="card"}function yY({open:e,disabled:t,setOpen:n,chevronRef:o,skipContentAnimRef:r,forwardedRef:s,onClick:l,onKeyDown:u,onPointerEnter:d,onPointerLeave:f,onPointerDown:m}){const p=a.useRef(null),C=a.useRef(null),S=a.useRef(!1),g=a.useCallback(v=>{p.current=v,ue(s,v)},[s]),h=qt(e,o,()=>i.isMotionFeatureEnabled("enableExpandable"),r);a.useEffect(()=>{const v=C.current;return()=>{v&&i.killMotion(v)}},[]),a.useEffect(()=>{if(!t)return;S.current=!1;const v=C.current;v&&i.killMotion(v)},[t]);const x=a.useCallback(v=>{l==null||l(v),!(v.defaultPrevented||t)&&n(!e)},[t,l,e,n]),A=a.useCallback(v=>{u==null||u(v),(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),t||n(!e))},[t,u,e,n]),b=a.useCallback(v=>{if(d==null||d(v),v.defaultPrevented||t)return;S.current=!0;const R=C.current;!R||i.shouldSkipInteractiveHoverLift()||i.animateInteractiveHoverLift(R,!0)},[t,d]),_=a.useCallback(v=>{f==null||f(v),S.current=!1;const R=C.current;!R||i.shouldSkipInteractiveHoverLift()||i.animateInteractiveHoverLift(R,!1)},[f]),L=a.useCallback(v=>{if(m==null||m(v),v.defaultPrevented||t)return;const R=C.current;!R||i.prefersReducedMotion()||i.animateInteractivePressSqueeze(R,{pointerInside:S.current})},[t,m]);return{setRefs:g,titleLiftRef:C,bindChevronRef:h,handleClick:x,handleKeyDown:A,handlePointerEnter:b,handlePointerLeave:_,handlePointerDown:L,mergeRefs:$e}}const Wc=.38,NY=.45,wY=-.45;function OY(e){return e.getBoundingClientRect().height}function PY(e,t,n){if(!e||n<=0)return;const o=Math.min(Math.max(t/n,0),1);$.set(e,{rotation:o*180})}function DY(e,t,n,o,r,s,l){return{onPointerDown:a.useCallback(d=>{if(s)return;const f=e.current,m=t.current;if(!f||!m||i.prefersReducedMotion())return;d.preventDefault();const p=Eo(m);if(p<=0)return;const C=d.currentTarget;C.setPointerCapture(d.pointerId);const S=d.clientY,g=OY(f);let h=S,x=performance.now(),A=0;i.killMotion(f,n.current),f.style.overflow="hidden",f.style.willChange="height";const b=L=>{if(L.pointerId!==d.pointerId)return;const v=L.clientY,R=v-S,T=performance.now(),E=T-x;E>0&&(A=(v-h)/E),h=v,x=T;const I=Math.max(0,Math.min(p,g+R));f.style.height=`${I}px`,PY(n.current,I,p)},_=L=>{if(L.pointerId!==d.pointerId)return;C.releasePointerCapture(L.pointerId),C.removeEventListener("pointermove",b),C.removeEventListener("pointerup",_),C.removeEventListener("pointercancel",_);const R=L.clientY-S,E=Math.max(0,Math.min(p,g+R))/p,I={...i.motionInteractive(),overwrite:"auto"},O=E>=Wc||A>NY,N=E<=1-Wc||A<wY;if(i.killMotion(f,n.current),!o&&O){const k=$.timeline({onComplete:()=>{f.style.willChange="",f.style.height="auto",f.style.overflow="",l&&(l.current=!0),r(!0)}});k.to(f,{height:p,...I},0),n.current&&k.to(n.current,{rotation:180,...I},0);return}if(o&&N){const k=$.timeline({onComplete:()=>{f.style.willChange="",f.style.height="0px",f.style.overflow="hidden",l&&(l.current=!0),r(!1)}});k.to(f,{height:0,...I},0),n.current&&k.to(n.current,{rotation:0,...I},0);return}const y=E>=.5,w=y?p:0,P=$.timeline({onComplete:()=>{f.style.willChange="",y?(f.style.height="auto",f.style.overflow=""):(f.style.height="0px",f.style.overflow="hidden"),l&&(l.current=!0),r(y)}});P.to(f,{height:w,...I},0),n.current&&P.to(n.current,{rotation:y?180:0,...I},0)};C.addEventListener("pointermove",b),C.addEventListener("pointerup",_),C.addEventListener("pointercancel",_)},[n,s,t,o,r,e,l])}}function ZS({className:e,onPointerDown:t,...n}){const o=Vi(),{variant:r,disabled:s,dragHandle:l,shellRef:u,innerRef:d,chevronRef:f,open:m,setOpen:p,skipContentAnimRef:C}=Gi(),{onPointerDown:S}=DY(u,d,f,m,p,s,C);return!l||r!=="card"?null:c.jsx("div",{"aria-hidden":!0,className:i.cn(SY,s&&hY,o.handle,e),onPointerDown:g=>{t==null||t(g),S(g)},...n,children:c.jsx("span",{className:xY})})}ZS.displayName="DisclosureHandle";const QS=a.forwardRef(function({children:t,className:n,...o},r){const s=Vi(),{open:l,panelId:u,triggerId:d,size:f,variant:m,shellRef:p,innerRef:C,skipContentAnimRef:S}=Gi();Cu(l,p,C,{skipAnimRef:S});const g=pu(p,l),h=a.useCallback(b=>{g(b),typeof r=="function"?r(b):r&&(r.current=b)},[g,r]),x=LY(m),A=m==="gloss";return c.jsx("div",{ref:h,"aria-hidden":!l,className:i.cn(gY,s.contentShell),children:c.jsx("div",{ref:C,className:i.cn(x,s.contentWrap),children:A?c.jsx("section",{id:u,"aria-labelledby":d,className:i.cn(s.contentPanel,n),...o,children:c.jsx("div",{className:i.cn(bY,s.glossPanel),children:c.jsx("div",{className:EY(f,s.glossContent),children:t})})}):c.jsx("section",{id:u,"aria-labelledby":d,className:TY({variant:m,size:f,className:n,slotClass:s.contentPanel}),...o,children:t})})})});QS.displayName="DisclosureContent";const JS=a.forwardRef(function({children:t,icon:n,asChild:o,className:r,onKeyDown:s,onClick:l,onPointerEnter:u,onPointerLeave:d,onPointerDown:f,...m},p){const C=Vi(),{open:S,setOpen:g,triggerId:h,panelId:x,variant:A,size:b,disabled:_,iconPosition:L,chevronRef:v,skipContentAnimRef:R}=Gi(),T=qS(b),E=yY({open:S,disabled:_,setOpen:g,chevronRef:v,skipContentAnimRef:R,forwardedRef:p,onClick:l,onKeyDown:s,onPointerEnter:u,onPointerLeave:d,onPointerDown:f}),I=n!==null?c.jsx("span",{ref:E.bindChevronRef,"aria-hidden":!0,className:i.cn(mY,T.chevron,i.TEXT_COLOR_TRANSITION,S&&CY,C.triggerChevron),children:n??c.jsx(be.IoChevronDown,{className:pY})}):null;if(o&&a.isValidElement(t)){const O=t;return a.cloneElement(O,{...m,id:h,ref:E.mergeRefs(p,E.setRefs,O.props.ref),className:i.cn(O.props.className,r),disabled:_||O.props.disabled,"aria-expanded":S,"aria-controls":x,onClick:N=>{var y,w;(w=(y=O.props).onClick)==null||w.call(y,N),E.handleClick(N)},onKeyDown:N=>{var y,w;(w=(y=O.props).onKeyDown)==null||w.call(y,N),E.handleKeyDown(N)}})}return c.jsxs("button",{ref:E.setRefs,id:h,type:"button","aria-expanded":S,"aria-controls":x,disabled:_,className:_Y({variant:A,size:b,disabled:_,className:r,slotClass:C.trigger}),onClick:E.handleClick,onKeyDown:E.handleKeyDown,onPointerEnter:E.handlePointerEnter,onPointerLeave:E.handlePointerLeave,onPointerDown:E.handlePointerDown,...m,children:[L==="start"&&I,c.jsx("span",{ref:E.titleLiftRef,className:i.cn(dY,C.triggerTitleLift),children:c.jsx(q,{as:"span",variant:T.text,className:i.cn(fY,T.titleClassName,S?"text-primary":"text-foreground",C.triggerTitle),children:t})}),L==="end"&&I]})});JS.displayName="DisclosureTrigger";function kY(e){return`disclosure-trigger-${e}`}function BY(e){return`disclosure-panel-${e}`}function jY({children:e,open:t,defaultOpen:n=!1,onOpenChange:o,value:r,variant:s,size:l,disabled:u=!1,iconPosition:d="end",dragHandle:f=!1}){const m=nY(),p=m!==null&&r!==void 0&&m.accordion,C=p?m.openValue===r:void 0,[S,g]=a.useState(n),h=p?C:t!==void 0?t:S,x=a.useCallback(w=>{p?m.setOpenValue(w?r??null:null):(t===void 0&&g(w),o==null||o(w))},[p,m,r,t,o]),A=a.useId(),b=kY(A),_=BY(A),L=a.useRef(null),v=a.useRef(null),R=a.useRef(null),T=a.useRef(!1),E=s??(m==null?void 0:m.variant)??"default",I=l??(m==null?void 0:m.size)??"base",O=IY(m),N=a.useMemo(()=>({open:h,setOpen:x,triggerId:b,panelId:_,variant:E,size:I,disabled:u,iconPosition:d,dragHandle:f,shellRef:L,innerRef:v,chevronRef:R,skipContentAnimRef:T}),[u,f,d,h,_,x,I,b,E]),y=f&&E==="card"?sY(e):e;return{contextValue:N,variant:E,groupedCardShell:O,orderedChildren:y}}const eh=a.forwardRef(function({children:t,className:n,classNames:o,open:r,defaultOpen:s,onOpenChange:l,value:u,variant:d,size:f,disabled:m,iconPosition:p,dragHandle:C,...S},g){const h=jY({children:t,open:r,defaultOpen:s,onOpenChange:l,value:u,variant:d,size:f,disabled:m,iconPosition:p,dragHandle:C});return c.jsx(eY,{value:h.contextValue,children:c.jsx(KS,{classNames:o,children:c.jsx("div",{ref:g,className:vY({variant:h.variant,groupedCardShell:h.groupedCardShell,className:n,slotClass:o==null?void 0:o.root}),...S,children:h.orderedChildren})})})});eh.displayName="Disclosure";function MY({accordion:e=!0,separated:t=!1,variant:n="default",size:o="base",value:r,defaultValue:s,onValueChange:l}){const u=r!==void 0,[d,f]=a.useState(s??null),m=u?r:d,p=a.useCallback(S=>{const g=e&&S===m?null:S;u||f(g),l==null||l(g)},[e,u,l,m]);return{contextValue:a.useMemo(()=>({openValue:m,setOpenValue:p,variant:n,size:o,separated:t,accordion:e}),[e,m,p,n,o,t]),separated:t,variant:n}}const th=a.forwardRef(function({children:t,accordion:n,separated:o,variant:r,size:s,value:l,defaultValue:u,onValueChange:d,className:f,classNames:m,...p},C){const S=MY({accordion:n,separated:o,variant:r,size:s,value:l,defaultValue:u,onValueChange:d});return c.jsx(tY,{value:S.contextValue,children:c.jsx(KS,{classNames:m,children:c.jsx("div",{ref:C,className:RY({separated:S.separated,variant:S.variant,className:f,slotClass:m==null?void 0:m.group}),...p,children:t})})})});th.displayName="DisclosureGroup";const FY=Object.assign(eh,{Trigger:JS,Handle:ZS,Content:QS,Group:th});function nh(e={}){const t=JSON.stringify(e.storageKey??i.DEFAULT_THEME_STORAGE_KEY),n=JSON.stringify(e.defaultTheme??"dark");return`(function(){try{var k=${t};var d=${n};var s=localStorage.getItem(k);var t=(s==="light"||s==="dark"||s==="system")?s:d;var r=t==="system"?(window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"):t;var e=document.documentElement;if(r==="light")e.setAttribute("data-theme","light");else e.removeAttribute("data-theme");}catch(_){}})();`}function HY({storageKey:e,defaultTheme:t,nonce:n}={}){return a.createElement("script",{nonce:n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:nh({storageKey:e,defaultTheme:t})}})}function GY(e){const{config:t,theme:n,tokens:o,customTokens:r,motion:s,toast:l,storageKey:u,labels:d}=e;return{theme:n??(t==null?void 0:t.theme)??"dark",storageKey:u!==void 0?u:(t==null?void 0:t.storageKey)??i.DEFAULT_THEME_STORAGE_KEY,tokens:o??(t==null?void 0:t.tokens),colors:t==null?void 0:t.colors,customTokens:r??(t==null?void 0:t.customTokens),motion:s??(t==null?void 0:t.motion),toast:l!==void 0?l:(t==null?void 0:t.toast)??!0,labels:d??(t==null?void 0:t.labels)}}function VY({children:e,resolvedConfig:t,root:n}){const{resolvedTheme:o}=i.useBurneTheme(),[r,s]=a.useState(null),l=a.useRef(!1),u=a.useCallback(()=>s(null),[]),d=r??t;a.useLayoutEffect(()=>{if(!d.tokens&&!d.motion&&!d.colors&&!d.customTokens){if(l.current){const p=n??(typeof document<"u"?document.documentElement:null);if(!p)return;i.applyThemeTokens(i.createDefaultThemeState(o),p),i.clearThemeInlineTokens(p),i.clearCustomThemeTokens(p),i.applyThemeMode(o,p),l.current=!1}return}const m=n??(typeof document<"u"?document.documentElement:null);m&&(i.applyBurneThemeConfig(d,m,o),l.current=!0)},[d,o,n]),a.useLayoutEffect(()=>{const m=n??(typeof document<"u"?document.documentElement:null);return()=>{!l.current||!m||(i.applyThemeTokens(i.createDefaultThemeState(o),m),i.clearThemeInlineTokens(m),i.clearCustomThemeTokens(m),l.current=!1)}},[n,o]);const f=a.useMemo(()=>({baseConfig:t,config:d,previewConfig:r,resolvedTheme:o,setPreviewConfig:s,clearPreview:u}),[t,d,r,o,u]);return c.jsx(i.BurneThemeRuntimeContextProvider,{value:f,children:e})}function zY(e){const{children:t,config:n,theme:o,tokens:r,customTokens:s,motion:l,labels:u,toast:d,storageKey:f,defaultTheme:m,root:p,onThemeChange:C}=e,S=a.useMemo(()=>GY({config:n,theme:o,tokens:r,customTokens:s,motion:l,labels:u,toast:d,storageKey:f}),[n,o,r,s,l,u,d,f]),g=S.theme??"dark",h=S.storageKey===void 0?i.DEFAULT_THEME_STORAGE_KEY:S.storageKey;let x=c.jsx(VY,{resolvedConfig:S,root:p,children:t});const A=S.toast??!0;if(A){const b=typeof A=="object"?A:{};x=c.jsx(up.Provider,{...b,children:x})}return x=c.jsx(du,{labels:S.labels,children:x}),c.jsx(i.ThemeProvider,{theme:o,defaultTheme:m??(g==="system"?"system":g),storageKey:h,root:p,onThemeChange:C,children:x})}exports.DEFAULT_THEME_STORAGE_KEY=i.DEFAULT_THEME_STORAGE_KEY;exports.FONT_WEIGHT_CSS_VAR=i.FONT_WEIGHT_CSS_VAR;exports.FONT_WEIGHT_DEFAULTS=i.FONT_WEIGHT_DEFAULTS;exports.MOTION_CONFIG_DEFAULTS=i.MOTION_CONFIG_DEFAULTS;exports.NARROW_VIEWPORT_MAX_PX=i.NARROW_VIEWPORT_MAX_PX;exports.SHADOW_CSS_VAR=i.SHADOW_CSS_VAR;exports.TOUCH_OR_NARROW_VIEWPORT_MQL=i.TOUCH_OR_NARROW_VIEWPORT_MQL;exports.TOUCH_OR_NARROW_VIEWPORT_MQL_ANY_POINTER=i.TOUCH_OR_NARROW_VIEWPORT_MQL_ANY_POINTER;exports.ThemeProvider=i.ThemeProvider;exports.burneFontWeightScale=i.burneFontWeightScale;exports.burneShadowScale=i.burneShadowScale;exports.buttonRippleTone=i.buttonRippleTone;exports.cn=i.cn;exports.colorToken=i.colorToken;exports.configureMotion=i.configureMotion;exports.designTokenNames=i.designTokenNames;exports.fontWeightToken=i.fontWeightToken;exports.getMotionConfig=i.getMotionConfig;exports.isMotionEnabled=i.isMotionEnabled;exports.isMotionFeatureEnabled=i.isMotionFeatureEnabled;exports.shadowToken=i.shadowToken;exports.tokensConfig=i.tokensConfig;exports.useBurneTheme=i.useBurneTheme;exports.useBurneThemeOptional=i.useBurneThemeOptional;exports.Accordion=Xb;exports.Alert=Db;exports.AlertDialog=dw;exports.Avatar=_H;exports.BURNE_LABELS_RU=ux;exports.Badge=V1;exports.Breadcrumbs=lG;exports.BurneLabelsProvider=du;exports.BurneUIProvider=zY;exports.Button=Vt;exports.ButtonGroup=ay;exports.COMPONENT_SIZES=sh;exports.Calendar=ZU;exports.Card=fF;exports.Checkbox=ZP;exports.CheckboxGroup=uv;exports.CloseButton=Cn;exports.ColorPicker=V2;exports.ColorSlider=z2;exports.ColorSwatch=to;exports.ComboBox=vf;exports.DEFAULT_BURNE_LABELS=Se;exports.Dialog=hw;exports.Disclosure=FY;exports.Drawer=E0;exports.Dropdown=Gt;exports.EN_LOCALE=TS;exports.Expandable=ht;exports.Field=le;exports.Form=fA;exports.Input=Xf;exports.Kbd=sV;exports.Label=ve;exports.Link=$0;exports.ListBox=Ht;exports.Loading=Al;exports.Meter=$j;exports.OVERLAY_BACKDROP_CSS_VAR=fh;exports.OVERLAY_BACKDROP_DEFAULTS=ph;exports.Pagination=WG;exports.Popover=ke;exports.ProgressBar=DM;exports.RIPPLE_COLOR=Co;exports.Radio=kD;exports.RadioGroup=Av;exports.Ripple=Dn;exports.SearchInput=Ja;exports.Select=tm;exports.SelectionIndicator=Be;exports.SelectionThumb=On;exports.Separator=$a;exports.Skeleton=JW;exports.Slider=uB;exports.Surface=zg;exports.Switch=VB;exports.TABLE_ROW_TONE_SURFACE=lS;exports.TOAST_SCRIM_CSS_VAR=ft;exports.TOAST_SCRIM_DEFAULTS=rh;exports.Table=xz;exports.Tabs=fj;exports.Text=q;exports.TextArea=hP;exports.ThemeScript=HY;exports.TimeField=wW;exports.Toast=up;exports.ToastContext=bl;exports.ToggleButton=Sm;exports.ToggleButtonGroup=tN;exports.Tooltip=bo;exports.Z_INDEX_CSS_VAR=gh;exports.Z_INDEX_DEFAULTS=Sh;exports.burneZIndexScale=Ch;exports.fieldErrorId=ze;exports.fieldHintId=Ve;exports.footerButtonSizeForAlertDialog=Nm;exports.formatBurneLabel=pn;exports.getThemeScript=nh;exports.hexToHsva=eo;exports.hexToRgba=NS;exports.hsvaToColorString=wS;exports.hsvaToHex=Ao;exports.hsvaToRgba=zt;exports.hueToRgbString=Vo;exports.joinFieldDescribedBy=je;exports.mergeBurneLabels=cu;exports.overlayBackdropToken=mh;exports.primaryButtonStatusForAlertTone=fN;exports.primaryButtonVariantForAlertTone=dN;exports.resolveAlertLiveRole=yu;exports.resolveAlertStatus=Js;exports.resolveAlertVariant=Qs;exports.rgbaToHex=yS;exports.rgbaToHsva=IS;exports.sliderThicknessToCss=qn;exports.toastScrimToken=mt;exports.useAlertDialog=_t;exports.useBurneLabel=St;exports.useBurneLabels=Ie;exports.useCalendar=Ne;exports.useColorPicker=kt;exports.useComboBoxContext=Fn;exports.useFieldSetErrorId=xa;exports.useFieldSetHintId=ha;exports.useFormField=dA;exports.useListBox=bn;exports.useListBoxActiveValue=yd;exports.useTabsContext=gr;exports.useToast=AO;exports.useToastContext=tp;exports.zIndexToken=hh;