strata-ui-react 0.1.9 → 0.1.11

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.
@@ -1,24 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react`);l=c(l);let u=require(`react/jsx-runtime`),d=require(`react-dom`);d=c(d);var f=o((e=>{var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),p=o((e=>{process.env.NODE_ENV!==`production`&&(function(){var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){var n=t.H;return n===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
2
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
3
- 2. You might be breaking the Rules of Hooks
4
- 3. You might have more than one copy of React in the same app
5
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n.useMemoCache(e)}})()})),m=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=f():t.exports=p()}));function h(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var g={};function _(e,t){let n=l.useRef(g);return n.current===g&&(n.current=e(t)),n}function v(e,t,n,r){let i=_(b).current;return x(i,e,t,n,r)&&C(i,[e,t,n,r]),i.callback}function y(e){let t=_(b).current;return S(t,e)&&C(t,e),t.callback}function b(){return{callback:null,cleanup:null,refs:[]}}function x(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function S(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function C(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var w=parseInt(l.version,10);function T(e){return w>=e}function E(e){if(!l.isValidElement(e))return null;let t=e,n=t.props;return(T(19)?n?.ref:t.ref)??null}function D(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function O(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function k(e,t){return typeof e==`function`?e(t):e}function A(e,t){return typeof e==`function`?e(t):e}var j={};function M(e,t,n,r,i){let a={...I(e,j)};return t&&(a=P(a,t)),n&&(a=P(a,n)),r&&(a=P(a,r)),i&&(a=P(a,i)),a}function N(e){if(e.length===0)return j;if(e.length===1)return I(e[0],j);let t={...I(e[0],j)};for(let n=1;n<e.length;n+=1)t=P(t,e[n]);return t}function P(e,t){return F(t)?t(e):ee(e,t)}function ee(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=D(e.style,r);break;case`className`:e[n]=z(e.className,r);break;default:te(n,r)?e[n]=L(e[n],r):e[n]=r}}return e}function te(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function F(e){return typeof e==`function`}function I(e,t){return F(e)?e(t):e??j}function L(e,t){return t?e?n=>{if(ne(n)){let r=n;R(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function R(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function z(e,t){return t?e?t+` `+e:t:e}function ne(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function B(){}const V=Object.freeze([]),H=Object.freeze({}),re={style:{transition:`none`}},U=`data-base-ui-click-trigger`,ie={fallbackAxisSide:`end`},ae={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function W(e,t,n={}){let r=t.render,i=oe(t,n);return n.enabled===!1?null:se(e,r,i,n.state??H)}function oe(e,t={}){let{className:n,style:r,render:i}=e,{state:a=H,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?k(n,a):void 0,d=l?A(r,a):void 0,f=l?O(a,c):H,p=l?D(f,Array.isArray(s)?N(s):s)??H:H;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=y([p.ref,E(i),...o]):p.ref=v(p.ref,E(i),o):v(null,null)),l?(u!==void 0&&(p.className=z(p.className,u)),d!==void 0&&(p.style=D(p.style,d)),p):H}function se(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=M(n,t.props);return e.ref=n.ref,l.cloneElement(t,e)}if(e&&typeof e==`string`)return ce(e,n);throw Error(process.env.NODE_ENV===`production`?h(8):`Base UI: Render element or function are not defined.`)}function ce(e,t){return e===`button`?(0,l.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,l.createElement)(`img`,{alt:``,...t,key:t.key}):l.createElement(e,t)}const le=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(le.displayName=`AvatarRootContext`);function ue(){let e=l.useContext(le);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(13):`Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.`);return e}const de={imageLoadingStatus:()=>null},fe=l.forwardRef(function(e,t){let{className:n,render:r,...i}=e,[a,o]=l.useState(`idle`),s=l.useMemo(()=>({imageLoadingStatus:a}),[a]),c=l.useMemo(()=>({imageLoadingStatus:a,setImageLoadingStatus:o}),[a,o]),d=W(`span`,e,{state:s,ref:t,props:i,stateAttributesMapping:de});return(0,u.jsx)(le.Provider,{value:c,children:d})});process.env.NODE_ENV!==`production`&&(fe.displayName=`AvatarRoot`);var pe=l[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],me=pe&&pe!==l.useLayoutEffect?pe:e=>e();function G(e){let t=_(he).current;return t.next=e,me(t.effect),t.trampoline}function he(){let e={next:void 0,callback:ge,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ge(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}var _e=()=>{};const K=typeof document<`u`?l.useLayoutEffect:_e;function ve(e,{referrerPolicy:t,crossOrigin:n}){let[r,i]=l.useState(`idle`);return K(()=>{if(!e)return i(`error`),B;let r=!0,a=new window.Image,o=e=>()=>{r&&i(e)};return i(`loading`),a.onload=o(`loaded`),a.onerror=o(`error`),t&&(a.referrerPolicy=t),a.crossOrigin=n??null,a.src=e,()=>{r=!1}},[e,n,t]),r}const ye=l.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,referrerPolicy:a,crossOrigin:o,...s}=e,c=ue(),u=ve(e.src,{referrerPolicy:a,crossOrigin:o}),d=G(e=>{i?.(e),c.setImageLoadingStatus(e)});return K(()=>{u!==`idle`&&d(u)},[u,d]),W(`img`,e,{state:l.useMemo(()=>({imageLoadingStatus:u}),[u]),ref:t,props:s,stateAttributesMapping:de,enabled:u===`loaded`})});process.env.NODE_ENV!==`production`&&(ye.displayName=`AvatarImage`);var be=[];function xe(e){l.useEffect(e,be)}var Se=0,Ce=class e{static create(){return new e}currentId=Se;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Se,t()},e)}isStarted(){return this.currentId!==Se}clear=()=>{this.currentId!==Se&&(clearTimeout(this.currentId),this.currentId=Se)};disposeEffect=()=>this.clear};function we(){let e=_(Ce.create).current;return xe(e.disposeEffect),e}const Te=l.forwardRef(function(e,t){let{className:n,render:r,delay:i,...a}=e,{imageLoadingStatus:o}=ue(),[s,c]=l.useState(i===void 0),u=we();return l.useEffect(()=>(i!==void 0&&u.start(i,()=>c(!0)),u.clear),[u,i]),W(`span`,e,{state:l.useMemo(()=>({imageLoadingStatus:o}),[o]),ref:t,props:a,stateAttributesMapping:de,enabled:o!==`loaded`&&s})});process.env.NODE_ENV!==`production`&&(Te.displayName=`AvatarFallback`);function Ee(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ee(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function De(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ee(e))&&(r&&(r+=` `),r+=t);return r}var Oe=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ke=(e,t)=>({classGroupId:e,validator:t}),Ae=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),je=`-`,Me=[],Ne=`arbitrary..`,Pe=e=>{let t=Le(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ie(e);let n=e.split(je);return Fe(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Oe(i,t):t:i||Me}return n[e]||Me}}},Fe=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Fe(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(je):e.slice(t).join(je),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ie=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ne+r:void 0})(),Le=e=>{let{theme:t,classGroups:n}=e;return Re(n,t)},Re=(e,t)=>{let n=Ae();for(let r in e){let i=e[r];ze(i,n,r,t)}return n},ze=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Be(i,t,n,r)}},Be=(e,t,n,r)=>{if(typeof e==`string`){Ve(e,t,n);return}if(typeof e==`function`){He(e,t,n,r);return}Ue(e,t,n,r)},Ve=(e,t,n)=>{let r=e===``?t:We(t,e);r.classGroupId=n},He=(e,t,n,r)=>{if(Ge(e)){ze(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ke(n,e))},Ue=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ze(o,We(t,a),n,r)}},We=(e,t)=>{let n=e,r=t.split(je),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ae(),n.nextPart.set(t,i)),n=i}return n},Ge=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ke=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},qe=`!`,Je=`:`,Ye=[],Xe=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ze=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Je){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(qe)?(c=s.slice(0,-1),l=!0):s.startsWith(qe)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Xe(t,l,c,u)};if(t){let e=t+Je,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Xe(Ye,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Qe=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},$e=e=>({cache:Ke(e.cacheSize),parseClassName:Ze(e),sortModifiers:Qe(e),...Pe(e)}),et=/\s+/,tt=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(et),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+qe:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},nt=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=rt(n))&&(i&&(i+=` `),i+=r);return i},rt=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=rt(e[r]))&&(n&&(n+=` `),n+=t);return n},it=(e,...t)=>{let n,r,i,a,o=o=>(n=$e(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=tt(e,n);return i(e,a),a};return a=o,(...e)=>a(nt(...e))},at=[],ot=e=>{let t=t=>t[e]||at;return t.isThemeGetter=!0,t},st=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ct=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lt=/^\d+\/\d+$/,ut=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ft=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ht=e=>lt.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),gt=e=>!!e&&Number.isInteger(Number(e)),_t=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),vt=e=>ut.test(e),yt=()=>!0,bt=e=>dt.test(e)&&!ft.test(e),xt=()=>!1,St=e=>pt.test(e),Ct=e=>mt.test(e),wt=e=>!J(e)&&!Y(e),Tt=e=>Lt(e,Vt,xt),J=e=>st.test(e),Et=e=>Lt(e,Ht,bt),Dt=e=>Lt(e,Ut,q),Ot=e=>Lt(e,zt,xt),kt=e=>Lt(e,Bt,Ct),At=e=>Lt(e,Gt,St),Y=e=>ct.test(e),jt=e=>Rt(e,Ht),Mt=e=>Rt(e,Wt),Nt=e=>Rt(e,zt),Pt=e=>Rt(e,Vt),Ft=e=>Rt(e,Bt),It=e=>Rt(e,Gt,!0),Lt=(e,t,n)=>{let r=st.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Rt=(e,t,n=!1)=>{let r=ct.exec(e);return r?r[1]?t(r[1]):n:!1},zt=e=>e===`position`||e===`percentage`,Bt=e=>e===`image`||e===`url`,Vt=e=>e===`length`||e===`size`||e===`bg-size`,Ht=e=>e===`length`,Ut=e=>e===`number`,Wt=e=>e===`family-name`,Gt=e=>e===`shadow`,Kt=()=>{let e=ot(`color`),t=ot(`font`),n=ot(`text`),r=ot(`font-weight`),i=ot(`tracking`),a=ot(`leading`),o=ot(`breakpoint`),s=ot(`container`),c=ot(`spacing`),l=ot(`radius`),u=ot(`shadow`),d=ot(`inset-shadow`),f=ot(`text-shadow`),p=ot(`drop-shadow`),m=ot(`blur`),h=ot(`perspective`),g=ot(`aspect`),_=ot(`ease`),v=ot(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[ht,`full`,`auto`,...w()],E=()=>[gt,`none`,`subgrid`,Y,J],D=()=>[`auto`,{span:[`full`,gt,Y,J]},gt,Y,J],O=()=>[gt,`auto`,Y,J],k=()=>[`auto`,`min`,`max`,`fr`,Y,J],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ht,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,Y,J],ee=()=>[...b(),Nt,Ot,{position:[Y,J]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],F=()=>[`auto`,`cover`,`contain`,Pt,Tt,{size:[Y,J]}],I=()=>[_t,jt,Et],L=()=>[``,`none`,`full`,l,Y,J],R=()=>[``,q,jt,Et],z=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],B=()=>[q,_t,Nt,Ot],V=()=>[``,`none`,m,Y,J],H=()=>[`none`,q,Y,J],re=()=>[`none`,q,Y,J],U=()=>[q,Y,J],ie=()=>[ht,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[vt],breakpoint:[vt],color:[yt],container:[vt],"drop-shadow":[vt],ease:[`in`,`out`,`in-out`],font:[wt],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[vt],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[vt],shadow:[vt],spacing:[`px`,q],text:[vt],"text-shadow":[vt],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ht,J,Y,g]}],container:[`container`],columns:[{columns:[q,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[gt,`auto`,Y,J]}],basis:[{basis:[ht,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,ht,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[gt,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,jt,Et]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Y,Dt]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,_t,J]}],"font-family":[{font:[Mt,J,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,J]}],"line-clamp":[{"line-clamp":[q,`none`,Y,Dt]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...z(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,Et]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[q,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:F()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},gt,Y,J],radial:[``,Y,J],conic:[gt,Y,J]},Ft,kt]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...z(),`hidden`,`none`]}],"divide-style":[{divide:[...z(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...z(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,jt,Et]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,It,At]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,It,At]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[q,Et]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,It,At]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":B()}],"mask-image-linear-to-pos":[{"mask-linear-to":B()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":B()}],"mask-image-t-to-pos":[{"mask-t-to":B()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":B()}],"mask-image-r-to-pos":[{"mask-r-to":B()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":B()}],"mask-image-b-to-pos":[{"mask-b-to":B()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":B()}],"mask-image-l-to-pos":[{"mask-l-to":B()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":B()}],"mask-image-x-to-pos":[{"mask-x-to":B()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":B()}],"mask-image-y-to-pos":[{"mask-y-to":B()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":B()}],"mask-image-radial-to-pos":[{"mask-radial-to":B()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":B()}],"mask-image-conic-to-pos":[{"mask-conic-to":B()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:V()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,It,At]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,q,Y,J]}],"hue-rotate":[{"hue-rotate":[q,Y,J]}],invert:[{invert:[``,q,Y,J]}],saturate:[{saturate:[q,Y,J]}],sepia:[{sepia:[``,q,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[q,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[q,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,q,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,q,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[q,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[q,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,q,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[q,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[q,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:H()}],"rotate-x":[{"rotate-x":H()}],"rotate-y":[{"rotate-y":H()}],"rotate-z":[{"rotate-z":H()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":[`scale-3d`],skew:[{skew:U()}],"skew-x":[{"skew-x":U()}],"skew-y":[{"skew-y":U()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,J]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[q,jt,Et,Dt]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},qt=it(Kt);function X(...e){return qt(De(e))}var Jt=m();const Yt=e=>{let t=(0,Jt.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`inline-flex size-xl items-center justify-center overflow-hidden rounded-full bg-surface-container align-middle font-medium select-none raised-2`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,u.jsx)(fe,{"data-slot":`avatar`,className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var Xt=m();const Zt=e=>{let t=(0,Xt.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=X(`size-full object-cover`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,u.jsx)(ye,{"data-slot":`avatar-image`,className:a,ref:i,...r}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o};var Qt=m();const $t=e=>{let t=(0,Qt.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=X(`flex size-full items-center justify-center`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,u.jsx)(Te,{"data-slot":`avatar-fallback`,className:a,ref:i,...r}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o};var en=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;const tn=De,nn=(e,t)=>n=>{if(t?.variants==null)return tn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=en(t)||en(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return tn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},rn=nn(`inline-flex items-center justify-center whitespace-nowrap select-none transition-all px-xs py-3xs gap-3xs font-medium`,{variants:{tone:{primary:``,secondary:``,tertiary:``,neutral:``,error:``,success:``,warning:``},style:{solid:`raised-1`,outline:`bg-transparent outline outline-2`},radius:{rounded:`rounded-lg`,circle:`rounded-full`}},defaultVariants:{tone:`neutral`,style:`solid`,radius:`rounded`},compoundVariants:[{tone:`primary`,style:`solid`,className:`bg-primary text-on-primary`},{tone:`primary`,style:`outline`,className:`outline-primary text-primary`},{tone:`secondary`,style:`solid`,className:`bg-secondary text-on-secondary`},{tone:`secondary`,style:`outline`,className:`outline-secondary text-secondary`},{tone:`tertiary`,style:`solid`,className:`bg-tertiary text-on-tertiary`},{tone:`tertiary`,style:`outline`,className:`outline-tertiary text-tertiary`},{tone:`neutral`,style:`solid`,className:`bg-surface-container`},{tone:`neutral`,style:`outline`,className:`outline-on-surface text-on-surface`},{tone:`error`,style:`solid`,className:`bg-error text-on-error`},{tone:`error`,style:`outline`,className:`outline-error text-error`},{tone:`success`,style:`solid`,className:`bg-success text-on-success`},{tone:`success`,style:`outline`,className:`outline-success text-success`},{tone:`warning`,style:`solid`,className:`bg-warning text-on-warning`},{tone:`warning`,style:`outline`,className:`outline-warning text-warning`}]});var an=m();const on=e=>{let t=(0,an.c)(18),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,tone:c,style:s,radius:a,children:n,ref:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l;t[8]!==r||t[9]!==a||t[10]!==s||t[11]!==c?(l=X(rn({className:r,tone:c,style:s,radius:a})),t[8]=r,t[9]=a,t[10]=s,t[11]=c,t[12]=l):l=t[12];let d;return t[13]!==n||t[14]!==i||t[15]!==o||t[16]!==l?(d=(0,u.jsx)(`div`,{className:l,ref:o,...i,children:n}),t[13]=n,t[14]=i,t[15]=o,t[16]=l,t[17]=d):d=t[17],d},sn=nn(`inline-flex items-center justify-center whitespace-nowrap rounded-full select-none transition-all disabled:pointer-events-none disabled:opacity-50 cursor-pointer`,{variants:{tone:{destructive:``,glass:``,neutral:``,primary:``,secondary:``,success:``,accent:``,warning:``},style:{solid:``,outline:`active:border-transparent`,ghost:``},size:{large:`h-2xl px-lg style-text-default-1 gap-xs [&>svg]:size-md`,medium:`h-xl px-md style-text-default-0 gap-2xs [&>svg]:size-sm`,small:`h-lg px-sm style-text-default--1 gap-3xs [&>svg]:size-xs`,iconLarge:`size-2xl p-0 [&>svg]:size-md`,iconMedium:`size-xl p-0 [&>svg]:size-sm`,iconSmall:`size-lg p-0 [&>svg]:size-xs`}},defaultVariants:{tone:`primary`,style:`solid`,size:`medium`},compoundVariants:[{tone:`primary`,style:`solid`,className:`bg-primary text-on-primary`},{tone:`primary`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`primary`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`primary`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`primary`,style:`outline`,className:`border-primary text-primary hover:text-on-primary-container hover:bg-primary-container active:bg-transparent`},{tone:`primary`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`primary`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`primary`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`primary`,style:`ghost`,className:`text-primary hover:surface-bright active:bg-surface-dim`},{tone:`primary`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`primary`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`primary`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`secondary`,style:`solid`,className:`bg-secondary text-on-secondary`},{tone:`secondary`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`secondary`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`secondary`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`secondary`,style:`outline`,className:`border-secondary text-secondary hover:text-on-secondary-container hover:bg-secondary-container active:bg-transparent`},{tone:`secondary`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`secondary`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`secondary`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`secondary`,style:`ghost`,className:`text-secondary hover:surface-bright active:bg-surface-dim`},{tone:`secondary`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`secondary`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`secondary`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`accent`,style:`solid`,className:`bg-accent text-on-accent`},{tone:`accent`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`accent`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`accent`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`accent`,style:`outline`,className:`border-accent text-accent hover:text-on-accent-container hover:bg-accent-container active:bg-transparent`},{tone:`accent`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`accent`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`accent`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`accent`,style:`ghost`,className:`text-accent hover:surface-bright active:bg-surface-dim`},{tone:`accent`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`accent`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`accent`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`success`,style:`solid`,className:`bg-success text-on-success`},{tone:`success`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`success`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`success`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`success`,style:`outline`,className:`border-success text-success hover:text-on-success-container hover:bg-success-container active:bg-transparent`},{tone:`success`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`success`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`success`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`success`,style:`ghost`,className:`text-success hover:surface-bright active:bg-surface-dim`},{tone:`success`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`success`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`success`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`warning`,style:`solid`,className:`bg-warning text-on-warning`},{tone:`warning`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`warning`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`warning`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`warning`,style:`outline`,className:`border-warning text-warning hover:text-on-warning-container hover:bg-warning-container active:bg-transparent`},{tone:`warning`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`warning`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`warning`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`warning`,style:`ghost`,className:`text-warning hover:surface-bright active:bg-surface-dim`},{tone:`warning`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`warning`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`warning`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`destructive`,style:`solid`,className:`bg-error text-on-error`},{tone:`destructive`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`destructive`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`destructive`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`destructive`,style:`outline`,className:`border-error text-error hover:text-on-error-container hover:bg-error-container active:bg-transparent`},{tone:`destructive`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`destructive`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`destructive`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`destructive`,style:`ghost`,className:`text-error hover:surface-bright active:bg-surface-dim`},{tone:`destructive`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`destructive`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`destructive`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`neutral`,style:`solid`,className:`bg-surface-container text-on-surface`},{tone:`neutral`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`neutral`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`neutral`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`neutral`,style:`outline`,className:`border-outline text-on-surface hover:text-on-surface hover:bg-surface-container-high active:bg-transparent`},{tone:`neutral`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`neutral`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`neutral`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`neutral`,style:`ghost`,className:`text-on-surface hover:surface-bright active:bg-surface-dim`},{tone:`neutral`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`neutral`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`neutral`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`}]});var cn=m();function ln(e){let t=(0,cn.c)(16),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,tone:s,style:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c;t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=X(sn({tone:s,style:o,size:a,className:r})),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11];let l;return t[12]!==n||t[13]!==i||t[14]!==c?(l=(0,u.jsx)(`button`,{className:c,...i,children:n}),t[12]=n,t[13]=i,t[14]=c,t[15]=l):l=t[15],l}function un({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=l.useRef(e!==void 0),[a,o]=l.useState(t),s=i?e:a;if(process.env.NODE_ENV!==`production`){l.useEffect(()=>{i!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${i?``:`un`}controlled ${r} state of ${n} to be ${i?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
6
- `))},[r,n,e]);let{current:a}=l.useRef(t);l.useEffect(()=>{!i&&JSON.stringify(a)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
7
- `))},[JSON.stringify(t)])}return[s,l.useCallback(e=>{i||o(e)},[])]}const dn={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};let fn=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),pn=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});const mn={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},hn={valid(e){return e===null?null:e?{[pn.valid]:``}:{[pn.invalid]:``}}};function gn(e){return l.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[fn.checked]:``}:{[fn.unchecked]:``}},...hn}),[e.indeterminate])}const _n={...l};var vn=0;function yn(e,t=`mui`){let[n,r]=l.useState(e),i=e||n;return l.useEffect(()=>{n??(vn+=1,r(`${t}-${vn}`))},[n,t]),i}var bn=_n.useId;function xn(e,t){if(bn!==void 0){let n=bn();return e??(t?`${t}-${n}`:n)}return yn(e,t)}function Sn(e){return xn(e,`base-ui`)}function Cn(){return typeof window<`u`}function wn(e){return Dn(e)?(e.nodeName||``).toLowerCase():`#document`}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function En(e){return((Dn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Dn(e){return Cn()?e instanceof Node||e instanceof Tn(e).Node:!1}function Z(e){return Cn()?e instanceof Element||e instanceof Tn(e).Element:!1}function On(e){return Cn()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function kn(e){return!Cn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}var An=new Set([`inline`,`contents`]);function jn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!An.has(i)}var Mn=new Set([`table`,`td`,`th`]);function Nn(e){return Mn.has(wn(e))}var Pn=[`:popover-open`,`:modal`];function Fn(e){return Pn.some(t=>{try{return e.matches(t)}catch{return!1}})}var In=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Ln=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Rn=[`paint`,`layout`,`strict`,`content`];function zn(e){let t=Vn(),n=Z(e)?Wn(e):e;return In.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Ln.some(e=>(n.willChange||``).includes(e))||Rn.some(e=>(n.contain||``).includes(e))}function Bn(e){let t=Kn(e);for(;On(t)&&!Un(t);){if(zn(t))return t;if(Fn(t))return null;t=Kn(t)}return null}function Vn(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Hn=new Set([`html`,`body`,`#document`]);function Un(e){return Hn.has(wn(e))}function Wn(e){return Tn(e).getComputedStyle(e)}function Gn(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kn(e){if(wn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||kn(e)&&e.host||En(e);return kn(t)?t.host:t}function qn(e){let t=Kn(e);return Un(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&jn(t)?t:qn(t)}function Jn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qn(e),i=r===e.ownerDocument?.body,a=Tn(r);if(i){let e=Yn(a);return t.concat(a,a.visualViewport||[],jn(r)?r:[],e&&n?Jn(e):[])}return t.concat(r,Jn(r,[],n))}function Yn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Xn;process.env.NODE_ENV!==`production`&&(Xn=new Set);function Zn(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);Xn.has(t)||(Xn.add(t),console.error(`Base UI: ${t}`))}}const Qn=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Qn.displayName=`CompositeRootContext`);function $n(e=!1){let t=l.useContext(Qn);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?h(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return t}function er(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:l.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function tr(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=l.useRef(null),o=$n(!0)!==void 0,s=G(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=er({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i});process.env.NODE_ENV!==`production`&&l.useEffect(()=>{if(!a.current)return;let e=a.current.tagName===`BUTTON`;i?e||Zn("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):e&&Zn("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[i]);let u=l.useCallback(()=>{let e=a.current;nr(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return K(u,[u]),{getButtonProps:l.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return M({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(R(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(R(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:G(e=>{a.current=e,u()})}}function nr(e){return On(e)&&e.tagName===`BUTTON`}const rr=l.createContext({invalid:void 0,name:void 0,validityData:{state:mn,errors:[],error:``,value:``,initialValue:null},setValidityData:B,disabled:void 0,touched:!1,setTouched:B,dirty:!1,setDirty:B,filled:!1,setFilled:B,focused:!1,setFocused:B,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=H)=>e,getInputValidationProps:(e=H)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!==`production`&&(rr.displayName=`FieldRootContext`);function ir(e=!0){let t=l.useContext(rr);if(t.setValidityData===B&&!e)throw Error(process.env.NODE_ENV===`production`?h(28):`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return t}const ar=l.createContext({disabled:!1});process.env.NODE_ENV!==`production`&&(ar.displayName=`FieldItemContext`);function or(){return l.useContext(ar)}function sr(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const cr=l.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:B,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});process.env.NODE_ENV!==`production`&&(cr.displayName=`FormContext`);function lr(){return l.useContext(cr)}function ur(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=lr(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:f}=ir(),p=G(e.getValue);K(()=>{if(!t)return;let e=n;e===void 0&&(e=p()),u.initialValue===null&&e!==null&&f(t=>({...t,initialValue:e}))},[t,f,n,u.initialValue,p]),K(()=>{!t||!r||s.current.fields.set(r,{getValue:p,name:i,controlRef:a,validityData:sr(u,c),validate(){let e=n;e===void 0&&(e=p()),l.current=!0,d.flushSync(()=>o(e))}})},[o,a,t,s,p,r,c,l,i,u,n]),K(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}const dr=l.createContext({controlId:void 0,setControlId:B,labelId:void 0,setLabelId:B,messageIds:[],setMessageIds:B,getDescriptionProps:e=>e});process.env.NODE_ENV!==`production`&&(dr.displayName=`LabelableContext`);function fr(){return l.useContext(dr)}const pr=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(pr.displayName=`CheckboxGroupContext`);function mr(e=!0){let t=l.useContext(pr);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?h(3):`Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.`);return t}const hr=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(hr.displayName=`CheckboxRootContext`);function gr(){let e=l.useContext(hr);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(14):`Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.`);return e}const _r=`none`,vr=`trigger-press`,yr=`trigger-hover`,br=`trigger-focus`,xr=`outside-press`,Sr=`close-press`,Cr=`focus-out`,wr=`escape-key`,Tr=`disabled`,Er=`imperative-action`;function Dr(e,t,n,r){let i=!1,a=!1,o=r??H;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Or(e,t){let n=l.useRef(e),r=G(t);K(()=>{n.current!==e&&r(n.current)},[e,r]),K(()=>{n.current=e},[e])}const kr=`data-parent`,Ar=l.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,disabled:a=!1,id:o,indeterminate:s=!1,inputRef:c,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:y,nativeButton:b=!1,...x}=e,{clearErrors:S}=lr(),{disabled:C,name:w,setDirty:T,setFilled:E,setFocused:D,setTouched:O,state:k,validationMode:A,validityData:j,shouldValidateOnChange:N,validation:P}=ir(),ee=or(),{labelId:te,controlId:F,setControlId:I,getDescriptionProps:L}=fr(),R=mr(),z=R?.parent,ne=z&&R.allValues,V=C||ee.disabled||R?.disabled||a,re=w??d,U=y??re,ie=Sn(),ae=Sn(),oe=F;ne?oe=p?ae:`${z.id}-${U}`:o&&(oe=o);let se={};ne&&(p?se=R.parent.getParentProps():U&&(se=R.parent.getChildProps(U)));let ce=G(f),{checked:le=n,indeterminate:ue=s,onCheckedChange:de,...fe}=se,pe=R?.value,me=R?.setValue,he=R?.defaultValue,ge=l.useRef(null),{getButtonProps:_e,buttonRef:ve}=tr({disabled:V,native:b}),ye=R?.validation??P,[be,xe]=un({controlled:U&&pe&&!p?pe.includes(U):le,default:U&&he&&!p?he.includes(U):i,name:`Checkbox`,state:`checked`});K(()=>{if(I!==B)return I(oe),()=>{I(void 0)}},[oe,R,I,p]),ur({enabled:!R,id:ie,commit:ye.commit,value:be,controlRef:ge,name:re,getValue:()=>be});let Se=l.useRef(null),Ce=v(c,Se,ye.inputRef);K(()=>{Se.current&&(Se.current.indeterminate=ue,be&&E(!0))},[be,ue,E]),Or(be,()=>{R&&!p||(S(re),E(be),T(be!==j.initialValue),N()?ye.commit(be):ye.commit(be,!0))});let we=M({checked:be,disabled:V,name:p?void 0:re,id:oe??void 0,required:g,ref:Ce,style:dn,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Dr(_r,e.nativeEvent);de?.(t,n),ce(t,n),!n.isCanceled&&(xe(t),U&&pe&&me&&!p&&me(t?[...pe,U]:pe.filter(e=>e!==U),n))},onFocus(){ge.current?.focus()}},y===void 0?H:{value:(R?be&&y:y)||``},L,R?ye.getValidationProps:ye.getInputValidationProps),Te=ne?!!le:be,Ee=ne&&ue||s;l.useEffect(()=>{z&&U&&z.disabledStatesRef.current.set(U,V)},[z,V,U]);let De=l.useMemo(()=>({...k,checked:Te,disabled:V,readOnly:m,required:g,indeterminate:Ee}),[k,Te,V,m,g,Ee]),Oe=gn(De),ke=W(`span`,e,{state:De,ref:[ve,ge,t,R?.registerControlRef],props:[{id:ie,role:`checkbox`,"aria-checked":ue?`mixed`:be,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":te,"data-parent":p?``:void 0,onFocus(){D(!0)},onBlur(){let e=Se.current;e&&(O(!0),D(!1),A===`onBlur`&&ye.commit(R?pe:e.checked))},onClick(e){m||V||(e.preventDefault(),Se.current?.click())}},L,ye.getValidationProps,x,fe,_e],stateAttributesMapping:Oe});return(0,u.jsxs)(hr.Provider,{value:De,children:[ke,!be&&!R&&re&&!p&&_!==void 0&&(0,u.jsx)(`input`,{type:`hidden`,name:re,value:_}),(0,u.jsx)(`input`,{...we})]})});process.env.NODE_ENV!==`production`&&(Ar.displayName=`CheckboxRoot`);function jr(e){let t=_(Mr,e).current;return t.next=e,K(t.effect),t}function Mr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Nr=null,Pr=globalThis.requestAnimationFrame,Fr=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=process.env.NODE_ENV===`test`&&Pr!==requestAnimationFrame&&(Pr=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Ir=new Fr,Lr=class e{static create(){return new e}static request(e){return Ir.request(e)}static cancel(e){return Ir.cancel(e)}currentId=Nr;request(e){this.cancel(),this.currentId=Ir.request(()=>{this.currentId=Nr,e()})}cancel=()=>{this.currentId!==Nr&&(Ir.cancel(this.currentId),this.currentId=Nr)};disposeEffect=()=>this.cancel};function Rr(){let e=_(Lr.create).current;return xe(e.disposeEffect),e}function zr(e){return e==null?e:`current`in e?e.current:e}function Br(e,t=!1,n=!0){let r=Rr();return G((i,a=null)=>{r.cancel();let o=zr(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||d.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;d.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function Vr(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=jr(n),o=G(i),s=Br(r,n);l.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function Hr(e,t=!1,n=!1){let[r,i]=l.useState(e&&t?`idle`:void 0),[a,o]=l.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),K(()=>{if(!e&&a&&r!==`ending`&&n){let e=Lr.request(()=>{i(`ending`)});return()=>{Lr.cancel(e)}}},[e,a,r,n]),K(()=>{if(!e||t)return;let n=Lr.request(()=>{i(void 0)});return()=>{Lr.cancel(n)}},[t,e]),K(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Lr.request(()=>{i(`idle`)});return()=>{Lr.cancel(n)}},[t,e,a,i,r]),l.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}let Ur=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({});var Wr={[Ur.startingStyle]:``},Gr={[Ur.endingStyle]:``};const Kr={transitionStatus(e){return e===`starting`?Wr:e===`ending`?Gr:null}},qr=l.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=gr(),s=o.checked||o.indeterminate,{transitionStatus:c,setMounted:u}=Hr(s),d=l.useRef(null),f=l.useMemo(()=>({...o,transitionStatus:c}),[o,c]);Vr({open:s,ref:d,onComplete(){s||u(!1)}});let p=gn(o),m=l.useMemo(()=>({...p,...Kr,...hn}),[p]),h=i||s,g=W(`span`,e,{enabled:h,ref:[t,d],state:f,stateAttributesMapping:m,props:a});return h?g:null});process.env.NODE_ENV!==`production`&&(qr.displayName=`CheckboxIndicator`);var Jr=m();const Yr=e=>{let t=(0,Jr.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,u.jsx)(qr,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};var Xr=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),Zr=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),Qr=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),$r=(0,l.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),ei=l.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=l.useContext($r);return l.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??f,height:i??f,fill:r??d,viewBox:`0 0 256 256`,transform:o||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&l.createElement(`title`,null,n),s,c.get(a??p))});ei.displayName=`IconBase`;var ti=l.forwardRef((e,t)=>l.createElement(ei,{ref:t,...e,weights:Xr}));ti.displayName=`CaretUpIcon`;var ni=l.forwardRef((e,t)=>l.createElement(ei,{ref:t,...e,weights:Zr}));ni.displayName=`CheckIcon`;var ri=l.forwardRef((e,t)=>l.createElement(ei,{ref:t,...e,weights:Qr}));ri.displayName=`XIcon`;var ii=m();const ai=e=>{let t=(0,ii.c)(23),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:n,ref:s,label:a,id:i,disabled:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c;t[7]===n?c=t[8]:(c=X(`flex size-md items-center text-on-accent justify-center rounded-sm bg-surface-dim inset-shadow-1-shadow data-checked:bg-accent data-checked:raised-1 hover:cursor-pointer transition-colors hover:disabled:cursor-not-allowed`,n),t[7]=n,t[8]=c);let l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,u.jsx)(Yr,{children:(0,u.jsx)(ni,{weight:`bold`})}),t[9]=l):l=t[9];let d;t[10]!==r||t[11]!==i||t[12]!==o||t[13]!==s||t[14]!==c?(d=(0,u.jsx)(Ar,{id:i,disabled:r,className:c,ref:s,...o,children:l}),t[10]=r,t[11]=i,t[12]=o,t[13]=s,t[14]=c,t[15]=d):d=t[15];let f;t[16]!==r||t[17]!==i||t[18]!==a?(f=a&&(0,u.jsx)(`label`,{htmlFor:i,className:X(`body-base cursor-pointer`,r&&`text-text-neutral-primary-disabled cursor-not-allowed`),children:a}),t[16]=r,t[17]=i,t[18]=a,t[19]=f):f=t[19];let p;return t[20]!==d||t[21]!==f?(p=(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d,f]}),t[20]=d,t[21]=f,t[22]=p):p=t[22],p},oi=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(oi.displayName=`DialogRootContext`);function si(e){let t=l.useContext(oi);if(e===!1&&t===void 0)throw Error(process.env.NODE_ENV===`production`?h(27):`Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.`);return t}let ci=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Ur.startingStyle]=`startingStyle`,e[e.endingStyle=Ur.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),li=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({});var ui={[li.popupOpen]:``},di={[li.popupOpen]:``,[li.pressed]:``},fi={[ci.open]:``},pi={[ci.closed]:``},mi={[ci.anchorHidden]:``};const hi={open(e){return e?ui:null}},gi={open(e){return e?fi:pi},anchorHidden(e){return e?mi:null}};var _i={...gi,...Kr};const vi=l.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=si(),s=o.useState(`open`),c=o.useState(`nested`),u=o.useState(`mounted`),d=o.useState(`transitionStatus`);return W(`div`,e,{state:l.useMemo(()=>({open:s,transitionStatus:d}),[s,d]),ref:[o.context.backdropRef,t],stateAttributesMapping:_i,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})});process.env.NODE_ENV!==`production`&&(vi.displayName=`DialogBackdrop`);const yi=l.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=si(),c=s.useState(`open`);function u(e){c&&s.setOpen(!1,Dr(`close-press`,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=tr({disabled:i,native:a});return W(`button`,e,{state:l.useMemo(()=>({disabled:i}),[i]),ref:[t,f],props:[{onClick:u},o,d]})});process.env.NODE_ENV!==`production`&&(yi.displayName=`DialogClose`);const bi=l.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=si(),s=Sn(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),W(`p`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(bi.displayName=`DialogDescription`);var xi=typeof navigator<`u`,Si=Ni(),Ci=Fi(),wi=Pi();const Ti=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),Ei=Si.platform===`MacIntel`&&Si.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Si.platform),Di=xi&&/firefox/i.test(wi),Oi=xi&&/apple/i.test(navigator.vendor),ki=xi&&/Edg/i.test(wi),Ai=xi&&/android/i.test(Ci)||/android/i.test(wi),ji=xi&&Ci.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,Mi=wi.includes(`jsdom/`);function Ni(){if(!xi)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function Pi(){if(!xi)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Fi(){if(!xi)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}const Ii=`data-base-ui-focusable`,Li=`active`,Ri=`selected`,zi=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Bi=`ArrowLeft`,Vi=`ArrowRight`,Hi=`ArrowUp`,Ui=`ArrowDown`;function Wi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&kn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Gi(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ki(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function qi(e){return e.matches(`html,body`)}function Ji(e){return e?.ownerDocument||document}function Yi(e){return On(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Xi(e){return e?e.getAttribute(`role`)===`combobox`&&Yi(e):!1}function Zi(e){if(!e||Mi)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Qi(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function $i(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...$i(e,t.id,n)])}function ea(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ta(e){e.preventDefault(),e.stopPropagation()}function na(e){return`nativeEvent`in e}function ra(e){return e.mozInputSource===0&&e.isTrusted?!0:Ai&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ia(e){return Mi?!1:!Ai&&e.width===0&&e.height===0||Ai&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function aa(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function oa(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var sa=[`top`,`right`,`bottom`,`left`],ca=Math.min,la=Math.max,ua=Math.round,da=Math.floor,fa=e=>({x:e,y:e}),pa={left:`right`,right:`left`,bottom:`top`,top:`bottom`},ma={start:`end`,end:`start`};function ha(e,t,n){return la(e,ca(t,n))}function ga(e,t){return typeof e==`function`?e(t):e}function _a(e){return e.split(`-`)[0]}function va(e){return e.split(`-`)[1]}function ya(e){return e===`x`?`y`:`x`}function ba(e){return e===`y`?`height`:`width`}var xa=new Set([`top`,`bottom`]);function Sa(e){return xa.has(_a(e))?`y`:`x`}function Ca(e){return ya(Sa(e))}function wa(e,t,n){n===void 0&&(n=!1);let r=va(e),i=Ca(e),a=ba(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Na(o)),[o,Na(o)]}function Ta(e){let t=Na(e);return[Ea(e),t,Ea(t)]}function Ea(e){return e.replace(/start|end/g,e=>ma[e])}var Da=[`left`,`right`],Oa=[`right`,`left`],ka=[`top`,`bottom`],Aa=[`bottom`,`top`];function ja(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Oa:Da:t?Da:Oa;case`left`:case`right`:return t?ka:Aa;default:return[]}}function Ma(e,t,n,r){let i=va(e),a=ja(_a(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ea)))),a}function Na(e){return e.replace(/left|right|bottom|top/g,e=>pa[e])}function Pa(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fa(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Pa(e)}function Ia(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function La(e,t,n){return Math.floor(e/t)!==n}function Ra(e,t){return t<0||t>=e.current.length}function za(e,t){return Va(e,{disabledIndices:t})}function Ba(e,t){return Va(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Va(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&Ka(e,a,r));return a}function Ha(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f=[],p={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(e==null)return;let i=e.closest(`[role="row"]`);i&&(m=!0),(i!==t||n===-1)&&(t=i,n+=1,f[n]=[]),f[n].push(r),p[r]=n})}let h=m&&f.length>0&&f.some(e=>e.length!==a);function g(t){if(!h||l===-1)return;let n=p[l];if(n==null)return;let i=f[n].indexOf(l),a=t===`up`?n-1:n+1;r&&(a<0?a=f.length-1:a>=f.length&&(a=0));let s=new Set;for(;a>=0&&a<f.length&&!s.has(a);){s.add(a);let n=f[a];if(n.length===0){a=t===`up`?a-1:a+1;continue}let c=Math.min(i,n.length-1);for(let t=c;t>=0;--t){let r=n[t];if(!Ka(e,r,o))return r}a=t===`up`?a-1:a+1,r&&(a<0?a=f.length-1:a>=f.length&&(a=0))}}if(t.key===`ArrowUp`){let n=g(`up`);if(n!==void 0)u&&ta(t),d=n;else{if(u&&ta(t),l===-1)d=c;else if(d=Va(e,{startingIndex:d,amount:a,decrement:!0,disabledIndices:o}),r&&(l-a<s||d<0)){let e=l%a,t=c%a,n=c-(t-e);d=t===e?c:t>e?n:n-a}Ra(e,d)&&(d=l)}}if(t.key===`ArrowDown`){let n=g(`down`);n===void 0?(u&&ta(t),l===-1?d=s:(d=Va(e,{startingIndex:l,amount:a,disabledIndices:o}),r&&l+a>c&&(d=Va(e,{startingIndex:l%a-a,amount:a,disabledIndices:o}))),Ra(e,d)&&(d=l)):(u&&ta(t),d=n)}if(n===`both`){let n=da(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&ta(t),l%a===a-1?r&&(d=Va(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=Va(e,{startingIndex:l,disabledIndices:o}),r&&La(d,a,n)&&(d=Va(e,{startingIndex:l-l%a-1,disabledIndices:o}))),La(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&ta(t),l%a===0?r&&(d=Va(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=Va(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&La(d,a,n)&&(d=Va(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),La(d,a,n)&&(d=l));let s=da(c/a)===n;Ra(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:Va(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function Ua(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{if(e>t&&process.env.NODE_ENV!==`production`)throw Error(process.env.NODE_ENV===`production`?h(29,o):`[Floating UI]: Invalid grid - item width at index ${o} is greater than grid columns`);let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function Wa(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function Ga(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Ka(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r?r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`:!1}var qa=[`input:not([inert])`,`select:not([inert])`,`textarea:not([inert])`,`a[href]:not([inert])`,`button:not([inert])`,`[tabindex]:not(slot):not([inert])`,`audio[controls]:not([inert])`,`video[controls]:not([inert])`,`[contenteditable]:not([contenteditable="false"]):not([inert])`,`details>summary:first-of-type:not([inert])`,`details:not([inert])`],Ja=qa.join(`,`),Ya=typeof Element>`u`,Xa=Ya?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Za=!Ya&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Qa=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&Qa(e.parentNode)},$a=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},eo=function(e,t,n){if(Qa(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ja));return t&&Xa.call(e,Ja)&&r.unshift(e),r=r.filter(n),r},to=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Qa(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=to(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Xa.call(a,Ja)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Qa(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=to(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},no=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},ro=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||$a(e))&&!no(e)?0:e.tabIndex},io=function(e,t){var n=ro(e);return n<0&&t&&!no(e)?0:n},ao=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},oo=function(e){return e.tagName===`INPUT`},so=function(e){return oo(e)&&e.type===`hidden`},co=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},lo=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},uo=function(e){if(!e.name)return!0;var t=e.form||Za(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=lo(r,e.form);return!i||i===e},fo=function(e){return oo(e)&&e.type===`radio`},po=function(e){return fo(e)&&!uo(e)},mo=function(e){var t=e&&Za(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Za(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},ho=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},go=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Xa.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Xa.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Za(e);if(o&&!o.shadowRoot&&r(o)===!0)return ho(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(mo(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return ho(e);return!1},_o=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Xa.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},vo=function(e,t){return!(t.disabled||Qa(t)||so(t)||go(t,e)||co(t)||_o(t))},yo=function(e,t){return!(po(t)||ro(t)<0||!vo(e,t))},bo=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},xo=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=io(a,i),s=i?xo(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(ao).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},So=function(e,t){return t||={},xo(t.getShadowRoot?to([e],t.includeContainer,{filter:yo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:bo}):eo(e,t.includeContainer,yo.bind(null,t)))},Co=function(e,t){return t||={},t.getShadowRoot?to([e],t.includeContainer,{filter:vo.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):eo(e,t.includeContainer,vo.bind(null,t))},wo=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Xa.call(e,Ja)===!1?!1:yo(t,e)};const To=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Eo(e,t){let n=So(e,To()),r=n.length;if(r===0)return;let i=Wi(Ji(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Do(e){return Eo(Ji(e).body,1)||e}function Oo(e){return Eo(Ji(e).body,-1)||e}function ko(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function Ao(e){So(e,To()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function jo(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Mo(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var No=l.createContext(null);process.env.NODE_ENV!==`production`&&(No.displayName=`FloatingNodeContext`);var Po=l.createContext(null);process.env.NODE_ENV!==`production`&&(Po.displayName=`FloatingTreeContext`);const Fo=()=>l.useContext(No)?.id||null,Io=e=>{let t=l.useContext(Po);return e??t};function Lo(e){return`data-base-ui-${e}`}var Ro=Lo(`safe-polygon`),zo=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zi}`;function Bo(e,t,n){if(n&&!aa(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var Vo=l.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ce,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(Vo.displayName=`FloatingDelayGroupContext`);function Ho(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=l.useRef(n),a=l.useRef(n),o=l.useRef(null),s=l.useRef(null),c=we();return(0,u.jsx)(Vo.Provider,{value:l.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Uo(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:u,currentContextRef:d,hasProvider:f,timeout:p}=l.useContext(Vo),[m,h]=l.useState(!1);return K(()=>{function e(){h(!1),d.current?.setIsInstantPhase(!1),o.current=null,d.current=null,s.current=u.current}if(i&&o.current&&!a&&o.current===r){if(h(!1),c){let t=r;return p.start(c,()=>{n.select(`open`)||o.current&&o.current!==t||e()}),()=>{p.clear()}}e()}},[i,a,r,o,s,c,u,d,p,n]),K(()=>{if(!i||!a)return;let e=d.current,t=o.current;p.clear(),d.current={onOpenChange:n.setOpen,setIsInstantPhase:h},o.current=r,s.current={open:0,close:Bo(u.current,`close`)},t!==null&&t!==r?(h(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Dr(_r))):(h(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,u,d,p]),K(()=>()=>{d.current=null},[d]),l.useMemo(()=>({hasProvider:f,delayRef:s,isInstantPhase:m}),[f,s,m])}function Wo(e){return e?.ownerDocument||document}const Go=l.forwardRef(function(e,t){let[n,r]=l.useState();K(()=>{Oi&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,u.jsx)(`span`,{...e,ref:t,style:dn,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});process.env.NODE_ENV!==`production`&&(Go.displayName=`FocusGuard`);var Ko=0;function qo(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Ko);let a=()=>e?.focus({preventScroll:n});i?a():Ko=requestAnimationFrame(a)}var Jo={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Yo(e){return e===`inert`?Jo.inert:e===`aria-hidden`?Jo[`aria-hidden`]:Jo.none}var Xo=new WeakSet,Zo={},Qo=0,$o=e=>e&&(e.host||$o(e.parentNode)),es=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=$o(t);return e.contains(n)?n:null}).filter(e=>e!=null);function ts(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=es(t,e),s=new Set,c=new Set(o),l=[];Zo[i]||(Zo[i]=new WeakMap);let u=Zo[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(wn(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Yo(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Xo.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Qo+=1,()=>{l.forEach(e=>{let t=Yo(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Xo.has(e)&&a&&e.removeAttribute(a),Xo.delete(e)),r||e.removeAttribute(i)}),--Qo,Qo||(Jo.inert=new WeakMap,Jo[`aria-hidden`]=new WeakMap,Jo.none=new WeakMap,Xo=new WeakSet,Zo={})}}function ns(e,t=!1,n=!1){let r=Ji(e[0]).body;return ts(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var rs=l.createContext(null);process.env.NODE_ENV!==`production`&&(rs.displayName=`PortalContext`);const is=()=>l.useContext(rs);var as=Lo(`portal`);function os(e={}){let{ref:t,container:n,componentProps:r=H,elementProps:i,elementState:a}=e,o=xn(),s=is()?.portalNode,[c,u]=l.useState(null),[f,p]=l.useState(null),m=l.useRef(null);K(()=>{if(n===null){m.current&&(m.current=null,p(null),u(null));return}if(o==null)return;let e=(n&&(Dn(n)?n:n.current))??s??document.body;if(e==null){m.current&&(m.current=null,p(null),u(null));return}m.current!==e&&(m.current=e,p(null),u(e))},[n,s,o]);let h=W(`div`,r,{ref:[t,p],state:a,props:[{id:o,[as]:``},i]});return{portalNode:f,portalSubtree:c&&h?d.createPortal(h,c):null}}const ss=l.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:f}=os({container:r,ref:t,componentProps:e,elementProps:s}),p=l.useRef(null),m=l.useRef(null),h=l.useRef(null),g=l.useRef(null),[_,v]=l.useState(null),y=_?.modal,b=_?.open,x=typeof o==`boolean`?o:!!_&&!_.modal&&_.open&&!!c;l.useEffect(()=>{if(!c||y)return;function e(e){c&&ko(e)&&(e.type===`focusin`?jo:Ao)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,y]),l.useEffect(()=>{!c||b||jo(c)},[b,c]);let S=l.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:c,setFocusManagerState:v}),[c]);return(0,u.jsxs)(l.Fragment,{children:[f,(0,u.jsxs)(rs.Provider,{value:S,children:[x&&c&&(0,u.jsx)(Go,{"data-type":`outside`,ref:p,onFocus:e=>{ko(e,c)?h.current?.focus():Oo(_?_.domReference:null)?.focus()}}),x&&c&&(0,u.jsx)(`span`,{"aria-owns":c.id,style:ae}),c&&d.createPortal(n,c),x&&c&&(0,u.jsx)(Go,{"data-type":`outside`,ref:m,onFocus:e=>{ko(e,c)?g.current?.focus():(Do(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,Dr(`focus-out`,e.nativeEvent)))}})]})]})});process.env.NODE_ENV!==`production`&&(ss.displayName=`FloatingPortal`);function cs(e,t){let n=Tn(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ls=20,us=[];function ds(){us=us.filter(e=>e.isConnected)}function fs(e){ds(),e&&wn(e)!==`body`&&(us.push(e),us.length>ls&&(us=us.slice(-ls)))}function ps(){return ds(),us[us.length-1]}function ms(e){if(!e)return null;let t=To();return wo(e,t)?e:So(e,t)[0]||e}function hs(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Wn(e).display!==`none`}function gs(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=To(),r=Co(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return wo(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function _s(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:d=!0,openInteractionType:f=``,getInsideElements:p=()=>[],nextFocusableElement:m,previousFocusableElement:h,beforeContentFocusGuardRef:g,externalTree:_}=e,y=`rootStore`in t?t.rootStore:t,b=y.useState(`open`),x=y.useState(`domReferenceElement`),S=y.useState(`floatingElement`),{events:C,dataRef:w}=y.context,T=G(()=>w.current.floatingContext?.nodeId),E=G(p),D=a===!1,O=Xi(x)&&D,k=jr(i),A=jr(a),j=jr(o),M=jr(f),N=Io(_),P=is(),ee=l.useRef(null),te=l.useRef(null),F=l.useRef(!1),I=l.useRef(!1),L=l.useRef(!1),R=l.useRef(-1),z=l.useRef(``),ne=l.useRef(``),B=we(),V=we(),H=Rr(),re=P!=null,U=Qi(S),ie=G((e=U)=>e?So(e,To()):[]),ae=G(e=>{let t=ie(e);return k.current.map(()=>t).filter(Boolean).flat()});l.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(U,Wi(Ji(U)))&&ie().length===0&&!O&&ta(e)}let t=Ji(U);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,x,U,c,k,O,ie,ae]),l.useEffect(()=>{if(r||!S)return;function e(e){let t=Gi(e),n=ie().indexOf(t);n!==-1&&(R.current=n)}return S.addEventListener(`focusin`,e),()=>{S.removeEventListener(`focusin`,e)}},[r,S,ie]),l.useEffect(()=>{if(r||!b)return;let e=Ji(U);function t(){L.current=!1}function n(e){let t=Gi(e);L.current=!(Q(S,t)||Q(x,t)||Q(P?.portalNode,t)),ne.current=e.pointerType||`keyboard`}function i(){ne.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,S,x,U,b,P]),l.useEffect(()=>{if(r||!d)return;function e(){I.current=!0,V.start(0,()=>{I.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=Gi(e);queueMicrotask(()=>{let i=T(),a=y.context.triggerElements,o=!(Q(x,t)||Q(S,t)||Q(t,S)||Q(P?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>Q(e,t))||t?.hasAttribute(Lo(`focus-guard`))||N&&($i(N.nodesRef.current,i).find(e=>Q(e.context?.elements.floating,t)||Q(e.context?.elements.domReference,t))||ea(N.nodesRef.current,i).find(e=>[e.context?.elements.floating,Qi(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===x&&U&&gs(U,k),s&&n!==x&&!hs(r)&&Wi(Ji(U))===Ji(U).body){if(On(U)&&(U.focus(),s===`popup`)){H.request(()=>{U.focus()});return}let e=R.current,t=ie(),n=t[e]||t[t.length-1]||U;On(n)&&n.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(O||!c)&&t&&o&&!I.current&&(O||t!==ps())&&(F.current=!0,y.setOpen(!1,Dr(`focus-out`,e)))})}function n(){L.current||(w.current.insideReactTree=!0,B.start(0,()=>{w.current.insideReactTree=!1}))}let i=On(x)?x:null,a=[];if(!(!S&&!i))return i&&(i.addEventListener(`focusout`,t),i.addEventListener(`pointerdown`,e),a.push(()=>{i.removeEventListener(`focusout`,t),i.removeEventListener(`pointerdown`,e)})),S&&(S.addEventListener(`focusout`,t),P&&(S.addEventListener(`focusout`,n,!0),a.push(()=>{S.removeEventListener(`focusout`,n,!0)})),a.push(()=>{S.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[r,x,S,U,c,N,P,y,d,s,ie,O,T,k,w,B,V,H]);let W=l.useRef(null),oe=l.useRef(null),se=v(W,g,P?.beforeInsideRef),ce=v(oe,P?.afterInsideRef);l.useEffect(()=>{if(r||!S||!b)return;let e=Array.from(P?.portalNode?.querySelectorAll(`[${Lo(`portal`)}]`)||[]),t=ns([S,(N?ea(N.nodesRef.current,T()):[]).find(e=>Xi(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,...E(),ee.current,te.current,W.current,oe.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,zr(h),zr(m),O?x:null].filter(e=>e!=null),c||O);return()=>{t()}},[b,r,x,S,c,k,P,O,N,T,E,m,h]),K(()=>{if(!b||r||!On(U))return;let e=Wi(Ji(U));queueMicrotask(()=>{let t=ae(U),n=A.current,r=typeof n==`function`?n(M.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||U:zr(r),i=i||t[0]||U,!Q(U,e)&&qo(i,{preventScroll:i===U})})},[r,b,U,D,ae,A,M]),K(()=>{if(r||!U)return;let e=Ji(U);fs(Wi(e));function t(e){if(e.open||(z.current=cs(e.nativeEvent,ne.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(F.current=!0),e.reason===`outside-press`)if(e.nested)F.current=!1;else if(ra(e.nativeEvent)||ia(e.nativeEvent))F.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?F.current=!1:F.current=!0}}C.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,dn),re&&x&&x.insertAdjacentElement(`afterend`,n);function i(){let e=j.current,t=typeof e==`function`?e(z.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=x||ps();return e&&e.isConnected?e:n}let r=x||ps()||n;return zr(t)||r}return()=>{C.off(`openchange`,t);let r=Wi(e),a=Q(S,r)||N&&$i(N.nodesRef.current,T(),!1).some(e=>Q(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=ms(o),i=typeof j.current!=`boolean`;j.current&&!F.current&&On(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,S,U,j,w,C,N,re,x,T]),l.useEffect(()=>{queueMicrotask(()=>{F.current=!1})},[r]),l.useEffect(()=>{if(r||!b)return;function e(e){Gi(e)?.closest(`[data-base-ui-click-trigger]`)&&(I.current=!0)}let t=Ji(U);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[r,b,U]),K(()=>{if(!r&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:d,open:b,onOpenChange:y.setOpen,domReference:x}),()=>{P.setFocusManagerState(null)}},[r,P,c,b,y,d,x]),K(()=>{if(!(r||!U))return gs(U,k),()=>{queueMicrotask(ds)}},[r,U,k]);let le=!r&&(c?!O:!0)&&(re||c);return(0,u.jsxs)(l.Fragment,{children:[le&&(0,u.jsx)(Go,{"data-type":`inside`,ref:se,onFocus:e=>{if(c){let e=ae();qo(e[e.length-1])}else P?.portalNode&&(F.current=!1,ko(e,P.portalNode)?Do(x)?.focus():zr(h??P.beforeOutsideRef)?.focus())}}),n,le&&(0,u.jsx)(Go,{"data-type":`inside`,ref:ce,onFocus:e=>{c?qo(ae()[0]):P?.portalNode&&(d&&(F.current=!0),ko(e,P.portalNode)?Oo(x)?.focus():zr(m??P.afterOutsideRef)?.focus())}})]})}function vs(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:u=0}=t,d=l.useRef(void 0),f=Rr(),p=we(),m=l.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,l=n.select(`open`);if(e.button!==0||a===`click`||aa(t,!0)&&s)return;let m=r.current.openEvent,h=m?.type,g=n.select(`domReferenceElement`)!==e.currentTarget,_=l&&g||!(l&&o&&(!(m&&c)||h===`click`||h===`mousedown`));if(Yi(i.target)){let e=Dr(vr,i,i.target);_&&t===`touch`&&u>0?p.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(_,e);return}let v=e.currentTarget;f.request(()=>{let e=Dr(vr,i,v);_&&t===`touch`&&u>0?p.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(_,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(aa(t,!0)&&s)return;let i=n.select(`open`),l=r.current.openEvent,f=n.select(`domReferenceElement`)!==e.currentTarget,m=i&&f||!(i&&o&&(!(l&&c)||oa(l))),h=Dr(vr,e.nativeEvent,e.currentTarget);m&&t===`touch`&&u>0?p.start(u,()=>{n.setOpen(!0,h)}):n.setOpen(m,h)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,f,p,u]);return l.useMemo(()=>i?{reference:m}:H,[i,m])}function ys(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function bs(e){return e!=null&&e.clientX!=null}function xs(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:u=null,y:d=null}=t,f=l.useRef(!1),p=l.useRef(null),[m,h]=l.useState(),[g,_]=l.useState([]),v=G((e,t)=>{f.current||o.current.openEvent&&!bs(o.current.openEvent)||n.set(`positionReference`,ys(a,{x:e,y:t,axis:c,dataRef:o,pointerType:m}))}),y=G(e=>{u!=null||d!=null||(r?p.current||_([]):v(e.clientX,e.clientY))}),b=aa(m)?i:r,x=l.useCallback(()=>{if(!b||!s||u!=null||d!=null)return;let e=Tn(i);function t(n){Q(i,Gi(n))?(e.removeEventListener(`mousemove`,t),p.current=null):v(n.clientX,n.clientY)}if(!o.current.openEvent||bs(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),p.current=null};return p.current=n,n}n.set(`positionReference`,a)},[b,s,u,d,i,o,a,n,v]);l.useEffect(()=>x(),[x,g]),l.useEffect(()=>{s&&!i&&(f.current=!1)},[s,i]),l.useEffect(()=>{!s&&r&&(f.current=!0)},[s,r]),K(()=>{s&&(u!=null||d!=null)&&(f.current=!1,v(u,d))},[s,u,d,v]);let S=l.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return l.useMemo(()=>s?{reference:S}:{},[s,S])}function Ss(e,t,n){let{reference:r,floating:i}=e,a=Sa(t),o=Ca(t),s=ba(o),c=_a(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(va(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var Cs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ss(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Ss(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function ws(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ga(t,e),p=Fa(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ia(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Ia(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ts=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ga(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=_a(r),_=Sa(o),v=_a(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Na(o)]:Ta(o)),x=p!==`none`;!d&&x&&b.push(...Ma(o,m,p,y));let S=[o,...b],C=await ws(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=wa(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Sa(t))||T.every(e=>Sa(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Sa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Es(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ds(e){return sa.some(t=>e[t]>=0)}var Os=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=ga(e,t);switch(r){case`referenceHidden`:{let e=Es(await ws(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ds(e)}}}case`escaped`:{let e=Es(await ws(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ds(e)}}}default:return{}}}}},ks=new Set([`left`,`top`]);async function As(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_a(n),s=va(n),c=Sa(n)===`y`,l=ks.has(o)?-1:1,u=a&&c?-1:1,d=ga(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var js=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await As(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ms=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ga(e,t),l={x:n,y:r},u=await ws(t,c),d=Sa(_a(i)),f=ya(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=ha(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=ha(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Ns=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ga(e,t),u={x:n,y:r},d=Sa(i),f=ya(d),p=u[f],m=u[d],h=ga(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ks.has(_a(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ps=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ga(e,t),u=await ws(t,l),d=_a(i),f=va(i),p=Sa(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=ca(h-u[g],v),x=ca(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=la(u.left,0),t=la(u.right,0),n=la(u.top,0),r=la(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:la(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:la(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Fs(e){let t=Wn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=On(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ua(n)!==a||ua(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Is(e){return Z(e)?e:e.contextElement}function Ls(e){let t=Is(e);if(!On(t))return fa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Fs(t),o=(a?ua(n.width):n.width)/r,s=(a?ua(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Rs=fa(0);function zs(e){let t=Tn(e);return!Vn()||!t.visualViewport?Rs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tn(e)?!1:t}function Vs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Is(e),o=fa(1);t&&(r?Z(r)&&(o=Ls(r)):o=Ls(e));let s=Bs(a,n,r)?zs(a):fa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Tn(a),t=r&&Z(r)?Tn(r):r,n=e,i=Yn(n);for(;i&&r&&t!==n;){let e=Ls(i),t=i.getBoundingClientRect(),r=Wn(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Tn(i),i=Yn(n)}}return Ia({width:u,height:d,x:c,y:l})}function Hs(e,t){let n=Gn(e).scrollLeft;return t?t.left+n:Vs(En(e)).left+n}function Us(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Hs(e,n),y:n.top+t.scrollTop}}function Ws(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=En(r),s=t?Fn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=fa(1),u=fa(0),d=On(r);if((d||!d&&!a)&&((wn(r)!==`body`||jn(o))&&(c=Gn(r)),On(r))){let e=Vs(r);l=Ls(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Us(o,c):fa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Gs(e){return Array.from(e.getClientRects())}function Ks(e){let t=En(e),n=Gn(e),r=e.ownerDocument.body,i=la(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=la(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Hs(e),s=-n.scrollTop;return Wn(r).direction===`rtl`&&(o+=la(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var qs=25;function Js(e,t){let n=Tn(e),r=En(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Vn();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Hs(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=qs&&(a-=o)}else l<=qs&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ys=new Set([`absolute`,`fixed`]);function Xs(e,t){let n=Vs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=On(e)?Ls(e):fa(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Zs(e,t,n){let r;if(t===`viewport`)r=Js(e,n);else if(t===`document`)r=Ks(En(e));else if(Z(t))r=Xs(t,n);else{let n=zs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ia(r)}function Qs(e,t){let n=Kn(e);return n===t||!Z(n)||Un(n)?!1:Wn(n).position===`fixed`||Qs(n,t)}function $s(e,t){let n=t.get(e);if(n)return n;let r=Jn(e,[],!1).filter(e=>Z(e)&&wn(e)!==`body`),i=null,a=Wn(e).position===`fixed`,o=a?Kn(e):e;for(;Z(o)&&!Un(o);){let t=Wn(o),n=zn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ys.has(i.position)||jn(o)&&!n&&Qs(e,o))?r=r.filter(e=>e!==o):i=t,o=Kn(o)}return t.set(e,r),r}function ec(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Fn(t)?[]:$s(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Zs(t,n,i);return e.top=la(r.top,e.top),e.right=ca(r.right,e.right),e.bottom=ca(r.bottom,e.bottom),e.left=la(r.left,e.left),e},Zs(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function tc(e){let{width:t,height:n}=Fs(e);return{width:t,height:n}}function nc(e,t,n){let r=On(t),i=En(t),a=n===`fixed`,o=Vs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=fa(0);function l(){c.x=Hs(i)}if(r||!r&&!a)if((wn(t)!==`body`||jn(i))&&(s=Gn(t)),r){let e=Vs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Us(i,s):fa(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function rc(e){return Wn(e).position===`static`}function ic(e,t){if(!On(e)||Wn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return En(e)===n&&(n=n.ownerDocument.body),n}function ac(e,t){let n=Tn(e);if(Fn(e))return n;if(!On(e)){let t=Kn(e);for(;t&&!Un(t);){if(Z(t)&&!rc(t))return t;t=Kn(t)}return n}let r=ic(e,t);for(;r&&Nn(r)&&rc(r);)r=ic(r,t);return r&&Un(r)&&rc(r)&&!zn(r)?n:r||Bn(e)||n}var oc=async function(e){let t=this.getOffsetParent||ac,n=this.getDimensions,r=await n(e.floating);return{reference:nc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sc(e){return Wn(e).direction===`rtl`}var cc={convertOffsetParentRelativeRectToViewportRelativeRect:Ws,getDocumentElement:En,getClippingRect:ec,getOffsetParent:ac,getElementRects:oc,getClientRects:Gs,getDimensions:tc,getScale:Ls,isElement:Z,isRTL:sc};function lc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uc(e,t){let n=null,r,i=En(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=da(d),h=da(i.clientWidth-(u+f)),g=da(i.clientHeight-(d+p)),_=da(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:la(0,ca(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!lc(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function dc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Is(e),u=i||a?[...l?Jn(l):[],...Jn(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?uc(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Vs(e):null;c&&g();function g(){let t=Vs(e);h&&!lc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var fc=js,pc=Ms,mc=Ts,hc=Ps,gc=Os,_c=Ns,vc=(e,t,n)=>{let r=new Map,i={platform:cc,...n},a={...i.platform,_c:r};return Cs(e,t,{...i,platform:a})},yc=typeof document<`u`?l.useLayoutEffect:function(){};function bc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!bc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!bc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sc(e,t){let n=xc(e);return Math.round(t*n)/n}function Cc(e){let t=l.useRef(e);return yc(()=>{t.current=e}),t}function wc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[f,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=l.useState(r);bc(m,r)||h(r);let[g,_]=l.useState(null),[v,y]=l.useState(null),b=l.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=l.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=l.useRef(null),T=l.useRef(null),E=l.useRef(f),D=c!=null,O=Cc(c),k=Cc(i),A=Cc(u),j=l.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),vc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!bc(E.current,t)&&(E.current=t,d.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);yc(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);let M=l.useRef(!1);yc(()=>(M.current=!0,()=>{M.current=!1}),[]),yc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=l.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=l.useMemo(()=>({reference:S,floating:C}),[S,C]),ee=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Sc(P.floating,f.x),r=Sc(P.floating,f.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xc(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:ee}),[f,j,N,P,ee])}var Tc=(e,t)=>({...fc(e),options:[e,t]}),Ec=(e,t)=>({...pc(e),options:[e,t]}),Dc=(e,t)=>({..._c(e),options:[e,t]}),Oc=(e,t)=>({...mc(e),options:[e,t]}),kc=(e,t)=>({...hc(e),options:[e,t]}),Ac=(e,t)=>({...gc(e),options:[e,t]}),jc={intentional:`onClick`,sloppy:`onPointerDown`};function Mc(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Nc(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:u=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p=`sloppy`,referencePress:m=!1,referencePressEvent:h=`sloppy`,ancestorScroll:g=!1,bubbles:_,externalTree:v}=t,y=Io(v),b=G(typeof f==`function`?f:()=>!1),x=typeof f==`function`?b:f,S=l.useRef(!1),{escapeKey:C,outsidePress:w}=Mc(_),T=l.useRef(null),E=we(),D=we(),O=G(()=>{D.clear(),c.current.insideReactTree=!1}),k=l.useRef(!1),A=l.useRef(``),j=G(e=>{A.current=e.pointerType}),M=G(()=>{let e=A.current,t=e===`pen`||!e?`mouse`:e,n=typeof p==`function`?p():p;return typeof n==`string`?n:n[t]}),N=G(e=>{if(!r||!u||!d||e.key!==`Escape`||k.current)return;let t=c.current.floatingContext?.nodeId,i=y?$i(y.nodesRef.current,t):[];if(!C&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Dr(`escape-key`,na(e)?e.nativeEvent:e);n.setOpen(!1,a),!C&&!a.isPropagationAllowed&&e.stopPropagation()}),P=G(e=>{let t=M();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),ee=G(()=>{c.current.insideReactTree=!0,D.start(0,O)}),te=G((e,t=!1)=>{if(P(e)){O();return}if(c.current.insideReactTree){O();return}if(M()===`intentional`&&t||typeof x==`function`&&!x(e))return;let r=Gi(e),i=`[${Lo(`inert`)}]`,a=Ji(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>Q(e,r))))return;let s=Z(r)?r:null;for(;s&&!Un(s);){let e=Kn(s);if(Un(e)||!Z(e))break;s=e}if(a.length&&Z(r)&&!qi(r)&&!Q(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!Q(s,e)))return;if(On(r)&&!(`touches`in e)){let t=Un(r),n=Wn(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=y&&$i(y.nodesRef.current,l).some(t=>Ki(e,t.context?.elements.floating));if(Ki(e,n.select(`floatingElement`))||Ki(e,n.select(`domReferenceElement`))||u)return;let d=y?$i(y.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Dr(`outside-press`,e)),O()}),F=G(e=>{M()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!u||Ki(e,n.select(`floatingElement`))||Ki(e,n.select(`domReferenceElement`))||te(e)}),I=G(e=>{if(M()!==`sloppy`||!n.select(`open`)||!u||Ki(e,n.select(`floatingElement`))||Ki(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}),L=G(e=>{let t=Gi(e);function n(){I(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),R=G(e=>{let t=S.current;if(S.current=!1,E.clear(),e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)return;let n=Gi(e);function r(){e.type===`pointerdown`?F(e):te(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),z=G(e=>{if(M()!==`sloppy`||!T.current||Ki(e,n.select(`floatingElement`))||Ki(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(te(e),E.clear(),T.current=null)}),ne=G(e=>{let t=Gi(e);function n(){z(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),B=G(e=>{M()!==`sloppy`||!T.current||Ki(e,n.select(`floatingElement`))||Ki(e,n.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&te(e),E.clear(),T.current=null)}),V=G(e=>{let t=Gi(e);function n(){B(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});l.useEffect(()=>{if(!r||!u)return;c.current.__escapeKeyBubbles=C,c.current.__outsidePressBubbles=w;let e=new Ce;function t(e){n.setOpen(!1,Dr(_r,e))}function s(){e.clear(),k.current=!0}function l(){e.start(Vn()?5:0,()=>{k.current=!1})}let f=Ji(i);f.addEventListener(`pointerdown`,j,!0),d&&(f.addEventListener(`keydown`,N),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,l)),x&&(f.addEventListener(`click`,R,!0),f.addEventListener(`pointerdown`,R,!0),f.addEventListener(`touchstart`,L,!0),f.addEventListener(`touchmove`,ne,!0),f.addEventListener(`touchend`,V,!0),f.addEventListener(`mousedown`,R,!0));let p=[];return g&&(Z(o)&&(p=Jn(o)),Z(i)&&(p=p.concat(Jn(i))),!Z(a)&&a&&a.contextElement&&(p=p.concat(Jn(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,j,!0),d&&(f.removeEventListener(`keydown`,N),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,l)),x&&(f.removeEventListener(`click`,R,!0),f.removeEventListener(`pointerdown`,R,!0),f.removeEventListener(`touchstart`,L,!0),f.removeEventListener(`touchmove`,ne,!0),f.removeEventListener(`touchend`,V,!0),f.removeEventListener(`mousedown`,R,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,d,x,r,s,g,u,C,w,N,te,R,F,L,ne,V,j,n]),l.useEffect(O,[x,O]);let H=l.useMemo(()=>({onKeyDown:N,...m&&{[jc[h]]:e=>{n.setOpen(!1,Dr(`trigger-press`,e.nativeEvent))},...h!==`intentional`&&{onClick(e){n.setOpen(!1,Dr(`trigger-press`,e.nativeEvent))}}}}),[N,n,m,h]),re=G(e=>{let t=Gi(e.nativeEvent);!Q(n.select(`floatingElement`),t)||e.button!==0||(S.current=!0)}),U=l.useMemo(()=>({onKeyDown:N,onPointerDown:re,onMouseDown:re,onMouseUp:re,onClickCapture:ee,onMouseDownCapture:ee,onPointerDownCapture:ee,onMouseUpCapture:ee,onTouchEndCapture:ee,onTouchMoveCapture:ee}),[N,re,ee]);return l.useMemo(()=>u?{reference:H,floating:U,trigger:H}:{},[u,H,U])}var Pc=(e,t,n)=>{if(t.length===1&&t[0]===n){let t=!1;try{let n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`The result function returned its own inputs without modification. e.g
8
- \`createSelector([state => state.todos], todos => todos)\`
9
- This could lead to inefficient memoization and unnecessary re-renders.
10
- Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:e})}}},Fc=(e,t,n)=>{let{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:a,inputSelectorResultsCopy:o}=e,s=r(()=>({}),...i);if(s.apply(null,a)!==s.apply(null,o)){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`An input selector returned a different result when passed same arguments.
11
- This means your output selector will likely run more frequently than intended.
12
- Avoid returning a new reference inside your input selector, e.g.
13
- \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:a,secondInputs:o,stack:e})}},Ic={inputStabilityCheck:`once`,identityFunctionCheck:`once`},Lc=Symbol(`NOT_FOUND`);function Rc(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function zc(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Bc(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Vc=e=>Array.isArray(e)?e:[e];function Hc(e){let t=Array.isArray(e[0])?e[0]:e;return Bc(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Uc(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Wc=(e,t)=>{let{identityFunctionCheck:n,inputStabilityCheck:r}={...Ic,...t};return{identityFunctionCheck:{shouldRun:n===`always`||n===`once`&&e,run:Pc},inputStabilityCheck:{shouldRun:r===`always`||r===`once`&&e,run:Fc}}},Gc=Object.getPrototypeOf({});function Kc(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Lc},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function qc(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return Lc}function i(t,i){r(t)===Lc&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var Jc=(e,t)=>e===t;function Yc(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function Xc(e,t){let{equalityCheck:n=Jc,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=Yc(n),o=0,s=r<=1?Kc(a):qc(r,a);function c(){let t=s.get(arguments);if(t===Lc){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var Zc=class{constructor(e){this.value=e}deref(){return this.value}},Qc=typeof WeakRef<`u`?WeakRef:Zc,$c=0,el=1;function tl(){return{s:$c,v:void 0,o:null,p:null}}function nl(e,t={}){let n=tl(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=tl(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=tl(),e.set(n,t)):t=r}}let s=t,c;if(t.s===el)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Qc(c):c}return s.s=el,s.v=c,c}return o.clearCache=()=>{n=tl(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function rl(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Rc(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=nl,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Vc(c),p=Vc(u),m=Hc(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=!0,_=l(function(){r++;let e=Uc(m,arguments);if(i=h.apply(null,e),process.env.NODE_ENV!==`production`){let{identityFunctionCheck:t,inputStabilityCheck:n}=Wc(g,d);if(t.shouldRun&&t.run(o,e,i),n.shouldRun){let t=Uc(m,arguments);n.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:s,memoizeOptions:f},arguments)}g&&=!1}return i},...p);return Object.assign(_,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var il=rl(nl),al=Object.assign((e,t=il)=>{zc(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>al}),ol=rl({memoize:Xc,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const $=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(process.env.NODE_ENV===`production`?h(1):`Unsupported number of selectors`);let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s};var sl=o((e=>{var t=require(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),cl=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require(`react`),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),ll=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=sl():t.exports=cl()})),ul=o((e=>{var t=require(`react`),n=ll();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),dl=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=require(`react`),r=ll(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),fl=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=ul():t.exports=dl()})),pl=ll(),ml=fl(),hl=T(19)?_l:vl;function gl(e,t,n,r,i){return hl(e,t,n,r,i)}function _l(e,t,n,r,i){let a=l.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,pl.useSyncExternalStore)(e.subscribe,a,a)}function vl(e,t,n,r,i){return(0,ml.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var yl=class e{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},bl=class extends yl{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){l.useDebugValue(e),K(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){K(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){if(process.env.NODE_ENV!==`production`){l.useDebugValue(e,e=>Object.keys(e));let t=l.useRef(Object.keys(e)).current,n=Object.keys(e);(t.length!==n.length||t.some((e,t)=>e!==n[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}K(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){l.useDebugValue(e);let r=t!==void 0;if(process.env.NODE_ENV!==`production`){let t=this.controlledValues.get(e);t!==void 0&&t!==r&&console.error(`A component is changing the ${r?``:`un`}controlled state of ${e.toString()} to be ${r?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),K(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{l.useDebugValue(e);let i=this.selectors[e];return gl(this,i,t,n,r)};useContextCallback(e,t){l.useDebugValue(e);let n=G(t??B);this.context[e]=n}useStateSetter(e){let t=l.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function xl(){let[,e]=l.useState({});return l.useCallback(()=>{e({})},[])}var Sl={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},Cl=class extends bl{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Mo(),nested:t,noEmit:n,triggerElements:i},Sl)}setOpen=(e,t)=>{if((!e||!this.state.open||oa(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function wl(e,t){let n=l.useRef(null);return l.useCallback(r=>{e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null&&(n.current=e,t.context.triggerElements.add(e,r)))},[t,e])}function Tl(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=wl(e,n),o=G(t=>{a(t),t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return K(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function El(e){let t=e.useState(`open`);K(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function Dl(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Hr(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=G(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Vr({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Ol=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);if(n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t),process.env.NODE_ENV!==`production`&&this.elements.size!==this.idMap.size))throw Error(process.env.NODE_ENV===`production`?h(87):`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`)}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function kl(){return new Cl({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Ol,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function Al(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:kl(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:H,inactiveTriggerProps:H,popupProps:H}}const jl={open:$(e=>e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:$(e=>e.activeTriggerId),activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function Ml(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=xn(),a=Fo()!=null;if(process.env.NODE_ENV!==`production`){let e=r.reference;e&&!Z(e)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`",`instead.`)}let o=_(()=>new Cl({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new Ol,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return K(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Z(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=e.noEmit||!1,o}function Nl(e={}){let{nodeId:t,externalTree:n}=e,r=Ml(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=l.useState(null),c=l.useRef(null),u=Io(n);K(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let d=wc({...e,elements:{...a,...o&&{reference:o}}}),f=l.useCallback(e=>{let t=Z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),d.refs.setReference(t)},[d.refs]),[p,m]=l.useState(null),[h,g]=l.useState(null);i.useSyncedValue(`referenceElement`,p),i.useSyncedValue(`domReferenceElement`,Z(p)?p:null),i.useSyncedValue(`floatingElement`,h);let _=l.useCallback(e=>{(Z(e)||e===null)&&(c.current=e,m(e)),(Z(d.refs.reference.current)||d.refs.reference.current===null||e!==null&&!Z(e))&&d.refs.setReference(e)},[d.refs,m]),v=l.useCallback(e=>{g(e),d.refs.setFloating(e)},[d.refs]),y=l.useMemo(()=>({...d.refs,setReference:_,setFloating:v,setPositionReference:f,domReference:c}),[d.refs,_,v,f]),b=l.useMemo(()=>({...d.elements,domReference:a.domReference}),[d.elements,a.domReference]),x=i.useState(`open`),S=i.useState(`floatingId`),C=l.useMemo(()=>({...d,dataRef:i.context.dataRef,open:x,onOpenChange:i.setOpen,events:i.context.events,floatingId:S,refs:y,elements:b,nodeId:t,rootStore:i}),[d,y,b,t,i,x,S]);return K(()=>{i.context.dataRef.current.floatingContext=C;let e=u?.nodesRef.current.find(e=>e.id===t);e&&(e.context=C)}),l.useMemo(()=>({...d,context:C,refs:y,elements:b,rootStore:i}),[d,y,b,C,i])}function Pl(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=xn(),o=Fo()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=_(()=>new Cl({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return K(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Z(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var Fl=ji&&Oi;function Il(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=l.useRef(!1),c=we(),u=l.useRef(!0);l.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Tn(e);function r(){!n.select(`open`)&&On(e)&&e===Wi(Ji(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return t.addEventListener(`blur`,r),Fl&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),Fl&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),l.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let d=l.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=Gi(e.nativeEvent);if(o&&Z(t)){if(Fl&&!e.relatedTarget){if(!u.current&&!Yi(t))return}else if(!Zi(t))return}n.setOpen(!0,Dr(br,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=Z(t)&&t.hasAttribute(Lo(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=Wi(o?o.ownerDocument:document);!t&&s===o||Q(i.current.floatingContext?.refs.floating.current,s)||Q(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Dr(br,r))})}}),[i,n,o,c]);return l.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}const Ll=Lo(`safe-polygon`);var Rl=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zi}`;function zl(e){return e?!!e.closest(Rl):!1}function Bl(e){let t=l.useRef(void 0),n=l.useRef(!1),r=l.useRef(void 0),i=l.useRef(!0),a=l.useRef(!1),o=l.useRef(()=>{}),s=l.useRef(!1),c=we(),u=we(),d=l.useRef(void 0);return l.useMemo(()=>{let l=e.context.dataRef.current;return l.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:u,handleCloseOptionsRef:d},l.hoverInteractionState},[e,t,n,r,i,a,o,s,c,u,d])}var Vl=new Set([`click`,`mousedown`]);function Hl(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:u}=t,{pointerTypeRef:d,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:m,unbindMouseMoveRef:h,restTimeoutPendingRef:g,openChangeTimeout:_,handleCloseOptionsRef:v}=Bl(n),y=Io(u),b=Fo(),x=G(()=>f.current?!0:o.current.openEvent?Vl.has(o.current.openEvent.type):!1),S=G(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),C=l.useCallback((e,t=!0)=>{let r=Ul(c,d.current);r&&!p.current?_.start(r,()=>n.setOpen(!1,Dr(yr,e))):t&&(_.clear(),n.setOpen(!1,Dr(yr,e)))},[c,p,n,d,_]),w=G(()=>{h.current(),p.current=void 0}),T=G(()=>{if(m.current){let e=Ji(i).body;e.style.pointerEvents=``,e.removeAttribute(Ll),m.current=!1}}),E=G(e=>{if(!zl(Gi(e))){f.current=!1;return}f.current=!0});K(()=>{r||(d.current=void 0,g.current=!1,f.current=!1,w(),T())},[r,d,g,f,w,T]),l.useEffect(()=>()=>{w()},[w]),l.useEffect(()=>T,[T]),K(()=>{if(s&&r&&v.current?.blockPointerEvents&&S()&&Z(a)&&i){m.current=!0;let e=Ji(i).body;e.setAttribute(Ll,``);let t=a,n=i,r=y?.nodesRef.current.find(e=>e.id===b)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,v,S,y,b,m]),l.useEffect(()=>{if(!s)return;function e(e){if(x()||!o.current.floatingContext||!n.select(`open`))return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(T(),w(),x()||C(e))}function t(e){_.clear(),T(),p.current?.(e),w()}function r(e){x()||C(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,E,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,E,!0))}})}function Ul(e,t){return t&&!aa(t)?0:typeof e==`function`?e():e}function Wl(e){return typeof e==`function`?e():e}var Gl={current:null};function Kl(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:u=0,move:f=!0,triggerElementRef:p=Gl,externalTree:m,isActiveTrigger:h=!0}=t,g=Io(m),{pointerTypeRef:_,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:x,unbindMouseMoveRef:S,restTimeoutPendingRef:C,openChangeTimeout:w,restTimeout:T,handleCloseOptionsRef:E}=Bl(n),D=jr(s),O=jr(o),k=jr(u);h&&(E.current=D.current?.__options);let A=G(()=>v.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),j=l.useCallback((e,t=!0)=>{let r=Bo(O.current,`close`,_.current);r&&!y.current?w.start(r,()=>n.setOpen(!1,Dr(yr,e))):t&&(w.clear(),n.setOpen(!1,Dr(yr,e)))},[O,y,n,_,w]),M=G(()=>{S.current(),y.current=void 0}),N=G(()=>{if(x.current){let e=Ji(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(Ll),x.current=!1}});l.useEffect(()=>{if(!a)return;function e(e){e.open||(w.clear(),T.clear(),b.current=!0,C.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,w,T,b,C]);let P=G(e=>{if(A()||!r.current.floatingContext)return;let t=n.context.triggerElements;if(e.relatedTarget&&t.hasElement(e.relatedTarget))return;let i=p.current;D.current?.({...r.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),M(),!A()&&i===n.select(`domReferenceElement`)&&j(e)}})(e)});return l.useEffect(()=>{if(!a)return;let e=p.current??(h?n.select(`domReferenceElement`):null);if(!Z(e))return;function t(e){if(w.clear(),b.current=!1,c&&!aa(_.current)||Wl(k.current)>0&&!Bo(O.current,`open`))return;let t=Bo(O.current,`open`,_.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>Q(t,e.target)))&&(!r||!Q(r,e.target)),o=e.currentTarget??null,s=!n.select(`open`)||a;t?w.start(t,()=>{s&&n.setOpen(!0,Dr(yr,e,o))}):s&&n.setOpen(!0,Dr(yr,e,o))}function i(e){if(A()){N();return}S.current();let t=Ji(n.select(`domReferenceElement`));T.clear(),C.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(D.current&&r.current.floatingContext){n.select(`open`)||w.clear();let i=p.current;y.current=D.current({...r.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),M(),!A()&&i===n.select(`domReferenceElement`)&&j(e,!0)}});let a=y.current;a(e),t.addEventListener(`mousemove`,a),S.current=()=>{t.removeEventListener(`mousemove`,a)};return}(_.current!==`touch`||!Q(n.select(`floatingElement`),e.relatedTarget))&&j(e)}}function o(e){P(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),f&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),f&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[M,N,b,r,O,j,n,a,D,P,h,A,c,f,_,k,T,C,w,p,g,S,y]),l.useMemo(()=>{function e(e){_.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>Q(t,e.target)))&&(!i||!Q(i,e.target));if(c&&!aa(_.current)||o&&!s||Wl(k.current)===0||!s&&C.current&&e.movementX**2+e.movementY**2<2)return;T.clear();function l(){!b.current&&(!o||s)&&n.setOpen(!0,Dr(yr,t,r))}_.current===`touch`?d.flushSync(()=>{l()}):s&&o?l():(C.current=!0,T.start(Wl(k.current),l))}}},[b,c,n,_,k,T,C])}function ql(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=l.useCallback(t=>Jl(t,e,`reference`),t),o=l.useCallback(t=>Jl(t,e,`floating`),n),s=l.useCallback(t=>Jl(t,e,`item`),r),c=l.useCallback(t=>Jl(t,e,`trigger`),i);return l.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function Jl(e,t,n){let r=new Map,i=n===`item`,a={};for(let t in n===`floating`&&(a.tabIndex=-1,a[`data-base-ui-focusable`]=``),e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&Yl(a,s,i,r)}return Yl(a,e,i,r),a}function Yl(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var Xl=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Zl(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{enabled:s=!0,role:c=`dialog`}=t,u=xn(),d=a?.id||u,f=l.useMemo(()=>Qi(o)?.id||i,[o,i]),p=Xl.get(c)??c,m=Fo()!=null,h=l.useMemo(()=>p===`tooltip`||c===`label`?H:{"aria-haspopup":p===`alertdialog`?`dialog`:p,"aria-expanded":`false`,...p===`listbox`&&{role:`combobox`},...p===`menu`&&m&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[p,m,c]),g=l.useMemo(()=>p===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:r?f:void 0}:{...h,"aria-expanded":r?`true`:`false`,"aria-controls":r?f:void 0,...p===`menu`&&{id:d}},[p,f,r,d,c,h]),_=l.useMemo(()=>{let e={id:f,...p&&{role:p}};return p===`tooltip`||c===`label`?e:{...e,...p===`menu`&&{"aria-labelledby":d}}},[p,f,d,c]),v=l.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${f}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[f,c]);return l.useMemo(()=>s?{reference:g,floating:_,item:v,trigger:h}:{},[s,g,_,h,v])}function Ql(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function $l(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function eu(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Ce,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=Gi(f),v=f.type===`mouseleave`,y=Q(s.floating,_),b=Q(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=$l(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Z(f.relatedTarget)&&Q(s.floating,f.relatedTarget)||d&&$i(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break;default:}function P([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]];default:return[]}}if(!Ql([m,h],N)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}Ql([m,h],P([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}let tu=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),nu=function(e){return e[e.open=ci.open]=`open`,e[e.closed=ci.closed]=`closed`,e[e.startingStyle=ci.startingStyle]=`startingStyle`,e[e.endingStyle=ci.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({});const ru=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(ru.displayName=`DialogPortalContext`);function iu(){let e=l.useContext(ru);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(26):`Base UI: <Dialog.Portal> is missing.`);return e}const au=`ArrowUp`,ou=`ArrowDown`,su=`ArrowLeft`,cu=`ArrowRight`,lu=`Home`,uu=`End`,du=new Set([su,cu]),fu=new Set([su,cu,lu,`End`]),pu=new Set([au,ou]),mu=new Set([au,ou,lu,`End`]),hu=new Set([...du,...pu]),gu=new Set([...hu,lu,`End`]),_u=new Set([au,ou,su,cu,lu,`End`]),vu=`Shift`,yu=`Control`,bu=`Alt`,xu=`Meta`,Su=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function Cu(e){return On(e)&&e.tagName===`INPUT`}function wu(e){return!!(Cu(e)&&e.selectionStart!=null||On(e)&&e.tagName===`TEXTAREA`)}function Tu(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Eu(e,t,`left`),a=Du(e),o=Du(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Eu(e,t,`top`),r=Du(e),i=Du(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Eu(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Du(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Ou={...gi,...Kr,nestedDialogOpen(e){return e?{[nu.nestedDialogOpen]:``}:null}};const ku=l.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=si(),c=s.useState(`descriptionElementId`),d=s.useState(`disablePointerDismissal`),f=s.useState(`floatingRootContext`),p=s.useState(`popupProps`),m=s.useState(`modal`),h=s.useState(`mounted`),g=s.useState(`nested`),_=s.useState(`nestedOpenDialogCount`),v=s.useState(`open`),y=s.useState(`openMethod`),b=s.useState(`titleElementId`),x=s.useState(`transitionStatus`),S=s.useState(`role`);iu(),Vr({open:v,ref:s.context.popupRef,onComplete(){v&&s.context.onOpenChangeComplete?.(!0)}});function C(e){return e===`touch`?s.context.popupRef.current:!0}let w=i===void 0?C:i,T=_>0,E=W(`div`,e,{state:l.useMemo(()=>({open:v,nested:g,transitionStatus:x,nestedDialogOpen:T}),[v,g,x,T]),props:[p,{"aria-labelledby":b??void 0,"aria-describedby":c??void 0,role:S,tabIndex:-1,hidden:!h,onKeyDown(e){_u.has(e.key)&&e.stopPropagation()},style:{[tu.nestedDialogs]:_}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:Ou});return(0,u.jsx)(_s,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!d,initialFocus:w,returnFocus:r,modal:m!==!1,restoreFocus:`popup`,children:E})});process.env.NODE_ENV!==`production`&&(ku.displayName=`DialogPopup`);function Au(e){return T(19)?e:e?`true`:void 0}const ju=l.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
14
- 0% 0%,
15
- 100% 0%,
16
- 100% 100%,
17
- 0% 100%,
18
- 0% 0%,
19
- ${e.left}px ${e.top}px,
20
- ${e.left}px ${e.bottom}px,
21
- ${e.right}px ${e.bottom}px,
22
- ${e.right}px ${e.top}px,
23
- ${e.left}px ${e.top}px
24
- )`}return(0,u.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});process.env.NODE_ENV!==`production`&&(ju.displayName=`InternalBackdrop`);const Mu=l.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=si(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,u.jsx)(ru.Provider,{value:n,children:(0,u.jsxs)(ss,{ref:t,...r,children:[a&&o===!0&&(0,u.jsx)(ju,{ref:i.context.internalBackdropRef,inert:Au(!open)}),e.children]})}):null});process.env.NODE_ENV!==`production`&&(Mu.displayName=`DialogPortal`);var Nu={},Pu={},Fu=``;function Iu(e){if(typeof document>`u`)return!1;let t=Wo(e);return Tn(t).innerWidth-t.documentElement.clientWidth>0}function Lu(e){let t=Wo(e),n=t.documentElement,r=t.body,i=jn(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function Ru(e){let t=Wo(e),n=t.documentElement,r=t.body,i=Tn(n),a=0,o=0,s=Lr.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(Ti&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Nu={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Fu=n.style.scrollBehavior,Pu={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=jn(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Nu),Object.assign(r.style,Pu),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Fu)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var zu=class{lockCount=0;restore=null;timeoutLock=Ce.create();timeoutUnlock=Ce.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Wo(e).documentElement,n=Tn(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=B;return}this.restore=Ei||!Iu(e)?Lu(e):Ru(e)}},Bu=new zu;function Vu(e=!0,t=null){K(()=>{if(e)return Bu.acquire(t)},[e,t])}function Hu(e){let t=l.useRef(``),n=l.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:l.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Uu(e){let[t,n]=l.useState(null),r=G((t,r)=>{e||n(r)}),i=l.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=Hu(r);return l.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function Wu(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:u,reset:d}=Uu(i);El(t);let{forceUnmount:f}=Dl(i,t,()=>{d()}),p=G(e=>{let n=Dr(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),m=l.useCallback(()=>{t.setOpen(!1,p(Er))},[t,p]);l.useImperativeHandle(r,()=>({unmount:f,close:m}),[f,m]);let h=Pl({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,_]=l.useState(0),v=g===0,y=Zl(h),b=Nc(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=Gi(e);if(v&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||Q(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});Vu(i&&o===!0,s);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=ql([y,b]);t.useContextCallback(`onNestedDialogOpen`,e=>{_(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{_(0)}),l.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(g),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,g]);let w=l.useMemo(()=>x(u),[x,u]),T=l.useMemo(()=>C(u),[C,u]),E=l.useMemo(()=>S(),[S]);t.useSyncedValues({openMethod:c,activeTriggerProps:w,inactiveTriggerProps:T,popupProps:E,floatingRootContext:h,nestedOpenDialogCount:g})}var Gu={...jl,modal:$(e=>e.modal),nested:$(e=>e.nested),nestedOpenDialogCount:$(e=>e.nestedOpenDialogCount),disablePointerDismissal:$(e=>e.disablePointerDismissal),openMethod:$(e=>e.openMethod),descriptionElementId:$(e=>e.descriptionElementId),titleElementId:$(e=>e.titleElementId),viewportElement:$(e=>e.viewportElement),role:$(e=>e.role)},Ku=class extends bl{constructor(e){super(qu(e),{popupRef:l.createRef(),backdropRef:l.createRef(),internalBackdropRef:l.createRef(),triggerElements:new Ol,onOpenChange:void 0,onOpenChangeComplete:void 0},Gu)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function qu(e={}){return{...Al(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function Ju(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:d,triggerId:f,defaultTriggerId:p=null}=e,m=si(!0),h=!!m,g=_(()=>d?.store??new Ku({open:n??r,activeTriggerId:f===void 0?p:f,modal:s,disablePointerDismissal:o,nested:h})).current;g.useControlledProp(`open`,n,r),g.useControlledProp(`activeTriggerId`,f,p),g.useSyncedValues({disablePointerDismissal:o,nested:h,modal:s}),g.useContextCallback(`onOpenChange`,i),g.useContextCallback(`onOpenChangeComplete`,a);let v=g.useState(`payload`);Wu({store:g,actionsRef:c,parentContext:m?.store.context,onOpenChange:i,triggerIdProp:f});let y=l.useMemo(()=>({store:g}),[g]);return(0,u.jsx)(oi.Provider,{value:y,children:typeof t==`function`?t({payload:v}):t})}const Yu=l.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=si(),s=Sn(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),W(`h2`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(Yu.displayName=`DialogTitle`);const Xu=l.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,...u}=e,d=si(!0),f=c?.store??d?.store;if(!f)throw Error(process.env.NODE_ENV===`production`?h(79):`Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.`);let p=Sn(o),m=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=l.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=Tl(p,_,f,{payload:s}),{getButtonProps:b,buttonRef:x}=tr({disabled:i,native:a}),S=ql([vs(m,{enabled:m!=null})]),C=l.useMemo(()=>({disabled:i,open:g}),[i,g]),w=f.useState(`triggerProps`,y);return W(`button`,e,{state:C,ref:[x,t,v,_],props:[S.getReferenceProps(),w,{"data-base-ui-click-trigger":``,id:p},u,b],stateAttributesMapping:hi})});process.env.NODE_ENV!==`production`&&(Xu.displayName=`DialogTrigger`);var Zu=m();const Qu=e=>{let t=(0,Zu.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(``,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,u.jsx)(ln,{style:`ghost`,tone:`neutral`,children:`Close`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,u.jsx)(yi,{className:o,ref:a,...i,render:s,children:n}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c};var $u=m();const ed=e=>{let t=(0,$u.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`text-prose-0 mb-0`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,u.jsx)(bi,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var td=m();const nd=e=>{let t=(0,td.c)(19),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,showCloseButton:o,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?!0:o,c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,u.jsx)(vi,{className:`fixed inset-[0px] min-h-dvh bg-scrim opacity-50 transition-all duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute`}),t[6]=c):c=t[6];let l;t[7]===r?l=t[8]:(l=X(`fixed top-1/2 left-1/2 min-w-1/3 max-w-[calc(100vw-3rem)] px-md py-sm space-y-2xs -translate-x-1/2 -translate-y-1/2 rounded-lg bg-surface-container outline-1 outline-outline transition-all duration-150 data-ending-style:scale-90 data-ending-style:opacity-0 data-starting-style:scale-90 data-starting-style:opacity-0`,r),t[7]=r,t[8]=l);let d;t[9]===s?d=t[10]:(d=s&&(0,u.jsx)(Qu,{}),t[9]=s,t[10]=d);let f;t[11]===d?f=t[12]:(f=(0,u.jsx)(`div`,{className:`flex justify-end`,children:d}),t[11]=d,t[12]=f);let p;return t[13]!==n||t[14]!==i||t[15]!==a||t[16]!==l||t[17]!==f?(p=(0,u.jsxs)(Mu,{children:[c,(0,u.jsxs)(ku,{className:l,ref:a,...i,children:[n,f]})]}),t[13]=n,t[14]=i,t[15]=a,t[16]=l,t[17]=f,t[18]=p):p=t[18],p};var rd=m();const id=e=>{let t=(0,rd.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`text-strong-2`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,u.jsx)(Yu,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var ad=m();const od=e=>{let t=(0,ad.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(``,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,u.jsx)(Xu,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var sd=m();const cd=e=>{let t=(0,sd.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,u.jsx)(Ju,{...n}),t[2]=n,t[3]=r),r};var ld=new WeakMap,ud=new WeakMap,dd={current:[]},fd=!1,pd=0,md=new Set,hd=new Map;function gd(e){let t=Array.from(e).sort((e,t)=>e instanceof Cd&&e.options.deps.includes(t)?1:t instanceof Cd&&t.options.deps.includes(e)?-1:0);for(let e of t){if(dd.current.includes(e))continue;dd.current.push(e),e.recompute();let t=ud.get(e);if(t)for(let e of t){let t=ld.get(e);t&&gd(t)}}}function _d(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function vd(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function yd(e){if(pd>0&&!hd.has(e)&&hd.set(e,e.prevState),md.add(e),!(pd>0)&&!fd)try{for(fd=!0;md.size>0;){let e=Array.from(md);md.clear();for(let t of e)t.prevState=hd.get(t)??t.prevState,_d(t);for(let t of e){let e=ld.get(t);e&&(dd.current.push(t),gd(e))}for(let t of e){let e=ld.get(t);if(e)for(let t of e)vd(t)}}}finally{fd=!1,dd.current=[],hd.clear()}}function bd(e){pd++;try{e()}finally{if(pd--,pd===0){let e=md.values().next().value;e&&yd(e)}}}function xd(e){return typeof e==`function`}var Sd=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):xd(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),yd(this)}},Cd=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof Sd){let e=ld.get(n);e||(e=new Set,ld.set(n,e)),e.add(this);let t=ud.get(this);t||(t=new Set,ud.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof Sd){let e=ld.get(n);e&&e.delete(this);let t=ud.get(this);t&&t.delete(n)}}},wd=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Td(e,t){return new wd(e,t).maybeExecute}var Ed=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},Dd=class extends Ed{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}},Od=new Dd;function kd(e,t){return typeof e==`function`?e(t):e}function Ad(e,t){return Bd(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function jd(e,t,n){let r=Bd(t);function i(e){if(!r.length)return kd(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function Md(e,t){let n=Bd(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var Nd=/^(\d+)$/gm,Pd=/\.(\d+)(?=\.)/gm,Fd=/^(\d+)\./gm,Id=/\.(\d+$)/gm,Ld=/\.{2,}/gm,Rd=`__int__`,zd=`${Rd}$1`;function Bd(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);return e.replace(/(^\[)|]/gm,``).replace(/\[/g,`.`).replace(Nd,zd).replace(Pd,`.${zd}.`).replace(Fd,`${zd}.`).replace(Id,`.${zd}`).replace(Ld,`.`).split(`.`).map(e=>{if(e.startsWith(Rd)){let t=e.substring(7),n=parseInt(t,10);return String(n)===t?n:t}return e})}function Vd(e,t){return e.length===0?t:t.length===0?e:t.startsWith(`[`)||t.startsWith(`.`)?e+t:`${e}.${t}`}function Hd(e){return!(Array.isArray(e)&&e.length===0)}function Ud(e,t){return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function Wd(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0;break}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Gd=e=>!!e&&typeof e==`object`&&`fields`in e;function Kd(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!Kd(e[i],t[i]))return!1;return!0}var qd=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Jd=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function Yd(e,t){return e==null?t:{...e,...t}}for(var Xd=256,Zd=[],Qd;Xd--;)Zd[Xd]=(Xd+256).toString(16).substring(1);function $d(){let e=0,t,n=``;if(!Qd||Xd+16>256){for(Qd=Array(256),e=256;e--;)Qd[e]=256*Math.random()|0;e=0,Xd=0}for(;e<16;e++)t=Qd[Xd+e],e===6?n+=Zd[t&15|64]:e===8?n+=Zd[t&63|128]:n+=Zd[t],e&1&&e>1&&e<11&&(n+=`-`);return Xd++,n}var ef=Td(e=>Od.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300}),tf=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function nf(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);Array.isArray(i)&&!Number.isNaN(o)?a+=`[${o}]`:a+=(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var rf=(e,t)=>{let n=nf(e,t);return{form:n,fields:n}},af={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:rf(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:rf(r.issues,e)}},of=e=>!!e&&`~standard`in e,sf={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function cf(e){function t(t,n,r){let i=o(t,n,`move`,r),s=Math.min(n,r),l=Math.max(n,r);for(let e=s;e<=l;e++)i.push(a(t,e));let u=Object.keys(e.fieldInfo).reduce((r,i)=>(i.startsWith(a(t,n))&&r.set(i,e.getFieldMeta(i)),r),new Map);c(i,n<r?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(a(t,r))).forEach(i=>{let o=i.replace(a(t,r),a(t,n)),s=u.get(o);s&&e.setFieldMeta(i,s)})}function n(e,t){c(o(e,t,`remove`),`up`)}function r(t,n,r){o(t,n,`swap`,r).forEach(i=>{if(!i.toString().startsWith(a(t,n)))return;let o=i.toString().replace(a(t,n),a(t,r)),[s,c]=[e.getFieldMeta(i),e.getFieldMeta(o)];s&&e.setFieldMeta(o,s),c&&e.setFieldMeta(i,c)})}function i(t,n){let r=o(t,n,`insert`);c(r,`down`),r.forEach(r=>{r.toString().startsWith(a(t,n))&&e.setFieldMeta(r,l())})}function a(e,t){return`${e}[${t}]`}function o(t,n,r,i){let o=[a(t,n)];switch(r){case`swap`:o.push(a(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)o.push(a(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)o.push(a(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>o.some(t=>e.startsWith(t)))}function s(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function c(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=s(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,l())})}let l=()=>sf;return{handleArrayMove:t,handleArrayRemove:n,handleArraySwap:r,handleArrayInsert:i}}function lf(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var uf=class{constructor(e){this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{let e=this.fieldMetaDerived.mount(),t=this.store.mount(),n=this.store.subscribe(()=>{ef(this)}),r=Od.on(`request-form-state`,e=>{e.payload.id===this._formId&&Od.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),i=Od.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),a=Od.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),o=()=>{a(),i(),r(),n(),e(),t(),Od.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:s}=this.options.validators||{};return Od.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),s&&this.validateSync(`mount`),o},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=!!e.transform?.deps?.some((e,t)=>e!==this.prevTransformArray[t]),r=e.defaultValues&&!Kd(e.defaultValues,t.defaultValues)&&!this.state.isTouched,i=!Kd(e.defaultState,t.defaultState)&&!this.state.isTouched;!r&&!i&&!n||(bd(()=>{this.baseStore.setState(()=>lf(Object.assign({},this.state,i?e.defaultState:{},r?{values:e.defaultValues}:{},n?{_force_re_eval:!this.state._force_re_eval}:{})))}),Od.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}))},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>lf({...this.options.defaultState,values:e??this.options.defaultValues??this.options.defaultState?.values,fieldMetaBase:r}))},this.validateAllFields=async e=>{let t=[];return bd(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0}))),n.instance.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return bd(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;return n?(n.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)):[]},this.validateSync=e=>{let t=Ud(e,{...this.options,form:this,validationLogic:this.options.validationLogic||tf}),n=!1,r={};return bd(()=>{for(let e of t){if(!e.validate)continue;let{formError:t,fieldErrors:i}=df(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),a=ff(e.cause),o=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]);for(let e of o){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??sf,o=i?.[e],{newErrorValue:s,newSource:c}=qd({newFormValidatorError:o,isPreviousErrorFromFormValidator:n?.[a]===`form`,previousErrorValue:t?.[a]});c===`form`&&(r[e]={...r[e],[a]:o}),t?.[a]!==s&&this.setFieldMeta(e,(e=sf)=>({...e,errorMap:{...e.errorMap,[a]:s},errorSourceMap:{...e.errorSourceMap,[a]:c}}))}this.state.errorMap?.[a]!==t&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:t}})),(t||i)&&(n=!0)}let i=ff(`submit`);this.state.errorMap?.[i]&&e!==`submit`&&!n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[i]:void 0}}));let a=ff(`server`);this.state.errorMap?.[a]&&e!==`server`&&!n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}))}),{hasErrored:n,fieldsErrorMap:r}},this.validateAsync=async e=>{let t=Wd(e,{...this.options,form:this,validationLogic:this.options.validationLogic||tf});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let n=[],r;for(let e of t){if(!e.validate)continue;let t=ff(e.cause);this.state.validationMetaMap[t]?.lastAbortController.abort();let i=new AbortController;this.state.validationMetaMap[t]={lastAbortController:i},n.push(new Promise(async t=>{let n;try{n=await new Promise((t,n)=>{setTimeout(async()=>{if(i.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:i.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){n=e}let{formError:a,fieldErrors:o}=df(n);o&&(r=r?{...r,...o}:o);let s=ff(e.cause);for(let e of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[e]===void 0)continue;let t=this.getFieldMeta(e);if(!t)continue;let{errorMap:n,errorSourceMap:i}=t,a=r?.[e],{newErrorValue:o,newSource:c}=qd({newFormValidatorError:a,isPreviousErrorFromFormValidator:i?.[s]===`form`,previousErrorValue:n?.[s]});n?.[s]!==o&&this.setFieldMeta(e,e=>({...e,errorMap:{...e.errorMap,[s]:o},errorSourceMap:{...e.errorSourceMap,[s]:c}}))}this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[s]:a}})),t(r?{fieldErrors:r,errorMapKey:s}:void 0)}))}let i=[],a={};if(n.length){i=await Promise.all(n);for(let e of i)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))a[n]={...a[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),a},this.validate=e=>{let{hasErrored:t,fieldsErrorMap:n}=this.validateSync(e);return t&&!this.options.asyncAlways?n:this.validateAsync(e)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),bd(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),Od.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),Od.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}bd(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.options.listeners?.onSubmit?.({value:e.instance.state.value,fieldApi:e.instance})})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),bd(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),Od.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),Od.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>Ad(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:kd(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=sf,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;bd(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:jd(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t!==n&&t.startsWith(n)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=Md(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],Yd(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),cf(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),Yd(r,{dontValidate:!0})),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),Yd(n,{dontValidate:!0})),cf(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return jd(jd(e,`${t}`,i),`${n}`,r)},Yd(r,{dontValidate:!0})),cf(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},Yd(r,{dontValidate:!0})),cf(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],Yd(t,{dontValidate:!0})),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>({...t,fieldMetaBase:{...t.fieldMetaBase,[e]:sf},values:this.options.defaultValues?jd(t.values,e,Ad(this.options.defaultValues,e)):t.values}))},this.setErrorMap=e=>{bd(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Gd(t)){let{formError:e,fieldErrors:r}=df(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>af.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>af.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??$d(),this._devtoolsSubmissionOverride=!1,this.baseStore=new Sd(lf({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values})),this.fieldMetaDerived=new Cd({deps:[this.baseStore],fn:({prevDepVals:e,currDepVals:t,prevVal:n})=>{let r=n,i=e?.[0],a=t[0],o=0,s={};for(let e of Object.keys(a.fieldMetaBase)){let t=a.fieldMetaBase[e],n=i?.fieldMetaBase[e],c=r?.[e],l=Ad(a.values,e),u=c?.errors;if(!n||t.errorMap!==n.errorMap){u=Object.values(t.errorMap??{}).filter(e=>e!==void 0);let n=this.getFieldInfo(e)?.instance;n&&!n.options.disableErrorFlat&&(u=u.flat(1))}let d=!Hd(u),f=!t.isDirty,p=Kd(l,Ad(this.options.defaultValues,e))||Kd(l,this.getFieldInfo(e)?.instance?.options.defaultValue);if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&t===n){s[e]=c,o++;continue}s[e]={...t,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(a.fieldMetaBase).length&&r&&o===Object.keys(a.fieldMetaBase).length?r:s}}),this.store=new Cd({deps:[this.baseStore,this.fieldMetaDerived],fn:({prevDepVals:e,currDepVals:t,prevVal:n})=>{let r=n,i=e?.[0],a=t[0],o=t[1],s=Object.values(o).filter(Boolean),c=s.some(e=>e.isValidating),l=s.every(e=>e.isValid),u=s.some(e=>e.isTouched),d=s.some(e=>e.isBlurred),f=s.every(e=>e.isDefaultValue),p=u&&a.errorMap?.onMount,m=s.some(e=>e.isDirty),h=!m,g=!!(a.errorMap?.onMount||s.some(e=>e?.errorMap?.onMount)),_=!!c,v=r?.errors??[];(!i||a.errorMap!==i.errorMap)&&(v=Object.values(a.errorMap).reduce((e,t)=>t===void 0?e:t&&Gd(t)?(e.push(t.form),e):(e.push(t),e),[]));let y=v.length===0,b=l&&y,x=this.options.canSubmitWhenInvalid??!1,S=a.submissionAttempts===0&&!u&&!g||!_&&!a.isSubmitting&&b||x,C=a.errorMap;if(p&&(v=v.filter(e=>e!==a.errorMap.onMount),C=Object.assign(C,{onMount:void 0})),r&&i&&r.errorMap===C&&r.fieldMeta===this.fieldMetaDerived.state&&r.errors===v&&r.isFieldsValidating===c&&r.isFieldsValid===l&&r.isFormValid===y&&r.isValid===b&&r.canSubmit===S&&r.isTouched===u&&r.isBlurred===d&&r.isPristine===h&&r.isDefaultValue===f&&r.isDirty===m&&Kd(i,a))return r;let w={...a,errorMap:C,fieldMeta:this.fieldMetaDerived.state,errors:v,isFieldsValidating:c,isFieldsValid:l,isFormValid:y,isValid:b,canSubmit:S,isTouched:u,isBlurred:d,isPristine:h,isDefaultValue:f,isDirty:m},T=this.options.transform?.deps??[];if(T.length!==this.prevTransformArray.length||T.some((e,t)=>e!==this.prevTransformArray[t])){let e=Object.assign({},this,{state:w});this.options.transform?.fn(e),w=e.state,this.prevTransformArray=T}return w}}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return of(e.validate)?af[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function df(e){return e?Gd(e)?{formError:df(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function ff(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;case`change`:default:return`onChange`}}var pf=class{constructor(e){this.options={},this.mount=()=>{let e=this.store.mount();this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let t=this.getInfo();t.instance=this,this.update(this.options);let{onMount:n}=this.options.validators||{};if(n){let e=this.runValidator({validate:n,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),e},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Kd(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,Yd(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,Yd(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,Yd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,Yd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,Yd(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,Yd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,Yd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,Yd(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=e=>{let t=Object.values(this.form.fieldInfo),n=[];for(let r of t){if(!r.instance)continue;let{onChangeListenTo:t,onBlurListenTo:i}=r.instance.options.validators||{};e===`change`&&t?.includes(this.name)&&n.push(r.instance),e===`blur`&&i?.includes(this.name)&&n.push(r.instance)}return n},this.validateSync=(e,t)=>{let n=Ud(e,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||tf}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=Ud(e,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||tf});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;bd(()=>{let e=(e,n)=>{let r=hf(n.cause),a=n.validate?mf(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Jd({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=hf(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=Wd(e,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||tf}),r=await t,i=this.getLinkedFields(e),a=i.reduce((t,n)=>{let r=Wd(e,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||tf});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),o=[],s=[],c=n.some(e=>e.validate)||a.some(e=>e.validate);if(c){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of i)e.setMeta(e=>({...e,isValidating:!0}))}let l=(e,t,n)=>{let i=hf(t.cause);e.getInfo().validationMetaMap[i]?.lastAbortController.abort();let a=new AbortController;this.getInfo().validationMetaMap[i]={lastAbortController:a},n.push(new Promise(async n=>{let o;try{o=await new Promise((n,r)=>{this.timeoutIds.validations[t.cause]&&clearTimeout(this.timeoutIds.validations[t.cause]),this.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(a.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:a.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){o=e}if(a.signal.aborted)return n(void 0);let s=mf(o),c=r[this.name]?.[i],{newErrorValue:l,newSource:u}=Jd({formLevelError:c,fieldLevelError:s});e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,o);for(let e of a)e.validate&&l(e.field,e,s);let u=[];if((o.length||s.length)&&(u=await Promise.all(o),await Promise.all(s)),c){this.setMeta(e=>({...e,isValidating:!1}));for(let e of i)e.setMeta(e=>({...e,isValidating:!1}))}return u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e),{hasErrored:r}=this.validateSync(e,n[this.name]??{});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[hf(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e);return this.validateAsync(e,i)},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>af.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>af.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},this.form=e.form,this.name=e.name,this.options=e,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=new Cd({deps:[this.form.store],fn:()=>{let t=this.form.getFieldMeta(this.name)??{...sf,...e.defaultMeta},n=this.form.getFieldValue(this.name);return!t.isTouched&&n===void 0&&this.options.defaultValue!==void 0&&!Kd(n,this.options.defaultValue)&&(n=this.options.defaultValue),{value:n,meta:t}}})}get state(){return this.store.state}runValidator(e){return of(e.validate)?af[e.type](e.value,e.validate):e.validate(e.value)}triggerOnBlurListener(){let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})}};function mf(e){if(e)return e}function hf(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;case`change`:default:return`onChange`}}var gf=class e{constructor(t){if(this.getFormFieldName=e=>{if(typeof this.fieldsMap==`string`)return Vd(this.fieldsMap,e);let t=Bd(e)[0];if(typeof t!=`string`)return``;let n=e.slice(t.length),r=this.fieldsMap[t];return Vd(r,n)},this.getFormFieldOptions=e=>{let t={...e},n=t.validators;if(t.name=this.getFormFieldName(e.name),n&&(n.onChangeListenTo||n.onBlurListenTo)){let e={...n},r=e=>{if(e)return e.map(e=>this.getFormFieldName(e))};e.onChangeListenTo=r(n.onChangeListenTo),e.onBlurListenTo=r(n.onBlurListenTo),t.validators=e}return t},this.mount=()=>this.store.mount(),this.validateArrayFieldsStartingFrom=async(e,t,n)=>this.form.validateArrayFieldsStartingFrom(this.getFormFieldName(e),t,n),this.validateField=(e,t)=>this.form.validateField(this.getFormFieldName(e),t),this.getFieldValue=e=>this.form.getFieldValue(this.getFormFieldName(e)),this.getFieldMeta=e=>this.form.getFieldMeta(this.getFormFieldName(e)),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(this.getFormFieldName(e),t),this.setFieldValue=(e,t,n)=>this.form.setFieldValue(this.getFormFieldName(e),t,n),this.deleteField=e=>this.form.deleteField(this.getFormFieldName(e)),this.pushFieldValue=(e,t,n)=>this.form.pushFieldValue(this.getFormFieldName(e),t,n),this.insertFieldValue=async(e,t,n,r)=>this.form.insertFieldValue(this.getFormFieldName(e),t,n,r),this.replaceFieldValue=async(e,t,n,r)=>this.form.replaceFieldValue(this.getFormFieldName(e),t,n,r),this.removeFieldValue=async(e,t,n)=>this.form.removeFieldValue(this.getFormFieldName(e),t,n),this.swapFieldValues=(e,t,n,r)=>this.form.swapFieldValues(this.getFormFieldName(e),t,n,r),this.moveFieldValues=(e,t,n,r)=>this.form.moveFieldValues(this.getFormFieldName(e),t,n,r),this.clearFieldValues=(e,t)=>this.form.clearFieldValues(this.getFormFieldName(e),t),this.resetField=e=>this.form.resetField(this.getFormFieldName(e)),this.validateAllFields=e=>this.form.validateAllFields(e),t.form instanceof e){let e=t.form;if(this.form=e.form,typeof t.fields==`string`)this.fieldsMap=e.getFormFieldName(t.fields);else{let n={...t.fields};for(let t in n)n[t]=e.getFormFieldName(n[t]);this.fieldsMap=n}}else this.form=t.form,this.fieldsMap=t.fields;this.store=new Cd({deps:[this.form.store],fn:({currDepVals:e})=>{let t=e[0],n;if(typeof this.fieldsMap==`string`)n=Ad(t.values,this.fieldsMap);else{n={};let e=this.fieldsMap;for(let r in e)n[r]=Ad(t.values,e[r])}return{values:n}}})}get state(){return this.store.state}async handleSubmit(e){return this.form.handleSubmit(e)}},_f=fl();function vf(e,t=e=>e,n={}){let r=n.equal??yf;return(0,_f.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,r)}function yf(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=bf(e);if(n.length!==bf(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function bf(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var xf=typeof window<`u`?l.useLayoutEffect:l.useEffect;function Sf(e){let[t,n]=(0,l.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,l.useState)(()=>new pf({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new pf({...e})),n({form:e.form,name:e.name}));let a=vf(r.store,e.mode===`array`?e=>Object.keys(e.value??[]).length:e=>e.value),o=vf(r.store,e=>e.meta.isTouched),s=vf(r.store,e=>e.meta.isBlurred),c=vf(r.store,e=>e.meta.isDirty),u=vf(r.store,e=>e.meta.errorMap),d=vf(r.store,e=>e.meta.errorSourceMap),f=vf(r.store,e=>e.meta.isValidating),p=(0,l.useMemo)(()=>{let t={...r,get state(){return{value:e.mode===`array`?r.state.value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:u,errorSourceMap:d,isValidating:f}}}}};return t.Field=Cf,t},[r,e.mode,a,o,s,c,u,d,f]);return xf(r.mount,[r]),xf(()=>{r.update(e)}),p}var Cf=(({children:e,...t})=>{let n=Sf(t);return(0,u.jsx)(u.Fragment,{children:(0,l.useMemo)(()=>kd(e,n),[e,n])})});function wf(){return(0,l.useState)(()=>$d())[0]}var Tf=l.version.split(`.`)[0]===`17`?wf:l.useId;function Ef({form:e,selector:t,children:n}){return(0,u.jsx)(u.Fragment,{children:kd(n,vf(e.store,t))})}function Df(e){let t=Tf(),[n,r]=(0,l.useState)(e?.formId),[i,a]=(0,l.useState)(()=>new uf({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new uf({...e,formId:n})),r(n)}let o=(0,l.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,u.jsx)(Cf,{...e,form:i})},e.Subscribe=function(e){return(0,u.jsx)(Ef,{form:i,selector:e.selector,children:e.children})},e},[i]);return xf(i.mount,[]),xf(()=>{i.update(e)}),o}function Of({lens:e,selector:t,children:n}){return(0,u.jsx)(u.Fragment,{children:kd(n,vf(e.store,t))})}function kf(e){let[t]=(0,l.useState)(()=>{let n=new gf(e),r=e.form instanceof gf?e.form.form:e.form,i=n;return i.AppForm=function(e){return(0,u.jsx)(r.AppForm,{...e})},i.AppField=function(e){return(0,u.jsx)(r.AppField,{...t.getFormFieldOptions(e)})},i.Field=function(e){return(0,u.jsx)(r.Field,{...t.getFormFieldOptions(e)})},i.Subscribe=function(e){return(0,u.jsx)(Of,{lens:t,selector:e.selector,children:e.children})},Object.assign(i,{...e.formComponents})});return xf(t.mount,[t]),t}var Af=(0,l.createContext)(null),jf=(0,l.createContext)(null);function Mf(){function e(){let e=(0,l.useContext)(Af);if(!e)throw Error("`fieldContext` only works when within a `fieldComponent` passed to `createFormHook`");return e}function t(){let e=(0,l.useContext)(jf);if(!e)throw Error("`formContext` only works when within a `formComponent` passed to `createFormHook`");return e}return{fieldContext:Af,useFieldContext:e,useFormContext:t,formContext:jf}}function Nf({fieldComponents:e,fieldContext:t,formContext:n,formComponents:r}){function i(i){let a=Df(i),o=(0,l.useMemo)(()=>({children:e})=>(0,u.jsx)(n.Provider,{value:a,children:e}),[a]),s=(0,l.useMemo)(()=>(({children:n,...r})=>(0,u.jsx)(a.Field,{...r,children:r=>(0,u.jsx)(t.Provider,{value:r,children:n(Object.assign(r,e))})})),[a]);return(0,l.useMemo)(()=>Object.assign(a,{AppField:s,AppForm:o,...r}),[a,s,o])}function a({render:e,props:t}){return n=>e({...t,...n})}function o({render:e,props:t,defaultValues:n}){return function(i){let a=kf((0,l.useMemo)(()=>({form:i.form,fields:i.fields,defaultValues:n,formComponents:r}),[i.form,i.fields]));return e({...t,...i,group:a})}}return{useAppForm:i,withForm:a,withFieldGroup:o}}const{fieldContext:Pf,useFieldContext:Ff,formContext:If,useFormContext:Lf}=Mf();var Rf=m();const zf=e=>{let t=(0,Rf.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=Ff(),s;t[5]===r?s=t[6]:(s=X(``,r),t[5]=r,t[6]=s);let c;t[7]===o.state.meta.errors?c=t[8]:(c=o.state.meta.errors.length>0&&(0,u.jsx)(`div`,{className:`mt-2`,children:o.state.meta.errors.map(Bf)}),t[7]=o.state.meta.errors,t[8]=c);let l;return t[9]!==n||t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==c?(l=(0,u.jsxs)(`div`,{className:s,ref:a,...i,children:[n,c]}),t[9]=n,t[10]=i,t[11]=a,t[12]=s,t[13]=c,t[14]=l):l=t[14],l};function Bf(e,t){return(0,u.jsx)(`p`,{className:`text-error text-sm`,children:e.message},t)}function Vf(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=fr(),o=Sn(t);return K(()=>{if(!(!n&&!t||a===B)){if(n){let e=r?.current;Z(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}const Hf=l.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:u,...d}=e,{state:f,name:p,disabled:m}=ir(),h=m||s,g=p??a,_=l.useMemo(()=>({...f,disabled:h}),[f,h]),{setTouched:v,setDirty:y,validityData:b,setFocused:x,setFilled:S,validationMode:C,validation:w}=ir(),{labelId:T}=fr(),E=Vf({id:i});K(()=>{let e=o!=null;w.inputRef.current?.value||e&&o!==``?S(!0):e&&o===``&&S(!1)},[w.inputRef,S,o]);let[D,O]=un({controlled:o,default:u,name:`FieldControl`,state:`value`}),k=o!==void 0,A=G((e,t)=>{c?.(e,t),!t.isCanceled&&O(e)});return ur({id:E,name:g,commit:w.commit,value:D,getValue:()=>w.inputRef.current?.value,controlRef:w.inputRef}),W(`input`,e,{ref:t,state:_,props:[{id:E,disabled:h,name:g,ref:w.inputRef,"aria-labelledby":T,...k?{value:D}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;A(t,Dr(_r,e.nativeEvent)),y(t!==b.initialValue),S(t!==``)},onFocus(){x(!0)},onBlur(e){v(!0),x(!1),C===`onBlur`&&w.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(v(!0),w.commit(e.currentTarget.value))}},w.getInputValidationProps(),d],stateAttributesMapping:hn})});process.env.NODE_ENV!==`production`&&(Hf.displayName=`FieldControl`);const Uf=l.forwardRef(function(e,t){return(0,u.jsx)(Hf,{ref:t,...e})});process.env.NODE_ENV!==`production`&&(Uf.displayName=`Input`);var Wf=m();const Gf=e=>{let t=(0,Wf.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(``,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,u.jsx)(`div`,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var Kf=m();const qf=e=>{let t=(0,Kf.c)(20),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({leadingIcon:r,showSeparator:o,className:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?!0:o,c=i.disabled,d=i.disabled,f;t[6]===n?f=t[7]:(f=X(`flex items-center gap-xs px-md w-full py-sm group h-xl inset-shadow-2-shadow inset-shadow-sm bg-surface-dim rounded-xl data-[disabled=true]:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:hover:outline-transparent outline-2 outline-transparent hover:not-focus-within:outline-outline focus-within:outline-primary focus-within:caret-primary transition-all`,n),t[6]=n,t[7]=f);let p;t[8]!==r||t[9]!==s?(p=r&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:X(`flex items-center text-on-surface-variant justify-center [&>svg]:size-s group-focus-within:text-primary transition-all`),children:(0,l.createElement)(r,{weight:`bold`})}),s&&(0,u.jsx)(Gf,{orientation:`vertical`,className:`group-focus-within:bg-primary`})]}),t[8]=r,t[9]=s,t[10]=p):p=t[10];let m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=X(`outline-none w-full`,`placeholder:opacity-60`,`disabled:text-text-neutral-primary-disabled disabled:cursor-not-allowed`,`overflow-ellipsis`),t[11]=m):m=t[11];let h;t[12]!==i||t[13]!==a?(h=(0,u.jsx)(Uf,{className:m,ref:a,...i}),t[12]=i,t[13]=a,t[14]=h):h=t[14];let g;return t[15]!==i.disabled||t[16]!==f||t[17]!==p||t[18]!==h?(g=(0,u.jsxs)(`div`,{"aria-disabled":c,"data-disabled":d,className:f,children:[p,h]}),t[15]=i.disabled,t[16]=f,t[17]=p,t[18]=h,t[19]=g):g=t[19],g};var Jf=m();const Yf=e=>{let t=(0,Jf.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=Ff(),s=o.name,c=o.name,l=o.state.value,d;t[5]===o?d=t[6]:(d=e=>o.handleChange(e.target.value),t[5]=o,t[6]=d);let f;t[7]===o?f=t[8]:(f=o.state.value&&o.getMeta().errors.length>0&&`outline-error`,t[7]=o,t[8]=f);let p;t[9]===o?p=t[10]:(p=o.state.value&&o.getMeta().isValid&&`outline-success`,t[9]=o,t[10]=p);let m;t[11]!==r||t[12]!==f||t[13]!==p?(m=X(f,p,r),t[11]=r,t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==n||t[16]!==o.name||t[17]!==o.state.value||t[18]!==i||t[19]!==a||t[20]!==d||t[21]!==m?(h=(0,u.jsx)(qf,{required:!0,type:`text`,id:s,name:c,value:l,onChange:d,className:m,ref:a,...i,children:n}),t[15]=n,t[16]=o.name,t[17]=o.state.value,t[18]=i,t[19]=a,t[20]=d,t[21]=m,t[22]=h):h=t[22],h};var Xf=m();const Zf=e=>{let t=(0,Xf.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({submittingText:o,className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?`Submitting...`:o,c=Lf(),l;t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==a||t[10]!==s?(l=e=>{let[t,o]=e;return(0,u.jsx)(ln,{type:`submit`,disabled:!t||o,className:X(`w-full`,r),ref:a,...i,children:o?s:n})},t[6]=n,t[7]=r,t[8]=i,t[9]=a,t[10]=s,t[11]=l):l=t[11];let d;return t[12]!==c.Subscribe||t[13]!==l?(d=(0,u.jsx)(c.Subscribe,{selector:Qf,children:l}),t[12]=c.Subscribe,t[13]=l,t[14]=d):d=t[14],d};function Qf(e){return[e.canSubmit,e.isSubmitting]}var $f=m();const ep=e=>{let t=(0,$f.c)(17),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=vf(Lf().store,tp),s;t[5]===r?s=t[6]:(s=X(``,r),t[5]=r,t[6]=s);let c;t[7]===o?c=t[8]:(c=o.map(np),t[7]=o,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,u.jsx)(`div`,{className:`mt-2`,children:c}),t[9]=c,t[10]=l);let d;return t[11]!==n||t[12]!==i||t[13]!==a||t[14]!==s||t[15]!==l?(d=(0,u.jsxs)(`div`,{className:s,ref:a,...i,children:[n,l]}),t[11]=n,t[12]=i,t[13]=a,t[14]=s,t[15]=l,t[16]=d):d=t[16],d};function tp(e){return e.errors}function np(e,t){return(0,u.jsx)(`p`,{className:`text-error text-sm`,children:e.message},t)}const rp=Nf({fieldComponents:{FieldErrors:zf,FieldInput:Yf},formComponents:{FormErrors:ep,FormSubmit:Zf},fieldContext:Pf,formContext:If});var ip=m();const ap=e=>{let t=(0,ip.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`hover:cursor-pointer`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,u.jsx)(`label`,{"data-slot":`label`,className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var op=m();const sp=e=>{let t=(0,op.c)(36),n,r,i,a,o,s,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],d=t[9]):({className:r,imageUrl:a,fallbackText:i,profileName:c,profileEmail:l,compact:d,children:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=d);let f=c===void 0?``:c,p=l===void 0?``:l,m=d===void 0?!1:d,h;t[10]===r?h=t[11]:(h=X(`flex items-center gap-xs transition-colors`,r),t[10]=r,t[11]=h);let g;t[12]===a?g=t[13]:(g=(0,u.jsx)(Zt,{src:a}),t[12]=a,t[13]=g);let _;t[14]===i?_=t[15]:(_=(0,u.jsx)($t,{children:i}),t[14]=i,t[15]=_);let v;t[16]!==n||t[17]!==g||t[18]!==_?(v=(0,u.jsxs)(Yt,{children:[g,_,n]}),t[16]=n,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y=m&&`hidden`,b;t[20]===y?b=t[21]:(b=X(`flex flex-col justify-start items-start`,y),t[20]=y,t[21]=b);let x;t[22]===f?x=t[23]:(x=(0,u.jsx)(`span`,{className:`text-prose-0`,children:f}),t[22]=f,t[23]=x);let S;t[24]===p?S=t[25]:(S=(0,u.jsx)(`span`,{className:`text-on-surface-variant text-prose--1`,children:p}),t[24]=p,t[25]=S);let C;t[26]!==x||t[27]!==S||t[28]!==b?(C=(0,u.jsxs)(`div`,{className:b,children:[x,S]}),t[26]=x,t[27]=S,t[28]=b,t[29]=C):C=t[29];let w;return t[30]!==o||t[31]!==s||t[32]!==C||t[33]!==h||t[34]!==v?(w=(0,u.jsxs)(`button`,{className:h,ref:s,...o,children:[v,C]}),t[30]=o,t[31]=s,t[32]=C,t[33]=h,t[34]=v,t[35]=w):w=t[35],w},cp=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(cp.displayName=`ScrollAreaRootContext`);function lp(){let e=l.useContext(cp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(53):`Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.`);return e}let up=function(e){return e.scrollAreaCornerHeight=`--scroll-area-corner-height`,e.scrollAreaCornerWidth=`--scroll-area-corner-width`,e}({});const dp=500,fp=16;function pp(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=n===`x`?`Inline`:`Block`;return n===`x`&&t===`margin`?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}let mp=function(e){return e.orientation=`data-orientation`,e.hovering=`data-hovering`,e.scrolling=`data-scrolling`,e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({});var hp=`base-ui-disable-scrollbar`;const gp={className:hp,element:(0,u.jsx)(`style`,{href:hp,precedence:`base-ui:low`,children:`.${hp}{scrollbar-width:none}.${hp}::-webkit-scrollbar{display:none}`})};let _p=function(e){return e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({});const vp={hasOverflowX:e=>e?{[_p.hasOverflowX]:``}:null,hasOverflowY:e=>e?{[_p.hasOverflowY]:``}:null,overflowXStart:e=>e?{[_p.overflowXStart]:``}:null,overflowXEnd:e=>e?{[_p.overflowXEnd]:``}:null,overflowYStart:e=>e?{[_p.overflowYStart]:``}:null,overflowYEnd:e=>e?{[_p.overflowYEnd]:``}:null,cornerHidden:()=>null};var yp={width:0,height:0},bp={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1};const xp=l.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,...a}=e,[o,s]=l.useState(!1),[c,d]=l.useState(!1),[f,p]=l.useState(!1),[m,h]=l.useState(yp),[g,_]=l.useState(yp),[v,y]=l.useState(!1),[b,x]=l.useState(bp),S=Sn(),C=l.useRef(null),w=l.useRef(null),T=l.useRef(null),E=l.useRef(null),D=l.useRef(null),O=l.useRef(null),k=l.useRef(null),A=l.useRef(!1),j=l.useRef(0),M=l.useRef(0),N=l.useRef(0),P=l.useRef(0),ee=l.useRef(`vertical`),te=we(),F=we(),I=l.useRef({x:0,y:0}),[L,R]=l.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),z=Sp(i),ne=G(e=>{let t=e.x-I.current.x,n=e.y-I.current.y;I.current=e,n!==0&&(p(!0),te.start(500,()=>{p(!1)})),t!==0&&(d(!0),F.start(500,()=>{d(!1)}))}),B=G(e=>{e.button===0&&(A.current=!0,j.current=e.clientY,M.current=e.clientX,ee.current=e.currentTarget.getAttribute(mp.orientation),w.current&&(N.current=w.current.scrollTop,P.current=w.current.scrollLeft),D.current&&ee.current===`vertical`&&D.current.setPointerCapture(e.pointerId),O.current&&ee.current===`horizontal`&&O.current.setPointerCapture(e.pointerId))}),V=G(e=>{if(!A.current)return;let t=e.clientY-j.current,n=e.clientX-M.current;if(w.current){let r=w.current.scrollHeight,i=w.current.clientHeight,a=w.current.scrollWidth,o=w.current.clientWidth;if(D.current&&T.current&&ee.current===`vertical`){let n=pp(T.current,`padding`,`y`),a=pp(D.current,`margin`,`y`),o=D.current.offsetHeight,s=t/(T.current.offsetHeight-o-n-a);w.current.scrollTop=N.current+s*(r-i),e.preventDefault(),p(!0),te.start(500,()=>{p(!1)})}if(O.current&&E.current&&ee.current===`horizontal`){let t=pp(E.current,`padding`,`x`),r=pp(O.current,`margin`,`x`),i=O.current.offsetWidth,s=n/(E.current.offsetWidth-i-t-r);w.current.scrollLeft=P.current+s*(a-o),e.preventDefault(),d(!0),F.start(500,()=>{d(!1)})}}}),H=G(e=>{A.current=!1,D.current&&ee.current===`vertical`&&D.current.releasePointerCapture(e.pointerId),O.current&&ee.current===`horizontal`&&O.current.releasePointerCapture(e.pointerId)});function re(e){let t=e.pointerType===`touch`;y(t),t||s(Q(C.current,e.target))}let U=l.useMemo(()=>({hasOverflowX:!L.scrollbarXHidden,hasOverflowY:!L.scrollbarYHidden,overflowXStart:b.xStart,overflowXEnd:b.xEnd,overflowYStart:b.yStart,overflowYEnd:b.yEnd,cornerHidden:L.cornerHidden}),[L.scrollbarXHidden,L.scrollbarYHidden,L.cornerHidden,b]),ie={role:`presentation`,onPointerEnter:re,onPointerMove:re,onPointerDown({pointerType:e}){y(e===`touch`)},onPointerLeave(){s(!1)},style:{position:`relative`,[up.scrollAreaCornerHeight]:`${m.height}px`,[up.scrollAreaCornerWidth]:`${m.width}px`}},ae=W(`div`,e,{state:U,ref:[t,C],props:[ie,a],stateAttributesMapping:vp}),oe=l.useMemo(()=>({handlePointerDown:B,handlePointerMove:V,handlePointerUp:H,handleScroll:ne,cornerSize:m,setCornerSize:h,thumbSize:g,setThumbSize:_,touchModality:v,cornerRef:k,scrollingX:c,setScrollingX:d,scrollingY:f,setScrollingY:p,hovering:o,setHovering:s,viewportRef:w,rootRef:C,scrollbarYRef:T,scrollbarXRef:E,thumbYRef:D,thumbXRef:O,rootId:S,hiddenState:L,setHiddenState:R,overflowEdges:b,setOverflowEdges:x,viewportState:U,overflowEdgeThreshold:z}),[B,V,H,ne,m,g,v,k,c,d,f,p,o,s,w,C,T,E,D,O,S,L,b,U,z]);return(0,u.jsxs)(cp.Provider,{value:oe,children:[gp.element,ae]})});process.env.NODE_ENV!==`production`&&(xp.displayName=`ScrollAreaRoot`);function Sp(e){if(typeof e==`number`){let t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const Cp=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Cp.displayName=`ScrollAreaViewportContext`);const wp=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(wp.displayName=`DirectionContext`);function Tp(){return l.useContext(wp)?.direction??`ltr`}function Ep(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Dp(e,t){if(typeof IntersectionObserver>`u`)return()=>{};let n=new IntersectionObserver(e=>{e.forEach(e=>{e.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let Op=function(e){return e.scrollAreaOverflowXStart=`--scroll-area-overflow-x-start`,e.scrollAreaOverflowXEnd=`--scroll-area-overflow-x-end`,e.scrollAreaOverflowYStart=`--scroll-area-overflow-y-start`,e.scrollAreaOverflowYEnd=`--scroll-area-overflow-y-end`,e}({});var kp=!1;function Ap(){kp||Ti||(typeof CSS<`u`&&`registerProperty`in CSS&&[Op.scrollAreaOverflowXStart,Op.scrollAreaOverflowXEnd,Op.scrollAreaOverflowYStart,Op.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),kp=!0)}const jp=l.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{viewportRef:a,scrollbarYRef:o,scrollbarXRef:s,thumbYRef:c,thumbXRef:f,cornerRef:p,setCornerSize:m,setThumbSize:h,rootId:g,setHiddenState:_,hiddenState:v,handleScroll:y,setHovering:b,setOverflowEdges:x,overflowEdges:S,overflowEdgeThreshold:C}=lp(),w=Tp(),T=l.useRef(!0),E=we(),D=we();function O(){let e=a.current,t=o.current,n=s.current,r=c.current,i=f.current,l=p.current;if(!e)return;let u=e.scrollHeight,d=e.scrollWidth,g=e.clientHeight,v=e.clientWidth,y=e.scrollTop,b=e.scrollLeft;if(u===0||d===0)return;let S=g>=u,T=v>=d,E=v/d,D=g/u,O=Math.max(0,d-v),k=Math.max(0,u-g),A=0,j=0;T||(A=Ep(w===`rtl`?-b:b,0,O),j=O-A);let M=S?0:Ep(y,0,k),N=S?0:k-M,P=T?0:v,ee=S?0:g,te=pp(n,`padding`,`x`),F=pp(t,`padding`,`y`),I=pp(i,`margin`,`x`),L=pp(r,`margin`,`y`),R=P-te-I,z=ee-F-L,ne=n?Math.min(n.offsetWidth,R):R,B=t?Math.min(t.offsetHeight,z):z,V=Math.max(16,ne*E),H=Math.max(16,B*D);if(h(e=>e.height===H&&e.width===V?e:{width:V,height:H}),t&&r){let e=t.offsetHeight-H-F-L,n=u-g,i=n===0?0:y/n,a=Math.min(e,Math.max(0,i*e));r.style.transform=`translate3d(0,${a}px,0)`}if(n&&i){let e=n.offsetWidth-V-te-I,t=d-v,r=t===0?0:b/t,a=w===`rtl`?Ep(r*e,-e,0):Ep(r*e,0,e);i.style.transform=`translate3d(${a}px,0,0)`}let re=Ep(A,0,O),U=Ep(j,0,O),ie=Ep(M,0,k),ae=Ep(N,0,k),W=[[Op.scrollAreaOverflowXStart,re],[Op.scrollAreaOverflowXEnd,U],[Op.scrollAreaOverflowYStart,ie],[Op.scrollAreaOverflowYEnd,ae]];for(let[t,n]of W)e.style.setProperty(t,`${n}px`);l&&(T||S?m({width:0,height:0}):!T&&!S&&m({width:t?.offsetWidth||0,height:n?.offsetHeight||0})),_(e=>{let t=S||T;return e.scrollbarYHidden===S&&e.scrollbarXHidden===T&&e.cornerHidden===t?e:{scrollbarYHidden:S,scrollbarXHidden:T,cornerHidden:t}});let oe={xStart:!T&&re>C.xStart,xEnd:!T&&U>C.xEnd,yStart:!S&&ie>C.yStart,yEnd:!S&&ae>C.yEnd};x(e=>e.xStart===oe.xStart&&e.xEnd===oe.xEnd&&e.yStart===oe.yStart&&e.yEnd===oe.yEnd?e:oe)}let k=G(()=>{d.flushSync(O)});K(()=>{if(a.current)return Ap(),Dp(a.current,k)},[k,a]),K(()=>{queueMicrotask(k)},[k,v,w]),K(()=>{a.current?.matches(`:hover`)&&b(!0)},[a,b]),l.useEffect(()=>{let e=a.current;if(typeof ResizeObserver>`u`||!e)return;let t=new ResizeObserver(k);return t.observe(e),D.start(0,()=>{Promise.all(e.getAnimations({subtree:!0}).map(e=>e.finished)).then(k).catch(()=>{})}),()=>{t.disconnect(),D.clear()}},[k,a,D]);function A(){T.current=!1}let j={role:`presentation`,...g&&{"data-id":`${g}-viewport`},...(!v.scrollbarXHidden||!v.scrollbarYHidden)&&{tabIndex:0},className:gp.className,style:{overflow:`scroll`},onScroll(){a.current&&(k(),T.current||y({x:a.current.scrollLeft,y:a.current.scrollTop}),E.start(100,()=>{T.current=!0}))},onWheel:A,onTouchMove:A,onPointerMove:A,onPointerEnter:A,onKeyDown:A},M=l.useMemo(()=>({hasOverflowX:!v.scrollbarXHidden,hasOverflowY:!v.scrollbarYHidden,overflowXStart:S.xStart,overflowXEnd:S.xEnd,overflowYStart:S.yStart,overflowYEnd:S.yEnd,cornerHidden:v.cornerHidden}),[v.scrollbarXHidden,v.scrollbarYHidden,v.cornerHidden,S]),N=W(`div`,e,{ref:[t,a],state:M,props:[j,i],stateAttributesMapping:vp}),P=l.useMemo(()=>({computeThumbPosition:k}),[k]);return(0,u.jsx)(Cp.Provider,{value:P,children:N})});process.env.NODE_ENV!==`production`&&(jp.displayName=`ScrollAreaViewport`);const Mp=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Mp.displayName=`ScrollAreaScrollbarContext`);function Np(){let e=l.useContext(Mp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(54):`Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.`);return e}let Pp=function(e){return e.scrollAreaThumbHeight=`--scroll-area-thumb-height`,e.scrollAreaThumbWidth=`--scroll-area-thumb-width`,e}({});const Fp=l.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,...o}=e,{hovering:s,scrollingX:c,scrollingY:d,hiddenState:f,overflowEdges:p,scrollbarYRef:m,scrollbarXRef:h,viewportRef:g,thumbYRef:_,thumbXRef:v,handlePointerDown:y,handlePointerUp:b,rootId:x,thumbSize:S}=lp(),C=l.useMemo(()=>({hovering:s,scrolling:{horizontal:c,vertical:d}[i],orientation:i,hasOverflowX:!f.scrollbarXHidden,hasOverflowY:!f.scrollbarYHidden,overflowXStart:p.xStart,overflowXEnd:p.xEnd,overflowYStart:p.yStart,overflowYEnd:p.yEnd,cornerHidden:f.cornerHidden}),[s,c,d,i,f,p]),w=Tp();l.useEffect(()=>{let e=g.current,t=i===`vertical`?m.current:h.current;if(!t)return;function n(n){if(!(!e||!t||n.ctrlKey)){if(n.preventDefault(),i===`vertical`){if(e.scrollTop===0&&n.deltaY<0)return}else if(e.scrollLeft===0&&n.deltaX<0)return;if(i===`vertical`){if(e.scrollTop===e.scrollHeight-e.clientHeight&&n.deltaY>0)return}else if(e.scrollLeft===e.scrollWidth-e.clientWidth&&n.deltaX>0)return;i===`vertical`?e.scrollTop+=n.deltaY:e.scrollLeft+=n.deltaX}}return t.addEventListener(`wheel`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n)}},[i,h,m,g]);let T={...x&&{"data-id":`${x}-scrollbar`},onPointerDown(e){if(e.button===0&&e.currentTarget===e.target&&g.current){if(_.current&&m.current&&i===`vertical`){let t=pp(_.current,`margin`,`y`),n=pp(m.current,`padding`,`y`),r=_.current.offsetHeight,i=m.current.getBoundingClientRect(),a=e.clientY-i.top-r/2-n+t/2,o=g.current.scrollHeight,s=g.current.clientHeight,c=a/(m.current.offsetHeight-r-n-t)*(o-s);g.current.scrollTop=c}if(v.current&&h.current&&i===`horizontal`){let t=pp(v.current,`margin`,`x`),n=pp(h.current,`padding`,`x`),r=v.current.offsetWidth,i=h.current.getBoundingClientRect(),a=e.clientX-i.left-r/2-n+t/2,o=g.current.scrollWidth,s=g.current.clientWidth,c=a/(h.current.offsetWidth-r-n-t),l;w===`rtl`?(l=(1-c)*(o-s),g.current.scrollLeft<=0&&(l=-l)):l=c*(o-s),g.current.scrollLeft=l}y(e)}},onPointerUp:b,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,...i===`vertical`&&{top:0,bottom:`var(${up.scrollAreaCornerHeight})`,insetInlineEnd:0,[Pp.scrollAreaThumbHeight]:`${S.height}px`},...i===`horizontal`&&{insetInlineStart:0,insetInlineEnd:`var(${up.scrollAreaCornerWidth})`,bottom:0,[Pp.scrollAreaThumbWidth]:`${S.width}px`}}},E=W(`div`,e,{ref:[t,i===`vertical`?m:h],state:C,props:[T,o],stateAttributesMapping:vp}),D=l.useMemo(()=>({orientation:i}),[i]),O=i===`vertical`?f.scrollbarYHidden:f.scrollbarXHidden;return a||!O?(0,u.jsx)(Mp.Provider,{value:D,children:E}):null});process.env.NODE_ENV!==`production`&&(Fp.displayName=`ScrollAreaScrollbar`);const Ip=l.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{thumbYRef:a,thumbXRef:o,handlePointerDown:s,handlePointerMove:c,handlePointerUp:u,setScrollingX:d,setScrollingY:f}=lp(),{orientation:p}=Np(),m=l.useMemo(()=>({orientation:p}),[p]);return W(`div`,e,{ref:[t,p===`vertical`?a:o],state:m,props:[{onPointerDown:s,onPointerMove:c,onPointerUp(e){p===`vertical`&&f(!1),p===`horizontal`&&d(!1),u(e)},style:{...p===`vertical`&&{height:`var(${Pp.scrollAreaThumbHeight})`},...p===`horizontal`&&{width:`var(${Pp.scrollAreaThumbWidth})`}}},i]})});process.env.NODE_ENV!==`production`&&(Ip.displayName=`ScrollAreaThumb`);const Lp=l.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{cornerRef:a,cornerSize:o,hiddenState:s}=lp(),c=W(`div`,e,{ref:[t,a],props:[{style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},i]});return s.cornerHidden?null:c});process.env.NODE_ENV!==`production`&&(Lp.displayName=`ScrollAreaCorner`);var Rp=m();const zp=e=>{let t=(0,Rp.c)(26),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({orientation:o,className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?`vertical`:o,c=s===`horizontal`&&`h-full`,l;t[6]!==r||t[7]!==c?(l=X(`h-[200px] rounded-lg bg-surface-container`,c,r),t[6]=r,t[7]=c,t[8]=l):l=t[8];let d;t[9]===n?d=t[10]:(d=(0,u.jsx)(jp,{className:`h-full overscroll-contain flex flex-col gap-xs py-2xs pr-sm pl-sm prose-step-0`,children:n}),t[9]=n,t[10]=d);let f=s===`vertical`&&`w-2xs mr-2xs my-2xs`,p=s===`horizontal`&&`h-2xs flex-col mb-2xs mx-xs`,m;t[11]!==r||t[12]!==f||t[13]!==p?(m=X(`inset-shadow-1-shadow flex justify-center rounded p-[2px] bg-surface-dim opacity-0 transition-opacity delay-300 data-hovering:opacity-100 data-hovering:delay-0 data-hovering:duration-75 data-scrolling:opacity-100 data-scrolling:delay-0 data-scrolling:duration-75 hover:cursor-pointer`,f,p,r),t[11]=r,t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,u.jsx)(Ip,{className:`w-full h-full rounded-full bg-accent rounded-1`}),t[15]=h):h=t[15];let g;t[16]!==s||t[17]!==m?(g=(0,u.jsx)(Fp,{orientation:s,className:m,children:h}),t[16]=s,t[17]=m,t[18]=g):g=t[18];let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,u.jsx)(Lp,{}),t[19]=_):_=t[19];let v;return t[20]!==i||t[21]!==a||t[22]!==l||t[23]!==d||t[24]!==g?(v=(0,u.jsxs)(xp,{className:l,ref:a,...i,children:[d,g,_]}),t[20]=i,t[21]=a,t[22]=l,t[23]=d,t[24]=g,t[25]=v):v=t[25],v},Bp=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Bp.displayName=`TooltipRootContext`);function Vp(e){let t=l.useContext(Bp);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?h(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return t}var Hp={...jl,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeDelay:$(e=>e.closeDelay)},Up=class e extends bl{constructor(e){super({...Wp(),...e},{popupRef:l.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Ol},Hp)}setOpen=(e,t)=>{let n=t.reason,r=n===yr,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?d.flushSync(o):o()};static useStore(t,n){let r=_(()=>t??new e(n)).current,i=Pl({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function Wp(){return{...Al(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function Gp(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:d,triggerId:f,defaultTriggerId:p=null,children:m}=e,h=Up.useStore(d?.store,{open:r??n,activeTriggerId:f===void 0?p:f});h.useControlledProp(`open`,r,n),h.useControlledProp(`activeTriggerId`,f,p),h.useContextCallback(`onOpenChange`,s),h.useContextCallback(`onOpenChangeComplete`,c);let g=h.useState(`open`),_=h.useState(`activeTriggerId`),v=h.useState(`payload`);h.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let y=!t&&g;K(()=>{g&&t&&h.setOpen(!1,Dr(`disabled`))},[g,t,h]),h.useSyncedValue(`disabled`,t),El(h);let{forceUnmount:b,transitionStatus:x}=Dl(y,h),S=h.useState(`isInstantPhase`),C=h.useState(`instantType`),w=h.useState(`lastOpenChangeReason`),T=l.useRef(null);K(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),h.set(`instantType`,`delay`)):T.current!==null&&(h.set(`instantType`,T.current),T.current=null)},[x,S,w,C,h]),K(()=>{y&&(_??h.set(`payload`,void 0))},[h,_,y]);let E=l.useCallback(()=>{h.setOpen(!1,Kp(h,Er))},[h]);l.useImperativeHandle(o,()=>({unmount:b,close:E}),[b,E]);let D=h.useState(`floatingRootContext`),{getReferenceProps:O,getFloatingProps:k,getTriggerProps:A}=ql([Il(D,{enabled:!t}),Nc(D,{enabled:!t,referencePress:!0}),xs(D,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),j=l.useMemo(()=>O(),[O]),M=l.useMemo(()=>A(),[A]),N=l.useMemo(()=>k(),[k]);return h.useSyncedValues({floatingRootContext:D,activeTriggerProps:j,inactiveTriggerProps:M,popupProps:N}),(0,u.jsx)(Bp.Provider,{value:h,children:typeof m==`function`?m({payload:v}):m})}function Kp(e,t){let n=Dr(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}const qp=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(qp.displayName=`TooltipProviderContext`);function Jp(){return l.useContext(qp)}const Yp=600,Xp=l.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:u,...d}=e,f=Vp(!0),p=i?.store??f;if(!p)throw Error(process.env.NODE_ENV===`production`?h(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let m=Sn(u),g=p.useState(`isTriggerActive`,m),_=p.useState(`floatingRootContext`),v=p.useState(`isOpenedByTrigger`,m),y=l.useRef(null),b=s??600,x=c??0,{registerTrigger:S,isMountedByThisTrigger:C}=Tl(m,y,p,{payload:a,closeDelay:x}),w=Jp(),{delayRef:T,isInstantPhase:E,hasProvider:D}=Uo(_,{open:v});p.useSyncedValue(`isInstantPhase`,E);let O=p.useState(`disabled`),k=o??O,A=p.useState(`trackCursorAxis`),j=p.useState(`disableHoverablePopup`),M=Kl(_,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?eu():null,restMs(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return D&&(n=t===0?0:s??e??b),n},delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return c==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g}),N=l.useMemo(()=>({open:v}),[v]),P=p.useState(`triggerProps`,C);return W(`button`,e,{state:N,ref:[t,S,y],props:[M,P,{id:m},d],stateAttributesMapping:hi})});process.env.NODE_ENV!==`production`&&(Xp.displayName=`TooltipTrigger`);const Zp=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Zp.displayName=`TooltipPortalContext`);function Qp(){let e=l.useContext(Zp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(70):`Base UI: <Tooltip.Portal> is missing.`);return e}const $p=l.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=os({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,u.jsxs)(l.Fragment,{children:[c,s&&d.createPortal(n,s)]})});process.env.NODE_ENV!==`production`&&($p.displayName=`FloatingPortalLite`);const em=l.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Vp().useState(`mounted`)||n?(0,u.jsx)(Zp.Provider,{value:n,children:(0,u.jsx)($p,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(em.displayName=`TooltipPortal`);const tm=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(tm.displayName=`TooltipPositionerContext`);function nm(){let e=l.useContext(tm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}const rm=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=ga(e,t)||{};if(l==null)return{};let f=Fa(u),p={x:n,y:r},m=Ca(i),h=ba(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=ha(k,j,A),N=!c.arrow&&va(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),im=(e,t)=>({...rm(e),options:[e,t]}),am={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Ac().fn(e)).data?.referenceHidden||a}}}},om={sideX:`left`,sideY:`top`},sm={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Tn(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:om};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Wo(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=_a(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:om.sideX,g=f===`top`?`bottom`:om.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function cm(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function lm(e,t,n){let{rects:r,placement:i}=e;return{side:cm(t,_a(i),n),align:va(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function um(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,C]=l.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=G(D),k=D?O:t,A=jr(t),j=Tp()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=a===`center`?M:`${M}-${a}`,P=c,ee=r===`bottom`?1:0,te=r===`top`?1:0,F=r===`right`?1:0,I=r===`left`?1:0;typeof P==`number`?P={top:P+ee,right:P+I,bottom:P+te,left:P+F}:P&&={top:(P.top||0)+ee,right:(P.right||0)+I,bottom:(P.bottom||0)+te,left:(P.left||0)+F};let L={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:P},R=l.useRef(null),z=jr(i),ne=jr(o),B=[Tc(e=>{let t=lm(e,r,j),n=typeof z.current==`function`?z.current(t):z.current,i=typeof ne.current==`function`?ne.current(t):ne.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],V=T===`none`&&w!==`shift`,H=!V&&(u||_||w===`shift`),re=w===`none`?null:Oc({...L,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!_&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),U=V?null:Ec(e=>{let t=Wo(e.elements.floating).documentElement;return{...L,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:H,limiter:u||_?void 0:Dc(e=>{if(!R.current)return{};let{width:t,height:n}=R.current.getBoundingClientRect(),r=Sa(_a(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[L,u,_,P,T]);w===`shift`||T===`shift`||a===`center`?B.push(U,re):B.push(re,U),B.push(kc({...L,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),im(()=>({element:R.current||document.createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=_a(a),l=Sa(c),u=R.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(lm(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,H&&l===`y`&&b?S:x),{}}},am,y),K(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);let ie=l.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:ae,elements:W,x:oe,y:se,middlewareData:ce,update:le,placement:ue,context:de,isPositioned:fe,floatingStyles:pe}=Nl({rootContext:m,placement:N,middleware:B,strategy:n,whileElementsMounted:p?void 0:(...e)=>dc(...e,ie),nodeId:v,externalTree:x}),{sideX:me,sideY:he}=ce.adaptiveOrigin||om,ge=fe?n:`fixed`,_e=l.useMemo(()=>y?{position:ge,[me]:oe,[he]:se}:{position:ge,...pe},[y,ge,me,oe,he,se,pe]),ve=l.useRef(null);K(()=>{if(!h)return;let e=A.current,t=typeof e==`function`?e():e,n=(dm(t)?t.current:t)||null;n!==ve.current&&(ae.setPositionReference(n),ve.current=n)},[h,ae,k,A]),l.useEffect(()=>{if(!h)return;let e=A.current;typeof e!=`function`&&dm(e)&&e.current!==ve.current&&(ae.setPositionReference(e.current),ve.current=e.current)},[h,ae,k,A]),l.useEffect(()=>{if(p&&h&&W.domReference&&W.floating)return dc(W.domReference,W.floating,le,ie)},[p,h,W,le,ie]);let ye=_a(ue),be=cm(r,ye,j),xe=va(ue)||`center`,Se=!!ce.hide?.referenceHidden;K(()=>{b&&h&&fe&&C(ye)},[b,h,fe,ye]);let Ce=l.useMemo(()=>({position:`absolute`,top:ce.arrow?.y,left:ce.arrow?.x}),[ce.arrow]),we=ce.arrow?.centerOffset!==0;return l.useMemo(()=>({positionerStyles:_e,arrowStyles:Ce,arrowRef:R,arrowUncentered:we,side:be,align:xe,physicalSide:ye,anchorHidden:Se,refs:ae,context:de,isPositioned:fe,update:le}),[_e,Ce,R,we,be,xe,ye,Se,ae,de,fe,le])}function dm(e){return e!=null&&`current`in e}function fm(e){return e===`starting`?re:H}const pm=l.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=ie,...v}=e,y=Vp(),b=Qp(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=um({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:d,collisionBoundary:f,collisionPadding:p,sticky:h,arrowPadding:m,disableAnchorTracking:g,keepMounted:b,collisionAvoidance:_,adaptiveOrigin:sm}),k=l.useMemo(()=>{let e={};return(!x||C===`both`||w)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!S,style:{...O.positionerStyles,...e}}},[x,C,w,S,O.positionerStyles]),A=l.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),j=l.useMemo(()=>({...A,arrowRef:O.arrowRef,arrowStyles:O.arrowStyles,arrowUncentered:O.arrowUncentered}),[A,O.arrowRef,O.arrowStyles,O.arrowUncentered]),M=W(`div`,e,{state:A,props:[k,fm(D),v],ref:[t,y.useStateSetter(`positionerElement`)],stateAttributesMapping:gi});return(0,u.jsx)(tm.Provider,{value:j,children:M})});process.env.NODE_ENV!==`production`&&(pm.displayName=`TooltipPositioner`);function mm(e){let t=Wn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=On(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(ua(n)!==a||ua(r)!==o)&&(n=a,r=o),{width:n,height:r}}var hm=typeof ResizeObserver<`u`,gm=()=>!0;function _m(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=gm,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:u}=e,d=l.useRef(!0),f=Br(t,!0,!1),p=Rr(),m=l.useRef(null),h=G(o),g=G(s),_=l.useMemo(()=>{let e=c===`top`,t=c===`left`;return u===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:H},[c,u]);K(()=>{if(!i||!a()||!hm){d.current=!0,m.current=null;return}if(!t||!n)return;Object.entries(_).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(m.current===null?m.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(m.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),m.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=vm(t,`position`,`static`),o=vm(t,`transform`,`none`),s=vm(t,`scale`,`1`),c=vm(n,`--available-width`,`max-content`),l=vm(n,`--available-height`,`max-content`);if(h?.(),d.current||m.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=mm(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),g?.(null,i),d.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let u=mm(t);t.style.setProperty(`--popup-width`,`${m.current.width}px`),t.style.setProperty(`--popup-height`,`${m.current.height}px`),r(),o(),c(),l(),g?.(m.current,u),n.style.setProperty(`--positioner-width`,`${u.width}px`),n.style.setProperty(`--positioner-height`,`${u.height}px`);let v=new AbortController;return p.request(()=>{t.style.setProperty(`--popup-width`,`${u.width}px`),t.style.setProperty(`--popup-height`,`${u.height}px`),f(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),p.cancel()}},[r,t,n,f,p,a,i,h,g,_])}function vm(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var ym={...gi,...Kr};const bm=l.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Vp(),{side:o,align:s}=nm(),c=a.useState(`open`),u=a.useState(`mounted`),d=a.useState(`instantType`),f=a.useState(`transitionStatus`),p=a.useState(`popupProps`),m=a.useState(`payload`),h=a.useState(`popupElement`),g=a.useState(`positionerElement`),_=a.useState(`floatingRootContext`),v=Tp();Vr({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function y(){_.context.events.emit(`measure-layout`)}function b(e,t){_.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}_m({popupElement:h,positionerElement:g,mounted:u,content:m,enabled:l.useCallback(()=>a.context.triggerElements.size>1,[a]),onMeasureLayout:y,onMeasureLayoutComplete:b,side:o,direction:v});let x=a.useState(`disabled`),S=a.useState(`closeDelay`);return Hl(_,{enabled:!x,closeDelay:S}),W(`div`,e,{state:l.useMemo(()=>({open:c,side:o,align:s,instant:d,transitionStatus:f}),[c,o,s,d,f]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[p,fm(f),i],stateAttributesMapping:ym})});process.env.NODE_ENV!==`production`&&(bm.displayName=`TooltipPopup`);const xm=l.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Vp().useState(`instantType`),{open:o,arrowRef:s,side:c,align:u,arrowUncentered:d,arrowStyles:f}=nm();return W(`div`,e,{state:l.useMemo(()=>({open:o,side:c,align:u,uncentered:d,instant:a}),[o,c,u,d,a]),ref:[t,s],props:[{style:f,"aria-hidden":!0},i],stateAttributesMapping:gi})});process.env.NODE_ENV!==`production`&&(xm.displayName=`TooltipArrow`);const Sm=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=l.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=l.useMemo(()=>({open:t,close:n}),[t,n]);return(0,u.jsx)(qp.Provider,{value:i,children:(0,u.jsx)(Ho,{delay:a,timeoutMs:r,children:e.children})})};process.env.NODE_ENV!==`production`&&(Sm.displayName=`TooltipProvider`);var Cm=m();const wm=e=>{let t=(0,Cm.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,u.jsx)(Sm,{children:(0,u.jsx)(Gp,{...r,children:n})}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i};var Tm=m();const Em=e=>{let t=(0,Tm.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,u.jsx)(Xp,{...r,children:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i};var Dm=m();const Om=e=>{let t=(0,Dm.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=X(`bg-surface-container-high origin-(--transform-origin) px-xs py-3xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md text-sm text-balance`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,u.jsx)(xm,{className:`data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180`,children:(0,u.jsx)(ti,{weight:`fill`,className:`fill-surface-container-high `})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,u.jsx)(em,{children:(0,u.jsx)(pm,{sideOffset:10,children:(0,u.jsxs)(bm,{className:a,...i,children:[o,n]})})}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s},km=({sliderInstance:e,isActive:t,onKeyDownHandler:n,onMouseDownHandler:r,onTouchStart:i,value:a,className:o,children:s,ref:c,...d})=>{let[f,p]=(0,l.useState)(!1);return(0,u.jsxs)(wm,{open:t||f,trackCursorAxis:`x`,children:[(0,u.jsx)(Em,{render:(0,u.jsx)(`button`,{onKeyDown:n,onMouseDown:r,onTouchStart:i,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),role:`slider`,"aria-valuemin":e.options.min,"aria-valuemax":e.options.max,"aria-valuenow":a,style:{left:`${e.getPercentageForValue(a)}%`,zIndex:t?`1`:`0`},className:X(`absolute top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full outline-none border-2 border-primary bg-surface-container hover:cursor-pointer active:border-secondary hover:border-secondary transition-[width,height,border] aspect-square`,t?`size-md shadow-4-shadow`:`size-sm shadow-1-shadow`,o),ref:c,...d,children:s})}),(0,u.jsx)(Om,{children:(0,u.jsx)(`span`,{children:a})})]})},Am=({index:e,steps:t,left:n,width:r,className:i,children:a,ref:o,...s})=>(0,u.jsx)(`div`,{className:X(`absolute bg-primary h-full rounded-full inset-shadow-1-shadow`,i),style:{background:`${e===t-1?`transparent`:`var(--color-primary)`}`,left:`${n}%`,width:`${r}%`},ref:o,...s,children:a}),jm=({className:e,children:t,ref:n,...r})=>(0,u.jsx)(`p`,{className:X(`absolute text-[0.6rem] top-full -translate-x-1/2 translate-y-[1.2rem] whitespace-nowrap style-text-default--1 text-on-surface-variant`,e),ref:n,...r,children:t}),Mm=({percentage:e,className:t,children:n,ref:r,...i})=>(0,u.jsxs)(`div`,{className:X(`absolute top-2xs -translate-x-1/2`,t),ref:r,...i,style:{left:`${e}%`},children:[(0,u.jsx)(`span`,{className:`absolute bg-on-surface-variant rounded-full left-0 h-2xs w-[2px] -translate-x-1/2 translate-y-[0.7rem]`}),n]}),Nm=({className:e,children:t,sliderRef:n,...r})=>(0,u.jsx)(`div`,{className:X(`relative h-2xs inset-shadow-1-shadow rounded-full bg-surface-dim grow`,e),ref:n,...r,children:t});var Pm=e=>{let t=e.getBoundingClientRect();return{left:Math.ceil(t.left),width:Math.ceil(t.width)}},Fm=e=>[...e].map(Number).sort((e,t)=>e-t),Im={getPercentageForValue:(e,t,n)=>Math.max(0,Math.min(100,(e-t)/(n-t)*100)),getValueForClientX:(e,t,n,r)=>{let{left:i,width:a}=t,o=(e-i)/a;return(r-n)*o+n}},Lm=class{constructor(e){this.sortedValues=[],this.rangerElement=null,this._willUpdate=()=>{let e=this.options.getRangerElement();this.rangerElement!==e&&(this.rangerElement=e)},this.getValueForClientX=e=>{let t=Pm(this.rangerElement);return this.options.interpolator.getValueForClientX(e,t,this.options.min,this.options.max)},this.getNextStep=(e,t)=>{let{min:n,max:r}=this.options;if(`steps`in this.options){let{steps:n}=this.options,r=n.indexOf(e)+t;return r>=0&&r<n.length?n[r]:e}else{let i=e+this.options.stepSize*t;return i>=n&&i<=r?i:e}},this.roundToStep=e=>{let{min:t,max:n}=this.options,r=t,i=n;if(`steps`in this.options)this.options.steps.forEach(t=>{t<=e&&t>r&&(r=t),t>=e&&t<i&&(i=t)});else{let{stepSize:t}=this.options;for(;r<e&&r+t<e;)r+=t;i=Math.min(r+t,n)}return e-r<i-e?r:i},this.handleDrag=e=>{if(this.activeHandleIndex===void 0)return;let t=e.type===`touchmove`?e.changedTouches[0].clientX:e.clientX,n=this.getValueForClientX(t),r=this.roundToStep(n);this.sortedValues=[...this.options.values.slice(0,this.activeHandleIndex),r,...this.options.values.slice(this.activeHandleIndex+1)],this.options.onDrag?this.options.onDrag(this):(this.tempValues=this.sortedValues,this.options.rerender())},this.handleKeyDown=(e,t)=>{let{values:n}=this.options;if(e.keyCode===37||e.keyCode===39){this.activeHandleIndex=t;let r=e.keyCode===37?-1:1,i=this.getNextStep(n[t],r);this.sortedValues=Fm([...n.slice(0,t),i,...n.slice(t+1)]),this.options.onChange&&this.options.onChange(this)}},this.handlePress=(e,t)=>{this.activeHandleIndex=t,this.options.rerender();let n=()=>{let{tempValues:e,handleDrag:t}=this;document.removeEventListener(`mousemove`,t),document.removeEventListener(`touchmove`,t),document.removeEventListener(`mouseup`,n),document.removeEventListener(`touchend`,n),this.sortedValues=Fm(e||this.options.values),this.options.onChange&&this.options.onChange(this),this.options.onDrag&&this.options.onDrag(this),this.activeHandleIndex=void 0,this.tempValues=void 0,this.options.rerender()},{handleDrag:r}=this;document.addEventListener(`mousemove`,r),document.addEventListener(`touchmove`,r),document.addEventListener(`mouseup`,n),document.addEventListener(`touchend`,n)},this.getPercentageForValue=e=>this.options.interpolator.getPercentageForValue(e,this.options.min,this.options.max),this.getTicks=()=>{let e=[];if(this.options.ticks)e=[...this.options.ticks];else if(`steps`in this.options)e=[...this.options.steps];else{for(e=[this.options.min];e[e.length-1]<this.options.max-this.options.tickSize;)e.push(e[e.length-1]+this.options.tickSize);e.push(this.options.max)}return e.map((e,t)=>({value:e,key:t,percentage:this.getPercentageForValue(e)}))},this.getSteps=()=>{let e=Fm(this.tempValues||this.options.values);return[...e,this.options.max].map((t,n)=>{let r=e[n-1],i=r===void 0?this.options.min:r,a=this.getPercentageForValue(i);return{left:a,width:this.getPercentageForValue(t)-a}})},this.handles=()=>(this.tempValues||this.options.values).map((e,t)=>({value:e,isActive:t===this.activeHandleIndex,onKeyDownHandler:e=>{this.handleKeyDown(e,t)},onMouseDownHandler:e=>{this.handlePress(e,t)},onTouchStart:e=>{this.handlePress(e,t)}})),this.setOptions(e)}setOptions(e){Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,tickSize:10,interpolator:Im,onChange:()=>{},...e}}},Rm=typeof window<`u`?l.useLayoutEffect:l.useEffect;function zm(e){let t=l.useReducer(()=>({}),{})[1],n={...e,rerender:t,onChange:n=>{t(),e.onChange?.(n)}},[r]=l.useState(()=>new Lm(n));return r.setOptions(n),Rm(()=>r._willUpdate()),r}const Bm=({leadingIcon:e,trailingIcon:t,min:n,max:r,stepSize:i,defaultValues:a,showTickLabels:o,label:s,className:c,ref:d,...f})=>{let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(a||[50]),g=zm({getRangerElement:()=>p.current,values:m,min:n??0,max:r??100,stepSize:i??1,onChange:e=>{h(e.sortedValues)}});return(0,u.jsxs)(`div`,{ref:d,className:X(`space-y-2xs`,c),...f,children:[s&&(0,u.jsx)(`p`,{className:`style-text-default--1 text-on-surface-variant`,children:s}),(0,u.jsxs)(`div`,{className:`flex items-center w-full gap-sm`,children:[e&&(0,u.jsx)(e,{className:`size-sm`,weight:`bold`}),(0,u.jsxs)(Nm,{sliderRef:p,children:[o&&g.getTicks().map(({value:e,key:t,percentage:n})=>(0,u.jsx)(Mm,{percentage:n,children:(0,u.jsx)(jm,{children:e})},t)),g.getSteps().map(({left:e,width:t},n)=>(0,u.jsx)(Am,{index:n,steps:g.getSteps().length,left:e,width:t},n)),g.handles().map(({isActive:e,onKeyDownHandler:t,onMouseDownHandler:n,onTouchStart:r,value:i},a)=>(0,u.jsx)(km,{sliderInstance:g,isActive:e,onKeyDownHandler:t,onMouseDownHandler:n,onTouchStart:r,value:i},a))]}),t&&(0,u.jsx)(t,{className:`size-sm`,weight:`bold`})]})]})},Vm=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Vm.displayName=`SwitchRootContext`);function Hm(){let e=l.useContext(Vm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(63):`Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.`);return e}let Um=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});const Wm={...hn,checked(e){return e?{[Um.checked]:``}:{[Um.unchecked]:``}}},Gm=l.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,id:a,inputRef:o,name:s,nativeButton:c=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,..._}=e,{clearErrors:y}=lr(),{state:b,setTouched:x,setDirty:S,validityData:C,setFilled:w,setFocused:T,shouldValidateOnChange:E,validationMode:D,disabled:O,name:k,validation:A}=ir(),{labelId:j}=fr(),N=O||m,P=k??s,ee=G(d),te=l.useRef(null),F=v(te,o,A.inputRef),I=l.useRef(null),L=Sn(),R=Vf({id:a,implicit:!1,controlRef:I}),[z,ne]=un({controlled:n,default:!!i,name:`Switch`,state:`checked`});ur({id:L,commit:A.commit,value:z,controlRef:I,name:P,getValue:()=>z}),K(()=>{te.current&&w(te.current.checked)},[te,w]),Or(z,()=>{y(P),S(z!==C.initialValue),w(z),E()?A.commit(z):A.commit(z,!0)});let{getButtonProps:B,buttonRef:V}=tr({disabled:N,native:c}),H={id:L,role:`switch`,"aria-checked":z,"aria-readonly":f||void 0,"aria-labelledby":j,onFocus(){N||T(!0)},onBlur(){let e=te.current;!e||N||(x(!0),T(!1),D===`onBlur`&&A.commit(e.checked))},onClick(e){f||N||(e.preventDefault(),te?.current?.click())}},re=l.useMemo(()=>M({checked:z,disabled:N,id:R,name:P,required:p,style:dn,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:F,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Dr(_r,e.nativeEvent);ee?.(t,n),!n.isCanceled&&ne(t)},onFocus(){I.current?.focus()}},A.getInputValidationProps),[z,N,F,R,P,ee,p,ne,A]),U=l.useMemo(()=>({...b,checked:z,disabled:N,readOnly:f,required:p}),[b,z,N,f,p]),ie=W(`span`,e,{state:U,ref:[t,I,V],props:[H,A.getValidationProps,_,B],stateAttributesMapping:Wm});return(0,u.jsxs)(Vm.Provider,{value:U,children:[ie,!z&&P&&g!==void 0&&(0,u.jsx)(`input`,{type:`hidden`,name:P,value:g}),(0,u.jsx)(`input`,{...re})]})});process.env.NODE_ENV!==`production`&&(Gm.displayName=`SwitchRoot`);const Km=l.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=ir(),o=Hm();return W(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:Wm,props:i})});process.env.NODE_ENV!==`production`&&(Km.displayName=`SwitchThumb`);var qm=m();const Jm=e=>{let t=(0,qm.c)(18),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({label:r,className:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=X(`relative group transition-colors flex items-center h-[26px] w-[50px] rounded-full bg-surface-dim bg-size-[6.5rem_100%] inset-shadow-1-shadow p-0.5 ease-[cubic-bezier(0.26,0.75,0.38,0.45)] before:absolute before:rounded-full data-checked:bg-accent data-checked:active:bg-gray-500 outline-2 outline-transparent not-disabled:hover:outline-accent hover:cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,n),t[5]=n,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,u.jsx)(Km,{className:`size-[14px] data-checked:size-[18px] rounded-full bg-accent transition-transform duration-500 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)] translate-x-[6px] shadow-xs data-checked:translate-x-[26px] data-checked:scale-[1.1] data-unchecked:bg-accent data-checked:bg-on-accent`}),t[7]=s):s=t[7];let c;t[8]!==i||t[9]!==a||t[10]!==o?(c=(0,u.jsx)(Gm,{className:o,ref:a,...i,children:s}),t[8]=i,t[9]=a,t[10]=o,t[11]=c):c=t[11];let l;t[12]!==r||t[13]!==i?(l=r&&(0,u.jsx)(ap,{htmlFor:i.id,children:r}),t[12]=r,t[13]=i,t[14]=l):l=t[14];let d;return t[15]!==c||t[16]!==l?(d=(0,u.jsxs)(`div`,{className:`flex items-center gap-xs`,children:[c,l]}),t[15]=c,t[16]=l,t[17]=d):d=t[17],d},Ym=(0,l.createContext)(`vertical`),Xm=l.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!==`production`&&(Xm.displayName=`CompositeListContext`);function Zm(){return l.useContext(Xm)}function Qm(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=G(i),o=l.useRef(0),s=_(eh).current,c=_($m).current,[d,f]=l.useState(0),p=l.useRef(d),m=G((e,t)=>{c.set(e,t??null),p.current+=1,f(p.current)}),h=G(e=>{c.delete(e),p.current+=1,f(p.current)}),g=l.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(th).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,d]);K(()=>{if(typeof MutationObserver!=`function`||g.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(p.current+=1,f(p.current))});return g.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[g]),K(()=>{p.current===d&&(n.current.length!==g.size&&(n.current.length=g.size),r&&r.current.length!==g.size&&(r.current.length=g.size),o.current=g.size),a(g)},[a,g,n,r,d]),K(()=>()=>{n.current=[]},[n]),K(()=>()=>{r&&(r.current=[])},[r]);let v=G(e=>(s.add(e),()=>{s.delete(e)}));K(()=>{s.forEach(e=>e(g))},[s,g]);let y=l.useMemo(()=>({register:m,unregister:h,subscribeMapChange:v,elementsRef:n,labelsRef:r,nextIndexRef:o}),[m,h,v,n,r,o]);return(0,u.jsx)(Xm.Provider,{value:y,children:t})}function $m(){return new Map}function eh(){return new Set}function th(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function nh(e){}const rh=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(rh.displayName=`TabsRootContext`);function ih(){let e=l.useContext(rh);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(64):`Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.`);return e}let ah=function(e){return e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e}({});const oh={tabActivationDirection:e=>({[ah.activationDirection]:e})},sh=l.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,...c}=e,d=Tp(),f=Object.hasOwn(e,`defaultValue`),p=l.useRef([]),[m,h]=l.useState(()=>new Map),[g,_]=un({controlled:s,default:r,name:`Tabs`,state:`value`}),v=s!==void 0,[y,b]=l.useState(()=>new Map),[x,S]=l.useState(`none`),C=G((e,t)=>{i?.(e,t),!t.isCanceled&&(_(e),S(t.activationDirection))}),w=G((e,t)=>{h(n=>{if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})}),T=G((e,t)=>{h(n=>{if(!n.has(e)||n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})}),E=l.useCallback(e=>m.get(e),[m]),D=l.useCallback(e=>{for(let t of y.values())if(e===t?.value)return t?.id},[y]),O=l.useCallback(e=>{if(e===void 0)return null;for(let[t,n]of y.entries())if(n!=null&&e===(n.value??n.index))return t;return null},[y]),k=l.useMemo(()=>({direction:d,getTabElementBySelectedValue:O,getTabIdByPanelValue:D,getTabPanelIdByValue:E,onValueChange:C,orientation:a,registerMountedTabPanel:w,setTabMap:b,unregisterMountedTabPanel:T,tabActivationDirection:x,value:g}),[d,O,D,E,C,a,w,b,T,x,g]),A=l.useMemo(()=>{for(let e of y.values())if(e!=null&&e.value===g)return e},[y,g]),j=l.useMemo(()=>{for(let e of y.values())if(e!=null&&!e.disabled)return e.value},[y]);K(()=>{if(v||y.size===0)return;let e=A?.disabled;if(f&&e&&g===r||!e&&!(A==null&&g!==null))return;let t=j??null;g!==t&&(_(t),S(`none`))},[r,j,f,v,A,S,_,y,g]);let M=W(`div`,e,{state:{orientation:a,tabActivationDirection:x},ref:t,props:c,stateAttributesMapping:oh});return(0,u.jsx)(rh.Provider,{value:k,children:(0,u.jsx)(Qm,{elementsRef:p,children:M})})});process.env.NODE_ENV!==`production`&&(sh.displayName=`TabsRoot`);const ch=`data-composite-item-active`;let lh=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function uh(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:u,labelsRef:d,nextIndexRef:f}=Zm(),p=l.useRef(-1),[m,h]=l.useState(a??(i===lh.GuessFromOrder?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1)),g=l.useRef(null),_=l.useCallback(e=>{if(g.current=e,m!==-1&&e!==null&&(u.current[m]=e,d)){let n=t!==void 0;d.current[m]=n?t:r?.current?.textContent??e.textContent}},[m,u,d,t,r]);return K(()=>{if(a!=null)return;let e=g.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),K(()=>{if(a==null)return c(e=>{let t=g.current?e.get(g.current)?.index:null;t!=null&&h(t)})},[a,c,h]),l.useMemo(()=>({ref:_,index:m}),[m,_])}function dh(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=$n(),{ref:i,index:a}=uh(e),o=n===a,s=l.useRef(null),c=v(i,s);return{compositeProps:l.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}const fh=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(fh.displayName=`TabsListContext`);function ph(){let e=l.useContext(fh);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(65):`Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.`);return e}const mh=l.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,...c}=e,{value:u,getTabPanelIdByValue:d,orientation:f}=ih(),{activateOnFocus:p,highlightedTabIndex:m,onTabActivation:h,setHighlightedTabIndex:g,tabsListElement:_}=ph(),v=Sn(o),{compositeProps:y,compositeRef:b,index:x}=dh({metadata:l.useMemo(()=>({disabled:r,id:v,value:a}),[r,v,a])}),S=a===u,C=l.useRef(!1);K(()=>{if(C.current){C.current=!1;return}if(!(S&&x>-1&&m!==x))return;let e=_;if(e!=null){let t=Wi(Wo(e));if(t&&Q(e,t))return}r||g(x)},[S,x,m,g,r,_]);let{getButtonProps:w,buttonRef:T}=tr({disabled:r,native:s,focusableWhenDisabled:!0}),E=d(a),D=l.useRef(!1),O=l.useRef(!1);function k(e){S||r||h(a,Dr(_r,e.nativeEvent,void 0,{activationDirection:`none`}))}function A(e){S||(x>-1&&!r&&g(x),!r&&p&&(!D.current||D.current&&O.current)&&h(a,Dr(_r,e.nativeEvent,void 0,{activationDirection:`none`})))}function j(e){if(S||r)return;D.current=!0;function t(){D.current=!1,O.current=!1}(!e.button||e.button===0)&&(O.current=!0,Wo(e.currentTarget).addEventListener(`pointerup`,t,{once:!0}))}return W(`button`,e,{state:l.useMemo(()=>({disabled:r,active:S,orientation:f}),[r,S,f]),ref:[t,T,b],props:[y,{role:`tab`,"aria-controls":E,"aria-selected":S,id:v,onClick:k,onFocus:A,onPointerDown:j,"data-composite-item-active":S?``:void 0,onKeyDownCapture(){C.current=!0}},c,w]})});process.env.NODE_ENV!==`production`&&(mh.displayName=`TabsTab`);const hh='!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();';let gh=function(e){return e.activeTabLeft=`--active-tab-left`,e.activeTabRight=`--active-tab-right`,e.activeTabTop=`--active-tab-top`,e.activeTabBottom=`--active-tab-bottom`,e.activeTabWidth=`--active-tab-width`,e.activeTabHeight=`--active-tab-height`,e}({});var _h={...oh,activeTabPosition:()=>null,activeTabSize:()=>null};const vh=l.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,...a}=e,{getTabElementBySelectedValue:o,orientation:s,tabActivationDirection:c,value:d}=ih(),{tabsListElement:f}=ph(),[p,m]=l.useState(!1),{value:h}=ih();xe(()=>m(!0));let g=xl();l.useEffect(()=>{if(d!=null&&f!=null&&typeof ResizeObserver<`u`){let e=new ResizeObserver(g);return e.observe(f),()=>{e.disconnect()}}},[d,f,g]);let _=0,v=0,y=0,b=0,x=0,S=0,C=!1;if(d!=null&&f!=null){let e=o(d);if(C=!0,e!=null){let{width:t,height:n}=mm(e),{width:r,height:i}=mm(f),a=e.getBoundingClientRect(),o=f.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1;if(Math.abs(s)>2**-52&&Math.abs(c)>2**-52){let e=a.left-o.left,t=a.top-o.top;_=e/s+f.scrollLeft-f.clientLeft,y=t/c+f.scrollTop-f.clientTop}else _=e.offsetLeft,y=e.offsetTop;x=t,S=n,v=f.scrollWidth-_-x,b=f.scrollHeight-y-S}}let w=l.useMemo(()=>C?{left:_,right:v,top:y,bottom:b}:null,[_,v,y,b,C]),T=l.useMemo(()=>C?{width:x,height:S}:null,[x,S,C]),E=l.useMemo(()=>{if(C)return{[gh.activeTabLeft]:`${_}px`,[gh.activeTabRight]:`${v}px`,[gh.activeTabTop]:`${y}px`,[gh.activeTabBottom]:`${b}px`,[gh.activeTabWidth]:`${x}px`,[gh.activeTabHeight]:`${S}px`}},[_,v,y,b,x,S,C]),D=C&&x>0&&S>0,O=W(`span`,e,{state:l.useMemo(()=>({orientation:s,activeTabPosition:w,activeTabSize:T,tabActivationDirection:c}),[s,w,T,c]),ref:t,props:[{role:`presentation`,style:E,hidden:!D},a,{suppressHydrationWarning:!0}],stateAttributesMapping:_h});return h==null?null:(0,u.jsxs)(l.Fragment,{children:[O,!p&&i&&(0,u.jsx)(`script`,{dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});process.env.NODE_ENV!==`production`&&(vh.displayName=`TabsIndicator`);let yh=function(e){return e.index=`data-index`,e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e.hidden=`data-hidden`,e}({});const bh=l.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,...o}=e,{value:s,getTabIdByPanelValue:c,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f,unregisterMountedTabPanel:p}=ih(),m=Sn(),{ref:h,index:g}=uh({metadata:l.useMemo(()=>({id:m,value:r}),[m,r])}),_=r!==s,v=c(r),y=W(`div`,e,{state:l.useMemo(()=>({hidden:_,orientation:u,tabActivationDirection:d}),[_,u,d]),ref:[t,h],props:[{"aria-labelledby":v,hidden:_,id:m??void 0,role:`tabpanel`,tabIndex:_?-1:0,[yh.index]:g},o],stateAttributesMapping:oh});return K(()=>{if(!(_&&!a)&&m!=null)return f(r,m),()=>{p(r,m)}},[_,a,r,m,f,p]),!_||a?y:null});process.env.NODE_ENV!==`production`&&(bh.displayName=`TabsPanel`);function xh(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Sh=[];function Ch(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:i=!1,orientation:a=`both`,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:u,enableHomeAndEndKeys:d=!1,stopEventPropagation:f=!1,disabledIndices:p,modifierKeys:m=Sh}=e,[h,g]=l.useState(0),_=n>1,y=l.useRef(null),b=v(y,u),x=l.useRef([]),S=l.useRef(!1),C=s??h,w=G((e,t=!1)=>{if((c??g)(e),t){let t=x.current[e];Tu(y.current,t,o,a)}}),T=G(e=>{if(e.size===0||S.current)return;S.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&w(r),Tu(y.current,n,o,a)}),E=l.useMemo(()=>({"aria-orientation":a===`both`?void 0:a,ref:b,onFocus(e){!y.current||!wu(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let s=d?gu:hu;if(!s.has(e.key)||wh(e,m)||!y.current)return;let c=o===`rtl`,l=c?su:cu,u={horizontal:l,vertical:ou,both:l}[a],h=c?cu:su,g={horizontal:h,vertical:au,both:h}[a];if(wu(e.target)&&!xh(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==g&&t<r.length||e.key!==u&&t>0)return}let v=C,b=za(x,p),S=Ba(x,p);if(_){let o=t||Array.from({length:x.current.length},()=>({width:1,height:1})),s=Ua(o,n,i),l=s.findIndex(e=>e!=null&&!Ka(x,e,p)),u=s.reduce((e,t,n)=>t!=null&&!Ka(x,t,p)?n:e,-1);v=s[Ha({current:s.map(e=>e?x.current[e]:null)},{event:e,orientation:a,loopFocus:r,cols:n,disabledIndices:Ga([...p||x.current.map((e,t)=>Ka(x,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:Wa(C>S?b:C,o,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[ou],both:[l,ou]}[a],E={horizontal:[h],vertical:[au],both:[h,au]}[a],D=_?s:{horizontal:d?fu:du,vertical:d?mu:pu,both:s}[a];d&&(e.key===`Home`?v=b:e.key===`End`&&(v=S)),v===C&&(T.includes(e.key)||E.includes(e.key))&&(v=r&&v===S&&T.includes(e.key)?b:r&&v===b&&E.includes(e.key)?S:Va(x,{startingIndex:v,decrement:E.includes(e.key),disabledIndices:p})),v!==C&&!Ra(x,v)&&(f&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),w(v,!0),queueMicrotask(()=>{x.current[v]?.focus()}))}}),[n,i,o,p,x,d,C,_,t,r,b,m,w,a,f]);return l.useMemo(()=>({props:E,highlightedIndex:C,onHighlightedIndexChange:w,elementsRef:x,disabledIndices:p,onMapChange:T,relayKeyboardEvent:E.onKeyDown}),[E,C,w,x,p,T])}function wh(e,t){for(let n of Su.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Th(e){let{render:t,className:n,refs:r=V,props:i=V,state:a=H,stateAttributesMapping:o,highlightedIndex:s,onHighlightedIndexChange:c,orientation:d,dense:f,itemSizes:p,loopFocus:m,cols:h,enableHomeAndEndKeys:g,onMapChange:_,stopEventPropagation:v=!0,rootRef:y,disabledIndices:b,modifierKeys:x,highlightItemOnHover:S=!1,tag:C=`div`,...w}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=Ch({itemSizes:p,cols:h,loopFocus:m,dense:f,orientation:d,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:y,stopEventPropagation:v,enableHomeAndEndKeys:g,direction:Tp(),disabledIndices:b,modifierKeys:x}),j=W(C,e,{state:a,ref:r,props:[T,...i,w],stateAttributesMapping:o}),M=l.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:S,relayKeyboardEvent:A}),[E,D,S,A]);return(0,u.jsx)(Qn.Provider,{value:M,children:(0,u.jsx)(Qm,{elementsRef:O,onMapChange:e=>{_?.(e),k(e)},children:j})})}const Eh=l.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,...o}=e,{getTabElementBySelectedValue:s,onValueChange:c,orientation:d,value:f,setTabMap:p,tabActivationDirection:m}=ih(),[h,g]=l.useState(0),[_,v]=l.useState(null),y=Oh(f,d,_,s),b=G((e,t)=>{e!==f&&(t.activationDirection=y(e),c(e,t))}),x=l.useMemo(()=>({orientation:d,tabActivationDirection:m}),[d,m]),S={"aria-orientation":d===`vertical`?`vertical`:void 0,role:`tablist`},C=l.useMemo(()=>({activateOnFocus:n,highlightedTabIndex:h,onTabActivation:b,setHighlightedTabIndex:g,tabsListElement:_,value:f}),[n,h,b,g,_,f]);return(0,u.jsx)(fh.Provider,{value:C,children:(0,u.jsx)(Th,{render:a,className:r,state:x,refs:[t,v],props:[S,o],stateAttributesMapping:oh,highlightedIndex:h,enableHomeAndEndKeys:!0,loopFocus:i,orientation:d,onHighlightedIndexChange:g,onMapChange:p,disabledIndices:V})})});process.env.NODE_ENV!==`production`&&(Eh.displayName=`TabsList`);function Dh(e,t){let{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect();return{left:n-i,top:r-a}}function Oh(e,t,n,r){let[i,a]=l.useState(null);return K(()=>{if(e==null||n==null){a(null);return}let i=r(e);if(i==null){a(null);return}let{left:o,top:s}=Dh(i,n);a(t===`horizontal`?o:s)},[t,r,n,e]),l.useCallback(o=>{if(o===e)return`none`;if(o==null)return a(null),`none`;if(o!=null&&n!=null){let e=r(o);if(e!=null){let{left:r,top:o}=Dh(e,n);if(i==null)return a(t===`horizontal`?r:o),`none`;if(t===`horizontal`){if(r<i)return a(r),`left`;if(r>i)return a(r),`right`}else if(o<i)return a(o),`up`;else if(o>i)return a(o),`down`}}return`none`},[r,t,i,n,e])}var kh=m();const Ah=e=>{let t=(0,kh.c)(13),n,r;if(t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),(0,l.useContext)(Ym)===`horizontal`){let e;t[3]===n?e=t[4]:(e=X(`absolute left-1/2 h-11 md:h-12 top-0 z-[-1] w-(--active-tab-width) translate-y-(--active-tab-top) -translate-x-1/2 rounded-2xl md:rounded-full bg-surface-brand-primary-default transition-all duration-300 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)]`,n),t[3]=n,t[4]=e);let i;return t[5]!==r||t[6]!==e?(i=(0,u.jsx)(vh,{className:e,...r}),t[5]=r,t[6]=e,t[7]=i):i=t[7],i}let i;t[8]===n?i=t[9]:(i=X(`absolute top-1/2 h-11 md:h-12 left-0 z-[-1] w-(--active-tab-width) translate-x-(--active-tab-left) -translate-y-1/2 rounded-full bg-surface-brand-primary-default transition-all duration-300 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)]`,n),t[8]=n,t[9]=i);let a;return t[10]!==r||t[11]!==i?(a=(0,u.jsx)(vh,{className:i,...r}),t[10]=r,t[11]=i,t[12]=a):a=t[12],a};var jh=m();const Mh=e=>{let t=(0,jh.c)(13),n,r;if(t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),(0,l.useContext)(Ym)===`horizontal`){let e;t[3]===n?e=t[4]:(e=X(`relative z-0 flex flex-col h-fit grow gap-2 p-2 bg-surface-neutral-primary-default rounded-3xl`,n),t[3]=n,t[4]=e);let i;return t[5]!==r||t[6]!==e?(i=(0,u.jsx)(Eh,{className:e,...r}),t[5]=r,t[6]=e,t[7]=i):i=t[7],i}let i;t[8]===n?i=t[9]:(i=X(`relative z-0 flex gap-1 p-2 bg-surface-neutral-primary-default rounded-full`,n),t[8]=n,t[9]=i);let a;return t[10]!==r||t[11]!==i?(a=(0,u.jsx)(Eh,{className:i,...r}),t[10]=r,t[11]=i,t[12]=a):a=t[12],a};var Nh=m();const Ph=e=>{let t=(0,Nh.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=(0,l.useContext)(Ym)===`horizontal`?`flex-1 min-h-0 h-full`:`grow`,a;t[3]!==n||t[4]!==i?(a=X(`relative rounded-xl bg-surface-neutral-primary-default`,i,`flex items-center justify-center p-4 overflow-auto`,n),t[3]=n,t[4]=i,t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==a?(o=(0,u.jsx)(bh,{className:a,...r}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o};var Fh=m();const Ih=e=>{let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`inline-flex rounded-2xl md:rounded-full h-11 md:h-12 px-6 body-base-semibold w-full text-text-brand-primary-default text-center items-center justify-center border-0 break-keep whitespace-nowrap outline-none select-none focus-visible:relative focus-visible:before:absolute focus-visible:before:outline data-selected:text-text-inverse-primary-default transition-colors duration-300 hover:cursor-pointer aria-[selected=false]:hover:bg-surface-neutral-primary-hover`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,u.jsx)(mh,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};var Lh=m();const Rh=e=>{let t=(0,Lh.c)(15),{className:n,ref:r,...i}=e,[a,o]=(0,l.useState)(i.orientation??`vertical`);if((0,l.useEffect)(()=>{let e=()=>{window.innerWidth<768?o(`horizontal`):o(i.orientation??`vertical`)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[i.orientation]),i.orientation=a,i.orientation===`horizontal`){let e=i.orientation,a;t[0]===n?a=t[1]:(a=X(`flex flex-wrap gap-4 overflow-auto`,n),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r||t[4]!==a?(o=(0,u.jsx)(sh,{className:a,ref:r,...i}),t[2]=i,t[3]=r,t[4]=a,t[5]=o):o=t[5];let s;return t[6]!==i.orientation||t[7]!==o?(s=(0,u.jsx)(Ym.Provider,{value:e,children:o}),t[6]=i.orientation,t[7]=o,t[8]=s):s=t[8],s}let s;t[9]===n?s=t[10]:(s=X(`flex flex-col gap-2 overflow-clip`,n),t[9]=n,t[10]=s);let c;return t[11]!==i||t[12]!==r||t[13]!==s?(c=(0,u.jsx)(sh,{className:s,ref:r,...i}),t[11]=i,t[12]=r,t[13]=s,t[14]=c):c=t[14],c};var zh=0;function Bh(e){return zh+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${zh}`}const Vh=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Vh.displayName=`ToastContext`);function Hh(){let e=l.useContext(Vh);if(!e)throw Error(process.env.NODE_ENV===`production`?h(73):`Base UI: useToastManager must be used within <Toast.Provider>.`);return e}function Uh(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}const Wh=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,[a,o]=l.useState([]),[s,c]=l.useState(!1),[d,f]=l.useState(!1),[p,m]=l.useState(null);a.length===0&&(s&&c(!1),d&&f(!1));let h=s||d,g=l.useRef(new Map),_=l.useRef(null),v=l.useRef(!0),y=l.useRef(!1);function b(e){let t=Wi(Wo(_.current));if(!_.current||!Q(_.current,t)||!Zi(t))return;let n=a.findIndex(t=>t.id===e),r=null,i=n+1;for(;i<a.length;){if(a[i].transitionStatus!==`ending`){r=a[i];break}i+=1}if(!r)for(i=n-1;i>=0;){if(a[i].transitionStatus!==`ending`){r=a[i];break}--i}r?r.ref?.current?.focus():p?.focus({preventScroll:!0})}let x=G(()=>{y.current||(y.current=!0,g.current.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}),S=G(()=>{y.current&&(y.current=!1,g.current.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Ce.create(),e.timeout.start(e.remaining,()=>{g.current.delete(t),e.callback()}),e.start=Date.now()}))}),C=G(e=>{o(t=>{let n=t.map(t=>t.id===e?{...t,transitionStatus:`ending`,height:0}:t),i=n.filter(e=>e.transitionStatus!==`ending`);return n.map(e=>{if(e.transitionStatus===`ending`)return e;let t=i.indexOf(e)>=r;return{...e,limited:t}})});let t=g.current.get(e);t&&t.timeout&&(t.timeout.clear(),g.current.delete(e)),a.find(t=>t.id===e)?.onClose?.(),b(e),a.length===1&&(c(!1),f(!1))}),w=G(e=>{o(t=>t.filter(t=>t.id!==e)),a.find(t=>t.id===e)?.onRemove?.()}),T=G((e,t,n)=>{let r=Date.now(),i=v.current&&!s&&!d,a=i?Ce.create():void 0;a?.start(t,()=>{g.current.delete(e),n()}),g.current.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}),E=G(e=>{let t=e.id||Bh(`toast`),i={...e,id:t,transitionStatus:`starting`};o(e=>{let t=[i,...e],n=t.filter(e=>e.transitionStatus!==`ending`);if(n.length>r){let e=n.length-r,i=n.slice(-e);return t.map(e=>i.some(t=>t.id===e.id)?{...e,limited:!0}:{...e,limited:!1})}return t.map(e=>({...e,limited:!1}))});let a=i.timeout??n;return i.type!==`loading`&&a>0&&T(t,a,()=>C(t)),(s||d||!v.current)&&x(),t}),D=G((e,t)=>{o(n=>n.map(n=>n.id===e?{...n,...t}:n))}),O=G((e,t)=>{let r=E({...Uh(t.loading),type:`loading`}),i=e.then(e=>{let i=Uh(t.success,e);D(r,{...i,type:`success`});let a=i.timeout??n;return a>0&&T(r,a,()=>C(r)),(s||d||!v.current)&&x(),e}).catch(e=>{let i=Uh(t.error,e);D(r,{...i,type:`error`});let a=i.timeout??n;return a>0&&T(r,a,()=>C(r)),(s||d||!v.current)&&x(),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i});l.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?O(t.promise,t):e===`update`&&n?D(n,t):e===`close`&&n?C(n):E(t)})},[E,D,T,n,i,O,C]);let k=l.useMemo(()=>({toasts:a,setToasts:o,hovering:s,setHovering:c,focused:d,setFocused:f,expanded:h,add:E,close:C,remove:w,update:D,promise:O,pauseTimers:x,resumeTimers:S,prevFocusElement:p,setPrevFocusElement:m,viewportRef:_,scheduleTimer:T,windowFocusedRef:v}),[E,C,d,s,h,x,p,O,w,S,T,a,D]);return(0,u.jsx)(Vh.Provider,{value:k,children:t})};process.env.NODE_ENV!==`production`&&(Wh.displayName=`ToastProvider`);const Gh=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Gh.displayName=`ToastViewportContext`);let Kh=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({});const qh=l.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,{toasts:o,pauseTimers:s,resumeTimers:c,setHovering:d,setFocused:f,viewportRef:p,windowFocusedRef:m,prevFocusElement:h,setPrevFocusElement:g,expanded:_,focused:v}=Hh(),y=l.useRef(!1),b=l.useRef(!1),x=o.length,S=o[0]?.height??0,C=l.useMemo(()=>o.some(e=>e.transitionStatus===`ending`),[o]);l.useEffect(()=>{if(!p.current)return;function e(e){x!==0&&e.key===`F6`&&e.target!==p.current&&(e.preventDefault(),g(Wi(Wo(p.current))),p.current?.focus({preventScroll:!0}),s(),f(!0))}let t=Tn(p.current);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[s,f,g,x,p]),l.useEffect(()=>{if(!p.current||!x)return;let e=Tn(p.current);function t(t){t.target===e&&(m.current=!1,s())}function n(t){if(t.relatedTarget||t.target===e)return;let n=Gi(t),r=Wi(Wo(p.current));(!Q(p.current,n)||!Zi(r))&&c(),setTimeout(()=>{m.current=!0})}return e.addEventListener(`blur`,t,!0),e.addEventListener(`focus`,n,!0),()=>{e.removeEventListener(`blur`,t,!0),e.removeEventListener(`focus`,n,!0)}},[s,c,p,m,f,x]),l.useEffect(()=>{let e=p.current;if(!e||x===0)return;let t=Wo(e);function n(t){t.pointerType===`touch`&&(Q(e,Gi(t))||(c(),d(!1),f(!1)))}return t.addEventListener(`pointerdown`,n,!0),()=>{t.removeEventListener(`pointerdown`,n,!0)}},[x,c,f,d,p]);function w(e){p.current&&(y.current=!0,e.relatedTarget===p.current?o[0]?.ref?.current?.focus():h?.focus({preventScroll:!0}))}function T(e){e.key===`Tab`&&e.shiftKey&&e.target===p.current&&(e.preventDefault(),h?.focus({preventScroll:!0}),c())}l.useEffect(()=>{!m.current||C||!b.current||(c(),d(!1),b.current=!1)},[C,c,d,m]);function E(){s(),d(!0),b.current=!1}function D(){o.some(e=>e.transitionStatus===`ending`)?b.current=!0:(c(),d(!1))}function O(){if(y.current){y.current=!1;return}v||Zi(Wo(p.current).activeElement)&&(f(!0),s())}function k(e){!v||Q(p.current,e.relatedTarget)||(f(!1),c())}let A={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:E,onMouseMove:E,onMouseLeave:D,onFocus:O,onBlur:k,onKeyDown:T,onClick:O},j=l.useMemo(()=>({expanded:_}),[_]),M=W(`div`,e,{ref:[t,p],state:j,props:[A,{style:{[Kh.frontmostHeight]:S?`${S}px`:void 0}},a,{children:(0,u.jsxs)(l.Fragment,{children:[x>0&&h&&(0,u.jsx)(Go,{onFocus:w}),i,x>0&&h&&(0,u.jsx)(Go,{onFocus:w})]})}]}),N=l.useMemo(()=>({viewportRef:p}),[p]),P=l.useMemo(()=>o.filter(e=>e.priority===`high`),[o]);return(0,u.jsxs)(Gh.Provider,{value:N,children:[x>0&&h&&(0,u.jsx)(Go,{onFocus:w}),M,!v&&P.length>0&&(0,u.jsx)(`div`,{style:dn,children:P.map(e=>(0,u.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,u.jsx)(`div`,{children:e.title}),(0,u.jsx)(`div`,{children:e.description})]},e.id))})]})});process.env.NODE_ENV!==`production`&&(qh.displayName=`ToastViewport`);const Jh=l.createContext(void 0);process.env.NODE_ENV!==`production`&&(Jh.displayName=`ToastRootContext`);function Yh(){let e=l.useContext(Jh);if(!e)throw Error(process.env.NODE_ENV===`production`?h(66):`Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.`);return e}let Xh=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({});var Zh={...Kr,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Qh=40,$h=10,eg=.5,tg=1;function ng(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function rg(e){let t=window.getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}const ig=l.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],...o}=e,s=n.positionerProps?.anchor!==void 0,c=[];s||(c=Array.isArray(a)?a:[a]);let f=c.length>0,{toasts:p,focused:m,close:h,remove:g,setToasts:_,pauseTimers:v,expanded:y,setHovering:b}=Hh(),[x,S]=l.useState(void 0),[C,w]=l.useState(!1),[T,E]=l.useState(!1),[D,O]=l.useState(!1),[k,A]=l.useState({x:0,y:0}),[j,M]=l.useState({x:0,y:0,scale:1}),[N,P]=l.useState(),[ee,te]=l.useState(),[F,I]=l.useState(null),L=l.useRef(null),R=l.useRef({x:0,y:0}),z=l.useRef({x:0,y:0,scale:1}),ne=l.useRef(void 0),B=l.useRef(0),V=l.useRef(!1),H=l.useRef({x:0,y:0}),re=l.useRef(!1),U=l.useMemo(()=>p.indexOf(n),[n,p]),ie=l.useMemo(()=>p.filter(e=>e.transitionStatus!==`ending`).indexOf(n),[n,p]),ae=l.useMemo(()=>p.slice(0,p.indexOf(n)).reduce((e,t)=>e+(t.height||0),0),[p,n]);Vr({open:n.transitionStatus!==`ending`,ref:L,onComplete(){n.transitionStatus===`ending`&&g(n.id)}});let oe=G((e=!1)=>{let t=L.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){_(e=>e.map(e=>e.id===n.id?{...e,ref:L,height:i,transitionStatus:void 0}:e))}e?d.flushSync(a):a()});K(oe,[oe]);function se(e,t){let n=e,r=t;return!c.includes(`left`)&&!c.includes(`right`)?n=e>0?e**eg:-(Math.abs(e)**eg):(!c.includes(`right`)&&e>0&&(n=e**eg),!c.includes(`left`)&&e<0&&(n=-(Math.abs(e)**eg))),!c.includes(`up`)&&!c.includes(`down`)?r=t>0?t**eg:-(Math.abs(t)**eg):(!c.includes(`down`)&&t>0&&(r=t**eg),!c.includes(`up`)&&t<0&&(r=-(Math.abs(t)**eg))),{x:n,y:r}}function ce(e){if(e.button!==0)return;e.pointerType===`touch`&&v();let t=Gi(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],[data-swipe-ignore]`))){if(V.current=!1,ne.current=void 0,B.current=0,R.current={x:e.clientX,y:e.clientY},H.current=R.current,L.current){let e=rg(L.current);z.current=e,M(e),A({x:e.x,y:e.y})}b(!0),w(!0),E(!1),I(null),re.current=!0,L.current?.setPointerCapture(e.pointerId)}}function le(e){if(!C)return;e.preventDefault(),re.current&&=(R.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>H.current.y||i>0&&t<H.current.y)&&(H.current={x:H.current.x,y:t}),(r<0&&n>H.current.x||r>0&&n<H.current.x)&&(H.current={x:n,y:H.current.y});let a=n-R.current.x,o=t-R.current.y,s=t-H.current.y,l=n-H.current.x;if(!T&&Math.sqrt(a*a+o*o)>=tg&&(E(!0),F===null)){let e=c.includes(`left`)||c.includes(`right`),t=c.includes(`up`)||c.includes(`down`);e&&t&&I(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!ne.current)F===`vertical`?o>0?u=`down`:o<0&&(u=`up`):F===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&c.includes(u)&&(ne.current=u,B.current=ng(u,a,o),S(u));else{let e=ne.current,t=ng(e,l,s);t>Qh?(V.current=!1,S(e)):!(c.includes(`left`)&&c.includes(`right`))&&!(c.includes(`up`)&&c.includes(`down`))&&B.current-t>=$h&&(V.current=!0)}let d=se(a,o),f=z.current.x,p=z.current.y;F===`horizontal`?(c.includes(`left`)||c.includes(`right`))&&(f+=d.x):(F===`vertical`||(c.includes(`left`)||c.includes(`right`))&&(f+=d.x),(c.includes(`up`)||c.includes(`down`))&&(p+=d.y)),A({x:f,y:p})}function ue(e){if(!C)return;if(w(!1),E(!1),I(null),L.current?.releasePointerCapture(e.pointerId),V.current){A({x:j.x,y:j.y}),S(void 0);return}let t=!1,r=k.x-j.x,i=k.y-j.y,a;for(let e of c){switch(e){case`right`:r>Qh&&(t=!0,a=`right`);break;case`left`:r<-Qh&&(t=!0,a=`left`);break;case`down`:i>Qh&&(t=!0,a=`down`);break;case`up`:i<-Qh&&(t=!0,a=`up`);break;default:break}if(t)break}t?(S(a),O(!0),h(n.id)):(A({x:j.x,y:j.y}),S(void 0))}function de(e){if(e.key===`Escape`){if(!L.current||!Q(L.current,Wi(Wo(L.current))))return;h(n.id)}}l.useEffect(()=>{if(!f)return;let e=L.current;if(!e)return;function t(t){Q(e,t.target)&&t.preventDefault()}return e.addEventListener(`touchmove`,t,{passive:!1}),()=>{e.removeEventListener(`touchmove`,t)}},[f]);function fe(){if(!C&&k.x===j.x&&k.y===j.y&&!D)return{[Xh.swipeMovementX]:`0px`,[Xh.swipeMovementY]:`0px`};let e=k.x-j.x,t=k.y-j.y;return{transition:C?`none`:void 0,transform:C?`translateX(${k.x}px) translateY(${k.y}px) scale(${j.scale})`:void 0,[Xh.swipeMovementX]:`${e}px`,[Xh.swipeMovementY]:`${t}px`}}let pe=n.priority===`high`,me={role:pe?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":N,"aria-describedby":ee,"aria-hidden":pe&&!m?!0:void 0,onPointerDown:f?ce:void 0,onPointerMove:f?le:void 0,onPointerUp:f?ue:void 0,onKeyDown:de,inert:Au(n.limited),style:{...fe(),[Xh.index]:n.transitionStatus===`ending`?U:ie,[Xh.offsetY]:`${ae}px`,[Xh.height]:n.height?`${n.height}px`:void 0}},he=l.useMemo(()=>({rootRef:L,toast:n,titleId:N,setTitleId:P,descriptionId:ee,setDescriptionId:te,swiping:C,swipeDirection:x,recalculateHeight:oe,index:U,visibleIndex:ie,expanded:y}),[n,N,ee,C,x,oe,U,ie,y]),ge=l.useMemo(()=>({transitionStatus:n.transitionStatus,expanded:y,limited:n.limited||!1,type:n.type,swiping:he.swiping,swipeDirection:he.swipeDirection}),[y,n.transitionStatus,n.limited,n.type,he.swiping,he.swipeDirection]),_e=W(`div`,e,{ref:[t,he.rootRef],state:ge,stateAttributesMapping:Zh,props:[me,o]});return(0,u.jsx)(Jh.Provider,{value:he,children:_e})});process.env.NODE_ENV!==`production`&&(ig.displayName=`ToastRoot`);const ag=l.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s}=Yh(),c=a??s.description,u=!!c,d=xn(i),{setDescriptionId:f}=Yh();K(()=>{if(u)return f(d),()=>{f(void 0)}},[u,d,f]);let p=W(`p`,e,{ref:t,state:l.useMemo(()=>({type:s.type}),[s.type]),props:{...o,id:d,children:c}});return u?p:null});process.env.NODE_ENV!==`production`&&(ag.displayName=`ToastDescription`);const og=l.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s}=Yh(),c=a??s.title,u=!!c,d=xn(i),{setTitleId:f}=Yh();K(()=>{if(u)return f(d),()=>{f(void 0)}},[u,d,f]);let p=W(`h2`,e,{ref:t,state:l.useMemo(()=>({type:s.type}),[s.type]),props:{...o,id:d,children:c}});return u?p:null});process.env.NODE_ENV!==`production`&&(og.displayName=`ToastTitle`);const sg=l.forwardRef(function(e,t){let{render:n,className:r,disabled:i,nativeButton:a=!0,...o}=e,{close:s,expanded:c}=Hh(),{toast:u}=Yh(),[d,f]=l.useState(!1),{getButtonProps:p,buttonRef:m}=tr({disabled:i,native:a}),h=l.useMemo(()=>({type:u.type}),[u.type]);return W(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!c&&!d,onClick(){s(u.id)},onFocus(){f(!0)},onBlur(){f(!1)}},o,p]})});process.env.NODE_ENV!==`production`&&(sg.displayName=`ToastClose`);const cg=$p;function lg(){let e=l.useContext(Vh);if(!e)throw Error(process.env.NODE_ENV===`production`?h(73):`Base UI: useToastManager must be used within <Toast.Provider>.`);let{toasts:t,add:n,close:r,update:i,promise:a}=e;return l.useMemo(()=>({toasts:t,add:n,close:r,update:i,promise:a}),[t,n,r,i,a])}const ug=({className:e,children:t,position:n=`top-right`,ref:r,...i})=>{let{toasts:a}=lg(),o=e=>{switch(e){case`top-left`:return`left`;case`bottom-left`:return`left`;case`top-right`:return`right`;case`bottom-right`:return`right`;case`top-center`:return`up`;case`bottom-center`:return`down`;default:return`right`}};return a.map(a=>(0,u.jsxs)(ig,{toast:a,swipeDirection:o(n),className:X(n===`bottom-right`||n===`bottom-center`||n===`bottom-left`?`absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] mr-0 w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*-15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-outline bg-surface-container bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:bottom-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[""] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] flex flex-col gap-3xs`:`absolute top-0 right-0 left-0 z-[calc(1000-var(--toast-index))] mx-auto w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-gray-200 bg-gray-50 bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[''] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)+calc(var(--toast-index)*var(--gap))+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(-150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(-150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e,a.data.variant===`success`&&`border-success bg-success-container`,a.data.variant===`error`&&`border-error bg-error-container`,a.data.variant===`warning`&&`border-warning bg-warning-container`),style:{"--gap":`1rem`,"--offset-y":`calc(var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) + var(--toast-swipe-movement-y))`},ref:r,...i,children:[t,(0,u.jsx)(og,{className:X(`text-sm font-semibold text-on-surface`,a.data.variant===`success`&&`text-on-success-container`,a.data.variant===`error`&&`text-on-error-container`,a.data.variant===`warning`&&`text-on-warning-container`)}),(0,u.jsx)(ag,{className:X(`text-sm text-on-surface`,a.data.variant===`success`&&`text-on-success-container`,a.data.variant===`error`&&`text-on-error-container`,a.data.variant===`warning`&&`text-on-warning-container`)}),(0,u.jsx)(sg,{className:`absolute top-xs right-2xs flex size-xs items-center justify-center rounded border-none bg-transparent text-on-surface hover:cursor-pointer`,"aria-label":`Close`,children:(0,u.jsx)(ri,{weight:`bold`})})]},a.id))};var dg=m();const fg=e=>{let t=(0,dg.c)(24),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({position:o,className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?`bottom-center`:o,c=s===`top-left`,l=s===`top-center`,d=s===`top-right`,f=s===`bottom-left`,p=s===`bottom-center`,m=s===`bottom-right`,h;t[6]!==r||t[7]!==c||t[8]!==l||t[9]!==d||t[10]!==f||t[11]!==p||t[12]!==m?(h=X({"fixed z-10 top-[1rem] left-[1rem] right-auto bottom-auto mx-0 flex w-1/4":c,"fixed z-10 top-[1rem] left-1/2 right-auto bottom-auto mx-auto flex w-1/4 -translate-x-1/2":l,"fixed z-10 top-[1rem] right-[1rem] left-auto bottom-auto mx-0 flex w-1/4":d,"fixed z-10 bottom-[6rem] left-[1rem] right-auto top-auto mx-0 flex w-1/4":f,"fixed z-10 bottom-[6rem] left-1/2 right-auto top-auto mx-auto flex w-1/4 -translate-x-1/2":p,"fixed z-10 bottom-[6rem] right-[1rem] left-auto top-auto mx-0 flex w-1/4":m},r),t[6]=r,t[7]=c,t[8]=l,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;t[14]===s?g=t[15]:(g=(0,u.jsx)(ug,{position:s}),t[14]=s,t[15]=g);let _;t[16]!==i||t[17]!==a||t[18]!==h||t[19]!==g?(_=(0,u.jsx)(cg,{children:(0,u.jsx)(qh,{className:h,ref:a,...i,children:g})}),t[16]=i,t[17]=a,t[18]=h,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==n||t[22]!==_?(v=(0,u.jsxs)(Wh,{timeout:5e3,children:[n,_]}),t[21]=n,t[22]=_,t[23]=v):v=t[23],v};exports.Avatar=Yt,exports.AvatarFallback=$t,exports.AvatarImage=Zt,exports.Badge=on,exports.Button=ln,exports.Checkbox=ai,exports.CheckboxIndicator=Yr,exports.Dialog=cd,exports.DialogClose=Qu,exports.DialogDescription=ed,exports.DialogPopup=nd,exports.DialogTitle=id,exports.DialogTrigger=od,exports.FieldErrors=zf,exports.FieldInput=Yf,exports.Form=rp,exports.FormErrors=ep,exports.FormSubmit=Zf,exports.Input=qf,exports.Label=ap,exports.Profile=sp,exports.ScrollArea=zp,exports.Separator=Gf,exports.Slider=Bm,exports.SliderHandle=km,exports.SliderSegment=Am,exports.SliderTick=Mm,exports.SliderTickLabel=jm,exports.SliderTrack=Nm,exports.Switch=Jm,exports.Tabs=Rh,exports.TabsIndicator=Ah,exports.TabsList=Mh,exports.TabsPanel=Ph,exports.TabsTab=Ih,exports.Toast=ug,exports.ToastProvider=fg,exports.Tooltip=wm,exports.TooltipContent=Om,exports.TooltipTrigger=Em,exports.cn=X;