strata-ui-react 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avatar-fallback.cjs +42 -0
- package/dist/avatar-fallback.js +42 -0
- package/dist/avatar-image.cjs +42 -0
- package/dist/avatar-image.js +42 -0
- package/dist/avatar.cjs +47 -0
- package/dist/avatar.js +47 -0
- package/dist/badge.cjs +63 -0
- package/dist/badge.js +63 -0
- package/dist/badge.types.cjs +100 -0
- package/dist/badge.types.js +100 -0
- package/dist/button.cjs +58 -0
- package/dist/button.js +58 -0
- package/dist/button.types.cjs +519 -0
- package/dist/button.types.js +519 -0
- package/dist/checkbox-indicator.cjs +36 -0
- package/dist/checkbox-indicator.js +36 -0
- package/dist/checkbox.cjs +84 -0
- package/dist/checkbox.js +84 -0
- package/dist/cn.cjs +6 -0
- package/dist/cn.js +6 -0
- package/dist/dialog-close.cjs +57 -0
- package/dist/dialog-close.js +57 -0
- package/dist/dialog-description.cjs +46 -0
- package/dist/dialog-description.js +46 -0
- package/dist/dialog-popup.cjs +72 -0
- package/dist/dialog-popup.js +72 -0
- package/dist/dialog-title.cjs +46 -0
- package/dist/dialog-title.js +46 -0
- package/dist/dialog-trigger.cjs +46 -0
- package/dist/dialog-trigger.js +46 -0
- package/dist/dialog.cjs +20 -0
- package/dist/dialog.js +20 -0
- package/dist/field-errors.cjs +63 -0
- package/dist/field-errors.js +63 -0
- package/dist/field-input.cjs +80 -0
- package/dist/field-input.js +80 -0
- package/dist/form-errors.cjs +73 -0
- package/dist/form-errors.js +73 -0
- package/dist/form-submit.cjs +65 -0
- package/dist/form-submit.js +65 -0
- package/dist/form.cjs +19 -0
- package/dist/form.js +19 -0
- package/dist/form.types.cjs +6 -0
- package/dist/form.types.js +3 -0
- package/dist/index.cjs +82 -0
- package/dist/index.d.cts +312 -0
- package/dist/index.d.ts +312 -1
- package/dist/index.js +42 -0
- package/dist/input.cjs +83 -0
- package/dist/input.js +83 -0
- package/dist/label.cjs +46 -0
- package/dist/label.js +46 -0
- package/dist/profile.cjs +127 -0
- package/dist/profile.js +127 -0
- package/dist/scroll-area.cjs +97 -0
- package/dist/scroll-area.js +97 -0
- package/dist/separator.cjs +45 -0
- package/dist/separator.js +45 -0
- package/dist/slider-handle.cjs +34 -0
- package/dist/slider-handle.js +34 -0
- package/dist/slider-segment.cjs +17 -0
- package/dist/slider-segment.js +17 -0
- package/dist/slider-tick-label.cjs +12 -0
- package/dist/slider-tick-label.js +12 -0
- package/dist/slider-tick.cjs +13 -0
- package/dist/slider-tick.js +13 -0
- package/dist/slider-track.cjs +12 -0
- package/dist/slider-track.js +12 -0
- package/dist/slider.cjs +69 -0
- package/dist/slider.js +69 -0
- package/dist/switch.cjs +71 -0
- package/dist/switch.js +71 -0
- package/dist/tabs-indicator.cjs +57 -0
- package/dist/tabs-indicator.js +57 -0
- package/dist/tabs-list.cjs +57 -0
- package/dist/tabs-list.js +57 -0
- package/dist/tabs-panel.cjs +40 -0
- package/dist/tabs-panel.js +40 -0
- package/dist/tabs-tab.cjs +36 -0
- package/dist/tabs-tab.js +36 -0
- package/dist/tabs.cjs +73 -0
- package/dist/tabs.js +73 -0
- package/dist/tabs.types.cjs +4 -0
- package/dist/tabs.types.js +4 -0
- package/dist/toast-provider.cjs +86 -0
- package/dist/toast-provider.js +86 -0
- package/dist/toast.cjs +40 -0
- package/dist/toast.js +40 -0
- package/dist/tooltip-context.cjs +56 -0
- package/dist/tooltip-context.js +56 -0
- package/dist/tooltip-trigger.cjs +29 -0
- package/dist/tooltip-trigger.js +29 -0
- package/dist/tooltip.cjs +29 -0
- package/dist/tooltip.js +29 -0
- package/package.json +18 -10
- package/dist/strata-ui-react.js +0 -13543
- package/dist/strata-ui-react.umd.cjs +0 -24
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`react/jsx-runtime`),require(`react-dom`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`react/jsx-runtime`,`react-dom`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`strata-ui-react`]={},e.React,e[`react/jsx-runtime`],e.reactDOM))})(this,function(e,t,n,r){var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));t=f(t),r=f(r);var p=u((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)}})),m=u((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)}})()})),h=u(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=p():t.exports=m()}));function g(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 _={};function v(e,n){let r=t.useRef(_);return r.current===_&&(r.current=e(n)),r}function y(e,t,n,r){let i=v(x).current;return S(i,e,t,n,r)&&w(i,[e,t,n,r]),i.callback}function b(e){let t=v(x).current;return C(t,e)&&w(t,e),t.callback}function x(){return{callback:null,cleanup:null,refs:[]}}function S(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function C(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function w(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 T=parseInt(t.version,10);function E(e){return T>=e}function D(e){if(!t.isValidElement(e))return null;let n=e,r=n.props;return(E(19)?r?.ref:n.ref)??null}function O(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function k(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 A(e,t){return typeof e==`function`?e(t):e}function j(e,t){return typeof e==`function`?e(t):e}var M={};function N(e,t,n,r,i){let a={...I(e,M)};return t&&(a=F(a,t)),n&&(a=F(a,n)),r&&(a=F(a,r)),i&&(a=F(a,i)),a}function P(e){if(e.length===0)return M;if(e.length===1)return I(e[0],M);let t={...I(e[0],M)};for(let n=1;n<e.length;n+=1)t=F(t,e[n]);return t}function F(e,t){return ne(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]=O(e.style,r);break;case`className`:e[n]=re(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 ne(e){return typeof e==`function`}function I(e,t){return ne(e)?e(t):e??M}function L(e,t){return t?e?n=>{if(z(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 re(e,t){return t?e?t+` `+e:t:e}function z(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function B(){}let V=Object.freeze([]),H=Object.freeze({}),U={style:{transition:`none`}},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?A(n,a):void 0,d=l?j(r,a):void 0,f=l?k(a,c):H,p=l?O(f,Array.isArray(s)?P(s):s)??H:H;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=b([p.ref,D(i),...o]):p.ref=y(p.ref,D(i),o):y(null,null)),l?(u!==void 0&&(p.className=re(p.className,u)),d!==void 0&&(p.style=O(p.style,d)),p):H}function se(e,n,r,i){if(n){if(typeof n==`function`)return n(r,i);let e=N(r,n.props);return e.ref=r.ref,t.cloneElement(n,e)}if(e&&typeof e==`string`)return ce(e,r);throw Error(process.env.NODE_ENV===`production`?g(8):`Base UI: Render element or function are not defined.`)}function ce(e,n){return e===`button`?(0,t.createElement)(`button`,{type:`button`,...n,key:n.key}):e===`img`?(0,t.createElement)(`img`,{alt:``,...n,key:n.key}):t.createElement(e,n)}let le=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(le.displayName=`AvatarRootContext`);function ue(){let e=t.useContext(le);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(13):`Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.`);return e}let de={imageLoadingStatus:()=>null},fe=t.forwardRef(function(e,r){let{className:i,render:a,...o}=e,[s,c]=t.useState(`idle`),l=t.useMemo(()=>({imageLoadingStatus:s}),[s]),u=t.useMemo(()=>({imageLoadingStatus:s,setImageLoadingStatus:c}),[s,c]),d=W(`span`,e,{state:l,ref:r,props:o,stateAttributesMapping:de});return(0,n.jsx)(le.Provider,{value:u,children:d})});process.env.NODE_ENV!==`production`&&(fe.displayName=`AvatarRoot`);var pe=t[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],me=pe&&pe!==t.useLayoutEffect?pe:e=>e();function G(e){let t=v(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.`)}let K=typeof document<`u`?t.useLayoutEffect:()=>{};function _e(e,{referrerPolicy:n,crossOrigin:r}){let[i,a]=t.useState(`idle`);return K(()=>{if(!e)return a(`error`),B;let t=!0,i=new window.Image,o=e=>()=>{t&&a(e)};return a(`loading`),i.onload=o(`loaded`),i.onerror=o(`error`),n&&(i.referrerPolicy=n),i.crossOrigin=r??null,i.src=e,()=>{t=!1}},[e,r,n]),i}let ve=t.forwardRef(function(e,n){let{className:r,render:i,onLoadingStatusChange:a,referrerPolicy:o,crossOrigin:s,...c}=e,l=ue(),u=_e(e.src,{referrerPolicy:o,crossOrigin:s}),d=G(e=>{a?.(e),l.setImageLoadingStatus(e)});return K(()=>{u!==`idle`&&d(u)},[u,d]),W(`img`,e,{state:t.useMemo(()=>({imageLoadingStatus:u}),[u]),ref:n,props:c,stateAttributesMapping:de,enabled:u===`loaded`})});process.env.NODE_ENV!==`production`&&(ve.displayName=`AvatarImage`);var ye=[];function be(e){t.useEffect(e,ye)}var xe=0,Se=class e{static create(){return new e}currentId=xe;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xe,t()},e)}isStarted(){return this.currentId!==xe}clear=()=>{this.currentId!==xe&&(clearTimeout(this.currentId),this.currentId=xe)};disposeEffect=()=>this.clear};function Ce(){let e=v(Se.create).current;return be(e.disposeEffect),e}let we=t.forwardRef(function(e,n){let{className:r,render:i,delay:a,...o}=e,{imageLoadingStatus:s}=ue(),[c,l]=t.useState(a===void 0),u=Ce();return t.useEffect(()=>(a!==void 0&&u.start(a,()=>l(!0)),u.clear),[u,a]),W(`span`,e,{state:t.useMemo(()=>({imageLoadingStatus:s}),[s]),ref:n,props:o,stateAttributesMapping:de,enabled:s!==`loaded`&&c})});process.env.NODE_ENV!==`production`&&(we.displayName=`AvatarFallback`);function Te(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=Te(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ee(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Te(e))&&(r&&(r+=` `),r+=t);return r}var De=(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},Oe=(e,t)=>({classGroupId:e,validator:t}),ke=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ae=`-`,je=[],Me=`arbitrary..`,Ne=e=>{let t=Ie(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Fe(e);let n=e.split(Ae);return Pe(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?De(i,t):t:i||je}return n[e]||je}}},Pe=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Pe(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ae):e.slice(t).join(Ae),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Fe=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?Me+r:void 0})(),Ie=e=>{let{theme:t,classGroups:n}=e;return Le(n,t)},Le=(e,t)=>{let n=ke();for(let r in e){let i=e[r];Re(i,n,r,t)}return n},Re=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ze(i,t,n,r)}},ze=(e,t,n,r)=>{if(typeof e==`string`){Be(e,t,n);return}if(typeof e==`function`){Ve(e,t,n,r);return}He(e,t,n,r)},Be=(e,t,n)=>{let r=e===``?t:Ue(t,e);r.classGroupId=n},Ve=(e,t,n,r)=>{if(We(e)){Re(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Oe(n,e))},He=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Re(o,Ue(t,a),n,r)}},Ue=(e,t)=>{let n=e,r=t.split(Ae),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ke(),n.nextPart.set(t,i)),n=i}return n},We=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ge=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)}}},Ke=`!`,qe=`:`,Je=[],Ye=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Xe=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===qe){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(Ke)?(c=s.slice(0,-1),l=!0):s.startsWith(Ke)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ye(t,l,c,u)};if(t){let e=t+qe,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ye(Je,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ze=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}},Qe=e=>({cache:Ge(e.cacheSize),parseClassName:Xe(e),sortModifiers:Ze(e),...Ne(e)}),$e=/\s+/,et=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split($e),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+Ke: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},tt=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=nt(n))&&(i&&(i+=` `),i+=r);return i},nt=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=nt(e[r]))&&(n&&(n+=` `),n+=t);return n},rt=(e,...t)=>{let n,r,i,a,o=o=>(n=Qe(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=et(e,n);return i(e,a),a};return a=o,(...e)=>a(tt(...e))},it=[],at=e=>{let t=t=>t[e]||it;return t.isThemeGetter=!0,t},ot=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,st=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ct=/^\d+\/\d+$/,lt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ut=/\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$/,dt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ft=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mt=e=>ct.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),ht=e=>!!e&&Number.isInteger(Number(e)),gt=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),_t=e=>lt.test(e),vt=()=>!0,yt=e=>ut.test(e)&&!dt.test(e),bt=()=>!1,xt=e=>ft.test(e),St=e=>pt.test(e),Ct=e=>!J(e)&&!Y(e),wt=e=>It(e,Bt,bt),J=e=>ot.test(e),Tt=e=>It(e,Vt,yt),Et=e=>It(e,Ht,q),Dt=e=>It(e,Rt,bt),Ot=e=>It(e,zt,St),kt=e=>It(e,Wt,xt),Y=e=>st.test(e),At=e=>Lt(e,Vt),jt=e=>Lt(e,Ut),Mt=e=>Lt(e,Rt),Nt=e=>Lt(e,Bt),Pt=e=>Lt(e,zt),Ft=e=>Lt(e,Wt,!0),It=(e,t,n)=>{let r=ot.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lt=(e,t,n=!1)=>{let r=st.exec(e);return r?r[1]?t(r[1]):n:!1},Rt=e=>e===`position`||e===`percentage`,zt=e=>e===`image`||e===`url`,Bt=e=>e===`length`||e===`size`||e===`bg-size`,Vt=e=>e===`length`,Ht=e=>e===`number`,Ut=e=>e===`family-name`,Wt=e=>e===`shadow`,Gt=rt(()=>{let e=at(`color`),t=at(`font`),n=at(`text`),r=at(`font-weight`),i=at(`tracking`),a=at(`leading`),o=at(`breakpoint`),s=at(`container`),c=at(`spacing`),l=at(`radius`),u=at(`shadow`),d=at(`inset-shadow`),f=at(`text-shadow`),p=at(`drop-shadow`),m=at(`blur`),h=at(`perspective`),g=at(`aspect`),_=at(`ease`),v=at(`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=()=>[mt,`full`,`auto`,...w()],E=()=>[ht,`none`,`subgrid`,Y,J],D=()=>[`auto`,{span:[`full`,ht,Y,J]},ht,Y,J],O=()=>[ht,`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=()=>[mt,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,Y,J],F=()=>[...b(),Mt,Dt,{position:[Y,J]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,Nt,wt,{size:[Y,J]}],ne=()=>[gt,At,Tt],I=()=>[``,`none`,`full`,l,Y,J],L=()=>[``,q,At,Tt],R=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[q,gt,Mt,Dt],B=()=>[``,`none`,m,Y,J],V=()=>[`none`,q,Y,J],H=()=>[`none`,q,Y,J],U=()=>[q,Y,J],ie=()=>[mt,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[_t],breakpoint:[_t],color:[vt],container:[_t],"drop-shadow":[_t],ease:[`in`,`out`,`in-out`],font:[Ct],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[_t],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[_t],shadow:[_t],spacing:[`px`,q],text:[_t],"text-shadow":[_t],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,mt,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:[ht,`auto`,Y,J]}],basis:[{basis:[mt,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,mt,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[ht,`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,At,Tt]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Y,Et]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,gt,J]}],"font-family":[{font:[jt,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,Et]}],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:[...R(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,Tt]}],"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:F()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ht,Y,J],radial:[``,Y,J],conic:[ht,Y,J]},Pt,Ot]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":L()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...R(),`hidden`,`none`]}],"divide-style":[{divide:[...R(),`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:[...R(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,At,Tt]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,Ft,kt]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ft,kt]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[q,Tt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Ft,kt]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"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":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"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":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"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":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"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":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"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":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"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":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"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":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"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":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"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":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"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:F()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:B()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ft,kt]}],"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":B()}],"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:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"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,At,Tt,Et]}],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`]}});function X(...e){return Gt(Ee(e))}var Kt=h();let qt=e=>{let t=(0,Kt.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=X(`inline-flex size-xl items-center justify-center overflow-hidden rounded-full bg-surface-container align-middle font-medium select-none raised-2`,i),t[5]=i,t[6]=s);let c;return t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,n.jsx)(fe,{"data-slot":`avatar`,className:s,ref:o,...a,children:r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c};var Jt=h();let Yt=e=>{let t=(0,Jt.c)(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=X(`size-full object-cover`,r),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=(0,n.jsx)(ve,{"data-slot":`avatar-image`,className:o,ref:a,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s};var Xt=h();let Zt=e=>{let t=(0,Xt.c)(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=X(`flex size-full items-center justify-center`,r),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=(0,n.jsx)(we,{"data-slot":`avatar-fallback`,className:o,ref:a,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s};var Qt=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;let $t=Ee,en=(e,t)=>n=>{if(t?.variants==null)return $t(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=Qt(t)||Qt(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 $t(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)},tn=en(`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 nn=h();let rn=e=>{let t=(0,nn.c)(18),r,i,a,o,s,c,l;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7]):({className:i,tone:l,style:c,radius:o,children:r,ref:s,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l);let u;t[8]!==i||t[9]!==o||t[10]!==c||t[11]!==l?(u=X(tn({className:i,tone:l,style:c,radius:o})),t[8]=i,t[9]=o,t[10]=c,t[11]=l,t[12]=u):u=t[12];let d;return t[13]!==r||t[14]!==a||t[15]!==s||t[16]!==u?(d=(0,n.jsx)(`div`,{className:u,ref:s,...a,children:r}),t[13]=r,t[14]=a,t[15]=s,t[16]=u,t[17]=d):d=t[17],d},an=en(`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 on=h();function sn(e){let t=(0,on.c)(16),r,i,a,o,s,c;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({className:i,children:r,tone:c,style:s,size:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l;t[7]!==i||t[8]!==o||t[9]!==s||t[10]!==c?(l=X(an({tone:c,style:s,size:o,className:i})),t[7]=i,t[8]=o,t[9]=s,t[10]=c,t[11]=l):l=t[11];let u;return t[12]!==r||t[13]!==a||t[14]!==l?(u=(0,n.jsx)(`button`,{className:l,...a,children:r}),t[12]=r,t[13]=a,t[14]=l,t[15]=u):u=t[15],u}function cn({controlled:e,default:n,name:r,state:i=`value`}){let{current:a}=t.useRef(e!==void 0),[o,s]=t.useState(n),c=a?e:o;if(process.env.NODE_ENV!==`production`){t.useEffect(()=>{a!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${a?``:`un`}controlled ${i} state of ${r} to be ${a?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${r} 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
|
-
`))},[i,r,e]);let{current:o}=t.useRef(n);t.useEffect(()=>{!a&&JSON.stringify(o)!==JSON.stringify(n)&&console.error([`Base UI: A component is changing the default ${i} state of an uncontrolled ${r} after being initialized. To suppress this warning opt to use a controlled ${r}.`].join(`
|
|
7
|
-
`))},[JSON.stringify(n)])}return[c,t.useCallback(e=>{a||s(e)},[])]}let ln={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},un=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}({}),dn=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}({}),fn={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},pn={valid(e){return e===null?null:e?{[dn.valid]:``}:{[dn.invalid]:``}}};function mn(e){return t.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[un.checked]:``}:{[un.unchecked]:``}},...pn}),[e.indeterminate])}let hn={...t};var gn=0;function _n(e,n=`mui`){let[r,i]=t.useState(e),a=e||r;return t.useEffect(()=>{r??(gn+=1,i(`${n}-${gn}`))},[r,n]),a}var vn=hn.useId;function yn(e,t){if(vn!==void 0){let n=vn();return e??(t?`${t}-${n}`:n)}return _n(e,t)}function bn(e){return yn(e,`base-ui`)}function xn(){return typeof window<`u`}function Sn(e){return Tn(e)?(e.nodeName||``).toLowerCase():`#document`}function Cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wn(e){return((Tn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Tn(e){return xn()?e instanceof Node||e instanceof Cn(e).Node:!1}function Z(e){return xn()?e instanceof Element||e instanceof Cn(e).Element:!1}function En(e){return xn()?e instanceof HTMLElement||e instanceof Cn(e).HTMLElement:!1}function Dn(e){return!xn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Cn(e).ShadowRoot}var On=new Set([`inline`,`contents`]);function kn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Hn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!On.has(i)}var An=new Set([`table`,`td`,`th`]);function jn(e){return An.has(Sn(e))}var Mn=[`:popover-open`,`:modal`];function Nn(e){return Mn.some(t=>{try{return e.matches(t)}catch{return!1}})}var Pn=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Fn=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],In=[`paint`,`layout`,`strict`,`content`];function Ln(e){let t=zn(),n=Z(e)?Hn(e):e;return Pn.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)||Fn.some(e=>(n.willChange||``).includes(e))||In.some(e=>(n.contain||``).includes(e))}function Rn(e){let t=Wn(e);for(;En(t)&&!Vn(t);){if(Ln(t))return t;if(Nn(t))return null;t=Wn(t)}return null}function zn(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Bn=new Set([`html`,`body`,`#document`]);function Vn(e){return Bn.has(Sn(e))}function Hn(e){return Cn(e).getComputedStyle(e)}function Un(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wn(e){if(Sn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Dn(e)&&e.host||wn(e);return Dn(t)?t.host:t}function Gn(e){let t=Wn(e);return Vn(t)?e.ownerDocument?e.ownerDocument.body:e.body:En(t)&&kn(t)?t:Gn(t)}function Kn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Gn(e),i=r===e.ownerDocument?.body,a=Cn(r);if(i){let e=qn(a);return t.concat(a,a.visualViewport||[],kn(r)?r:[],e&&n?Kn(e):[])}return t.concat(r,Kn(r,[],n))}function qn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Jn;process.env.NODE_ENV!==`production`&&(Jn=new Set);function Yn(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);Jn.has(t)||(Jn.add(t),console.error(`Base UI: ${t}`))}}let Xn=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Xn.displayName=`CompositeRootContext`);function Zn(e=!1){let n=t.useContext(Xn);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?g(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return n}function Qn(e){let{focusableWhenDisabled:n,disabled:r,composite:i=!1,tabIndex:a=0,isNativeButton:o}=e,s=i&&n!==!1,c=i&&n===!1;return{props:t.useMemo(()=>{let e={onKeyDown(e){r&&n&&e.key!==`Tab`&&e.preventDefault()}};return i||(e.tabIndex=a,!o&&r&&(e.tabIndex=n?a:-1)),(o&&(n||s)||!o&&r)&&(e[`aria-disabled`]=r),o&&(!n||c)&&(e.disabled=r),e},[i,r,n,s,c,o,a])}}function $n(e={}){let{disabled:n=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0}=e,o=t.useRef(null),s=Zn(!0)!==void 0,c=G(()=>{let e=o.current;return!!(e?.tagName===`A`&&e?.href)}),{props:l}=Qn({focusableWhenDisabled:r,disabled:n,composite:s,tabIndex:i,isNativeButton:a});process.env.NODE_ENV!==`production`&&t.useEffect(()=>{if(!o.current)return;let e=o.current.tagName===`BUTTON`;a?e||Yn("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&&Yn("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`.")},[a]);let u=t.useCallback(()=>{let e=o.current;er(e)&&s&&n&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[n,l.disabled,s]);return K(u,[u]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...u}=e;return N({type:a?`button`:void 0,onClick(e){if(n){e.preventDefault();return}t?.(e)},onMouseDown(e){n||r?.(e)},onKeyDown(e){if(n||(R(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!a&&!c()&&!n,i=e.key===`Enter`,s=e.key===` `;r&&((s||i)&&e.preventDefault(),i&&t?.(e))},onKeyUp(e){n||(R(e),i?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!a&&!n&&e.key===` `&&t?.(e)},onPointerDown(e){if(n){e.preventDefault();return}s?.(e)}},a?void 0:{role:`button`},l,u)},[n,l,a,c]),buttonRef:G(e=>{o.current=e,u()})}}function er(e){return En(e)&&e.tagName===`BUTTON`}let tr=t.createContext({invalid:void 0,name:void 0,validityData:{state:fn,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`&&(tr.displayName=`FieldRootContext`);function nr(e=!0){let n=t.useContext(tr);if(n.setValidityData===B&&!e)throw Error(process.env.NODE_ENV===`production`?g(28):`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return n}let rr=t.createContext({disabled:!1});process.env.NODE_ENV!==`production`&&(rr.displayName=`FieldItemContext`);function ir(){return t.useContext(rr)}function ar(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let or=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:B,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});process.env.NODE_ENV!==`production`&&(or.displayName=`FormContext`);function sr(){return t.useContext(or)}function cr(e){let{enabled:t=!0,value:n,id:i,name:a,controlRef:o,commit:s}=e,{formRef:c}=sr(),{invalid:l,markedDirtyRef:u,validityData:d,setValidityData:f}=nr(),p=G(e.getValue);K(()=>{if(!t)return;let e=n;e===void 0&&(e=p()),d.initialValue===null&&e!==null&&f(t=>({...t,initialValue:e}))},[t,f,n,d.initialValue,p]),K(()=>{!t||!i||c.current.fields.set(i,{getValue:p,name:a,controlRef:o,validityData:ar(d,l),validate(){let e=n;e===void 0&&(e=p()),u.current=!0,r.flushSync(()=>s(e))}})},[s,o,t,c,p,i,l,u,a,d,n]),K(()=>{let e=c.current.fields;return()=>{i&&e.delete(i)}},[c,i])}let lr=t.createContext({controlId:void 0,setControlId:B,labelId:void 0,setLabelId:B,messageIds:[],setMessageIds:B,getDescriptionProps:e=>e});process.env.NODE_ENV!==`production`&&(lr.displayName=`LabelableContext`);function ur(){return t.useContext(lr)}let dr=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(dr.displayName=`CheckboxGroupContext`);function fr(e=!0){let n=t.useContext(dr);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?g(3):`Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.`);return n}let pr=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(pr.displayName=`CheckboxRootContext`);function mr(){let e=t.useContext(pr);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(14):`Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.`);return e}let hr=`none`,gr=`trigger-press`,_r=`trigger-hover`,vr=`trigger-focus`,yr=`imperative-action`;function br(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 xr(e,n){let r=t.useRef(e),i=G(n);K(()=>{r.current!==e&&i(r.current)},[e,i]),K(()=>{r.current=e},[e])}let Sr=t.forwardRef(function(e,r){let{checked:i,className:a,defaultChecked:o=!1,disabled:s=!1,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:b=!1,...x}=e,{clearErrors:S}=sr(),{disabled:C,name:w,setDirty:T,setFilled:E,setFocused:D,setTouched:O,state:k,validationMode:A,validityData:j,shouldValidateOnChange:M,validation:P}=nr(),F=ir(),{labelId:ee,controlId:te,setControlId:ne,getDescriptionProps:I}=ur(),L=fr(),R=L?.parent,re=R&&L.allValues,z=C||F.disabled||L?.disabled||s,V=w??d,U=v??V,ie=bn(),ae=bn(),oe=te;re?oe=p?ae:`${R.id}-${U}`:c&&(oe=c);let se={};re&&(p?se=L.parent.getParentProps():U&&(se=L.parent.getChildProps(U)));let ce=G(f),{checked:le=i,indeterminate:ue=l,onCheckedChange:de,...fe}=se,pe=L?.value,me=L?.setValue,he=L?.defaultValue,ge=t.useRef(null),{getButtonProps:_e,buttonRef:ve}=$n({disabled:z,native:b}),ye=L?.validation??P,[be,xe]=cn({controlled:U&&pe&&!p?pe.includes(U):le,default:U&&he&&!p?he.includes(U):o,name:`Checkbox`,state:`checked`});K(()=>{if(ne!==B)return ne(oe),()=>{ne(void 0)}},[oe,L,ne,p]),cr({enabled:!L,id:ie,commit:ye.commit,value:be,controlRef:ge,name:V,getValue:()=>be});let Se=t.useRef(null),Ce=y(u,Se,ye.inputRef);K(()=>{Se.current&&(Se.current.indeterminate=ue,be&&E(!0))},[be,ue,E]),xr(be,()=>{L&&!p||(S(V),E(be),T(be!==j.initialValue),M()?ye.commit(be):ye.commit(be,!0))});let we=N({checked:be,disabled:z,name:p?void 0:V,id:oe??void 0,required:g,ref:Ce,style:ln,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=br(hr,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()}},v===void 0?H:{value:(L?be&&v:v)||``},I,L?ye.getValidationProps:ye.getInputValidationProps),Te=re?!!le:be,Ee=re&&ue||l;t.useEffect(()=>{R&&U&&R.disabledStatesRef.current.set(U,z)},[R,z,U]);let De=t.useMemo(()=>({...k,checked:Te,disabled:z,readOnly:m,required:g,indeterminate:Ee}),[k,Te,z,m,g,Ee]),Oe=mn(De),ke=W(`span`,e,{state:De,ref:[ve,ge,r,L?.registerControlRef],props:[{id:ie,role:`checkbox`,"aria-checked":ue?`mixed`:be,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":ee,"data-parent":p?``:void 0,onFocus(){D(!0)},onBlur(){let e=Se.current;e&&(O(!0),D(!1),A===`onBlur`&&ye.commit(L?pe:e.checked))},onClick(e){m||z||(e.preventDefault(),Se.current?.click())}},I,ye.getValidationProps,x,fe,_e],stateAttributesMapping:Oe});return(0,n.jsxs)(pr.Provider,{value:De,children:[ke,!be&&!L&&V&&!p&&_!==void 0&&(0,n.jsx)(`input`,{type:`hidden`,name:V,value:_}),(0,n.jsx)(`input`,{...we})]})});process.env.NODE_ENV!==`production`&&(Sr.displayName=`CheckboxRoot`);function Cr(e){let t=v(wr,e).current;return t.next=e,K(t.effect),t}function wr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Tr=null,Er=globalThis.requestAnimationFrame,Dr=new 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`&&Er!==requestAnimationFrame&&(Er=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)}},Or=class e{static create(){return new e}static request(e){return Dr.request(e)}static cancel(e){return Dr.cancel(e)}currentId=Tr;request(e){this.cancel(),this.currentId=Dr.request(()=>{this.currentId=Tr,e()})}cancel=()=>{this.currentId!==Tr&&(Dr.cancel(this.currentId),this.currentId=Tr)};disposeEffect=()=>this.cancel};function kr(){let e=v(Or.create).current;return be(e.disposeEffect),e}function Ar(e){return e==null?e:`current`in e?e.current:e}function jr(e,t=!1,n=!0){let i=kr();return G((a,o=null)=>{i.cancel();let s=Ar(e);s!=null&&(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?a():i.request(()=>{function e(){s&&Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{o!=null&&o.aborted||r.flushSync(a)}).catch(()=>{if(n){if(o!=null&&o.aborted)return;r.flushSync(a)}else s.getAnimations().length>0&&s.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?i.request(e):e()}))})}function Mr(e){let{enabled:n=!0,open:r,ref:i,onComplete:a}=e,o=Cr(r),s=G(a),c=jr(i,r);t.useEffect(()=>{n&&c(()=>{r===o.current&&s()})},[n,r,s,c,o])}function Nr(e,n=!1,r=!1){let[i,a]=t.useState(e&&n?`idle`:void 0),[o,s]=t.useState(e);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!r&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),K(()=>{if(!e&&o&&i!==`ending`&&r){let e=Or.request(()=>{a(`ending`)});return()=>{Or.cancel(e)}}},[e,o,i,r]),K(()=>{if(!e||n)return;let t=Or.request(()=>{a(void 0)});return()=>{Or.cancel(t)}},[n,e]),K(()=>{if(!e||!n)return;e&&o&&i!==`idle`&&a(`starting`);let t=Or.request(()=>{a(`idle`)});return()=>{Or.cancel(t)}},[n,e,o,a,i]),t.useMemo(()=>({mounted:o,setMounted:s,transitionStatus:i}),[o,i])}let Pr=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({});var Fr={[Pr.startingStyle]:``},Ir={[Pr.endingStyle]:``};let Lr={transitionStatus(e){return e===`starting`?Fr:e===`ending`?Ir:null}},Rr=t.forwardRef(function(e,n){let{render:r,className:i,keepMounted:a=!1,...o}=e,s=mr(),c=s.checked||s.indeterminate,{transitionStatus:l,setMounted:u}=Nr(c),d=t.useRef(null),f=t.useMemo(()=>({...s,transitionStatus:l}),[s,l]);Mr({open:c,ref:d,onComplete(){c||u(!1)}});let p=mn(s),m=t.useMemo(()=>({...p,...Lr,...pn}),[p]),h=a||c,g=W(`span`,e,{enabled:h,ref:[n,d],state:f,stateAttributesMapping:m,props:o});return h?g:null});process.env.NODE_ENV!==`production`&&(Rr.displayName=`CheckboxIndicator`);var zr=h();let Br=e=>{let t=(0,zr.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=X(`flex`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,n.jsx)(Rr,{className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o};var Vr=new Map([[`bold`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`}))]]),Hr=new Map([[`bold`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`}),t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`}))]]),Ur=new Map([[`bold`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`}),t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`,t.createElement(t.Fragment,null,t.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`}))]]),Wr=(0,t.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Gr=t.forwardRef((e,n)=>{let{alt:r,color:i,size:a,weight:o,mirrored:s,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=t.useContext(Wr);return t.createElement(`svg`,{ref:n,xmlns:`http://www.w3.org/2000/svg`,width:a??f,height:a??f,fill:i??d,viewBox:`0 0 256 256`,transform:s||m?`scale(-1, 1)`:void 0,...h,...u},!!r&&t.createElement(`title`,null,r),c,l.get(o??p))});Gr.displayName=`IconBase`;var Kr=t.forwardRef((e,n)=>t.createElement(Gr,{ref:n,...e,weights:Vr}));Kr.displayName=`CaretUpIcon`;var qr=t.forwardRef((e,n)=>t.createElement(Gr,{ref:n,...e,weights:Hr}));qr.displayName=`CheckIcon`;var Jr=t.forwardRef((e,n)=>t.createElement(Gr,{ref:n,...e,weights:Ur}));Jr.displayName=`XIcon`;var Yr=h();let Xr=e=>{let t=(0,Yr.c)(23),r,i,a,o,s,c;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({className:r,ref:c,label:o,id:a,disabled:i,...s}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l;t[7]===r?l=t[8]:(l=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`,r),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,n.jsx)(Br,{children:(0,n.jsx)(qr,{weight:`bold`})}),t[9]=u):u=t[9];let d;t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==c||t[14]!==l?(d=(0,n.jsx)(Sr,{id:a,disabled:i,className:l,ref:c,...s,children:u}),t[10]=i,t[11]=a,t[12]=s,t[13]=c,t[14]=l,t[15]=d):d=t[15];let f;t[16]!==i||t[17]!==a||t[18]!==o?(f=o&&(0,n.jsx)(`label`,{htmlFor:a,className:X(`body-base cursor-pointer`,i&&`text-text-neutral-primary-disabled cursor-not-allowed`),children:o}),t[16]=i,t[17]=a,t[18]=o,t[19]=f):f=t[19];let p;return t[20]!==d||t[21]!==f?(p=(0,n.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d,f]}),t[20]=d,t[21]=f,t[22]=p):p=t[22],p},Zr=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Zr.displayName=`DialogRootContext`);function Qr(e){let n=t.useContext(Zr);if(e===!1&&n===void 0)throw Error(process.env.NODE_ENV===`production`?g(27):`Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.`);return n}let $r=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Pr.startingStyle]=`startingStyle`,e[e.endingStyle=Pr.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),ei=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({});var ti={[ei.popupOpen]:``};ei.popupOpen,ei.pressed;var ni={[$r.open]:``},ri={[$r.closed]:``},ii={[$r.anchorHidden]:``};let ai={open(e){return e?ti:null}},oi={open(e){return e?ni:ri},anchorHidden(e){return e?ii:null}};var si={...oi,...Lr};let ci=t.forwardRef(function(e,n){let{render:r,className:i,forceRender:a=!1,...o}=e,{store:s}=Qr(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d=s.useState(`transitionStatus`);return W(`div`,e,{state:t.useMemo(()=>({open:c,transitionStatus:d}),[c,d]),ref:[s.context.backdropRef,n],stateAttributesMapping:si,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});process.env.NODE_ENV!==`production`&&(ci.displayName=`DialogBackdrop`);let li=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{store:c}=Qr(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,br(`close-press`,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=$n({disabled:a,native:o});return W(`button`,e,{state:t.useMemo(()=>({disabled:a}),[a]),ref:[n,f],props:[{onClick:u},s,d]})});process.env.NODE_ENV!==`production`&&(li.displayName=`DialogClose`);let ui=t.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=Qr(),s=bn(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),W(`p`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(ui.displayName=`DialogDescription`);var di=typeof navigator<`u`,fi=xi(),pi=Ci(),mi=Si();let hi=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),gi=fi.platform===`MacIntel`&&fi.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(fi.platform);di&&/firefox/i.test(mi);let _i=di&&/apple/i.test(navigator.vendor);di&&/Edg/i.test(mi);let vi=di&&/android/i.test(pi)||/android/i.test(mi),yi=di&&pi.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,bi=mi.includes(`jsdom/`);function xi(){if(!di)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 Si(){if(!di)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Ci(){if(!di)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}let wi=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Ti(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&&Dn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ei(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Di(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 Oi(e){return e.matches(`html,body`)}function ki(e){return e?.ownerDocument||document}function Ai(e){return En(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ji(e){return e?e.getAttribute(`role`)===`combobox`&&Ai(e):!1}function Mi(e){if(!e||bi)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ni(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Pi(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Pi(e,t.id,n)])}function Fi(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 Ii(e){e.preventDefault(),e.stopPropagation()}function Li(e){return`nativeEvent`in e}function Ri(e){return e.mozInputSource===0&&e.isTrusted?!0:vi&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function zi(e){return bi?!1:!vi&&e.width===0&&e.height===0||vi&&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 Bi(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Vi(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Hi=[`top`,`right`,`bottom`,`left`],Ui=Math.min,Wi=Math.max,Gi=Math.round,Ki=Math.floor,qi=e=>({x:e,y:e}),Ji={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Yi={start:`end`,end:`start`};function Xi(e,t,n){return Wi(e,Ui(t,n))}function Zi(e,t){return typeof e==`function`?e(t):e}function Qi(e){return e.split(`-`)[0]}function $i(e){return e.split(`-`)[1]}function ea(e){return e===`x`?`y`:`x`}function ta(e){return e===`y`?`height`:`width`}var na=new Set([`top`,`bottom`]);function ra(e){return na.has(Qi(e))?`y`:`x`}function ia(e){return ea(ra(e))}function aa(e,t,n){n===void 0&&(n=!1);let r=$i(e),i=ia(e),a=ta(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ma(o)),[o,ma(o)]}function oa(e){let t=ma(e);return[sa(e),t,sa(t)]}function sa(e){return e.replace(/start|end/g,e=>Yi[e])}var ca=[`left`,`right`],la=[`right`,`left`],ua=[`top`,`bottom`],da=[`bottom`,`top`];function fa(e,t,n){switch(e){case`top`:case`bottom`:return n?t?la:ca:t?ca:la;case`left`:case`right`:return t?ua:da;default:return[]}}function pa(e,t,n,r){let i=$i(e),a=fa(Qi(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(sa)))),a}function ma(e){return e.replace(/left|right|bottom|top/g,e=>Ji[e])}function ha(e){return{top:0,right:0,bottom:0,left:0,...e}}function ga(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ha(e)}function _a(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 va(e,t,n){return Math.floor(e/t)!==n}function ya(e,t){return t<0||t>=e.current.length}function ba(e,t){return Sa(e,{disabledIndices:t})}function xa(e,t){return Sa(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Sa(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&&Da(e,a,r));return a}function Ca(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(!Da(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&&Ii(t),d=n;else{if(u&&Ii(t),l===-1)d=c;else if(d=Sa(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}ya(e,d)&&(d=l)}}if(t.key===`ArrowDown`){let n=g(`down`);n===void 0?(u&&Ii(t),l===-1?d=s:(d=Sa(e,{startingIndex:l,amount:a,disabledIndices:o}),r&&l+a>c&&(d=Sa(e,{startingIndex:l%a-a,amount:a,disabledIndices:o}))),ya(e,d)&&(d=l)):(u&&Ii(t),d=n)}if(n===`both`){let n=Ki(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&Ii(t),l%a===a-1?r&&(d=Sa(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=Sa(e,{startingIndex:l,disabledIndices:o}),r&&va(d,a,n)&&(d=Sa(e,{startingIndex:l-l%a-1,disabledIndices:o}))),va(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&Ii(t),l%a===0?r&&(d=Sa(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=Sa(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&va(d,a,n)&&(d=Sa(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),va(d,a,n)&&(d=l));let s=Ki(c/a)===n;ya(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:Sa(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function wa(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`?g(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 Ta(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 Ea(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Da(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 Oa=[`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])`].join(`,`),ka=typeof Element>`u`,Aa=ka?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ja=!ka&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Ma=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&Ma(e.parentNode)},Na=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Pa=function(e,t,n){if(Ma(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Oa));return t&&Aa.call(e,Oa)&&r.unshift(e),r=r.filter(n),r},Fa=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Ma(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Fa(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Aa.call(a,Oa)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Ma(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Fa(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},Ia=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},La=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Na(e))&&!Ia(e)?0:e.tabIndex},Ra=function(e,t){var n=La(e);return n<0&&t&&!Ia(e)?0:n},za=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ba=function(e){return e.tagName===`INPUT`},Va=function(e){return Ba(e)&&e.type===`hidden`},Ha=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ua=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Wa=function(e){if(!e.name)return!0;var t=e.form||ja(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=Ua(r,e.form);return!i||i===e},Ga=function(e){return Ba(e)&&e.type===`radio`},Ka=function(e){return Ga(e)&&!Wa(e)},qa=function(e){var t=e&&ja(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=ja(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Ja=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Ya=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=Aa.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Aa.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=ja(e);if(o&&!o.shadowRoot&&r(o)===!0)return Ja(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(qa(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Ja(e);return!1},Xa=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 Aa.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Za=function(e,t){return!(t.disabled||Ma(t)||Va(t)||Ya(t,e)||Ha(t)||Xa(t))},Qa=function(e,t){return!(Ka(t)||La(t)<0||!Za(e,t))},$a=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},eo=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Ra(a,i),s=i?eo(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(za).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},to=function(e,t){return t||={},eo(t.getShadowRoot?Fa([e],t.includeContainer,{filter:Qa.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:$a}):Pa(e,t.includeContainer,Qa.bind(null,t)))},no=function(e,t){return t||={},t.getShadowRoot?Fa([e],t.includeContainer,{filter:Za.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Pa(e,t.includeContainer,Za.bind(null,t))},ro=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Aa.call(e,Oa)===!1?!1:Qa(t,e)};let io=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function ao(e,t){let n=to(e,io()),r=n.length;if(r===0)return;let i=Ti(ki(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function oo(e){return ao(ki(e).body,1)||e}function so(e){return ao(ki(e).body,-1)||e}function co(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function lo(e){to(e,io()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function uo(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 fo(){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 po=t.createContext(null);process.env.NODE_ENV!==`production`&&(po.displayName=`FloatingNodeContext`);var mo=t.createContext(null);process.env.NODE_ENV!==`production`&&(mo.displayName=`FloatingTreeContext`);let ho=()=>t.useContext(po)?.id||null,go=e=>{let n=t.useContext(mo);return e??n};function _o(e){return`data-base-ui-${e}`}_o(`safe-polygon`),`${wi}`;function vo(e,t,n){if(n&&!Bi(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 yo=t.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Se,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(yo.displayName=`FloatingDelayGroupContext`);function bo(e){let{children:r,delay:i,timeoutMs:a=0}=e,o=t.useRef(i),s=t.useRef(i),c=t.useRef(null),l=t.useRef(null),u=Ce();return(0,n.jsx)(yo.Provider,{value:t.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:s,currentIdRef:c,timeoutMs:a,currentContextRef:l,timeout:u}),[a,u]),children:r})}function xo(e,n={open:!1}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{enabled:a=!0,open:o}=n,{currentIdRef:s,delayRef:c,timeoutMs:l,initialDelayRef:u,currentContextRef:d,hasProvider:f,timeout:p}=t.useContext(yo),[m,h]=t.useState(!1);return K(()=>{function e(){h(!1),d.current?.setIsInstantPhase(!1),s.current=null,d.current=null,c.current=u.current}if(a&&s.current&&!o&&s.current===i){if(h(!1),l){let t=i;return p.start(l,()=>{r.select(`open`)||s.current&&s.current!==t||e()}),()=>{p.clear()}}e()}},[a,o,i,s,c,l,u,d,p,r]),K(()=>{if(!a||!o)return;let e=d.current,t=s.current;p.clear(),d.current={onOpenChange:r.setOpen,setIsInstantPhase:h},s.current=i,c.current={open:0,close:vo(u.current,`close`)},t!==null&&t!==i?(h(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,br(hr))):(h(!1),e?.setIsInstantPhase(!1))},[a,o,i,r,s,c,l,u,d,p]),K(()=>()=>{d.current=null},[d]),t.useMemo(()=>({hasProvider:f,delayRef:c,isInstantPhase:m}),[f,c,m])}function So(e){return e?.ownerDocument||document}let Co=t.forwardRef(function(e,r){let[i,a]=t.useState();K(()=>{_i&&a(`button`)},[]);let o={tabIndex:0,role:i};return(0,n.jsx)(`span`,{...e,ref:r,style:ln,"aria-hidden":i?void 0:!0,...o,"data-base-ui-focus-guard":``})});process.env.NODE_ENV!==`production`&&(Co.displayName=`FocusGuard`);var wo=0;function To(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(wo);let a=()=>e?.focus({preventScroll:n});i?a():wo=requestAnimationFrame(a)}var Eo={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Do(e){return e===`inert`?Eo.inert:e===`aria-hidden`?Eo[`aria-hidden`]:Eo.none}var Oo=new WeakSet,ko={},Ao=0,jo=e=>e&&(e.host||jo(e.parentNode)),Mo=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=jo(t);return e.contains(n)?n:null}).filter(e=>e!=null);function No(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Mo(t,e),s=new Set,c=new Set(o),l=[];ko[i]||(ko[i]=new WeakMap);let u=ko[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(Sn(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Do(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&&Oo.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Ao+=1,()=>{l.forEach(e=>{let t=Do(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Oo.has(e)&&a&&e.removeAttribute(a),Oo.delete(e)),r||e.removeAttribute(i)}),--Ao,Ao||(Eo.inert=new WeakMap,Eo[`aria-hidden`]=new WeakMap,Eo.none=new WeakMap,Oo=new WeakSet,ko={})}}function Po(e,t=!1,n=!1){let r=ki(e[0]).body;return No(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var Fo=t.createContext(null);process.env.NODE_ENV!==`production`&&(Fo.displayName=`PortalContext`);let Io=()=>t.useContext(Fo);var Lo=_o(`portal`);function Ro(e={}){let{ref:n,container:i,componentProps:a=H,elementProps:o,elementState:s}=e,c=yn(),l=Io()?.portalNode,[u,d]=t.useState(null),[f,p]=t.useState(null),m=t.useRef(null);K(()=>{if(i===null){m.current&&(m.current=null,p(null),d(null));return}if(c==null)return;let e=(i&&(Tn(i)?i:i.current))??l??document.body;if(e==null){m.current&&(m.current=null,p(null),d(null));return}m.current!==e&&(m.current=e,p(null),d(e))},[i,l,c]);let h=W(`div`,a,{ref:[n,p],state:s,props:[{id:c,[Lo]:``},o]});return{portalNode:f,portalSubtree:u&&h?r.createPortal(h,u):null}}let zo=t.forwardRef(function(e,i){let{children:a,container:o,className:s,render:c,renderGuards:l,...u}=e,{portalNode:d,portalSubtree:f}=Ro({container:o,ref:i,componentProps:e,elementProps:u}),p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),g=t.useRef(null),[_,v]=t.useState(null),y=_?.modal,b=_?.open,x=typeof l==`boolean`?l:!!_&&!_.modal&&_.open&&!!d;t.useEffect(()=>{if(!d||y)return;function e(e){d&&co(e)&&(e.type===`focusin`?uo:lo)(d)}return d.addEventListener(`focusin`,e,!0),d.addEventListener(`focusout`,e,!0),()=>{d.removeEventListener(`focusin`,e,!0),d.removeEventListener(`focusout`,e,!0)}},[d,y]),t.useEffect(()=>{!d||b||uo(d)},[b,d]);let S=t.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:d,setFocusManagerState:v}),[d]);return(0,n.jsxs)(t.Fragment,{children:[f,(0,n.jsxs)(Fo.Provider,{value:S,children:[x&&d&&(0,n.jsx)(Co,{"data-type":`outside`,ref:p,onFocus:e=>{co(e,d)?h.current?.focus():so(_?_.domReference:null)?.focus()}}),x&&d&&(0,n.jsx)(`span`,{"aria-owns":d.id,style:ae}),d&&r.createPortal(a,d),x&&d&&(0,n.jsx)(Co,{"data-type":`outside`,ref:m,onFocus:e=>{co(e,d)?g.current?.focus():(oo(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,br(`focus-out`,e.nativeEvent)))}})]})]})});process.env.NODE_ENV!==`production`&&(zo.displayName=`FloatingPortal`);function Bo(e,t){let n=Cn(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 Vo=20,Ho=[];function Uo(){Ho=Ho.filter(e=>e.isConnected)}function Wo(e){Uo(),e&&Sn(e)!==`body`&&(Ho.push(e),Ho.length>Vo&&(Ho=Ho.slice(-Vo)))}function Go(){return Uo(),Ho[Ho.length-1]}function Ko(e){if(!e)return null;let t=io();return ro(e,t)?e:to(e,t)[0]||e}function qo(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Hn(e).display!==`none`}function Jo(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=io(),r=no(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ro(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 Yo(e){let{context:r,children:i,disabled:a=!1,order:o=[`content`],initialFocus:s=!0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:f=``,getInsideElements:p=()=>[],nextFocusableElement:m,previousFocusableElement:h,beforeContentFocusGuardRef:g,externalTree:_}=e,v=`rootStore`in r?r.rootStore:r,b=v.useState(`open`),x=v.useState(`domReferenceElement`),S=v.useState(`floatingElement`),{events:C,dataRef:w}=v.context,T=G(()=>w.current.floatingContext?.nodeId),E=G(p),D=s===!1,O=ji(x)&&D,k=Cr(o),A=Cr(s),j=Cr(c),M=Cr(f),N=go(_),P=Io(),F=t.useRef(null),ee=t.useRef(null),te=t.useRef(!1),ne=t.useRef(!1),I=t.useRef(!1),L=t.useRef(-1),R=t.useRef(``),re=t.useRef(``),z=Ce(),B=Ce(),V=kr(),H=P!=null,U=Ni(S),ie=G((e=U)=>e?to(e,io()):[]),ae=G(e=>{let t=ie(e);return k.current.map(()=>t).filter(Boolean).flat()});t.useEffect(()=>{if(a||!u)return;function e(e){e.key===`Tab`&&Q(U,Ti(ki(U)))&&ie().length===0&&!O&&Ii(e)}let t=ki(U);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[a,x,U,u,k,O,ie,ae]),t.useEffect(()=>{if(a||!S)return;function e(e){let t=Ei(e),n=ie().indexOf(t);n!==-1&&(L.current=n)}return S.addEventListener(`focusin`,e),()=>{S.removeEventListener(`focusin`,e)}},[a,S,ie]),t.useEffect(()=>{if(a||!b)return;let e=ki(U);function t(){I.current=!1}function n(e){let t=Ei(e);I.current=!(Q(S,t)||Q(x,t)||Q(P?.portalNode,t)),re.current=e.pointerType||`keyboard`}function r(){re.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,r,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,r,!0)}},[a,S,x,U,b,P]),t.useEffect(()=>{if(a||!d)return;function e(){ne.current=!0,B.start(0,()=>{ne.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=Ei(e);queueMicrotask(()=>{let i=T(),a=v.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(_o(`focus-guard`))||N&&(Pi(N.nodesRef.current,i).find(e=>Q(e.context?.elements.floating,t)||Q(e.context?.elements.domReference,t))||Fi(N.nodesRef.current,i).find(e=>[e.context?.elements.floating,Ni(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===x&&U&&Jo(U,k),l&&n!==x&&!qo(r)&&Ti(ki(U))===ki(U).body){if(En(U)&&(U.focus(),l===`popup`)){V.request(()=>{U.focus()});return}let e=L.current,t=ie(),n=t[e]||t[t.length-1]||U;En(n)&&n.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(O||!u)&&t&&o&&!ne.current&&(O||t!==Go())&&(te.current=!0,v.setOpen(!1,br(`focus-out`,e)))})}function n(){I.current||(w.current.insideReactTree=!0,z.start(0,()=>{w.current.insideReactTree=!1}))}let r=En(x)?x:null,i=[];if(!(!S&&!r))return r&&(r.addEventListener(`focusout`,t),r.addEventListener(`pointerdown`,e),i.push(()=>{r.removeEventListener(`focusout`,t),r.removeEventListener(`pointerdown`,e)})),S&&(S.addEventListener(`focusout`,t),P&&(S.addEventListener(`focusout`,n,!0),i.push(()=>{S.removeEventListener(`focusout`,n,!0)})),i.push(()=>{S.removeEventListener(`focusout`,t)})),()=>{i.forEach(e=>{e()})}},[a,x,S,U,u,N,P,v,d,l,ie,O,T,k,w,z,B,V]);let W=t.useRef(null),oe=t.useRef(null),se=y(W,g,P?.beforeInsideRef),ce=y(oe,P?.afterInsideRef);t.useEffect(()=>{if(a||!S||!b)return;let e=Array.from(P?.portalNode?.querySelectorAll(`[${_o(`portal`)}]`)||[]),t=Po([S,(N?Fi(N.nodesRef.current,T()):[]).find(e=>ji(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,...E(),F.current,ee.current,W.current,oe.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ar(h),Ar(m),O?x:null].filter(e=>e!=null),u||O);return()=>{t()}},[b,a,x,S,u,k,P,O,N,T,E,m,h]),K(()=>{if(!b||a||!En(U))return;let e=Ti(ki(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:Ar(r),i=i||t[0]||U,!Q(U,e)&&To(i,{preventScroll:i===U})})},[a,b,U,D,ae,A,M]),K(()=>{if(a||!U)return;let e=ki(U);Wo(Ti(e));function t(e){if(e.open||(R.current=Bo(e.nativeEvent,re.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(te.current=!0),e.reason===`outside-press`)if(e.nested)te.current=!1;else if(Ri(e.nativeEvent)||zi(e.nativeEvent))te.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?te.current=!1:te.current=!0}}C.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,ln),H&&x&&x.insertAdjacentElement(`afterend`,n);function r(){let e=j.current,t=typeof e==`function`?e(R.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=x||Go();return e&&e.isConnected?e:n}let r=x||Go()||n;return Ar(t)||r}return()=>{C.off(`openchange`,t);let i=Ti(e),a=Q(S,i)||N&&Pi(N.nodesRef.current,T(),!1).some(e=>Q(e.context?.elements.floating,i)),o=r();queueMicrotask(()=>{let t=Ko(o),r=typeof j.current!=`boolean`;j.current&&!te.current&&En(t)&&(!(!r&&t!==i&&i!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[a,S,U,j,w,C,N,H,x,T]),t.useEffect(()=>{queueMicrotask(()=>{te.current=!1})},[a]),t.useEffect(()=>{if(a||!b)return;function e(e){Ei(e)?.closest(`[data-base-ui-click-trigger]`)&&(ne.current=!0)}let t=ki(U);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[a,b,U]),K(()=>{if(!a&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:d,open:b,onOpenChange:v.setOpen,domReference:x}),()=>{P.setFocusManagerState(null)}},[a,P,u,b,v,d,x]),K(()=>{if(!(a||!U))return Jo(U,k),()=>{queueMicrotask(Uo)}},[a,U,k]);let le=!a&&(u?!O:!0)&&(H||u);return(0,n.jsxs)(t.Fragment,{children:[le&&(0,n.jsx)(Co,{"data-type":`inside`,ref:se,onFocus:e=>{if(u){let e=ae();To(e[e.length-1])}else P?.portalNode&&(te.current=!1,co(e,P.portalNode)?oo(x)?.focus():Ar(h??P.beforeOutsideRef)?.focus())}}),i,le&&(0,n.jsx)(Co,{"data-type":`inside`,ref:ce,onFocus:e=>{u?To(ae()[0]):P?.portalNode&&(d&&(te.current=!0),co(e,P.portalNode)?so(x)?.focus():Ar(m??P.afterOutsideRef)?.focus())}})]})}function Xo(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.context.dataRef,{enabled:a=!0,event:o=`click`,toggle:s=!0,ignoreMouse:c=!1,stickIfOpen:l=!0,touchOpenDelay:u=0}=n,d=t.useRef(void 0),f=kr(),p=Ce(),m=t.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,n=e.nativeEvent,a=r.select(`open`);if(e.button!==0||o===`click`||Bi(t,!0)&&c)return;let m=i.current.openEvent,h=m?.type,g=r.select(`domReferenceElement`)!==e.currentTarget,_=a&&g||!(a&&s&&(!(m&&l)||h===`click`||h===`mousedown`));if(Ai(n.target)){let e=br(gr,n,n.target);_&&t===`touch`&&u>0?p.start(u,()=>{r.setOpen(!0,e)}):r.setOpen(_,e);return}let v=e.currentTarget;f.request(()=>{let e=br(gr,n,v);_&&t===`touch`&&u>0?p.start(u,()=>{r.setOpen(!0,e)}):r.setOpen(_,e)})},onClick(e){if(o===`mousedown-only`)return;let t=d.current;if(o===`mousedown`&&t){d.current=void 0;return}if(Bi(t,!0)&&c)return;let n=r.select(`open`),a=i.current.openEvent,f=r.select(`domReferenceElement`)!==e.currentTarget,m=n&&f||!(n&&s&&(!(a&&l)||Vi(a))),h=br(gr,e.nativeEvent,e.currentTarget);m&&t===`touch`&&u>0?p.start(u,()=>{r.setOpen(!0,h)}):r.setOpen(m,h)},onKeyDown(){d.current=void 0}}),[i,o,c,r,l,s,f,p,u]);return t.useMemo(()=>a?{reference:m}:H,[a,m])}function Zo(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 Qo(e){return e!=null&&e.clientX!=null}function $o(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.context.dataRef,{enabled:c=!0,axis:l=`both`,x:u=null,y:d=null}=n,f=t.useRef(!1),p=t.useRef(null),[m,h]=t.useState(),[g,_]=t.useState([]),v=G((e,t)=>{f.current||s.current.openEvent&&!Qo(s.current.openEvent)||r.set(`positionReference`,Zo(o,{x:e,y:t,axis:l,dataRef:s,pointerType:m}))}),y=G(e=>{u!=null||d!=null||(i?p.current||_([]):v(e.clientX,e.clientY))}),b=Bi(m)?a:i,x=t.useCallback(()=>{if(!b||!c||u!=null||d!=null)return;let e=Cn(a);function t(n){Q(a,Ei(n))?(e.removeEventListener(`mousemove`,t),p.current=null):v(n.clientX,n.clientY)}if(!s.current.openEvent||Qo(s.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),p.current=null};return p.current=n,n}r.set(`positionReference`,o)},[b,c,u,d,a,s,o,r,v]);t.useEffect(()=>x(),[x,g]),t.useEffect(()=>{c&&!a&&(f.current=!1)},[c,a]),t.useEffect(()=>{!c&&i&&(f.current=!0)},[c,i]),K(()=>{c&&(u!=null||d!=null)&&(f.current=!1,v(u,d))},[c,u,d,v]);let S=t.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return t.useMemo(()=>c?{reference:S}:{},[c,S])}function es(e,t,n){let{reference:r,floating:i}=e,a=ra(t),o=ia(t),s=ta(o),c=Qi(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($i(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var ts=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}=es(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}=es(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function ns(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}=Zi(t,e),p=ga(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=_a(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=_a(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 rs=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}=Zi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Qi(r),_=ra(o),v=Qi(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ma(o)]:oa(o)),x=p!==`none`;!d&&x&&b.push(...pa(o,m,p,y));let S=[o,...b],C=await ns(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=aa(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`&&_!==ra(t))||T.every(e=>ra(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=ra(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 is(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function as(e){return Hi.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}=Zi(e,t);switch(r){case`referenceHidden`:{let e=is(await ns(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:as(e)}}}case`escaped`:{let e=is(await ns(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:as(e)}}}default:return{}}}}},ss=new Set([`left`,`top`]);async function cs(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Qi(n),s=$i(n),c=ra(n)===`y`,l=ss.has(o)?-1:1,u=a&&c?-1:1,d=Zi(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 ls=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 cs(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}}}}},us=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}=Zi(e,t),l={x:n,y:r},u=await ns(t,c),d=ra(Qi(i)),f=ea(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=Xi(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=Xi(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}}}}}},ds=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}=Zi(e,t),u={x:n,y:r},d=ra(i),f=ea(d),p=u[f],m=u[d],h=Zi(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=ss.has(Qi(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}}}},fs=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}=Zi(e,t),u=await ns(t,l),d=Qi(i),f=$i(i),p=ra(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=Ui(h-u[g],v),x=Ui(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=Wi(u.left,0),t=Wi(u.right,0),n=Wi(u.top,0),r=Wi(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Wi(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Wi(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 ps(e){let t=Hn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=En(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Gi(n)!==a||Gi(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ms(e){return Z(e)?e:e.contextElement}function hs(e){let t=ms(e);if(!En(t))return qi(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ps(t),o=(a?Gi(n.width):n.width)/r,s=(a?Gi(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var gs=qi(0);function _s(e){let t=Cn(e);return!zn()||!t.visualViewport?gs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Cn(e)?!1:t}function ys(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ms(e),o=qi(1);t&&(r?Z(r)&&(o=hs(r)):o=hs(e));let s=vs(a,n,r)?_s(a):qi(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=Cn(a),t=r&&Z(r)?Cn(r):r,n=e,i=qn(n);for(;i&&r&&t!==n;){let e=hs(i),t=i.getBoundingClientRect(),r=Hn(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=Cn(i),i=qn(n)}}return _a({width:u,height:d,x:c,y:l})}function bs(e,t){let n=Un(e).scrollLeft;return t?t.left+n:ys(wn(e)).left+n}function xs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bs(e,n),y:n.top+t.scrollTop}}function Ss(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=wn(r),s=t?Nn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=qi(1),u=qi(0),d=En(r);if((d||!d&&!a)&&((Sn(r)!==`body`||kn(o))&&(c=Un(r)),En(r))){let e=ys(r);l=hs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?xs(o,c):qi(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 Cs(e){return Array.from(e.getClientRects())}function ws(e){let t=wn(e),n=Un(e),r=e.ownerDocument.body,i=Wi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Wi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+bs(e),s=-n.scrollTop;return Hn(r).direction===`rtl`&&(o+=Wi(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ts=25;function Es(e,t){let n=Cn(e),r=wn(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=zn();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=bs(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<=Ts&&(a-=o)}else l<=Ts&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ds=new Set([`absolute`,`fixed`]);function Os(e,t){let n=ys(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=En(e)?hs(e):qi(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ks(e,t,n){let r;if(t===`viewport`)r=Es(e,n);else if(t===`document`)r=ws(wn(e));else if(Z(t))r=Os(t,n);else{let n=_s(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _a(r)}function As(e,t){let n=Wn(e);return n===t||!Z(n)||Vn(n)?!1:Hn(n).position===`fixed`||As(n,t)}function js(e,t){let n=t.get(e);if(n)return n;let r=Kn(e,[],!1).filter(e=>Z(e)&&Sn(e)!==`body`),i=null,a=Hn(e).position===`fixed`,o=a?Wn(e):e;for(;Z(o)&&!Vn(o);){let t=Hn(o),n=Ln(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ds.has(i.position)||kn(o)&&!n&&As(e,o))?r=r.filter(e=>e!==o):i=t,o=Wn(o)}return t.set(e,r),r}function Ms(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Nn(t)?[]:js(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=ks(t,n,i);return e.top=Wi(r.top,e.top),e.right=Ui(r.right,e.right),e.bottom=Ui(r.bottom,e.bottom),e.left=Wi(r.left,e.left),e},ks(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ns(e){let{width:t,height:n}=ps(e);return{width:t,height:n}}function Ps(e,t,n){let r=En(t),i=wn(t),a=n===`fixed`,o=ys(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=qi(0);function l(){c.x=bs(i)}if(r||!r&&!a)if((Sn(t)!==`body`||kn(i))&&(s=Un(t)),r){let e=ys(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?xs(i,s):qi(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 Fs(e){return Hn(e).position===`static`}function Is(e,t){if(!En(e)||Hn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return wn(e)===n&&(n=n.ownerDocument.body),n}function Ls(e,t){let n=Cn(e);if(Nn(e))return n;if(!En(e)){let t=Wn(e);for(;t&&!Vn(t);){if(Z(t)&&!Fs(t))return t;t=Wn(t)}return n}let r=Is(e,t);for(;r&&jn(r)&&Fs(r);)r=Is(r,t);return r&&Vn(r)&&Fs(r)&&!Ln(r)?n:r||Rn(e)||n}var Rs=async function(e){let t=this.getOffsetParent||Ls,n=this.getDimensions,r=await n(e.floating);return{reference:Ps(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zs(e){return Hn(e).direction===`rtl`}var Bs={convertOffsetParentRelativeRectToViewportRelativeRect:Ss,getDocumentElement:wn,getClippingRect:Ms,getOffsetParent:Ls,getElementRects:Rs,getClientRects:Cs,getDimensions:Ns,getScale:hs,isElement:Z,isRTL:zs};function Vs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hs(e,t){let n=null,r,i=wn(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=Ki(d),h=Ki(i.clientWidth-(u+f)),g=Ki(i.clientHeight-(d+p)),_=Ki(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Wi(0,Ui(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&&!Vs(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 Us(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=ms(e),u=i||a?[...l?Kn(l):[],...Kn(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Hs(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?ys(e):null;c&&g();function g(){let t=ys(e);h&&!Vs(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 Ws=ls,Gs=us,Ks=rs,qs=fs,Js=os,Ys=ds,Xs=(e,t,n)=>{let r=new Map,i={platform:Bs,...n},a={...i.platform,_c:r};return ts(e,t,{...i,platform:a})},Zs=typeof document<`u`?t.useLayoutEffect:function(){};function Qs(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(!Qs(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)&&!Qs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $s(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ec(e,t){let n=$s(e);return Math.round(t*n)/n}function tc(e){let n=t.useRef(e);return Zs(()=>{n.current=e}),n}function nc(e){e===void 0&&(e={});let{placement:n=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=t.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=t.useState(a);Qs(m,a)||h(a);let[g,_]=t.useState(null),[v,y]=t.useState(null),b=t.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=t.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=s||g,C=c||v,w=t.useRef(null),T=t.useRef(null),E=t.useRef(f),D=u!=null,O=tc(u),k=tc(o),A=tc(d),j=t.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:n,strategy:i,middleware:m};k.current&&(e.platform=k.current),Xs(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Qs(E.current,t)&&(E.current=t,r.flushSync(()=>{p(t)}))})},[m,n,i,k,A]);Zs(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=t.useRef(!1);Zs(()=>(M.current=!0,()=>{M.current=!1}),[]),Zs(()=>{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=t.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=t.useMemo(()=>({reference:S,floating:C}),[S,C]),F=t.useMemo(()=>{let e={position:i,left:0,top:0};if(!P.floating)return e;let t=ec(P.floating,f.x),n=ec(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+n+`px)`,...$s(P.floating)>=1.5&&{willChange:`transform`}}:{position:i,left:t,top:n}},[i,l,P.floating,f.x,f.y]);return t.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var rc=(e,t)=>({...Ws(e),options:[e,t]}),ic=(e,t)=>({...Gs(e),options:[e,t]}),ac=(e,t)=>({...Ys(e),options:[e,t]}),oc=(e,t)=>({...Ks(e),options:[e,t]}),sc=(e,t)=>({...qs(e),options:[e,t]}),cc=(e,t)=>({...Js(e),options:[e,t]}),lc={intentional:`onClick`,sloppy:`onPointerDown`};function uc(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function dc(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),o=r.useState(`referenceElement`),s=r.useState(`domReferenceElement`),{onOpenChange:c,dataRef:l}=r.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}=n,y=go(v),b=G(typeof f==`function`?f:()=>!1),x=typeof f==`function`?b:f,S=t.useRef(!1),{escapeKey:C,outsidePress:w}=uc(_),T=t.useRef(null),E=Ce(),D=Ce(),O=G(()=>{D.clear(),l.current.insideReactTree=!1}),k=t.useRef(!1),A=t.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(!i||!u||!d||e.key!==`Escape`||k.current)return;let t=l.current.floatingContext?.nodeId,n=y?Pi(y.nodesRef.current,t):[];if(!C&&n.length>0){let e=!0;if(n.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=br(`escape-key`,Li(e)?e.nativeEvent:e);r.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`}),F=G(()=>{l.current.insideReactTree=!0,D.start(0,O)}),ee=G((e,t=!1)=>{if(P(e)){O();return}if(l.current.insideReactTree){O();return}if(M()===`intentional`&&t||typeof x==`function`&&!x(e))return;let n=Ei(e),i=`[${_o(`inert`)}]`,a=ki(r.select(`floatingElement`)).querySelectorAll(i),o=r.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Q(e,n))))return;let s=Z(n)?n:null;for(;s&&!Vn(s);){let e=Wn(s);if(Vn(e)||!Z(e))break;s=e}if(a.length&&Z(n)&&!Oi(n)&&!Q(n,r.select(`floatingElement`))&&Array.from(a).every(e=>!Q(s,e)))return;if(En(n)&&!(`touches`in e)){let t=Vn(n),r=Hn(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}let c=l.current.floatingContext?.nodeId,u=y&&Pi(y.nodesRef.current,c).some(t=>Di(e,t.context?.elements.floating));if(Di(e,r.select(`floatingElement`))||Di(e,r.select(`domReferenceElement`))||u)return;let d=y?Pi(y.nodesRef.current,c):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r.setOpen(!1,br(`outside-press`,e)),O()}),te=G(e=>{M()!==`sloppy`||e.pointerType===`touch`||!r.select(`open`)||!u||Di(e,r.select(`floatingElement`))||Di(e,r.select(`domReferenceElement`))||ee(e)}),ne=G(e=>{if(M()!==`sloppy`||!r.select(`open`)||!u||Di(e,r.select(`floatingElement`))||Di(e,r.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)}))}),I=G(e=>{let t=Ei(e);function n(){ne(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),L=G(e=>{let t=S.current;if(S.current=!1,E.clear(),e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)return;let n=Ei(e);function r(){e.type===`pointerdown`?te(e):ee(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),R=G(e=>{if(M()!==`sloppy`||!T.current||Di(e,r.select(`floatingElement`))||Di(e,r.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(n*n+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(ee(e),E.clear(),T.current=null)}),re=G(e=>{let t=Ei(e);function n(){R(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),z=G(e=>{M()!==`sloppy`||!T.current||Di(e,r.select(`floatingElement`))||Di(e,r.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&ee(e),E.clear(),T.current=null)}),B=G(e=>{let t=Ei(e);function n(){z(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});t.useEffect(()=>{if(!i||!u)return;l.current.__escapeKeyBubbles=C,l.current.__outsidePressBubbles=w;let e=new Se;function t(e){r.setOpen(!1,br(hr,e))}function n(){e.clear(),k.current=!0}function c(){e.start(zn()?5:0,()=>{k.current=!1})}let f=ki(a);f.addEventListener(`pointerdown`,j,!0),d&&(f.addEventListener(`keydown`,N),f.addEventListener(`compositionstart`,n),f.addEventListener(`compositionend`,c)),x&&(f.addEventListener(`click`,L,!0),f.addEventListener(`pointerdown`,L,!0),f.addEventListener(`touchstart`,I,!0),f.addEventListener(`touchmove`,re,!0),f.addEventListener(`touchend`,B,!0),f.addEventListener(`mousedown`,L,!0));let p=[];return g&&(Z(s)&&(p=Kn(s)),Z(a)&&(p=p.concat(Kn(a))),!Z(o)&&o&&o.contextElement&&(p=p.concat(Kn(o.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`,n),f.removeEventListener(`compositionend`,c)),x&&(f.removeEventListener(`click`,L,!0),f.removeEventListener(`pointerdown`,L,!0),f.removeEventListener(`touchstart`,I,!0),f.removeEventListener(`touchmove`,re,!0),f.removeEventListener(`touchend`,B,!0),f.removeEventListener(`mousedown`,L,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[l,a,o,s,d,x,i,c,g,u,C,w,N,ee,L,te,I,re,B,j,r]),t.useEffect(O,[x,O]);let V=t.useMemo(()=>({onKeyDown:N,...m&&{[lc[h]]:e=>{r.setOpen(!1,br(`trigger-press`,e.nativeEvent))},...h!==`intentional`&&{onClick(e){r.setOpen(!1,br(`trigger-press`,e.nativeEvent))}}}}),[N,r,m,h]),H=G(e=>{let t=Ei(e.nativeEvent);!Q(r.select(`floatingElement`),t)||e.button!==0||(S.current=!0)}),U=t.useMemo(()=>({onKeyDown:N,onPointerDown:H,onMouseDown:H,onMouseUp:H,onClickCapture:F,onMouseDownCapture:F,onPointerDownCapture:F,onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[N,H,F]);return t.useMemo(()=>u?{reference:V,floating:U,trigger:V}:{},[u,V,U])}var fc=(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})}}},pc=(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})}},mc={inputStabilityCheck:`once`,identityFunctionCheck:`once`},hc=Symbol(`NOT_FOUND`);function gc(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function _c(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function vc(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 yc=e=>Array.isArray(e)?e:[e];function bc(e){let t=Array.isArray(e[0])?e[0]:e;return vc(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function xc(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Sc=(e,t)=>{let{identityFunctionCheck:n,inputStabilityCheck:r}={...mc,...t};return{identityFunctionCheck:{shouldRun:n===`always`||n===`once`&&e,run:fc},inputStabilityCheck:{shouldRun:r===`always`||r===`once`&&e,run:pc}}};function Cc(e){let t;return{get(n){return t&&e(t.key,n)?t.value:hc},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function wc(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 hc}function i(t,i){r(t)===hc&&(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 Tc=(e,t)=>e===t;function Ec(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 Dc(e,t){let{equalityCheck:n=Tc,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=Ec(n),o=0,s=r<=1?Cc(a):wc(r,a);function c(){let t=s.get(arguments);if(t===hc){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 Oc=class{constructor(e){this.value=e}deref(){return this.value}},kc=typeof WeakRef<`u`?WeakRef:Oc,Ac=0,jc=1;function Mc(){return{s:Ac,v:void 0,o:null,p:null}}function Nc(e,t={}){let n=Mc(),{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=Mc(),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=Mc(),e.set(n,t)):t=r}}let s=t,c;if(t.s===jc)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 kc(c):c}return s.s=jc,s.v=c,c}return o.clearCache=()=>{n=Mc(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Pc(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()),gc(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Nc,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=yc(c),p=yc(u),m=bc(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=!0,_=l(function(){r++;let e=xc(m,arguments);if(i=h.apply(null,e),process.env.NODE_ENV!==`production`){let{identityFunctionCheck:t,inputStabilityCheck:n}=Sc(g,d);if(t.shouldRun&&t.run(o,e,i),n.shouldRun){let t=xc(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 Fc=Pc(Nc),Ic=Object.assign((e,t=Fc)=>{_c(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:()=>Ic});Pc({memoize:Dc,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});let $=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(process.env.NODE_ENV===`production`?g(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 Lc=u((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})),Rc=u((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())})()})),zc=u(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Lc():t.exports=Rc()})),Bc=u((e=>{var t=require(`react`),n=zc();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}})),Vc=u((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=zc(),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())})()})),Hc=u(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Bc():t.exports=Vc()})),Uc=zc(),Wc=Hc(),Gc=E(19)?qc:Jc;function Kc(e,t,n,r,i){return Gc(e,t,n,r,i)}function qc(e,n,r,i,a){let o=t.useCallback(()=>n(e.getSnapshot(),r,i,a),[e,n,r,i,a]);return(0,Uc.useSyncExternalStore)(e.subscribe,o,o)}function Jc(e,t,n,r,i){return(0,Wc.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Yc=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)}},Xc=class extends Yc{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,n){t.useDebugValue(e),K(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}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`){t.useDebugValue(e,e=>Object.keys(e));let n=t.useRef(Object.keys(e)).current,r=Object.keys(e);(n.length!==r.length||n.some((e,t)=>e!==r[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,n,r){t.useDebugValue(e);let i=n!==void 0;if(process.env.NODE_ENV!==`production`){let t=this.controlledValues.get(e);t!==void 0&&t!==i&&console.error(`A component is changing the ${i?``:`un`}controlled state of ${e.toString()} to be ${i?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}this.controlledValues.has(e)||(this.controlledValues.set(e,i),!i&&!Object.is(this.state[e],r)&&super.setState({...this.state,[e]:r})),K(()=>{i&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,r,i])}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,n,r,i)=>{t.useDebugValue(e);let a=this.selectors[e];return Kc(this,a,n,r,i)};useContextCallback(e,n){t.useDebugValue(e);let r=G(n??B);this.context[e]=r}useStateSetter(e){let n=t.useRef(void 0);return n.current===void 0&&(n.current=t=>{this.set(e,t)}),n.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 Zc(){let[,e]=t.useState({});return t.useCallback(()=>{e({})},[])}var Qc={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},$c=class extends Xc{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:fo(),nested:t,noEmit:n,triggerElements:i},Qc)}setOpen=(e,t)=>{if((!e||!this.state.open||Vi(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 el(e,n){let r=t.useRef(null);return t.useCallback(t=>{e!==void 0&&(r.current!==null&&(n.context.triggerElements.delete(r.current),r.current=null),t!==null&&(r.current=e,n.context.triggerElements.add(e,t)))},[n,e])}function tl(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=el(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 nl(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 rl(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Nr(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 Mr({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var il=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`?g(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 al(){return new $c({open:!1,floatingElement:null,referenceElement:null,triggerElements:new il,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function ol(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:al(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:H,inactiveTriggerProps:H,popupProps:H}}let sl={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 cl(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=yn(),a=ho()!=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=v(()=>new $c({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new il,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 ll(e={}){let{nodeId:n,externalTree:r}=e,i=cl(e),a=e.rootContext||i,o={reference:a.useState(`referenceElement`),floating:a.useState(`floatingElement`),domReference:a.useState(`domReferenceElement`)},[s,c]=t.useState(null),l=t.useRef(null),u=go(r);K(()=>{o.domReference&&(l.current=o.domReference)},[o.domReference]);let d=nc({...e,elements:{...o,...s&&{reference:s}}}),f=t.useCallback(e=>{let t=Z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),d.refs.setReference(t)},[d.refs]),[p,m]=t.useState(null),[h,g]=t.useState(null);a.useSyncedValue(`referenceElement`,p),a.useSyncedValue(`domReferenceElement`,Z(p)?p:null),a.useSyncedValue(`floatingElement`,h);let _=t.useCallback(e=>{(Z(e)||e===null)&&(l.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=t.useCallback(e=>{g(e),d.refs.setFloating(e)},[d.refs]),y=t.useMemo(()=>({...d.refs,setReference:_,setFloating:v,setPositionReference:f,domReference:l}),[d.refs,_,v,f]),b=t.useMemo(()=>({...d.elements,domReference:o.domReference}),[d.elements,o.domReference]),x=a.useState(`open`),S=a.useState(`floatingId`),C=t.useMemo(()=>({...d,dataRef:a.context.dataRef,open:x,onOpenChange:a.setOpen,events:a.context.events,floatingId:S,refs:y,elements:b,nodeId:n,rootStore:a}),[d,y,b,n,a,x,S]);return K(()=>{a.context.dataRef.current.floatingContext=C;let e=u?.nodesRef.current.find(e=>e.id===n);e&&(e.context=C)}),t.useMemo(()=>({...d,context:C,refs:y,elements:b,rootStore:a}),[d,y,b,C,a])}function ul(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=yn(),o=ho()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=v(()=>new $c({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 dl=yi&&_i;function fl(e,n={}){let r=`rootStore`in e?e.rootStore:e,{events:i,dataRef:a}=r.context,{enabled:o=!0,visibleOnly:s=!0}=n,c=t.useRef(!1),l=Ce(),u=t.useRef(!0);t.useEffect(()=>{let e=r.select(`domReferenceElement`);if(!o)return;let t=Cn(e);function n(){!r.select(`open`)&&En(e)&&e===Ti(ki(e))&&(c.current=!0)}function i(){u.current=!0}function a(){u.current=!1}return t.addEventListener(`blur`,n),dl&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,a,!0)),()=>{t.removeEventListener(`blur`,n),dl&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,a,!0))}},[r,o]),t.useEffect(()=>{if(!o)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(c.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,o]);let d=t.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(e){if(c.current)return;let t=Ei(e.nativeEvent);if(s&&Z(t)){if(dl&&!e.relatedTarget){if(!u.current&&!Ai(t))return}else if(!Mi(t))return}r.setOpen(!0,br(vr,e.nativeEvent,e.currentTarget))},onBlur(e){c.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=Z(t)&&t.hasAttribute(_o(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let o=r.select(`domReferenceElement`),s=Ti(o?o.ownerDocument:document);!t&&s===o||Q(a.current.floatingContext?.refs.floating.current,s)||Q(o,s)||i||r.context.triggerElements.hasElement(e.relatedTarget)||r.setOpen(!1,br(vr,n))})}}),[a,r,s,l]);return t.useMemo(()=>o?{reference:d,trigger:d}:{},[o,d])}let pl=_o(`safe-polygon`);var ml=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${wi}`;function hl(e){return e?!!e.closest(ml):!1}function gl(e){let n=t.useRef(void 0),r=t.useRef(!1),i=t.useRef(void 0),a=t.useRef(!0),o=t.useRef(!1),s=t.useRef(()=>{}),c=t.useRef(!1),l=Ce(),u=Ce(),d=t.useRef(void 0);return t.useMemo(()=>{let t=e.context.dataRef.current;return t.hoverInteractionState||={pointerTypeRef:n,interactedInsideRef:r,handlerRef:i,blockMouseMoveRef:a,performedPointerEventsMutationRef:o,unbindMouseMoveRef:s,restTimeoutPendingRef:c,openChangeTimeout:l,restTimeout:u,handleCloseOptionsRef:d},t.hoverInteractionState},[e,n,r,i,a,o,s,c,l,u,d])}var _l=new Set([`click`,`mousedown`]);function vl(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),{dataRef:s}=r.context,{enabled:c=!0,closeDelay:l=0,externalTree:u}=n,{pointerTypeRef:d,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:m,unbindMouseMoveRef:h,restTimeoutPendingRef:g,openChangeTimeout:_,handleCloseOptionsRef:v}=gl(r),y=go(u),b=ho(),x=G(()=>f.current?!0:s.current.openEvent?_l.has(s.current.openEvent.type):!1),S=G(()=>{let e=s.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),C=t.useCallback((e,t=!0)=>{let n=yl(l,d.current);n&&!p.current?_.start(n,()=>r.setOpen(!1,br(_r,e))):t&&(_.clear(),r.setOpen(!1,br(_r,e)))},[l,p,r,d,_]),w=G(()=>{h.current(),p.current=void 0}),T=G(()=>{if(m.current){let e=ki(a).body;e.style.pointerEvents=``,e.removeAttribute(pl),m.current=!1}}),E=G(e=>{if(!hl(Ei(e))){f.current=!1;return}f.current=!0});K(()=>{i||(d.current=void 0,g.current=!1,f.current=!1,w(),T())},[i,d,g,f,w,T]),t.useEffect(()=>()=>{w()},[w]),t.useEffect(()=>T,[T]),K(()=>{if(c&&i&&v.current?.blockPointerEvents&&S()&&Z(o)&&a){m.current=!0;let e=ki(a).body;e.setAttribute(pl,``);let t=o,n=a,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=``}}},[c,i,o,a,v,S,y,b,m]),t.useEffect(()=>{if(!c)return;function e(e){if(x()||!s.current.floatingContext||!r.select(`open`))return;let t=r.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(T(),w(),x()||C(e))}function t(e){_.clear(),T(),p.current?.(e),w()}function n(e){x()||C(e,!1)}let i=a;return i&&(i.addEventListener(`mouseleave`,e),i.addEventListener(`mouseenter`,t),i.addEventListener(`mouseleave`,n),i.addEventListener(`pointerdown`,E,!0)),()=>{i&&(i.removeEventListener(`mouseleave`,e),i.removeEventListener(`mouseenter`,t),i.removeEventListener(`mouseleave`,n),i.removeEventListener(`pointerdown`,E,!0))}})}function yl(e,t){return t&&!Bi(t)?0:typeof e==`function`?e():e}function bl(e){return typeof e==`function`?e():e}var xl={current:null};function Sl(e,n={}){let i=`rootStore`in e?e.rootStore:e,{dataRef:a,events:o}=i.context,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0,triggerElementRef:p=xl,externalTree:m,isActiveTrigger:h=!0}=n,g=go(m),{pointerTypeRef:_,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:x,unbindMouseMoveRef:S,restTimeoutPendingRef:C,openChangeTimeout:w,restTimeout:T,handleCloseOptionsRef:E}=gl(i),D=Cr(l),O=Cr(c),k=Cr(d);h&&(E.current=D.current?.__options);let A=G(()=>v.current?!0:a.current.openEvent?[`click`,`mousedown`].includes(a.current.openEvent.type):!1),j=t.useCallback((e,t=!0)=>{let n=vo(O.current,`close`,_.current);n&&!y.current?w.start(n,()=>i.setOpen(!1,br(_r,e))):t&&(w.clear(),i.setOpen(!1,br(_r,e)))},[O,y,i,_,w]),M=G(()=>{S.current(),y.current=void 0}),N=G(()=>{if(x.current){let e=ki(i.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(pl),x.current=!1}});t.useEffect(()=>{if(!s)return;function e(e){e.open||(w.clear(),T.clear(),b.current=!0,C.current=!1)}return o.on(`openchange`,e),()=>{o.off(`openchange`,e)}},[s,o,w,T,b,C]);let P=G(e=>{if(A()||!a.current.floatingContext)return;let t=i.context.triggerElements;if(e.relatedTarget&&t.hasElement(e.relatedTarget))return;let n=p.current;D.current?.({...a.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),M(),!A()&&n===i.select(`domReferenceElement`)&&j(e)}})(e)});return t.useEffect(()=>{if(!s)return;let e=p.current??(h?i.select(`domReferenceElement`):null);if(!Z(e))return;function t(e){if(w.clear(),b.current=!1,u&&!Bi(_.current)||bl(k.current)>0&&!vo(O.current,`open`))return;let t=vo(O.current,`open`,_.current),n=i.select(`domReferenceElement`),r=i.context.triggerElements,a=(r.hasElement(e.target)||r.hasMatchingElement(t=>Q(t,e.target)))&&(!n||!Q(n,e.target)),o=e.currentTarget??null,s=!i.select(`open`)||a;t?w.start(t,()=>{s&&i.setOpen(!0,br(_r,e,o))}):s&&i.setOpen(!0,br(_r,e,o))}function n(e){if(A()){N();return}S.current();let t=ki(i.select(`domReferenceElement`));T.clear(),C.current=!1;let n=i.context.triggerElements;if(!(e.relatedTarget&&n.hasElement(e.relatedTarget))){if(D.current&&a.current.floatingContext){i.select(`open`)||w.clear();let n=p.current;y.current=D.current({...a.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),M(),!A()&&n===i.select(`domReferenceElement`)&&j(e,!0)}});let r=y.current;r(e),t.addEventListener(`mousemove`,r),S.current=()=>{t.removeEventListener(`mousemove`,r)};return}(_.current!==`touch`||!Q(i.select(`floatingElement`),e.relatedTarget))&&j(e)}}function r(e){P(e)}return i.select(`open`)&&e.addEventListener(`mouseleave`,r),f&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,n),()=>{e.removeEventListener(`mouseleave`,r),f&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,n)}},[M,N,b,a,O,j,i,s,D,P,h,A,u,f,_,k,T,C,w,p,g,S,y]),t.useMemo(()=>{function e(e){_.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,a=i.select(`domReferenceElement`),o=i.context.triggerElements,s=i.select(`open`),c=(o.hasElement(e.target)||o.hasMatchingElement(t=>Q(t,e.target)))&&(!a||!Q(a,e.target));if(u&&!Bi(_.current)||s&&!c||bl(k.current)===0||!c&&C.current&&e.movementX**2+e.movementY**2<2)return;T.clear();function l(){!b.current&&(!s||c)&&i.setOpen(!0,br(_r,t,n))}_.current===`touch`?r.flushSync(()=>{l()}):c&&s?l():(C.current=!0,T.start(bl(k.current),l))}}},[b,u,i,_,k,T,C])}function Cl(e=[]){let n=e.map(e=>e?.reference),r=e.map(e=>e?.floating),i=e.map(e=>e?.item),a=e.map(e=>e?.trigger),o=t.useCallback(t=>wl(t,e,`reference`),n),s=t.useCallback(t=>wl(t,e,`floating`),r),c=t.useCallback(t=>wl(t,e,`item`),i),l=t.useCallback(t=>wl(t,e,`trigger`),a);return t.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c,getTriggerProps:l}),[o,s,c,l])}function wl(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&&Tl(a,s,i,r)}return Tl(a,e,i,r),a}function Tl(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 El=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Dl(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingId`),o=r.useState(`domReferenceElement`),s=r.useState(`floatingElement`),{enabled:c=!0,role:l=`dialog`}=n,u=yn(),d=o?.id||u,f=t.useMemo(()=>Ni(s)?.id||a,[s,a]),p=El.get(l)??l,m=ho()!=null,h=t.useMemo(()=>p===`tooltip`||l===`label`?H:{"aria-haspopup":p===`alertdialog`?`dialog`:p,"aria-expanded":`false`,...p===`listbox`&&{role:`combobox`},...p===`menu`&&m&&{role:`menuitem`},...l===`select`&&{"aria-autocomplete":`none`},...l===`combobox`&&{"aria-autocomplete":`list`}},[p,m,l]),g=t.useMemo(()=>p===`tooltip`||l===`label`?{[`aria-${l===`label`?`labelledby`:`describedby`}`]:i?f:void 0}:{...h,"aria-expanded":i?`true`:`false`,"aria-controls":i?f:void 0,...p===`menu`&&{id:d}},[p,f,i,d,l,h]),_=t.useMemo(()=>{let e={id:f,...p&&{role:p}};return p===`tooltip`||l===`label`?e:{...e,...p===`menu`&&{"aria-labelledby":d}}},[p,f,d,l]),v=t.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${f}-fui-option`}};switch(l){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[f,l]);return t.useMemo(()=>c?{reference:g,floating:_,item:v,trigger:h}:{},[c,g,_,h,v])}function Ol(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 kl(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Al(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Se,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],_=Ei(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=kl(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&&Pi(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(!Ol([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()}Ol([m,h],P([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}let jl=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),Ml=function(e){return e[e.open=$r.open]=`open`,e[e.closed=$r.closed]=`closed`,e[e.startingStyle=$r.startingStyle]=`startingStyle`,e[e.endingStyle=$r.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Nl=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Nl.displayName=`DialogPortalContext`);function Pl(){let e=t.useContext(Nl);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(26):`Base UI: <Dialog.Portal> is missing.`);return e}let Fl=`ArrowUp`,Il=`ArrowDown`,Ll=`ArrowLeft`,Rl=`ArrowRight`,zl=`Home`,Bl=new Set([Ll,Rl]),Vl=new Set([Ll,Rl,zl,`End`]),Hl=new Set([Fl,Il]),Ul=new Set([Fl,Il,zl,`End`]),Wl=new Set([...Bl,...Hl]),Gl=new Set([...Wl,zl,`End`]),Kl=new Set([Fl,Il,Ll,Rl,zl,`End`]),ql=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function Jl(e){return En(e)&&e.tagName===`INPUT`}function Yl(e){return!!(Jl(e)&&e.selectionStart!=null||En(e)&&e.tagName===`TEXTAREA`)}function Xl(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=Zl(e,t,`left`),a=Ql(e),o=Ql(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=Zl(e,t,`top`),r=Ql(e),i=Ql(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 Zl(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 Ql(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 $l={...oi,...Lr,nestedDialogOpen(e){return e?{[Ml.nestedDialogOpen]:``}:null}};let eu=t.forwardRef(function(e,r){let{className:i,finalFocus:a,initialFocus:o,render:s,...c}=e,{store:l}=Qr(),u=l.useState(`descriptionElementId`),d=l.useState(`disablePointerDismissal`),f=l.useState(`floatingRootContext`),p=l.useState(`popupProps`),m=l.useState(`modal`),h=l.useState(`mounted`),g=l.useState(`nested`),_=l.useState(`nestedOpenDialogCount`),v=l.useState(`open`),y=l.useState(`openMethod`),b=l.useState(`titleElementId`),x=l.useState(`transitionStatus`),S=l.useState(`role`);Pl(),Mr({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}});function C(e){return e===`touch`?l.context.popupRef.current:!0}let w=o===void 0?C:o,T=_>0,E=W(`div`,e,{state:t.useMemo(()=>({open:v,nested:g,transitionStatus:x,nestedDialogOpen:T}),[v,g,x,T]),props:[p,{"aria-labelledby":b??void 0,"aria-describedby":u??void 0,role:S,tabIndex:-1,hidden:!h,onKeyDown(e){Kl.has(e.key)&&e.stopPropagation()},style:{[jl.nestedDialogs]:_}},c],ref:[r,l.context.popupRef,l.useStateSetter(`popupElement`)],stateAttributesMapping:$l});return(0,n.jsx)(Yo,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!d,initialFocus:w,returnFocus:a,modal:m!==!1,restoreFocus:`popup`,children:E})});process.env.NODE_ENV!==`production`&&(eu.displayName=`DialogPopup`);function tu(e){return E(19)?e:e?`true`:void 0}let nu=t.forwardRef(function(e,t){let{cutout:r,...i}=e,a;if(r){let e=r?.getBoundingClientRect();a=`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,n.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...i,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:a}})});process.env.NODE_ENV!==`production`&&(nu.displayName=`InternalBackdrop`);let ru=t.forwardRef(function(e,t){let{keepMounted:r=!1,...i}=e,{store:a}=Qr(),o=a.useState(`mounted`),s=a.useState(`modal`);return o||r?(0,n.jsx)(Nl.Provider,{value:r,children:(0,n.jsxs)(zo,{ref:t,...i,children:[o&&s===!0&&(0,n.jsx)(nu,{ref:a.context.internalBackdropRef,inert:tu(!open)}),e.children]})}):null});process.env.NODE_ENV!==`production`&&(ru.displayName=`DialogPortal`);var iu={},au={},ou=``;function su(e){if(typeof document>`u`)return!1;let t=So(e);return Cn(t).innerWidth-t.documentElement.clientWidth>0}function cu(e){let t=So(e),n=t.documentElement,r=t.body,i=kn(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function lu(e){let t=So(e),n=t.documentElement,r=t.body,i=Cn(n),a=0,o=0,s=Or.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(hi&&(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,iu={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ou=n.style.scrollBehavior,au={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),_=kn(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,iu),Object.assign(r.style,au),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ou)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var uu=new class{lockCount=0;restore=null;timeoutLock=Se.create();timeoutUnlock=Se.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=So(e).documentElement,n=Cn(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=B;return}this.restore=gi||!su(e)?cu(e):lu(e)}};function du(e=!0,t=null){K(()=>{if(e)return uu.acquire(t)},[e,t])}function fu(e){let n=t.useRef(``),r=t.useCallback(t=>{t.defaultPrevented||(n.current=t.pointerType,e(t,t.pointerType))},[e]);return{onClick:t.useCallback(t=>{if(t.detail===0){e(t,`keyboard`);return}`pointerType`in t&&e(t,t.pointerType),e(t,n.current),n.current=``},[e]),onPointerDown:r}}function pu(e){let[n,r]=t.useState(null),i=G((t,n)=>{e||r(n)}),a=t.useCallback(()=>{r(null)},[]),{onClick:o,onPointerDown:s}=fu(i);return t.useMemo(()=>({openMethod:n,reset:a,triggerProps:{onClick:o,onPointerDown:s}}),[n,a,o,s])}function mu(e){let{store:n,parentContext:r,actionsRef:i}=e,a=n.useState(`open`),o=n.useState(`disablePointerDismissal`),s=n.useState(`modal`),c=n.useState(`popupElement`),{openMethod:l,triggerProps:u,reset:d}=pu(a);nl(n);let{forceUnmount:f}=rl(a,n,()=>{d()}),p=G(e=>{let t=br(e);return t.preventUnmountOnClose=()=>{n.set(`preventUnmountingOnClose`,!0)},t}),m=t.useCallback(()=>{n.setOpen(!1,p(yr))},[n,p]);t.useImperativeHandle(i,()=>({unmount:f,close:m}),[f,m]);let h=ul({popupStore:n,onOpenChange:n.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,_]=t.useState(0),v=g===0,y=Dl(h),b=dc(h,{outsidePressEvent(){return n.context.internalBackdropRef.current||n.context.backdropRef.current?`intentional`:{mouse:s===`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 t=Ei(e);if(v&&!o){let e=t;return s&&(n.context.internalBackdropRef.current||n.context.backdropRef.current)?n.context.internalBackdropRef.current===e||n.context.backdropRef.current===e||Q(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});du(a&&s===!0,c);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=Cl([y,b]);n.useContextCallback(`onNestedDialogOpen`,e=>{_(e+1)}),n.useContextCallback(`onNestedDialogClose`,()=>{_(0)}),t.useEffect(()=>(r?.onNestedDialogOpen&&a&&r.onNestedDialogOpen(g),r?.onNestedDialogClose&&!a&&r.onNestedDialogClose(),()=>{r?.onNestedDialogClose&&a&&r.onNestedDialogClose()}),[a,r,g]);let w=t.useMemo(()=>x(u),[x,u]),T=t.useMemo(()=>C(u),[C,u]),E=t.useMemo(()=>S(),[S]);n.useSyncedValues({openMethod:l,activeTriggerProps:w,inactiveTriggerProps:T,popupProps:E,floatingRootContext:h,nestedOpenDialogCount:g})}var hu={...sl,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)},gu=class extends Xc{constructor(e){super(_u(e),{popupRef:t.createRef(),backdropRef:t.createRef(),internalBackdropRef:t.createRef(),triggerElements:new il,onOpenChange:void 0,onOpenChangeComplete:void 0},hu)}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 _u(e={}){return{...ol(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function vu(e){let{children:r,open:i,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p=null}=e,m=Qr(!0),h=!!m,g=v(()=>d?.store??new gu({open:i??a,activeTriggerId:f===void 0?p:f,modal:l,disablePointerDismissal:c,nested:h})).current;g.useControlledProp(`open`,i,a),g.useControlledProp(`activeTriggerId`,f,p),g.useSyncedValues({disablePointerDismissal:c,nested:h,modal:l}),g.useContextCallback(`onOpenChange`,o),g.useContextCallback(`onOpenChangeComplete`,s);let _=g.useState(`payload`);mu({store:g,actionsRef:u,parentContext:m?.store.context,onOpenChange:o,triggerIdProp:f});let y=t.useMemo(()=>({store:g}),[g]);return(0,n.jsx)(Zr.Provider,{value:y,children:typeof r==`function`?r({payload:_}):r})}let yu=t.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=Qr(),s=bn(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),W(`h2`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(yu.displayName=`DialogTitle`);let bu=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=Qr(!0),f=l?.store??d?.store;if(!f)throw Error(process.env.NODE_ENV===`production`?g(79):`Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.`);let p=bn(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),_=t.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=tl(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=$n({disabled:a,native:o}),S=Cl([Xo(m,{enabled:m!=null})]),C=t.useMemo(()=>({disabled:a,open:h}),[a,h]),w=f.useState(`triggerProps`,y);return W(`button`,e,{state:C,ref:[x,n,v,_],props:[S.getReferenceProps(),w,{"data-base-ui-click-trigger":``,id:p},u,b],stateAttributesMapping:ai})});process.env.NODE_ENV!==`production`&&(bu.displayName=`DialogTrigger`);var xu=h();let Su=e=>{let t=(0,xu.c)(13),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=X(``,i),t[5]=i,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,n.jsx)(sn,{style:`ghost`,tone:`neutral`,children:`Close`}),t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==a||t[10]!==o||t[11]!==s?(l=(0,n.jsx)(li,{className:s,ref:o,...a,render:c,children:r}),t[8]=r,t[9]=a,t[10]=o,t[11]=s,t[12]=l):l=t[12],l};var Cu=h();let wu=e=>{let t=(0,Cu.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=X(`text-prose-0 mb-0`,i),t[5]=i,t[6]=s);let c;return t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,n.jsx)(ui,{className:s,ref:o,...a,children:r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c};var Tu=h();let Eu=e=>{let t=(0,Tu.c)(19),r,i,a,o,s;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({className:i,children:r,showCloseButton:s,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let c=s===void 0?!0:s,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,n.jsx)(ci,{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]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=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`,i),t[7]=i,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,n.jsx)(Su,{}),t[9]=c,t[10]=d);let f;t[11]===d?f=t[12]:(f=(0,n.jsx)(`div`,{className:`flex justify-end`,children:d}),t[11]=d,t[12]=f);let p;return t[13]!==r||t[14]!==a||t[15]!==o||t[16]!==u||t[17]!==f?(p=(0,n.jsxs)(ru,{children:[l,(0,n.jsxs)(eu,{className:u,ref:o,...a,children:[r,f]})]}),t[13]=r,t[14]=a,t[15]=o,t[16]=u,t[17]=f,t[18]=p):p=t[18],p};var Du=h();let Ou=e=>{let t=(0,Du.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=X(`text-strong-2`,i),t[5]=i,t[6]=s);let c;return t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,n.jsx)(yu,{className:s,ref:o,...a,children:r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c};var ku=h();let Au=e=>{let t=(0,ku.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=X(``,i),t[5]=i,t[6]=s);let c;return t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,n.jsx)(bu,{className:s,ref:o,...a,children:r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c};var ju=h();let Mu=e=>{let t=(0,ju.c)(4),r;t[0]===e?r=t[1]:({...r}=e,t[0]=e,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,n.jsx)(vu,{...r}),t[2]=r,t[3]=i),i};var Nu=new WeakMap,Pu=new WeakMap,Fu={current:[]},Iu=!1,Lu=0,Ru=new Set,zu=new Map;function Bu(e){let t=Array.from(e).sort((e,t)=>e instanceof qu&&e.options.deps.includes(t)?1:t instanceof qu&&t.options.deps.includes(e)?-1:0);for(let e of t){if(Fu.current.includes(e))continue;Fu.current.push(e),e.recompute();let t=Pu.get(e);if(t)for(let e of t){let t=Nu.get(e);t&&Bu(t)}}}function Vu(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Hu(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Uu(e){if(Lu>0&&!zu.has(e)&&zu.set(e,e.prevState),Ru.add(e),!(Lu>0)&&!Iu)try{for(Iu=!0;Ru.size>0;){let e=Array.from(Ru);Ru.clear();for(let t of e)t.prevState=zu.get(t)??t.prevState,Vu(t);for(let t of e){let e=Nu.get(t);e&&(Fu.current.push(t),Bu(e))}for(let t of e){let e=Nu.get(t);if(e)for(let t of e)Hu(t)}}}finally{Iu=!1,Fu.current=[],zu.clear()}}function Wu(e){Lu++;try{e()}finally{if(Lu--,Lu===0){let e=Ru.values().next().value;e&&Uu(e)}}}function Gu(e){return typeof e==`function`}var Ku=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):Gu(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),Uu(this)}},qu=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 Ku){let e=Nu.get(n);e||(e=new Set,Nu.set(n,e)),e.add(this);let t=Pu.get(this);t||(t=new Set,Pu.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 Ku){let e=Nu.get(n);e&&e.delete(this);let t=Pu.get(this);t&&t.delete(n)}}},Ju=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 Yu(e,t){return new Ju(e,t).maybeExecute}var Xu=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)}},Zu=new class extends Xu{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function Qu(e,t){return typeof e==`function`?e(t):e}function $u(e,t){return ld(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function ed(e,t,n){let r=ld(t);function i(e){if(!r.length)return Qu(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 td(e,t){let n=ld(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,rd=/\.(\d+)(?=\.)/gm,id=/^(\d+)\./gm,ad=/\.(\d+$)/gm,od=/\.{2,}/gm,sd=`__int__`,cd=`${sd}$1`;function ld(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,cd).replace(rd,`.${cd}.`).replace(id,`${cd}.`).replace(ad,`.${cd}`).replace(od,`.`).split(`.`).map(e=>{if(e.startsWith(sd)){let t=e.substring(7),n=parseInt(t,10);return String(n)===t?n:t}return e})}function ud(e,t){return e.length===0?t:t.length===0?e:t.startsWith(`[`)||t.startsWith(`.`)?e+t:`${e}.${t}`}function dd(e){return!(Array.isArray(e)&&e.length===0)}function fd(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 pd(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 md=e=>!!e&&typeof e==`object`&&`fields`in e;function hd(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)||!hd(e[i],t[i]))return!1;return!0}var gd=({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},_d=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function vd(e,t){return e==null?t:{...e,...t}}for(var yd=256,bd=[],xd;yd--;)bd[yd]=(yd+256).toString(16).substring(1);function Sd(){let e=0,t,n=``;if(!xd||yd+16>256){for(xd=Array(256),e=256;e--;)xd[e]=256*Math.random()|0;e=0,yd=0}for(;e<16;e++)t=xd[yd+e],e===6?n+=bd[t&15|64]:e===8?n+=bd[t&63|128]:n+=bd[t],e&1&&e>1&&e<11&&(n+=`-`);return yd++,n}var Cd=Yu(e=>Zu.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300}),wd=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 Td(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 Ed=(e,t)=>{let n=Td(e,t);return{form:n,fields:n}},Dd={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:Ed(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:Ed(r.issues,e)}},Od=e=>!!e&&`~standard`in e,kd={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function Ad(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=()=>kd;return{handleArrayMove:t,handleArrayRemove:n,handleArraySwap:r,handleArrayInsert:i}}function jd(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 Md=class{constructor(e){this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{let e=this.fieldMetaDerived.mount(),t=this.store.mount(),n=this.store.subscribe(()=>{Cd(this)}),r=Zu.on(`request-form-state`,e=>{e.payload.id===this._formId&&Zu.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),i=Zu.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),a=Zu.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(),Zu.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:s}=this.options.validators||{};return Zu.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&&!hd(e.defaultValues,t.defaultValues)&&!this.state.isTouched,i=!hd(e.defaultState,t.defaultState)&&!this.state.isTouched;!r&&!i&&!n||(Wu(()=>{this.baseStore.setState(()=>jd(Object.assign({},this.state,i?e.defaultState:{},r?{values:e.defaultValues}:{},n?{_force_re_eval:!this.state._force_re_eval}:{})))}),Zu.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(()=>jd({...this.options.defaultState,values:e??this.options.defaultValues??this.options.defaultState?.values,fieldMetaBase:r}))},this.validateAllFields=async e=>{let t=[];return Wu(()=>{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 Wu(()=>{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=fd(e,{...this.options,form:this,validationLogic:this.options.validationLogic||wd}),n=!1,r={};return Wu(()=>{for(let e of t){if(!e.validate)continue;let{formError:t,fieldErrors:i}=Nd(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),a=Pd(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)??kd,o=i?.[e],{newErrorValue:s,newSource:c}=gd({newFormValidatorError:o,isPreviousErrorFromFormValidator:n?.[a]===`form`,previousErrorValue:t?.[a]});c===`form`&&(r[e]={...r[e],[a]:o}),t?.[a]!==s&&this.setFieldMeta(e,(e=kd)=>({...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=Pd(`submit`);this.state.errorMap?.[i]&&e!==`submit`&&!n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[i]:void 0}}));let a=Pd(`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=pd(e,{...this.options,form:this,validationLogic:this.options.validationLogic||wd});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let n=[],r;for(let e of t){if(!e.validate)continue;let t=Pd(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}=Nd(n);o&&(r=r?{...r,...o}:o);let s=Pd(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}=gd({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})),Wu(()=>{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}),Zu.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}),Zu.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}Wu(()=>{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}),Wu(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),Zu.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),Zu.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>$u(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]:Qu(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=kd,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;Wu(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:ed(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=td(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)],vd(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),Ad(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),vd(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),vd(n,{dontValidate:!0})),Ad(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 ed(ed(e,`${t}`,i),`${n}`,r)},vd(r,{dontValidate:!0})),Ad(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},vd(r,{dontValidate:!0})),Ad(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,[],vd(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]:kd},values:this.options.defaultValues?ed(t.values,e,$u(this.options.defaultValues,e)):t.values}))},this.setErrorMap=e=>{Wu(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(md(t)){let{formError:e,fieldErrors:r}=Nd(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=>Dd.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>Dd.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Sd(),this._devtoolsSubmissionOverride=!1,this.baseStore=new Ku(jd({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values})),this.fieldMetaDerived=new qu({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=$u(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=!dd(u),f=!t.isDirty,p=hd(l,$u(this.options.defaultValues,e))||hd(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 qu({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&&md(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&&hd(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 Od(e.validate)?Dd[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function Nd(e){return e?md(e)?{formError:Nd(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function Pd(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 Fd=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&&(hd(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,vd(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,vd(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,vd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,vd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,vd(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,vd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,vd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,vd(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=fd(e,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||wd}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=fd(e,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||wd});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;Wu(()=>{let e=(e,n)=>{let r=Ld(n.cause),a=n.validate?Id(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}=_d({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=Ld(`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=pd(e,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||wd}),r=await t,i=this.getLinkedFields(e),a=i.reduce((t,n)=>{let r=pd(e,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||wd});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=Ld(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=Id(o),c=r[this.name]?.[i],{newErrorValue:l,newSource:u}=_d({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[Ld(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=>Dd.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>Dd.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 qu({deps:[this.form.store],fn:()=>{let t=this.form.getFieldMeta(this.name)??{...kd,...e.defaultMeta},n=this.form.getFieldValue(this.name);return!t.isTouched&&n===void 0&&this.options.defaultValue!==void 0&&!hd(n,this.options.defaultValue)&&(n=this.options.defaultValue),{value:n,meta:t}}})}get state(){return this.store.state}runValidator(e){return Od(e.validate)?Dd[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 Id(e){if(e)return e}function Ld(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 Rd=class e{constructor(t){if(this.getFormFieldName=e=>{if(typeof this.fieldsMap==`string`)return ud(this.fieldsMap,e);let t=ld(e)[0];if(typeof t!=`string`)return``;let n=e.slice(t.length),r=this.fieldsMap[t];return ud(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 qu({deps:[this.form.store],fn:({currDepVals:e})=>{let t=e[0],n;if(typeof this.fieldsMap==`string`)n=$u(t.values,this.fieldsMap);else{n={};let e=this.fieldsMap;for(let r in e)n[r]=$u(t.values,e[r])}return{values:n}}})}get state(){return this.store.state}async handleSubmit(e){return this.form.handleSubmit(e)}},zd=Hc();function Bd(e,t=e=>e,n={}){let r=n.equal??Vd;return(0,zd.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,r)}function Vd(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=Hd(e);if(n.length!==Hd(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 Hd(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var Ud=typeof window<`u`?t.useLayoutEffect:t.useEffect;function Wd(e){let[n,r]=(0,t.useState)(()=>({form:e.form,name:e.name})),[i,a]=(0,t.useState)(()=>new Fd({...e}));(n.form!==e.form||n.name!==e.name)&&(a(new Fd({...e})),r({form:e.form,name:e.name}));let o=Bd(i.store,e.mode===`array`?e=>Object.keys(e.value??[]).length:e=>e.value),s=Bd(i.store,e=>e.meta.isTouched),c=Bd(i.store,e=>e.meta.isBlurred),l=Bd(i.store,e=>e.meta.isDirty),u=Bd(i.store,e=>e.meta.errorMap),d=Bd(i.store,e=>e.meta.errorSourceMap),f=Bd(i.store,e=>e.meta.isValidating),p=(0,t.useMemo)(()=>{let t={...i,get state(){return{value:e.mode===`array`?i.state.value:o,get meta(){return{...i.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}};return t.Field=Gd,t},[i,e.mode,o,s,c,l,u,d,f]);return Ud(i.mount,[i]),Ud(()=>{i.update(e)}),p}var Gd=(({children:e,...r})=>{let i=Wd(r);return(0,n.jsx)(n.Fragment,{children:(0,t.useMemo)(()=>Qu(e,i),[e,i])})});function Kd(){return(0,t.useState)(()=>Sd())[0]}var qd=t.version.split(`.`)[0]===`17`?Kd:t.useId;function Jd({form:e,selector:t,children:r}){return(0,n.jsx)(n.Fragment,{children:Qu(r,Bd(e.store,t))})}function Yd(e){let r=qd(),[i,a]=(0,t.useState)(e?.formId),[o,s]=(0,t.useState)(()=>new Md({...e,formId:e?.formId??r}));if(i!==e?.formId){let t=e?.formId??r;s(new Md({...e,formId:t})),a(t)}let c=(0,t.useMemo)(()=>{let e={...o,handleSubmit:((...e)=>o._handleSubmit(...e)),get formId(){return o._formId},get state(){return o.store.state}};return e.Field=function(e){return(0,n.jsx)(Gd,{...e,form:o})},e.Subscribe=function(e){return(0,n.jsx)(Jd,{form:o,selector:e.selector,children:e.children})},e},[o]);return Ud(o.mount,[]),Ud(()=>{o.update(e)}),c}function Xd({lens:e,selector:t,children:r}){return(0,n.jsx)(n.Fragment,{children:Qu(r,Bd(e.store,t))})}function Zd(e){let[r]=(0,t.useState)(()=>{let t=new Rd(e),i=e.form instanceof Rd?e.form.form:e.form,a=t;return a.AppForm=function(e){return(0,n.jsx)(i.AppForm,{...e})},a.AppField=function(e){return(0,n.jsx)(i.AppField,{...r.getFormFieldOptions(e)})},a.Field=function(e){return(0,n.jsx)(i.Field,{...r.getFormFieldOptions(e)})},a.Subscribe=function(e){return(0,n.jsx)(Xd,{lens:r,selector:e.selector,children:e.children})},Object.assign(a,{...e.formComponents})});return Ud(r.mount,[r]),r}var Qd=(0,t.createContext)(null),$d=(0,t.createContext)(null);function ef(){function e(){let e=(0,t.useContext)(Qd);if(!e)throw Error("`fieldContext` only works when within a `fieldComponent` passed to `createFormHook`");return e}function n(){let e=(0,t.useContext)($d);if(!e)throw Error("`formContext` only works when within a `formComponent` passed to `createFormHook`");return e}return{fieldContext:Qd,useFieldContext:e,useFormContext:n,formContext:$d}}function tf({fieldComponents:e,fieldContext:r,formContext:i,formComponents:a}){function o(o){let s=Yd(o),c=(0,t.useMemo)(()=>({children:e})=>(0,n.jsx)(i.Provider,{value:s,children:e}),[s]),l=(0,t.useMemo)(()=>(({children:t,...i})=>(0,n.jsx)(s.Field,{...i,children:i=>(0,n.jsx)(r.Provider,{value:i,children:t(Object.assign(i,e))})})),[s]);return(0,t.useMemo)(()=>Object.assign(s,{AppField:l,AppForm:c,...a}),[s,l,c])}function s({render:e,props:t}){return n=>e({...t,...n})}function c({render:e,props:n,defaultValues:r}){return function(i){let o=Zd((0,t.useMemo)(()=>({form:i.form,fields:i.fields,defaultValues:r,formComponents:a}),[i.form,i.fields]));return e({...n,...i,group:o})}}return{useAppForm:o,withForm:s,withFieldGroup:c}}let{fieldContext:nf,useFieldContext:rf,formContext:af,useFormContext:of}=ef();var sf=h();let cf=e=>{let t=(0,sf.c)(15),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s=rf(),c;t[5]===i?c=t[6]:(c=X(``,i),t[5]=i,t[6]=c);let l;t[7]===s.state.meta.errors?l=t[8]:(l=s.state.meta.errors.length>0&&(0,n.jsx)(`div`,{className:`mt-2`,children:s.state.meta.errors.map(lf)}),t[7]=s.state.meta.errors,t[8]=l);let u;return t[9]!==r||t[10]!==a||t[11]!==o||t[12]!==c||t[13]!==l?(u=(0,n.jsxs)(`div`,{className:c,ref:o,...a,children:[r,l]}),t[9]=r,t[10]=a,t[11]=o,t[12]=c,t[13]=l,t[14]=u):u=t[14],u};function lf(e,t){return(0,n.jsx)(`p`,{className:`text-error text-sm`,children:e.message},t)}function uf(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=ur(),o=bn(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}let df=t.forwardRef(function(e,n){let{render:r,className:i,id:a,name:o,value:s,disabled:c=!1,onValueChange:l,defaultValue:u,...d}=e,{state:f,name:p,disabled:m}=nr(),h=m||c,g=p??o,_=t.useMemo(()=>({...f,disabled:h}),[f,h]),{setTouched:v,setDirty:y,validityData:b,setFocused:x,setFilled:S,validationMode:C,validation:w}=nr(),{labelId:T}=ur(),E=uf({id:a});K(()=>{let e=s!=null;w.inputRef.current?.value||e&&s!==``?S(!0):e&&s===``&&S(!1)},[w.inputRef,S,s]);let[D,O]=cn({controlled:s,default:u,name:`FieldControl`,state:`value`}),k=s!==void 0,A=G((e,t)=>{l?.(e,t),!t.isCanceled&&O(e)});return cr({id:E,name:g,commit:w.commit,value:D,getValue:()=>w.inputRef.current?.value,controlRef:w.inputRef}),W(`input`,e,{ref:n,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,br(hr,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:pn})});process.env.NODE_ENV!==`production`&&(df.displayName=`FieldControl`);let ff=t.forwardRef(function(e,t){return(0,n.jsx)(df,{ref:t,...e})});process.env.NODE_ENV!==`production`&&(ff.displayName=`Input`);var pf=h();let mf=e=>{let t=(0,pf.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=X(``,i),t[5]=i,t[6]=s);let c;return t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,n.jsx)(`div`,{className:s,ref:o,...a,children:r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c};var hf=h();let gf=e=>{let r=(0,hf.c)(20),i,a,o,s,c;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({leadingIcon:a,showSeparator:c,className:i,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c);let l=c===void 0?!0:c,u=o.disabled,d=o.disabled,f;r[6]===i?f=r[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`,i),r[6]=i,r[7]=f);let p;r[8]!==a||r[9]!==l?(p=a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.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,t.createElement)(a,{weight:`bold`})}),l&&(0,n.jsx)(mf,{orientation:`vertical`,className:`group-focus-within:bg-primary`})]}),r[8]=a,r[9]=l,r[10]=p):p=r[10];let m;r[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`),r[11]=m):m=r[11];let h;r[12]!==o||r[13]!==s?(h=(0,n.jsx)(ff,{className:m,ref:s,...o}),r[12]=o,r[13]=s,r[14]=h):h=r[14];let g;return r[15]!==o.disabled||r[16]!==f||r[17]!==p||r[18]!==h?(g=(0,n.jsxs)(`div`,{"aria-disabled":u,"data-disabled":d,className:f,children:[p,h]}),r[15]=o.disabled,r[16]=f,r[17]=p,r[18]=h,r[19]=g):g=r[19],g};var _f=h();let vf=e=>{let t=(0,_f.c)(23),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s=rf(),c=s.name,l=s.name,u=s.state.value,d;t[5]===s?d=t[6]:(d=e=>s.handleChange(e.target.value),t[5]=s,t[6]=d);let f;t[7]===s?f=t[8]:(f=s.state.value&&s.getMeta().errors.length>0&&`outline-error`,t[7]=s,t[8]=f);let p;t[9]===s?p=t[10]:(p=s.state.value&&s.getMeta().isValid&&`outline-success`,t[9]=s,t[10]=p);let m;t[11]!==i||t[12]!==f||t[13]!==p?(m=X(f,p,i),t[11]=i,t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==r||t[16]!==s.name||t[17]!==s.state.value||t[18]!==a||t[19]!==o||t[20]!==d||t[21]!==m?(h=(0,n.jsx)(gf,{required:!0,type:`text`,id:c,name:l,value:u,onChange:d,className:m,ref:o,...a,children:r}),t[15]=r,t[16]=s.name,t[17]=s.state.value,t[18]=a,t[19]=o,t[20]=d,t[21]=m,t[22]=h):h=t[22],h};var yf=h();let bf=e=>{let t=(0,yf.c)(15),r,i,a,o,s;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({submittingText:s,className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let c=s===void 0?`Submitting...`:s,l=of(),u;t[6]!==r||t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==c?(u=e=>{let[t,s]=e;return(0,n.jsx)(sn,{type:`submit`,disabled:!t||s,className:X(`w-full`,i),ref:o,...a,children:s?c:r})},t[6]=r,t[7]=i,t[8]=a,t[9]=o,t[10]=c,t[11]=u):u=t[11];let d;return t[12]!==l.Subscribe||t[13]!==u?(d=(0,n.jsx)(l.Subscribe,{selector:xf,children:u}),t[12]=l.Subscribe,t[13]=u,t[14]=d):d=t[14],d};function xf(e){return[e.canSubmit,e.isSubmitting]}var Sf=h();let Cf=e=>{let t=(0,Sf.c)(17),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s=Bd(of().store,wf),c;t[5]===i?c=t[6]:(c=X(``,i),t[5]=i,t[6]=c);let l;t[7]===s?l=t[8]:(l=s.map(Tf),t[7]=s,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,n.jsx)(`div`,{className:`mt-2`,children:l}),t[9]=l,t[10]=u);let d;return t[11]!==r||t[12]!==a||t[13]!==o||t[14]!==c||t[15]!==u?(d=(0,n.jsxs)(`div`,{className:c,ref:o,...a,children:[r,u]}),t[11]=r,t[12]=a,t[13]=o,t[14]=c,t[15]=u,t[16]=d):d=t[16],d};function wf(e){return e.errors}function Tf(e,t){return(0,n.jsx)(`p`,{className:`text-error text-sm`,children:e.message},t)}let Ef=tf({fieldComponents:{FieldErrors:cf,FieldInput:vf},formComponents:{FormErrors:Cf,FormSubmit:bf},fieldContext:nf,formContext:af});var Df=h();let Of=e=>{let t=(0,Df.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=X(`hover:cursor-pointer`,i),t[5]=i,t[6]=s);let c;return t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,n.jsx)(`label`,{"data-slot":`label`,className:s,ref:o,...a,children:r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c};var kf=h();let Af=e=>{let t=(0,kf.c)(36),r,i,a,o,s,c,l,u,d;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9]):({className:i,imageUrl:o,fallbackText:a,profileName:l,profileEmail:u,compact:d,children:r,ref:c,...s}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d);let f=l===void 0?``:l,p=u===void 0?``:u,m=d===void 0?!1:d,h;t[10]===i?h=t[11]:(h=X(`flex items-center gap-xs transition-colors`,i),t[10]=i,t[11]=h);let g;t[12]===o?g=t[13]:(g=(0,n.jsx)(Yt,{src:o}),t[12]=o,t[13]=g);let _;t[14]===a?_=t[15]:(_=(0,n.jsx)(Zt,{children:a}),t[14]=a,t[15]=_);let v;t[16]!==r||t[17]!==g||t[18]!==_?(v=(0,n.jsxs)(qt,{children:[g,_,r]}),t[16]=r,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,n.jsx)(`span`,{className:`text-prose-0`,children:f}),t[22]=f,t[23]=x);let S;t[24]===p?S=t[25]:(S=(0,n.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,n.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]!==s||t[31]!==c||t[32]!==C||t[33]!==h||t[34]!==v?(w=(0,n.jsxs)(`button`,{className:h,ref:c,...s,children:[v,C]}),t[30]=s,t[31]=c,t[32]=C,t[33]=h,t[34]=v,t[35]=w):w=t[35],w},jf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(jf.displayName=`ScrollAreaRootContext`);function Mf(){let e=t.useContext(jf);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(53):`Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.`);return e}let Nf=function(e){return e.scrollAreaCornerHeight=`--scroll-area-corner-height`,e.scrollAreaCornerWidth=`--scroll-area-corner-width`,e}({});function Pf(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 Ff=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 If=`base-ui-disable-scrollbar`;let Lf={className:If,element:(0,n.jsx)(`style`,{href:If,precedence:`base-ui:low`,children:`.${If}{scrollbar-width:none}.${If}::-webkit-scrollbar{display:none}`})},Rf=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}({}),zf={hasOverflowX:e=>e?{[Rf.hasOverflowX]:``}:null,hasOverflowY:e=>e?{[Rf.hasOverflowY]:``}:null,overflowXStart:e=>e?{[Rf.overflowXStart]:``}:null,overflowXEnd:e=>e?{[Rf.overflowXEnd]:``}:null,overflowYStart:e=>e?{[Rf.overflowYStart]:``}:null,overflowYEnd:e=>e?{[Rf.overflowYEnd]:``}:null,cornerHidden:()=>null};var Bf={width:0,height:0},Vf={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1};let Hf=t.forwardRef(function(e,r){let{render:i,className:a,overflowEdgeThreshold:o,...s}=e,[c,l]=t.useState(!1),[u,d]=t.useState(!1),[f,p]=t.useState(!1),[m,h]=t.useState(Bf),[g,_]=t.useState(Bf),[v,y]=t.useState(!1),[b,x]=t.useState(Vf),S=bn(),C=t.useRef(null),w=t.useRef(null),T=t.useRef(null),E=t.useRef(null),D=t.useRef(null),O=t.useRef(null),k=t.useRef(null),A=t.useRef(!1),j=t.useRef(0),M=t.useRef(0),N=t.useRef(0),P=t.useRef(0),F=t.useRef(`vertical`),ee=Ce(),te=Ce(),ne=t.useRef({x:0,y:0}),[I,L]=t.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),R=Uf(o),re=G(e=>{let t=e.x-ne.current.x,n=e.y-ne.current.y;ne.current=e,n!==0&&(p(!0),ee.start(500,()=>{p(!1)})),t!==0&&(d(!0),te.start(500,()=>{d(!1)}))}),z=G(e=>{e.button===0&&(A.current=!0,j.current=e.clientY,M.current=e.clientX,F.current=e.currentTarget.getAttribute(Ff.orientation),w.current&&(N.current=w.current.scrollTop,P.current=w.current.scrollLeft),D.current&&F.current===`vertical`&&D.current.setPointerCapture(e.pointerId),O.current&&F.current===`horizontal`&&O.current.setPointerCapture(e.pointerId))}),B=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&&F.current===`vertical`){let n=Pf(T.current,`padding`,`y`),a=Pf(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),ee.start(500,()=>{p(!1)})}if(O.current&&E.current&&F.current===`horizontal`){let t=Pf(E.current,`padding`,`x`),r=Pf(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),te.start(500,()=>{d(!1)})}}}),V=G(e=>{A.current=!1,D.current&&F.current===`vertical`&&D.current.releasePointerCapture(e.pointerId),O.current&&F.current===`horizontal`&&O.current.releasePointerCapture(e.pointerId)});function H(e){let t=e.pointerType===`touch`;y(t),t||l(Q(C.current,e.target))}let U=t.useMemo(()=>({hasOverflowX:!I.scrollbarXHidden,hasOverflowY:!I.scrollbarYHidden,overflowXStart:b.xStart,overflowXEnd:b.xEnd,overflowYStart:b.yStart,overflowYEnd:b.yEnd,cornerHidden:I.cornerHidden}),[I.scrollbarXHidden,I.scrollbarYHidden,I.cornerHidden,b]),ie={role:`presentation`,onPointerEnter:H,onPointerMove:H,onPointerDown({pointerType:e}){y(e===`touch`)},onPointerLeave(){l(!1)},style:{position:`relative`,[Nf.scrollAreaCornerHeight]:`${m.height}px`,[Nf.scrollAreaCornerWidth]:`${m.width}px`}},ae=W(`div`,e,{state:U,ref:[r,C],props:[ie,s],stateAttributesMapping:zf}),oe=t.useMemo(()=>({handlePointerDown:z,handlePointerMove:B,handlePointerUp:V,handleScroll:re,cornerSize:m,setCornerSize:h,thumbSize:g,setThumbSize:_,touchModality:v,cornerRef:k,scrollingX:u,setScrollingX:d,scrollingY:f,setScrollingY:p,hovering:c,setHovering:l,viewportRef:w,rootRef:C,scrollbarYRef:T,scrollbarXRef:E,thumbYRef:D,thumbXRef:O,rootId:S,hiddenState:I,setHiddenState:L,overflowEdges:b,setOverflowEdges:x,viewportState:U,overflowEdgeThreshold:R}),[z,B,V,re,m,g,v,k,u,d,f,p,c,l,w,C,T,E,D,O,S,I,b,U,R]);return(0,n.jsxs)(jf.Provider,{value:oe,children:[Lf.element,ae]})});process.env.NODE_ENV!==`production`&&(Hf.displayName=`ScrollAreaRoot`);function Uf(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)}}let Wf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Wf.displayName=`ScrollAreaViewportContext`);let Gf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Gf.displayName=`DirectionContext`);function Kf(){return t.useContext(Gf)?.direction??`ltr`}function qf(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Jf(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 Yf=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 Xf=!1;function Zf(){Xf||hi||(typeof CSS<`u`&&`registerProperty`in CSS&&[Yf.scrollAreaOverflowXStart,Yf.scrollAreaOverflowXEnd,Yf.scrollAreaOverflowYStart,Yf.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),Xf=!0)}let Qf=t.forwardRef(function(e,i){let{render:a,className:o,...s}=e,{viewportRef:c,scrollbarYRef:l,scrollbarXRef:u,thumbYRef:d,thumbXRef:f,cornerRef:p,setCornerSize:m,setThumbSize:h,rootId:g,setHiddenState:_,hiddenState:v,handleScroll:y,setHovering:b,setOverflowEdges:x,overflowEdges:S,overflowEdgeThreshold:C}=Mf(),w=Kf(),T=t.useRef(!0),E=Ce(),D=Ce();function O(){let e=c.current,t=l.current,n=u.current,r=d.current,i=f.current,a=p.current;if(!e)return;let o=e.scrollHeight,s=e.scrollWidth,g=e.clientHeight,v=e.clientWidth,y=e.scrollTop,b=e.scrollLeft;if(o===0||s===0)return;let S=g>=o,T=v>=s,E=v/s,D=g/o,O=Math.max(0,s-v),k=Math.max(0,o-g),A=0,j=0;T||(A=qf(w===`rtl`?-b:b,0,O),j=O-A);let M=S?0:qf(y,0,k),N=S?0:k-M,P=T?0:v,F=S?0:g,ee=Pf(n,`padding`,`x`),te=Pf(t,`padding`,`y`),ne=Pf(i,`margin`,`x`),I=Pf(r,`margin`,`y`),L=P-ee-ne,R=F-te-I,re=n?Math.min(n.offsetWidth,L):L,z=t?Math.min(t.offsetHeight,R):R,B=Math.max(16,re*E),V=Math.max(16,z*D);if(h(e=>e.height===V&&e.width===B?e:{width:B,height:V}),t&&r){let e=t.offsetHeight-V-te-I,n=o-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-B-ee-ne,t=s-v,r=t===0?0:b/t,a=w===`rtl`?qf(r*e,-e,0):qf(r*e,0,e);i.style.transform=`translate3d(${a}px,0,0)`}let H=qf(A,0,O),U=qf(j,0,O),ie=qf(M,0,k),ae=qf(N,0,k),W=[[Yf.scrollAreaOverflowXStart,H],[Yf.scrollAreaOverflowXEnd,U],[Yf.scrollAreaOverflowYStart,ie],[Yf.scrollAreaOverflowYEnd,ae]];for(let[t,n]of W)e.style.setProperty(t,`${n}px`);a&&(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&&H>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(()=>{r.flushSync(O)});K(()=>{if(c.current)return Zf(),Jf(c.current,k)},[k,c]),K(()=>{queueMicrotask(k)},[k,v,w]),K(()=>{c.current?.matches(`:hover`)&&b(!0)},[c,b]),t.useEffect(()=>{let e=c.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,c,D]);function A(){T.current=!1}let j={role:`presentation`,...g&&{"data-id":`${g}-viewport`},...(!v.scrollbarXHidden||!v.scrollbarYHidden)&&{tabIndex:0},className:Lf.className,style:{overflow:`scroll`},onScroll(){c.current&&(k(),T.current||y({x:c.current.scrollLeft,y:c.current.scrollTop}),E.start(100,()=>{T.current=!0}))},onWheel:A,onTouchMove:A,onPointerMove:A,onPointerEnter:A,onKeyDown:A},M=t.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:[i,c],state:M,props:[j,s],stateAttributesMapping:zf}),P=t.useMemo(()=>({computeThumbPosition:k}),[k]);return(0,n.jsx)(Wf.Provider,{value:P,children:N})});process.env.NODE_ENV!==`production`&&(Qf.displayName=`ScrollAreaViewport`);let $f=t.createContext(void 0);process.env.NODE_ENV!==`production`&&($f.displayName=`ScrollAreaScrollbarContext`);function ep(){let e=t.useContext($f);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(54):`Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.`);return e}let tp=function(e){return e.scrollAreaThumbHeight=`--scroll-area-thumb-height`,e.scrollAreaThumbWidth=`--scroll-area-thumb-width`,e}({}),np=t.forwardRef(function(e,r){let{render:i,className:a,orientation:o=`vertical`,keepMounted:s=!1,...c}=e,{hovering:l,scrollingX:u,scrollingY:d,hiddenState:f,overflowEdges:p,scrollbarYRef:m,scrollbarXRef:h,viewportRef:g,thumbYRef:_,thumbXRef:v,handlePointerDown:y,handlePointerUp:b,rootId:x,thumbSize:S}=Mf(),C=t.useMemo(()=>({hovering:l,scrolling:{horizontal:u,vertical:d}[o],orientation:o,hasOverflowX:!f.scrollbarXHidden,hasOverflowY:!f.scrollbarYHidden,overflowXStart:p.xStart,overflowXEnd:p.xEnd,overflowYStart:p.yStart,overflowYEnd:p.yEnd,cornerHidden:f.cornerHidden}),[l,u,d,o,f,p]),w=Kf();t.useEffect(()=>{let e=g.current,t=o===`vertical`?m.current:h.current;if(!t)return;function n(n){if(!(!e||!t||n.ctrlKey)){if(n.preventDefault(),o===`vertical`){if(e.scrollTop===0&&n.deltaY<0)return}else if(e.scrollLeft===0&&n.deltaX<0)return;if(o===`vertical`){if(e.scrollTop===e.scrollHeight-e.clientHeight&&n.deltaY>0)return}else if(e.scrollLeft===e.scrollWidth-e.clientWidth&&n.deltaX>0)return;o===`vertical`?e.scrollTop+=n.deltaY:e.scrollLeft+=n.deltaX}}return t.addEventListener(`wheel`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n)}},[o,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&&o===`vertical`){let t=Pf(_.current,`margin`,`y`),n=Pf(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&&o===`horizontal`){let t=Pf(v.current,`margin`,`x`),n=Pf(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`,...o===`vertical`&&{top:0,bottom:`var(${Nf.scrollAreaCornerHeight})`,insetInlineEnd:0,[tp.scrollAreaThumbHeight]:`${S.height}px`},...o===`horizontal`&&{insetInlineStart:0,insetInlineEnd:`var(${Nf.scrollAreaCornerWidth})`,bottom:0,[tp.scrollAreaThumbWidth]:`${S.width}px`}}},E=W(`div`,e,{ref:[r,o===`vertical`?m:h],state:C,props:[T,c],stateAttributesMapping:zf}),D=t.useMemo(()=>({orientation:o}),[o]),O=o===`vertical`?f.scrollbarYHidden:f.scrollbarXHidden;return s||!O?(0,n.jsx)($f.Provider,{value:D,children:E}):null});process.env.NODE_ENV!==`production`&&(np.displayName=`ScrollAreaScrollbar`);let rp=t.forwardRef(function(e,n){let{render:r,className:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,setScrollingX:d,setScrollingY:f}=Mf(),{orientation:p}=ep(),m=t.useMemo(()=>({orientation:p}),[p]);return W(`div`,e,{ref:[n,p===`vertical`?o:s],state:m,props:[{onPointerDown:c,onPointerMove:l,onPointerUp(e){p===`vertical`&&f(!1),p===`horizontal`&&d(!1),u(e)},style:{...p===`vertical`&&{height:`var(${tp.scrollAreaThumbHeight})`},...p===`horizontal`&&{width:`var(${tp.scrollAreaThumbWidth})`}}},a]})});process.env.NODE_ENV!==`production`&&(rp.displayName=`ScrollAreaThumb`);let ip=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{cornerRef:a,cornerSize:o,hiddenState:s}=Mf(),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`&&(ip.displayName=`ScrollAreaCorner`);var ap=h();let op=e=>{let t=(0,ap.c)(26),r,i,a,o,s;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({orientation:s,className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let c=s===void 0?`vertical`:s,l=c===`horizontal`&&`h-full`,u;t[6]!==i||t[7]!==l?(u=X(`h-[200px] rounded-lg bg-surface-container`,l,i),t[6]=i,t[7]=l,t[8]=u):u=t[8];let d;t[9]===r?d=t[10]:(d=(0,n.jsx)(Qf,{className:`h-full overscroll-contain flex flex-col gap-xs py-2xs pr-sm pl-sm prose-step-0`,children:r}),t[9]=r,t[10]=d);let f=c===`vertical`&&`w-2xs mr-2xs my-2xs`,p=c===`horizontal`&&`h-2xs flex-col mb-2xs mx-xs`,m;t[11]!==i||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,i),t[11]=i,t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,n.jsx)(rp,{className:`w-full h-full rounded-full bg-accent rounded-1`}),t[15]=h):h=t[15];let g;t[16]!==c||t[17]!==m?(g=(0,n.jsx)(np,{orientation:c,className:m,children:h}),t[16]=c,t[17]=m,t[18]=g):g=t[18];let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,n.jsx)(ip,{}),t[19]=_):_=t[19];let v;return t[20]!==a||t[21]!==o||t[22]!==u||t[23]!==d||t[24]!==g?(v=(0,n.jsxs)(Hf,{className:u,ref:o,...a,children:[d,g,_]}),t[20]=a,t[21]=o,t[22]=u,t[23]=d,t[24]=g,t[25]=v):v=t[25],v},sp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(sp.displayName=`TooltipRootContext`);function cp(e){let n=t.useContext(sp);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?g(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return n}var lp={...sl,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 Xc{constructor(e){super({...dp(),...e},{popupRef:t.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new il},lp)}setOpen=(e,t)=>{let n=t.reason,i=n===_r,a=e&&n===`trigger-focus`,o=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let s=()=>{let r={open:e,openChangeReason:n};a?r.instantType=`focus`:o?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)};i?r.flushSync(s):s()};static useStore(t,n){let r=v(()=>t??new e(n)).current,i=ul({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function dp(){return{...ol(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function fp(e){let{disabled:r=!1,defaultOpen:i=!1,open:a,disableHoverablePopup:o=!1,trackCursorAxis:s=`none`,actionsRef:c,onOpenChange:l,onOpenChangeComplete:u,handle:d,triggerId:f,defaultTriggerId:p=null,children:m}=e,h=up.useStore(d?.store,{open:a??i,activeTriggerId:f===void 0?p:f});h.useControlledProp(`open`,a,i),h.useControlledProp(`activeTriggerId`,f,p),h.useContextCallback(`onOpenChange`,l),h.useContextCallback(`onOpenChangeComplete`,u);let g=h.useState(`open`),_=h.useState(`activeTriggerId`),v=h.useState(`payload`);h.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:o});let y=!r&&g;K(()=>{g&&r&&h.setOpen(!1,br(`disabled`))},[g,r,h]),h.useSyncedValue(`disabled`,r),nl(h);let{forceUnmount:b,transitionStatus:x}=rl(y,h),S=h.useState(`isInstantPhase`),C=h.useState(`instantType`),w=h.useState(`lastOpenChangeReason`),T=t.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=t.useCallback(()=>{h.setOpen(!1,pp(h,yr))},[h]);t.useImperativeHandle(c,()=>({unmount:b,close:E}),[b,E]);let D=h.useState(`floatingRootContext`),{getReferenceProps:O,getFloatingProps:k,getTriggerProps:A}=Cl([fl(D,{enabled:!r}),dc(D,{enabled:!r,referencePress:!0}),$o(D,{enabled:!r&&s!==`none`,axis:s===`none`?void 0:s})]),j=t.useMemo(()=>O(),[O]),M=t.useMemo(()=>A(),[A]),N=t.useMemo(()=>k(),[k]);return h.useSyncedValues({floatingRootContext:D,activeTriggerProps:j,inactiveTriggerProps:M,popupProps:N}),(0,n.jsx)(sp.Provider,{value:h,children:typeof m==`function`?m({payload:v}):m})}function pp(e,t){let n=br(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}let mp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(mp.displayName=`TooltipProviderContext`);function hp(){return t.useContext(mp)}let gp=t.forwardRef(function(e,n){let{className:r,render:i,handle:a,payload:o,disabled:s,delay:c,closeDelay:l,id:u,...d}=e,f=cp(!0),p=a?.store??f;if(!p)throw Error(process.env.NODE_ENV===`production`?g(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let m=bn(u),h=p.useState(`isTriggerActive`,m),_=p.useState(`floatingRootContext`),v=p.useState(`isOpenedByTrigger`,m),y=t.useRef(null),b=c??600,x=l??0,{registerTrigger:S,isMountedByThisTrigger:C}=tl(m,y,p,{payload:o,closeDelay:x}),w=hp(),{delayRef:T,isInstantPhase:E,hasProvider:D}=xo(_,{open:v});p.useSyncedValue(`isInstantPhase`,E);let O=p.useState(`disabled`),k=s??O,A=p.useState(`trackCursorAxis`),j=p.useState(`disableHoverablePopup`),M=Sl(_,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?Al():null,restMs(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return D&&(n=t===0?0:c??e??b),n},delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return l==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:h}),N=t.useMemo(()=>({open:v}),[v]),P=p.useState(`triggerProps`,C);return W(`button`,e,{state:N,ref:[n,S,y],props:[M,P,{id:m},d],stateAttributesMapping:ai})});process.env.NODE_ENV!==`production`&&(gp.displayName=`TooltipTrigger`);let _p=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(_p.displayName=`TooltipPortalContext`);function vp(){let e=t.useContext(_p);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(70):`Base UI: <Tooltip.Portal> is missing.`);return e}let yp=t.forwardRef(function(e,i){let{children:a,container:o,className:s,render:c,...l}=e,{portalNode:u,portalSubtree:d}=Ro({container:o,ref:i,componentProps:e,elementProps:l});return!d&&!u?null:(0,n.jsxs)(t.Fragment,{children:[d,u&&r.createPortal(a,u)]})});process.env.NODE_ENV!==`production`&&(yp.displayName=`FloatingPortalLite`);let bp=t.forwardRef(function(e,t){let{keepMounted:r=!1,...i}=e;return cp().useState(`mounted`)||r?(0,n.jsx)(_p.Provider,{value:r,children:(0,n.jsx)(yp,{ref:t,...i})}):null});process.env.NODE_ENV!==`production`&&(bp.displayName=`TooltipPortal`);let xp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(xp.displayName=`TooltipPositionerContext`);function Sp(){let e=t.useContext(xp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}let Cp=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`}=Zi(e,t)||{};if(l==null)return{};let f=ga(u),p={x:n,y:r},m=ia(i),h=ta(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=Xi(k,j,A),N=!c.arrow&&$i(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}}}),wp=(e,t)=>({...Cp(e),options:[e,t]}),Tp={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 cc().fn(e)).data?.referenceHidden||a}}}},Ep={sideX:`left`,sideY:`top`},Dp={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Cn(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Ep};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=So(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Qi(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`:Ep.sideX,g=f===`top`?`bottom`:Ep.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Op(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 kp(e,t,n){let{rects:r,placement:i}=e;return{side:Op(t,Qi(i),n),align:$i(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ap(e){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=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]=t.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,D=typeof n==`function`?n:void 0,O=G(D),k=D?O:n,A=Cr(n),j=Kf()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[i],N=o===`center`?M:`${M}-${o}`,P=l,F=i===`bottom`?1:0,ee=i===`top`?1:0,te=i===`right`?1:0,ne=i===`left`?1:0;typeof P==`number`?P={top:P+F,right:P+ne,bottom:P+ee,left:P+te}:P&&={top:(P.top||0)+F,right:(P.right||0)+ne,bottom:(P.bottom||0)+ee,left:(P.left||0)+te};let I={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:P},L=t.useRef(null),R=Cr(a),re=Cr(s),z=[rc(e=>{let t=kp(e,i,j),n=typeof R.current==`function`?R.current(t):R.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[typeof a==`function`?0:a,typeof s==`function`?0:s,j,i])],B=T===`none`&&w!==`shift`,V=!B&&(u||_||w===`shift`),H=w===`none`?null:oc({...I,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=B?null:ic(e=>{let t=So(e.elements.floating).documentElement;return{...I,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:V,limiter:u||_?void 0:ac(e=>{if(!L.current)return{};let{width:t,height:n}=L.current.getBoundingClientRect(),r=ra(Qi(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[I,u,_,P,T]);w===`shift`||T===`shift`||o===`center`?z.push(U,H):z.push(H,U),z.push(sc({...I,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)})}}),wp(()=>({element:L.current||document.createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Qi(r),l=ra(c),u=L.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 a==`function`?a(kp(e,i,j)):a,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`,V&&l===`y`&&b?S:x),{}}},Tp,y),K(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);let ie=t.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}=ll({rootContext:m,placement:N,middleware:z,strategy:r,whileElementsMounted:p?void 0:(...e)=>Us(...e,ie),nodeId:v,externalTree:x}),{sideX:me,sideY:he}=ce.adaptiveOrigin||Ep,ge=fe?r:`fixed`,_e=t.useMemo(()=>y?{position:ge,[me]:oe,[he]:se}:{position:ge,...pe},[y,ge,me,oe,he,se,pe]),ve=t.useRef(null);K(()=>{if(!h)return;let e=A.current,t=typeof e==`function`?e():e,n=(jp(t)?t.current:t)||null;n!==ve.current&&(ae.setPositionReference(n),ve.current=n)},[h,ae,k,A]),t.useEffect(()=>{if(!h)return;let e=A.current;typeof e!=`function`&&jp(e)&&e.current!==ve.current&&(ae.setPositionReference(e.current),ve.current=e.current)},[h,ae,k,A]),t.useEffect(()=>{if(p&&h&&W.domReference&&W.floating)return Us(W.domReference,W.floating,le,ie)},[p,h,W,le,ie]);let ye=Qi(ue),be=Op(i,ye,j),xe=$i(ue)||`center`,Se=!!ce.hide?.referenceHidden;K(()=>{b&&h&&fe&&C(ye)},[b,h,fe,ye]);let Ce=t.useMemo(()=>({position:`absolute`,top:ce.arrow?.y,left:ce.arrow?.x}),[ce.arrow]),we=ce.arrow?.centerOffset!==0;return t.useMemo(()=>({positionerStyles:_e,arrowStyles:Ce,arrowRef:L,arrowUncentered:we,side:be,align:xe,physicalSide:ye,anchorHidden:Se,refs:ae,context:de,isPositioned:fe,update:le}),[_e,Ce,L,we,be,xe,ye,Se,ae,de,fe,le])}function jp(e){return e!=null&&`current`in e}function Mp(e){return e===`starting`?U:H}let Np=t.forwardRef(function(e,r){let{render:i,className:a,anchor:o,positionMethod:s=`absolute`,side:c=`top`,align:l=`center`,sideOffset:u=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=cp(),b=vp(),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=Ap({anchor:o,positionMethod:s,floatingRootContext:T,mounted:S,side:c,sideOffset:u,align:l,alignOffset:d,collisionBoundary:f,collisionPadding:p,sticky:h,arrowPadding:m,disableAnchorTracking:g,keepMounted:b,collisionAvoidance:_,adaptiveOrigin:Dp}),k=t.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=t.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=t.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,Mp(D),v],ref:[r,y.useStateSetter(`positionerElement`)],stateAttributesMapping:oi});return(0,n.jsx)(xp.Provider,{value:j,children:M})});process.env.NODE_ENV!==`production`&&(Np.displayName=`TooltipPositioner`);function Pp(e){let t=Hn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=En(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(Gi(n)!==a||Gi(r)!==o)&&(n=a,r=o),{width:n,height:r}}var Fp=typeof ResizeObserver<`u`,Ip=()=>!0;function Lp(e){let{popupElement:n,positionerElement:r,content:i,mounted:a,enabled:o=Ip,onMeasureLayout:s,onMeasureLayoutComplete:c,side:l,direction:u}=e,d=t.useRef(!0),f=jr(n,!0,!1),p=kr(),m=t.useRef(null),h=G(s),g=G(c),_=t.useMemo(()=>{let e=l===`top`,t=l===`left`;return u===`rtl`?(e||=l===`inline-end`,t||=l===`inline-end`):(e||=l===`inline-start`,t||=l===`inline-start`),e?{position:`absolute`,[l===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:H},[l,u]);K(()=>{if(!a||!o()||!Fp){d.current=!0,m.current=null;return}if(!n||!r)return;Object.entries(_).forEach(([e,t])=>{n.style.setProperty(e,t)});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(n),n.style.setProperty(`--popup-width`,`auto`),n.style.setProperty(`--popup-height`,`auto`);let t=Rp(n,`position`,`static`),i=Rp(n,`transform`,`none`),s=Rp(n,`scale`,`1`),c=Rp(r,`--available-width`,`max-content`),l=Rp(r,`--available-height`,`max-content`);if(h?.(),d.current||m.current===null){r.style.setProperty(`--positioner-width`,`max-content`),r.style.setProperty(`--positioner-height`,`max-content`);let a=Pp(n);return r.style.setProperty(`--positioner-width`,`${a.width}px`),r.style.setProperty(`--positioner-height`,`${a.height}px`),t(),i(),s(),c(),l(),g?.(null,a),d.current=!1,()=>{e.disconnect()}}n.style.setProperty(`--popup-width`,`auto`),n.style.setProperty(`--popup-height`,`auto`),r.style.setProperty(`--positioner-width`,`max-content`),r.style.setProperty(`--positioner-height`,`max-content`);let u=Pp(n);n.style.setProperty(`--popup-width`,`${m.current.width}px`),n.style.setProperty(`--popup-height`,`${m.current.height}px`),t(),i(),c(),l(),g?.(m.current,u),r.style.setProperty(`--positioner-width`,`${u.width}px`),r.style.setProperty(`--positioner-height`,`${u.height}px`);let v=new AbortController;return p.request(()=>{n.style.setProperty(`--popup-width`,`${u.width}px`),n.style.setProperty(`--popup-height`,`${u.height}px`),f(()=>{n.style.setProperty(`--popup-width`,`auto`),n.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),p.cancel()}},[i,n,r,f,p,o,a,h,g,_])}function Rp(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var zp={...oi,...Lr};let Bp=t.forwardRef(function(e,n){let{className:r,render:i,...a}=e,o=cp(),{side:s,align:c}=Sp(),l=o.useState(`open`),u=o.useState(`mounted`),d=o.useState(`instantType`),f=o.useState(`transitionStatus`),p=o.useState(`popupProps`),m=o.useState(`payload`),h=o.useState(`popupElement`),g=o.useState(`positionerElement`),_=o.useState(`floatingRootContext`),v=Kf();Mr({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}});function y(){_.context.events.emit(`measure-layout`)}function b(e,t){_.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}Lp({popupElement:h,positionerElement:g,mounted:u,content:m,enabled:t.useCallback(()=>o.context.triggerElements.size>1,[o]),onMeasureLayout:y,onMeasureLayoutComplete:b,side:s,direction:v});let x=o.useState(`disabled`),S=o.useState(`closeDelay`);return vl(_,{enabled:!x,closeDelay:S}),W(`div`,e,{state:t.useMemo(()=>({open:l,side:s,align:c,instant:d,transitionStatus:f}),[l,s,c,d,f]),ref:[n,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[p,Mp(f),a],stateAttributesMapping:zp})});process.env.NODE_ENV!==`production`&&(Bp.displayName=`TooltipPopup`);let Vp=t.forwardRef(function(e,n){let{className:r,render:i,...a}=e,o=cp().useState(`instantType`),{open:s,arrowRef:c,side:l,align:u,arrowUncentered:d,arrowStyles:f}=Sp();return W(`div`,e,{state:t.useMemo(()=>({open:s,side:l,align:u,uncentered:d,instant:o}),[s,l,u,d,o]),ref:[n,c],props:[{style:f,"aria-hidden":!0},a],stateAttributesMapping:oi})});process.env.NODE_ENV!==`production`&&(Vp.displayName=`TooltipArrow`);let Hp=function(e){let{delay:r,closeDelay:i,timeout:a=400}=e,o=t.useMemo(()=>({delay:r,closeDelay:i}),[r,i]),s=t.useMemo(()=>({open:r,close:i}),[r,i]);return(0,n.jsx)(mp.Provider,{value:o,children:(0,n.jsx)(bo,{delay:s,timeoutMs:a,children:e.children})})};process.env.NODE_ENV!==`production`&&(Hp.displayName=`TooltipProvider`);var Up=h();let Wp=e=>{let t=(0,Up.c)(6),r,i;t[0]===e?(r=t[1],i=t[2]):({children:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;return t[3]!==r||t[4]!==i?(a=(0,n.jsx)(Hp,{children:(0,n.jsx)(fp,{...i,children:r})}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a};var Gp=h();let Kp=e=>{let t=(0,Gp.c)(6),r,i;t[0]===e?(r=t[1],i=t[2]):({children:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;return t[3]!==r||t[4]!==i?(a=(0,n.jsx)(gp,{...i,children:r}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a};var qp=h();let Jp=e=>{let t=(0,qp.c)(11),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:i,children:r,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===i?o=t[5]:(o=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`,i),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,n.jsx)(Vp,{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,n.jsx)(Kr,{weight:`fill`,className:`fill-surface-container-high `})}),t[6]=s):s=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==o?(c=(0,n.jsx)(bp,{children:(0,n.jsx)(Np,{sideOffset:10,children:(0,n.jsxs)(Bp,{className:o,...a,children:[s,r]})})}),t[7]=r,t[8]=a,t[9]=o,t[10]=c):c=t[10],c},Yp=({sliderInstance:e,isActive:r,onKeyDownHandler:i,onMouseDownHandler:a,onTouchStart:o,value:s,className:c,children:l,ref:u,...d})=>{let[f,p]=(0,t.useState)(!1);return(0,n.jsxs)(Wp,{open:r||f,trackCursorAxis:`x`,children:[(0,n.jsx)(Kp,{render:(0,n.jsx)(`button`,{onKeyDown:i,onMouseDown:a,onTouchStart:o,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),role:`slider`,"aria-valuemin":e.options.min,"aria-valuemax":e.options.max,"aria-valuenow":s,style:{left:`${e.getPercentageForValue(s)}%`,zIndex:r?`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`,r?`size-md shadow-4-shadow`:`size-sm shadow-1-shadow`,c),ref:u,...d,children:l})}),(0,n.jsx)(Jp,{children:(0,n.jsx)(`span`,{children:s})})]})},Xp=({index:e,steps:t,left:r,width:i,className:a,children:o,ref:s,...c})=>(0,n.jsx)(`div`,{className:X(`absolute bg-primary h-full rounded-full inset-shadow-1-shadow`,a),style:{background:`${e===t-1?`transparent`:`var(--color-primary)`}`,left:`${r}%`,width:`${i}%`},ref:s,...c,children:o}),Zp=({className:e,children:t,ref:r,...i})=>(0,n.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:r,...i,children:t}),Qp=({percentage:e,className:t,children:r,ref:i,...a})=>(0,n.jsxs)(`div`,{className:X(`absolute top-2xs -translate-x-1/2`,t),ref:i,...a,style:{left:`${e}%`},children:[(0,n.jsx)(`span`,{className:`absolute bg-on-surface-variant rounded-full left-0 h-2xs w-[2px] -translate-x-1/2 translate-y-[0.7rem]`}),r]}),$p=({className:e,children:t,sliderRef:r,...i})=>(0,n.jsx)(`div`,{className:X(`relative h-2xs inset-shadow-1-shadow rounded-full bg-surface-dim grow`,e),ref:r,...i,children:t});var em=e=>{let t=e.getBoundingClientRect();return{left:Math.ceil(t.left),width:Math.ceil(t.width)}},tm=e=>[...e].map(Number).sort((e,t)=>e-t),nm={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}},rm=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=em(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=tm([...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=tm(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=tm(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:nm,onChange:()=>{},...e}}},im=typeof window<`u`?t.useLayoutEffect:t.useEffect;function am(e){let n=t.useReducer(()=>({}),{})[1],r={...e,rerender:n,onChange:t=>{n(),e.onChange?.(t)}},[i]=t.useState(()=>new rm(r));return i.setOptions(r),im(()=>i._willUpdate()),i}let om=({leadingIcon:e,trailingIcon:r,min:i,max:a,stepSize:o,defaultValues:s,showTickLabels:c,label:l,className:u,ref:d,...f})=>{let p=(0,t.useRef)(null),[m,h]=(0,t.useState)(s||[50]),g=am({getRangerElement:()=>p.current,values:m,min:i??0,max:a??100,stepSize:o??1,onChange:e=>{h(e.sortedValues)}});return(0,n.jsxs)(`div`,{ref:d,className:X(`space-y-2xs`,u),...f,children:[l&&(0,n.jsx)(`p`,{className:`style-text-default--1 text-on-surface-variant`,children:l}),(0,n.jsxs)(`div`,{className:`flex items-center w-full gap-sm`,children:[e&&(0,n.jsx)(e,{className:`size-sm`,weight:`bold`}),(0,n.jsxs)($p,{sliderRef:p,children:[c&&g.getTicks().map(({value:e,key:t,percentage:r})=>(0,n.jsx)(Qp,{percentage:r,children:(0,n.jsx)(Zp,{children:e})},t)),g.getSteps().map(({left:e,width:t},r)=>(0,n.jsx)(Xp,{index:r,steps:g.getSteps().length,left:e,width:t},r)),g.handles().map(({isActive:e,onKeyDownHandler:t,onMouseDownHandler:r,onTouchStart:i,value:a},o)=>(0,n.jsx)(Yp,{sliderInstance:g,isActive:e,onKeyDownHandler:t,onMouseDownHandler:r,onTouchStart:i,value:a},o))]}),r&&(0,n.jsx)(r,{className:`size-sm`,weight:`bold`})]})]})},sm=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(sm.displayName=`SwitchRootContext`);function cm(){let e=t.useContext(sm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(63):`Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.`);return e}let lm=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}({}),um={...pn,checked(e){return e?{[lm.checked]:``}:{[lm.unchecked]:``}}},dm=t.forwardRef(function(e,r){let{checked:i,className:a,defaultChecked:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,..._}=e,{clearErrors:v}=sr(),{state:b,setTouched:x,setDirty:S,validityData:C,setFilled:w,setFocused:T,shouldValidateOnChange:E,validationMode:D,disabled:O,name:k,validation:A}=nr(),{labelId:j}=ur(),M=O||m,P=k??l,F=G(d),ee=t.useRef(null),te=y(ee,c,A.inputRef),ne=t.useRef(null),I=bn(),L=uf({id:s,implicit:!1,controlRef:ne}),[R,re]=cn({controlled:i,default:!!o,name:`Switch`,state:`checked`});cr({id:I,commit:A.commit,value:R,controlRef:ne,name:P,getValue:()=>R}),K(()=>{ee.current&&w(ee.current.checked)},[ee,w]),xr(R,()=>{v(P),S(R!==C.initialValue),w(R),E()?A.commit(R):A.commit(R,!0)});let{getButtonProps:z,buttonRef:B}=$n({disabled:M,native:u}),V={id:I,role:`switch`,"aria-checked":R,"aria-readonly":f||void 0,"aria-labelledby":j,onFocus(){M||T(!0)},onBlur(){let e=ee.current;!e||M||(x(!0),T(!1),D===`onBlur`&&A.commit(e.checked))},onClick(e){f||M||(e.preventDefault(),ee?.current?.click())}},H=t.useMemo(()=>N({checked:R,disabled:M,id:L,name:P,required:p,style:ln,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:te,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=br(hr,e.nativeEvent);F?.(t,n),!n.isCanceled&&re(t)},onFocus(){ne.current?.focus()}},A.getInputValidationProps),[R,M,te,L,P,F,p,re,A]),U=t.useMemo(()=>({...b,checked:R,disabled:M,readOnly:f,required:p}),[b,R,M,f,p]),ie=W(`span`,e,{state:U,ref:[r,ne,B],props:[V,A.getValidationProps,_,z],stateAttributesMapping:um});return(0,n.jsxs)(sm.Provider,{value:U,children:[ie,!R&&P&&g!==void 0&&(0,n.jsx)(`input`,{type:`hidden`,name:P,value:g}),(0,n.jsx)(`input`,{...H})]})});process.env.NODE_ENV!==`production`&&(dm.displayName=`SwitchRoot`);let fm=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=nr(),o=cm();return W(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:um,props:i})});process.env.NODE_ENV!==`production`&&(fm.displayName=`SwitchThumb`);var pm=h();let mm=e=>{let t=(0,pm.c)(18),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({label:i,className:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=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`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,n.jsx)(fm,{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]=c):c=t[7];let l;t[8]!==a||t[9]!==o||t[10]!==s?(l=(0,n.jsx)(dm,{className:s,ref:o,...a,children:c}),t[8]=a,t[9]=o,t[10]=s,t[11]=l):l=t[11];let u;t[12]!==i||t[13]!==a?(u=i&&(0,n.jsx)(Of,{htmlFor:a.id,children:i}),t[12]=i,t[13]=a,t[14]=u):u=t[14];let d;return t[15]!==l||t[16]!==u?(d=(0,n.jsxs)(`div`,{className:`flex items-center gap-xs`,children:[l,u]}),t[15]=l,t[16]=u,t[17]=d):d=t[17],d},hm=(0,t.createContext)(`vertical`),gm=t.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!==`production`&&(gm.displayName=`CompositeListContext`);function _m(){return t.useContext(gm)}function vm(e){let{children:r,elementsRef:i,labelsRef:a,onMapChange:o}=e,s=G(o),c=t.useRef(0),l=v(bm).current,u=v(ym).current,[d,f]=t.useState(0),p=t.useRef(d),m=G((e,t)=>{u.set(e,t??null),p.current+=1,f(p.current)}),h=G(e=>{u.delete(e),p.current+=1,f(p.current)}),g=t.useMemo(()=>{let e=new Map;return Array.from(u.keys()).filter(e=>e.isConnected).sort(xm).forEach((t,n)=>{let r=u.get(t)??{};e.set(t,{...r,index:n})}),e},[u,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&&(i.current.length!==g.size&&(i.current.length=g.size),a&&a.current.length!==g.size&&(a.current.length=g.size),c.current=g.size),s(g)},[s,g,i,a,d]),K(()=>()=>{i.current=[]},[i]),K(()=>()=>{a&&(a.current=[])},[a]);let _=G(e=>(l.add(e),()=>{l.delete(e)}));K(()=>{l.forEach(e=>e(g))},[l,g]);let y=t.useMemo(()=>({register:m,unregister:h,subscribeMapChange:_,elementsRef:i,labelsRef:a,nextIndexRef:c}),[m,h,_,i,a,c]);return(0,n.jsx)(gm.Provider,{value:y,children:r})}function ym(){return new Map}function bm(){return new Set}function xm(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}let Sm=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Sm.displayName=`TabsRootContext`);function Cm(){let e=t.useContext(Sm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(64):`Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.`);return e}let wm=function(e){return e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e}({}),Tm={tabActivationDirection:e=>({[wm.activationDirection]:e})},Em=t.forwardRef(function(e,r){let{className:i,defaultValue:a=0,onValueChange:o,orientation:s=`horizontal`,render:c,value:l,...u}=e,d=Kf(),f=Object.hasOwn(e,`defaultValue`),p=t.useRef([]),[m,h]=t.useState(()=>new Map),[g,_]=cn({controlled:l,default:a,name:`Tabs`,state:`value`}),v=l!==void 0,[y,b]=t.useState(()=>new Map),[x,S]=t.useState(`none`),C=G((e,t)=>{o?.(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=t.useCallback(e=>m.get(e),[m]),D=t.useCallback(e=>{for(let t of y.values())if(e===t?.value)return t?.id},[y]),O=t.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=t.useMemo(()=>({direction:d,getTabElementBySelectedValue:O,getTabIdByPanelValue:D,getTabPanelIdByValue:E,onValueChange:C,orientation:s,registerMountedTabPanel:w,setTabMap:b,unregisterMountedTabPanel:T,tabActivationDirection:x,value:g}),[d,O,D,E,C,s,w,b,T,x,g]),A=t.useMemo(()=>{for(let e of y.values())if(e!=null&&e.value===g)return e},[y,g]),j=t.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===a||!e&&!(A==null&&g!==null))return;let t=j??null;g!==t&&(_(t),S(`none`))},[a,j,f,v,A,S,_,y,g]);let M=W(`div`,e,{state:{orientation:s,tabActivationDirection:x},ref:r,props:u,stateAttributesMapping:Tm});return(0,n.jsx)(Sm.Provider,{value:k,children:(0,n.jsx)(vm,{elementsRef:p,children:M})})});process.env.NODE_ENV!==`production`&&(Em.displayName=`TabsRoot`);let Dm=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function Om(e={}){let{label:n,metadata:r,textRef:i,indexGuessBehavior:a,index:o}=e,{register:s,unregister:c,subscribeMapChange:l,elementsRef:u,labelsRef:d,nextIndexRef:f}=_m(),p=t.useRef(-1),[m,h]=t.useState(o??(a===Dm.GuessFromOrder?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1)),g=t.useRef(null),_=t.useCallback(e=>{if(g.current=e,m!==-1&&e!==null&&(u.current[m]=e,d)){let t=n!==void 0;d.current[m]=t?n:i?.current?.textContent??e.textContent}},[m,u,d,n,i]);return K(()=>{if(o!=null)return;let e=g.current;if(e)return s(e,r),()=>{c(e)}},[o,s,c,r]),K(()=>{if(o==null)return l(e=>{let t=g.current?e.get(g.current)?.index:null;t!=null&&h(t)})},[o,l,h]),t.useMemo(()=>({ref:_,index:m}),[m,_])}function km(e={}){let{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:i}=Zn(),{ref:a,index:o}=Om(e),s=r===o,c=t.useRef(null),l=y(a,c);return{compositeProps:t.useMemo(()=>({tabIndex:s?0:-1,onFocus(){i(o)},onMouseMove(){let e=c.current;if(!n||!e)return;let t=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!s&&!t&&e.focus()}}),[s,i,o,n]),compositeRef:l,index:o}}let Am=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Am.displayName=`TabsListContext`);function jm(){let e=t.useContext(Am);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?g(65):`Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.`);return e}let Mm=t.forwardRef(function(e,n){let{className:r,disabled:i=!1,render:a,value:o,id:s,nativeButton:c=!0,...l}=e,{value:u,getTabPanelIdByValue:d,orientation:f}=Cm(),{activateOnFocus:p,highlightedTabIndex:m,onTabActivation:h,setHighlightedTabIndex:g,tabsListElement:_}=jm(),v=bn(s),{compositeProps:y,compositeRef:b,index:x}=km({metadata:t.useMemo(()=>({disabled:i,id:v,value:o}),[i,v,o])}),S=o===u,C=t.useRef(!1);K(()=>{if(C.current){C.current=!1;return}if(!(S&&x>-1&&m!==x))return;let e=_;if(e!=null){let t=Ti(So(e));if(t&&Q(e,t))return}i||g(x)},[S,x,m,g,i,_]);let{getButtonProps:w,buttonRef:T}=$n({disabled:i,native:c,focusableWhenDisabled:!0}),E=d(o),D=t.useRef(!1),O=t.useRef(!1);function k(e){S||i||h(o,br(hr,e.nativeEvent,void 0,{activationDirection:`none`}))}function A(e){S||(x>-1&&!i&&g(x),!i&&p&&(!D.current||D.current&&O.current)&&h(o,br(hr,e.nativeEvent,void 0,{activationDirection:`none`})))}function j(e){if(S||i)return;D.current=!0;function t(){D.current=!1,O.current=!1}(!e.button||e.button===0)&&(O.current=!0,So(e.currentTarget).addEventListener(`pointerup`,t,{once:!0}))}return W(`button`,e,{state:t.useMemo(()=>({disabled:i,active:S,orientation:f}),[i,S,f]),ref:[n,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}},l,w]})});process.env.NODE_ENV!==`production`&&(Mm.displayName=`TabsTab`);let Nm=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 Pm={...Tm,activeTabPosition:()=>null,activeTabSize:()=>null};let Fm=t.forwardRef(function(e,r){let{className:i,render:a,renderBeforeHydration:o=!1,...s}=e,{getTabElementBySelectedValue:c,orientation:l,tabActivationDirection:u,value:d}=Cm(),{tabsListElement:f}=jm(),[p,m]=t.useState(!1),{value:h}=Cm();be(()=>m(!0));let g=Zc();t.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=c(d);if(C=!0,e!=null){let{width:t,height:n}=Pp(e),{width:r,height:i}=Pp(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=t.useMemo(()=>C?{left:_,right:v,top:y,bottom:b}:null,[_,v,y,b,C]),T=t.useMemo(()=>C?{width:x,height:S}:null,[x,S,C]),E=t.useMemo(()=>{if(C)return{[Nm.activeTabLeft]:`${_}px`,[Nm.activeTabRight]:`${v}px`,[Nm.activeTabTop]:`${y}px`,[Nm.activeTabBottom]:`${b}px`,[Nm.activeTabWidth]:`${x}px`,[Nm.activeTabHeight]:`${S}px`}},[_,v,y,b,x,S,C]),D=C&&x>0&&S>0,O=W(`span`,e,{state:t.useMemo(()=>({orientation:l,activeTabPosition:w,activeTabSize:T,tabActivationDirection:u}),[l,w,T,u]),ref:r,props:[{role:`presentation`,style:E,hidden:!D},s,{suppressHydrationWarning:!0}],stateAttributesMapping:Pm});return h==null?null:(0,n.jsxs)(t.Fragment,{children:[O,!p&&o&&(0,n.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`&&(Fm.displayName=`TabsIndicator`);let Im=function(e){return e.index=`data-index`,e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e.hidden=`data-hidden`,e}({}),Lm=t.forwardRef(function(e,n){let{className:r,value:i,render:a,keepMounted:o=!1,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f,unregisterMountedTabPanel:p}=Cm(),m=bn(),{ref:h,index:g}=Om({metadata:t.useMemo(()=>({id:m,value:i}),[m,i])}),_=i!==c,v=l(i),y=W(`div`,e,{state:t.useMemo(()=>({hidden:_,orientation:u,tabActivationDirection:d}),[_,u,d]),ref:[n,h],props:[{"aria-labelledby":v,hidden:_,id:m??void 0,role:`tabpanel`,tabIndex:_?-1:0,[Im.index]:g},s],stateAttributesMapping:Tm});return K(()=>{if(!(_&&!o)&&m!=null)return f(i,m),()=>{p(i,m)}},[_,o,i,m,f,p]),!_||o?y:null});process.env.NODE_ENV!==`production`&&(Lm.displayName=`TabsPanel`);function Rm(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var zm=[];function Bm(e){let{itemSizes:n,cols:r=1,loopFocus:i=!0,dense:a=!1,orientation:o=`both`,direction:s,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:u,enableHomeAndEndKeys:d=!1,stopEventPropagation:f=!1,disabledIndices:p,modifierKeys:m=zm}=e,[h,g]=t.useState(0),_=r>1,v=t.useRef(null),b=y(v,u),x=t.useRef([]),S=t.useRef(!1),C=c??h,w=G((e,t=!1)=>{if((l??g)(e),t){let t=x.current[e];Xl(v.current,t,s,o)}}),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),Xl(v.current,n,s,o)}),E=t.useMemo(()=>({"aria-orientation":o===`both`?void 0:o,ref:b,onFocus(e){!v.current||!Yl(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let t=d?Gl:Wl;if(!t.has(e.key)||Vm(e,m)||!v.current)return;let c=s===`rtl`,l=c?Ll:Rl,u={horizontal:l,vertical:Il,both:l}[o],h=c?Rl:Ll,g={horizontal:h,vertical:Fl,both:h}[o];if(Yl(e.target)&&!Rm(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 y=C,b=ba(x,p),S=xa(x,p);if(_){let t=n||Array.from({length:x.current.length},()=>({width:1,height:1})),s=wa(t,r,a),l=s.findIndex(e=>e!=null&&!Da(x,e,p)),u=s.reduce((e,t,n)=>t!=null&&!Da(x,t,p)?n:e,-1);y=s[Ca({current:s.map(e=>e?x.current[e]:null)},{event:e,orientation:o,loopFocus:i,cols:r,disabledIndices:Ea([...p||x.current.map((e,t)=>Da(x,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:Ta(C>S?b:C,t,s,r,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[Il],both:[l,Il]}[o],E={horizontal:[h],vertical:[Fl],both:[h,Fl]}[o],D=_?t:{horizontal:d?Vl:Bl,vertical:d?Ul:Hl,both:t}[o];d&&(e.key===`Home`?y=b:e.key===`End`&&(y=S)),y===C&&(T.includes(e.key)||E.includes(e.key))&&(y=i&&y===S&&T.includes(e.key)?b:i&&y===b&&E.includes(e.key)?S:Sa(x,{startingIndex:y,decrement:E.includes(e.key),disabledIndices:p})),y!==C&&!ya(x,y)&&(f&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),w(y,!0),queueMicrotask(()=>{x.current[y]?.focus()}))}}),[r,a,s,p,x,d,C,_,n,i,b,m,w,o,f]);return t.useMemo(()=>({props:E,highlightedIndex:C,onHighlightedIndexChange:w,elementsRef:x,disabledIndices:p,onMapChange:T,relayKeyboardEvent:E.onKeyDown}),[E,C,w,x,p,T])}function Vm(e,t){for(let n of ql.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Hm(e){let{render:r,className:i,refs:a=V,props:o=V,state:s=H,stateAttributesMapping:c,highlightedIndex:l,onHighlightedIndexChange:u,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}=Bm({itemSizes:p,cols:h,loopFocus:m,dense:f,orientation:d,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:y,stopEventPropagation:v,enableHomeAndEndKeys:g,direction:Kf(),disabledIndices:b,modifierKeys:x}),j=W(C,e,{state:s,ref:a,props:[T,...o,w],stateAttributesMapping:c}),M=t.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:S,relayKeyboardEvent:A}),[E,D,S,A]);return(0,n.jsx)(Xn.Provider,{value:M,children:(0,n.jsx)(vm,{elementsRef:O,onMapChange:e=>{_?.(e),k(e)},children:j})})}let Um=t.forwardRef(function(e,r){let{activateOnFocus:i=!1,className:a,loopFocus:o=!0,render:s,...c}=e,{getTabElementBySelectedValue:l,onValueChange:u,orientation:d,value:f,setTabMap:p,tabActivationDirection:m}=Cm(),[h,g]=t.useState(0),[_,v]=t.useState(null),y=Gm(f,d,_,l),b=G((e,t)=>{e!==f&&(t.activationDirection=y(e),u(e,t))}),x=t.useMemo(()=>({orientation:d,tabActivationDirection:m}),[d,m]),S={"aria-orientation":d===`vertical`?`vertical`:void 0,role:`tablist`},C=t.useMemo(()=>({activateOnFocus:i,highlightedTabIndex:h,onTabActivation:b,setHighlightedTabIndex:g,tabsListElement:_,value:f}),[i,h,b,g,_,f]);return(0,n.jsx)(Am.Provider,{value:C,children:(0,n.jsx)(Hm,{render:s,className:a,state:x,refs:[r,v],props:[S,c],stateAttributesMapping:Tm,highlightedIndex:h,enableHomeAndEndKeys:!0,loopFocus:o,orientation:d,onHighlightedIndexChange:g,onMapChange:p,disabledIndices:V})})});process.env.NODE_ENV!==`production`&&(Um.displayName=`TabsList`);function Wm(e,t){let{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect();return{left:n-i,top:r-a}}function Gm(e,n,r,i){let[a,o]=t.useState(null);return K(()=>{if(e==null||r==null){o(null);return}let t=i(e);if(t==null){o(null);return}let{left:a,top:s}=Wm(t,r);o(n===`horizontal`?a:s)},[n,i,r,e]),t.useCallback(t=>{if(t===e)return`none`;if(t==null)return o(null),`none`;if(t!=null&&r!=null){let e=i(t);if(e!=null){let{left:t,top:i}=Wm(e,r);if(a==null)return o(n===`horizontal`?t:i),`none`;if(n===`horizontal`){if(t<a)return o(t),`left`;if(t>a)return o(t),`right`}else if(i<a)return o(i),`up`;else if(i>a)return o(i),`down`}}return`none`},[i,n,a,r,e])}var Km=h();let qm=e=>{let r=(0,Km.c)(13),i,a;if(r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a),(0,t.useContext)(hm)===`horizontal`){let e;r[3]===i?e=r[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)]`,i),r[3]=i,r[4]=e);let t;return r[5]!==a||r[6]!==e?(t=(0,n.jsx)(Fm,{className:e,...a}),r[5]=a,r[6]=e,r[7]=t):t=r[7],t}let o;r[8]===i?o=r[9]:(o=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)]`,i),r[8]=i,r[9]=o);let s;return r[10]!==a||r[11]!==o?(s=(0,n.jsx)(Fm,{className:o,...a}),r[10]=a,r[11]=o,r[12]=s):s=r[12],s};var Jm=h();let Ym=e=>{let r=(0,Jm.c)(13),i,a;if(r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a),(0,t.useContext)(hm)===`horizontal`){let e;r[3]===i?e=r[4]:(e=X(`relative z-0 flex flex-col h-fit grow gap-2 p-2 bg-surface-neutral-primary-default rounded-3xl`,i),r[3]=i,r[4]=e);let t;return r[5]!==a||r[6]!==e?(t=(0,n.jsx)(Um,{className:e,...a}),r[5]=a,r[6]=e,r[7]=t):t=r[7],t}let o;r[8]===i?o=r[9]:(o=X(`relative z-0 flex gap-1 p-2 bg-surface-neutral-primary-default rounded-full`,i),r[8]=i,r[9]=o);let s;return r[10]!==a||r[11]!==o?(s=(0,n.jsx)(Um,{className:o,...a}),r[10]=a,r[11]=o,r[12]=s):s=r[12],s};var Xm=h();let Zm=e=>{let r=(0,Xm.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o=(0,t.useContext)(hm)===`horizontal`?`flex-1 min-h-0 h-full`:`grow`,s;r[3]!==i||r[4]!==o?(s=X(`relative rounded-xl bg-surface-neutral-primary-default`,o,`flex items-center justify-center p-4 overflow-auto`,i),r[3]=i,r[4]=o,r[5]=s):s=r[5];let c;return r[6]!==a||r[7]!==s?(c=(0,n.jsx)(Lm,{className:s,...a}),r[6]=a,r[7]=s,r[8]=c):c=r[8],c};var Qm=h();let $m=e=>{let t=(0,Qm.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=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`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,n.jsx)(Mm,{className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o};var eh=h();let th=e=>{let r=(0,eh.c)(15),{className:i,ref:a,...o}=e,[s,c]=(0,t.useState)(o.orientation??`vertical`);if((0,t.useEffect)(()=>{let e=()=>{window.innerWidth<768?c(`horizontal`):c(o.orientation??`vertical`)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[o.orientation]),o.orientation=s,o.orientation===`horizontal`){let e=o.orientation,t;r[0]===i?t=r[1]:(t=X(`flex flex-wrap gap-4 overflow-auto`,i),r[0]=i,r[1]=t);let s;r[2]!==o||r[3]!==a||r[4]!==t?(s=(0,n.jsx)(Em,{className:t,ref:a,...o}),r[2]=o,r[3]=a,r[4]=t,r[5]=s):s=r[5];let c;return r[6]!==o.orientation||r[7]!==s?(c=(0,n.jsx)(hm.Provider,{value:e,children:s}),r[6]=o.orientation,r[7]=s,r[8]=c):c=r[8],c}let l;r[9]===i?l=r[10]:(l=X(`flex flex-col gap-2 overflow-clip`,i),r[9]=i,r[10]=l);let u;return r[11]!==o||r[12]!==a||r[13]!==l?(u=(0,n.jsx)(Em,{className:l,ref:a,...o}),r[11]=o,r[12]=a,r[13]=l,r[14]=u):u=r[14],u};var nh=0;function rh(e){return nh+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${nh}`}let ih=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(ih.displayName=`ToastContext`);function ah(){let e=t.useContext(ih);if(!e)throw Error(process.env.NODE_ENV===`production`?g(73):`Base UI: useToastManager must be used within <Toast.Provider>.`);return e}function oh(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}let sh=function(e){let{children:r,timeout:i=5e3,limit:a=3,toastManager:o}=e,[s,c]=t.useState([]),[l,u]=t.useState(!1),[d,f]=t.useState(!1),[p,m]=t.useState(null);s.length===0&&(l&&u(!1),d&&f(!1));let h=l||d,g=t.useRef(new Map),_=t.useRef(null),v=t.useRef(!0),y=t.useRef(!1);function b(e){let t=Ti(So(_.current));if(!_.current||!Q(_.current,t)||!Mi(t))return;let n=s.findIndex(t=>t.id===e),r=null,i=n+1;for(;i<s.length;){if(s[i].transitionStatus!==`ending`){r=s[i];break}i+=1}if(!r)for(i=n-1;i>=0;){if(s[i].transitionStatus!==`ending`){r=s[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??=Se.create(),e.timeout.start(e.remaining,()=>{g.current.delete(t),e.callback()}),e.start=Date.now()}))}),C=G(e=>{c(t=>{let n=t.map(t=>t.id===e?{...t,transitionStatus:`ending`,height:0}:t),r=n.filter(e=>e.transitionStatus!==`ending`);return n.map(e=>{if(e.transitionStatus===`ending`)return e;let t=r.indexOf(e)>=a;return{...e,limited:t}})});let t=g.current.get(e);t&&t.timeout&&(t.timeout.clear(),g.current.delete(e)),s.find(t=>t.id===e)?.onClose?.(),b(e),s.length===1&&(u(!1),f(!1))}),w=G(e=>{c(t=>t.filter(t=>t.id!==e)),s.find(t=>t.id===e)?.onRemove?.()}),T=G((e,t,n)=>{let r=Date.now(),i=v.current&&!l&&!d,a=i?Se.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||rh(`toast`),n={...e,id:t,transitionStatus:`starting`};c(e=>{let t=[n,...e],r=t.filter(e=>e.transitionStatus!==`ending`);if(r.length>a){let e=r.length-a,n=r.slice(-e);return t.map(e=>n.some(t=>t.id===e.id)?{...e,limited:!0}:{...e,limited:!1})}return t.map(e=>({...e,limited:!1}))});let r=n.timeout??i;return n.type!==`loading`&&r>0&&T(t,r,()=>C(t)),(l||d||!v.current)&&x(),t}),D=G((e,t)=>{c(n=>n.map(n=>n.id===e?{...n,...t}:n))}),O=G((e,t)=>{let n=E({...oh(t.loading),type:`loading`}),r=e.then(e=>{let r=oh(t.success,e);D(n,{...r,type:`success`});let a=r.timeout??i;return a>0&&T(n,a,()=>C(n)),(l||d||!v.current)&&x(),e}).catch(e=>{let r=oh(t.error,e);D(n,{...r,type:`error`});let a=r.timeout??i;return a>0&&T(n,a,()=>C(n)),(l||d||!v.current)&&x(),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(r),r});t.useEffect(function(){if(o)return o[` 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,i,o,O,C]);let k=t.useMemo(()=>({toasts:s,setToasts:c,hovering:l,setHovering:u,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,l,h,x,p,O,w,S,T,s,D]);return(0,n.jsx)(ih.Provider,{value:k,children:r})};process.env.NODE_ENV!==`production`&&(sh.displayName=`ToastProvider`);let ch=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(ch.displayName=`ToastViewportContext`);let lh=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),uh=t.forwardRef(function(e,r){let{render:i,className:a,children:o,...s}=e,{toasts:c,pauseTimers:l,resumeTimers:u,setHovering:d,setFocused:f,viewportRef:p,windowFocusedRef:m,prevFocusElement:h,setPrevFocusElement:g,expanded:_,focused:v}=ah(),y=t.useRef(!1),b=t.useRef(!1),x=c.length,S=c[0]?.height??0,C=t.useMemo(()=>c.some(e=>e.transitionStatus===`ending`),[c]);t.useEffect(()=>{if(!p.current)return;function e(e){x!==0&&e.key===`F6`&&e.target!==p.current&&(e.preventDefault(),g(Ti(So(p.current))),p.current?.focus({preventScroll:!0}),l(),f(!0))}let t=Cn(p.current);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[l,f,g,x,p]),t.useEffect(()=>{if(!p.current||!x)return;let e=Cn(p.current);function t(t){t.target===e&&(m.current=!1,l())}function n(t){if(t.relatedTarget||t.target===e)return;let n=Ei(t),r=Ti(So(p.current));(!Q(p.current,n)||!Mi(r))&&u(),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)}},[l,u,p,m,f,x]),t.useEffect(()=>{let e=p.current;if(!e||x===0)return;let t=So(e);function n(t){t.pointerType===`touch`&&(Q(e,Ei(t))||(u(),d(!1),f(!1)))}return t.addEventListener(`pointerdown`,n,!0),()=>{t.removeEventListener(`pointerdown`,n,!0)}},[x,u,f,d,p]);function w(e){p.current&&(y.current=!0,e.relatedTarget===p.current?c[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}),u())}t.useEffect(()=>{!m.current||C||!b.current||(u(),d(!1),b.current=!1)},[C,u,d,m]);function E(){l(),d(!0),b.current=!1}function D(){c.some(e=>e.transitionStatus===`ending`)?b.current=!0:(u(),d(!1))}function O(){if(y.current){y.current=!1;return}v||Mi(So(p.current).activeElement)&&(f(!0),l())}function k(e){!v||Q(p.current,e.relatedTarget)||(f(!1),u())}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=t.useMemo(()=>({expanded:_}),[_]),M=W(`div`,e,{ref:[r,p],state:j,props:[A,{style:{[lh.frontmostHeight]:S?`${S}px`:void 0}},s,{children:(0,n.jsxs)(t.Fragment,{children:[x>0&&h&&(0,n.jsx)(Co,{onFocus:w}),o,x>0&&h&&(0,n.jsx)(Co,{onFocus:w})]})}]}),N=t.useMemo(()=>({viewportRef:p}),[p]),P=t.useMemo(()=>c.filter(e=>e.priority===`high`),[c]);return(0,n.jsxs)(ch.Provider,{value:N,children:[x>0&&h&&(0,n.jsx)(Co,{onFocus:w}),M,!v&&P.length>0&&(0,n.jsx)(`div`,{style:ln,children:P.map(e=>(0,n.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,n.jsx)(`div`,{children:e.title}),(0,n.jsx)(`div`,{children:e.description})]},e.id))})]})});process.env.NODE_ENV!==`production`&&(uh.displayName=`ToastViewport`);let dh=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(dh.displayName=`ToastRootContext`);function fh(){let e=t.useContext(dh);if(!e)throw Error(process.env.NODE_ENV===`production`?g(66):`Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.`);return e}let ph=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 mh={...Lr,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},hh=40,gh=10,_h=.5,vh=1;function yh(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 bh(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}}let xh=t.forwardRef(function(e,i){let{toast:a,render:o,className:s,swipeDirection:c=[`down`,`right`],...l}=e,u=a.positionerProps?.anchor!==void 0,d=[];u||(d=Array.isArray(c)?c:[c]);let f=d.length>0,{toasts:p,focused:m,close:h,remove:g,setToasts:_,pauseTimers:v,expanded:y,setHovering:b}=ah(),[x,S]=t.useState(void 0),[C,w]=t.useState(!1),[T,E]=t.useState(!1),[D,O]=t.useState(!1),[k,A]=t.useState({x:0,y:0}),[j,M]=t.useState({x:0,y:0,scale:1}),[N,P]=t.useState(),[F,ee]=t.useState(),[te,ne]=t.useState(null),I=t.useRef(null),L=t.useRef({x:0,y:0}),R=t.useRef({x:0,y:0,scale:1}),re=t.useRef(void 0),z=t.useRef(0),B=t.useRef(!1),V=t.useRef({x:0,y:0}),H=t.useRef(!1),U=t.useMemo(()=>p.indexOf(a),[a,p]),ie=t.useMemo(()=>p.filter(e=>e.transitionStatus!==`ending`).indexOf(a),[a,p]),ae=t.useMemo(()=>p.slice(0,p.indexOf(a)).reduce((e,t)=>e+(t.height||0),0),[p,a]);Mr({open:a.transitionStatus!==`ending`,ref:I,onComplete(){a.transitionStatus===`ending`&&g(a.id)}});let oe=G((e=!1)=>{let t=I.current;if(!t)return;let n=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=n;function o(){_(e=>e.map(e=>e.id===a.id?{...e,ref:I,height:i,transitionStatus:void 0}:e))}e?r.flushSync(o):o()});K(oe,[oe]);function se(e,t){let n=e,r=t;return!d.includes(`left`)&&!d.includes(`right`)?n=e>0?e**_h:-(Math.abs(e)**_h):(!d.includes(`right`)&&e>0&&(n=e**_h),!d.includes(`left`)&&e<0&&(n=-(Math.abs(e)**_h))),!d.includes(`up`)&&!d.includes(`down`)?r=t>0?t**_h:-(Math.abs(t)**_h):(!d.includes(`down`)&&t>0&&(r=t**_h),!d.includes(`up`)&&t<0&&(r=-(Math.abs(t)**_h))),{x:n,y:r}}function ce(e){if(e.button!==0)return;e.pointerType===`touch`&&v();let t=Ei(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],[data-swipe-ignore]`))){if(B.current=!1,re.current=void 0,z.current=0,L.current={x:e.clientX,y:e.clientY},V.current=L.current,I.current){let e=bh(I.current);R.current=e,M(e),A({x:e.x,y:e.y})}b(!0),w(!0),E(!1),ne(null),H.current=!0,I.current?.setPointerCapture(e.pointerId)}}function le(e){if(!C)return;e.preventDefault(),H.current&&=(L.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>V.current.y||i>0&&t<V.current.y)&&(V.current={x:V.current.x,y:t}),(r<0&&n>V.current.x||r>0&&n<V.current.x)&&(V.current={x:n,y:V.current.y});let a=n-L.current.x,o=t-L.current.y,s=t-V.current.y,c=n-V.current.x;if(!T&&Math.sqrt(a*a+o*o)>=vh&&(E(!0),te===null)){let e=d.includes(`left`)||d.includes(`right`),t=d.includes(`up`)||d.includes(`down`);e&&t&&ne(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let l;if(!re.current)te===`vertical`?o>0?l=`down`:o<0&&(l=`up`):te===`horizontal`?a>0?l=`right`:a<0&&(l=`left`):l=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,l&&d.includes(l)&&(re.current=l,z.current=yh(l,a,o),S(l));else{let e=re.current,t=yh(e,c,s);t>hh?(B.current=!1,S(e)):!(d.includes(`left`)&&d.includes(`right`))&&!(d.includes(`up`)&&d.includes(`down`))&&z.current-t>=gh&&(B.current=!0)}let u=se(a,o),f=R.current.x,p=R.current.y;te===`horizontal`?(d.includes(`left`)||d.includes(`right`))&&(f+=u.x):(te===`vertical`||(d.includes(`left`)||d.includes(`right`))&&(f+=u.x),(d.includes(`up`)||d.includes(`down`))&&(p+=u.y)),A({x:f,y:p})}function ue(e){if(!C)return;if(w(!1),E(!1),ne(null),I.current?.releasePointerCapture(e.pointerId),B.current){A({x:j.x,y:j.y}),S(void 0);return}let t=!1,n=k.x-j.x,r=k.y-j.y,i;for(let e of d){switch(e){case`right`:n>hh&&(t=!0,i=`right`);break;case`left`:n<-hh&&(t=!0,i=`left`);break;case`down`:r>hh&&(t=!0,i=`down`);break;case`up`:r<-hh&&(t=!0,i=`up`);break;default:break}if(t)break}t?(S(i),O(!0),h(a.id)):(A({x:j.x,y:j.y}),S(void 0))}function de(e){if(e.key===`Escape`){if(!I.current||!Q(I.current,Ti(So(I.current))))return;h(a.id)}}t.useEffect(()=>{if(!f)return;let e=I.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{[ph.swipeMovementX]:`0px`,[ph.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,[ph.swipeMovementX]:`${e}px`,[ph.swipeMovementY]:`${t}px`}}let pe=a.priority===`high`,me={role:pe?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":N,"aria-describedby":F,"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:tu(a.limited),style:{...fe(),[ph.index]:a.transitionStatus===`ending`?U:ie,[ph.offsetY]:`${ae}px`,[ph.height]:a.height?`${a.height}px`:void 0}},he=t.useMemo(()=>({rootRef:I,toast:a,titleId:N,setTitleId:P,descriptionId:F,setDescriptionId:ee,swiping:C,swipeDirection:x,recalculateHeight:oe,index:U,visibleIndex:ie,expanded:y}),[a,N,F,C,x,oe,U,ie,y]),ge=t.useMemo(()=>({transitionStatus:a.transitionStatus,expanded:y,limited:a.limited||!1,type:a.type,swiping:he.swiping,swipeDirection:he.swipeDirection}),[y,a.transitionStatus,a.limited,a.type,he.swiping,he.swipeDirection]),_e=W(`div`,e,{ref:[i,he.rootRef],state:ge,stateAttributesMapping:mh,props:[me,l]});return(0,n.jsx)(dh.Provider,{value:he,children:_e})});process.env.NODE_ENV!==`production`&&(xh.displayName=`ToastRoot`);let Sh=t.forwardRef(function(e,n){let{render:r,className:i,id:a,children:o,...s}=e,{toast:c}=fh(),l=o??c.description,u=!!l,d=yn(a),{setDescriptionId:f}=fh();K(()=>{if(u)return f(d),()=>{f(void 0)}},[u,d,f]);let p=W(`p`,e,{ref:n,state:t.useMemo(()=>({type:c.type}),[c.type]),props:{...s,id:d,children:l}});return u?p:null});process.env.NODE_ENV!==`production`&&(Sh.displayName=`ToastDescription`);let Ch=t.forwardRef(function(e,n){let{render:r,className:i,id:a,children:o,...s}=e,{toast:c}=fh(),l=o??c.title,u=!!l,d=yn(a),{setTitleId:f}=fh();K(()=>{if(u)return f(d),()=>{f(void 0)}},[u,d,f]);let p=W(`h2`,e,{ref:n,state:t.useMemo(()=>({type:c.type}),[c.type]),props:{...s,id:d,children:l}});return u?p:null});process.env.NODE_ENV!==`production`&&(Ch.displayName=`ToastTitle`);let wh=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a,nativeButton:o=!0,...s}=e,{close:c,expanded:l}=ah(),{toast:u}=fh(),[d,f]=t.useState(!1),{getButtonProps:p,buttonRef:m}=$n({disabled:a,native:o}),h=t.useMemo(()=>({type:u.type}),[u.type]);return W(`button`,e,{ref:[n,m],state:h,props:[{"aria-hidden":!l&&!d,onClick(){c(u.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})});process.env.NODE_ENV!==`production`&&(wh.displayName=`ToastClose`);let Th=yp;function Eh(){let e=t.useContext(ih);if(!e)throw Error(process.env.NODE_ENV===`production`?g(73):`Base UI: useToastManager must be used within <Toast.Provider>.`);let{toasts:n,add:r,close:i,update:a,promise:o}=e;return t.useMemo(()=>({toasts:n,add:r,close:i,update:a,promise:o}),[n,r,i,a,o])}let Dh=({className:e,children:t,position:r=`top-right`,ref:i,...a})=>{let{toasts:o}=Eh(),s=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 o.map(o=>(0,n.jsxs)(xh,{toast:o,swipeDirection:s(r),className:X(r===`bottom-right`||r===`bottom-center`||r===`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,o.data.variant===`success`&&`border-success bg-success-container`,o.data.variant===`error`&&`border-error bg-error-container`,o.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:i,...a,children:[t,(0,n.jsx)(Ch,{className:X(`text-sm font-semibold text-on-surface`,o.data.variant===`success`&&`text-on-success-container`,o.data.variant===`error`&&`text-on-error-container`,o.data.variant===`warning`&&`text-on-warning-container`)}),(0,n.jsx)(Sh,{className:X(`text-sm text-on-surface`,o.data.variant===`success`&&`text-on-success-container`,o.data.variant===`error`&&`text-on-error-container`,o.data.variant===`warning`&&`text-on-warning-container`)}),(0,n.jsx)(wh,{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,n.jsx)(Jr,{weight:`bold`})})]},o.id))};var Oh=h();e.Avatar=qt,e.AvatarFallback=Zt,e.AvatarImage=Yt,e.Badge=rn,e.Button=sn,e.Checkbox=Xr,e.CheckboxIndicator=Br,e.Dialog=Mu,e.DialogClose=Su,e.DialogDescription=wu,e.DialogPopup=Eu,e.DialogTitle=Ou,e.DialogTrigger=Au,e.FieldErrors=cf,e.FieldInput=vf,e.Form=Ef,e.FormErrors=Cf,e.FormSubmit=bf,e.Input=gf,e.Label=Of,e.Profile=Af,e.ScrollArea=op,e.Separator=mf,e.Slider=om,e.SliderHandle=Yp,e.SliderSegment=Xp,e.SliderTick=Qp,e.SliderTickLabel=Zp,e.SliderTrack=$p,e.Switch=mm,e.Tabs=th,e.TabsIndicator=qm,e.TabsList=Ym,e.TabsPanel=Zm,e.TabsTab=$m,e.Toast=Dh,e.ToastProvider=e=>{let t=(0,Oh.c)(24),r,i,a,o,s;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({position:s,className:i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let c=s===void 0?`bottom-center`:s,l=c===`top-left`,u=c===`top-center`,d=c===`top-right`,f=c===`bottom-left`,p=c===`bottom-center`,m=c===`bottom-right`,h;t[6]!==i||t[7]!==l||t[8]!==u||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":l,"fixed z-10 top-[1rem] left-1/2 right-auto bottom-auto mx-auto flex w-1/4 -translate-x-1/2":u,"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},i),t[6]=i,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;t[14]===c?g=t[15]:(g=(0,n.jsx)(Dh,{position:c}),t[14]=c,t[15]=g);let _;t[16]!==a||t[17]!==o||t[18]!==h||t[19]!==g?(_=(0,n.jsx)(Th,{children:(0,n.jsx)(uh,{className:h,ref:o,...a,children:g})}),t[16]=a,t[17]=o,t[18]=h,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==r||t[22]!==_?(v=(0,n.jsxs)(sh,{timeout:5e3,children:[r,_]}),t[21]=r,t[22]=_,t[23]=v):v=t[23],v},e.Tooltip=Wp,e.TooltipContent=Jp,e.TooltipTrigger=Kp,e.cn=X});
|