@segmentify/ui 0.0.53 → 0.0.54
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/segmentify-ui.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),O=require("react"),Qv=require("react-dom"),Oe=require("lucide-react"),Mn=require("react-hook-form"),ey=require("sonner"),MF=require("@tanstack/react-query");function UR(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=UR(O),ao=UR(Qv);function DF(e,t){const n=b.createContext(t),r=i=>{const{children:s,...a}=i,l=b.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=b.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Kt(e,t=[]){let n=[];function r(i,s){const a=b.createContext(s),l=n.length;n=[...n,s];const u=d=>{const{scope:f,children:p,...g}=d,m=f?.[e]?.[l]||a,v=b.useMemo(()=>g,Object.values(g));return h.jsx(m.Provider,{value:v,children:p})};u.displayName=i+"Provider";function c(d,f){const p=f?.[e]?.[l]||a,g=b.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>b.createContext(s));return function(a){const l=a?.[e]||i;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,kF(o,...t)]}function kF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Z0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function oo(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Z0(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Z0(e[o],null)}}}}function Be(...e){return b.useCallback(oo(...e),e)}function Ui(e){const t=jF(e),n=b.forwardRef((r,o)=>{const{children:i,...s}=r,a=b.Children.toArray(i),l=a.find(FF);if(l){const u=l.props.children,c=a.map(d=>d===l?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:d);return h.jsx(t,{...s,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,c):null})}return h.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function jF(e){const t=b.forwardRef((n,r)=>{const{children:o,...i}=n;if(b.isValidElement(o)){const s=BF(o),a=LF(i,o.props);return o.type!==b.Fragment&&(a.ref=r?oo(r,s):s),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YR=Symbol("radix.slottable");function XR(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=YR,t}function FF(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YR}function LF(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function BF(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ul(e){const t=e+"CollectionProvider",[n,r]=Kt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:y}=m,x=O.useRef(null),w=O.useRef(new Map).current;return h.jsx(o,{scope:v,itemMap:w,collectionRef:x,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Ui(a),u=O.forwardRef((m,v)=>{const{scope:y,children:x}=m,w=i(a,y),C=Be(v,w.collectionRef);return h.jsx(l,{ref:C,children:x})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=Ui(c),p=O.forwardRef((m,v)=>{const{scope:y,children:x,...w}=m,C=O.useRef(null),S=Be(v,C),R=i(c,y);return O.useEffect(()=>(R.itemMap.set(C,{ref:C,...w}),()=>{R.itemMap.delete(C)})),h.jsx(f,{[d]:"",ref:S,children:x})});p.displayName=c;function g(m){const v=i(e+"CollectionConsumer",m);return O.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((R,I)=>w.indexOf(R.ref.current)-w.indexOf(I.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},g,r]}function he(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qt=globalThis?.document?b.useLayoutEffect:()=>{},VF=b[" useInsertionEffect ".trim().toString()]||qt;function fn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=$F({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const c=b.useRef(e!==void 0);b.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=b.useCallback(c=>{if(a){const d=GF(c)?c(e):c;d!==e&&s.current?.(d)}else i(c)},[a,e,i,s]);return[l,u]}function $F({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),o=b.useRef(n),i=b.useRef(t);return VF(()=>{i.current=t},[t]),b.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function GF(e){return typeof e=="function"}var HF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=HF.reduce((e,t)=>{const n=Ui(`Primitive.${t}`),r=b.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ZR(e,t){e&&ao.flushSync(()=>e.dispatchEvent(t))}function WF(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Ht=e=>{const{present:t,children:n}=e,r=zF(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=Be(r.ref,qF(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:i}):null};Ht.displayName="Presence";function zF(e){const[t,n]=b.useState(),r=b.useRef(null),o=b.useRef(e),i=b.useRef("none"),s=e?"mounted":"unmounted",[a,l]=WF(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Mu(r.current);i.current=a==="mounted"?u:"none"},[a]),qt(()=>{const u=r.current,c=o.current;if(c!==e){const f=i.current,p=Mu(u);e?l("MOUNT"):p==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qt(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const m=Mu(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=p=>{p.target===t&&(i.current=Mu(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Mu(e){return e?.animationName||"none"}function qF(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var UF=b[" useId ".trim().toString()]||(()=>{}),YF=0;function $t(e){const[t,n]=b.useState(UF());return qt(()=>{n(r=>r??String(YF++))},[e]),t?`radix-${t}`:""}var Pd="Collapsible",[XF,JR]=Kt(Pd),[ZF,ty]=XF(Pd),KR=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,u]=fn({prop:r,defaultProp:o??!1,onChange:s,caller:Pd});return h.jsx(ZF,{scope:n,disabled:i,contentId:$t(),open:l,onOpenToggle:b.useCallback(()=>u(c=>!c),[u]),children:h.jsx(Ee.div,{"data-state":iy(l),"data-disabled":i?"":void 0,...a,ref:t})})});KR.displayName=Pd;var QR="CollapsibleTrigger",ny=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ty(QR,n);return h.jsx(Ee.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":iy(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:he(e.onClick,o.onOpenToggle)})});ny.displayName=QR;var ry="CollapsibleContent",oy=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ty(ry,e.__scopeCollapsible);return h.jsx(Ht,{present:n||o.open,children:({present:i})=>h.jsx(JF,{...r,ref:t,present:i})})});oy.displayName=ry;var JF=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=ty(ry,n),[a,l]=b.useState(r),u=b.useRef(null),c=Be(t,u),d=b.useRef(0),f=d.current,p=b.useRef(0),g=p.current,m=s.open||a,v=b.useRef(m),y=b.useRef(void 0);return b.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),qt(()=>{const x=u.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();d.current=w.height,p.current=w.width,v.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),l(r)}},[s.open,r]),h.jsx(Ee.div,{"data-state":iy(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&o})});function iy(e){return e?"open":"closed"}var eA=KR,KF=ny,QF=oy,eL=b.createContext(void 0);function gi(e){const t=b.useContext(eL);return e||t||"ltr"}var Lr="Accordion",tL=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[sy,nL,rL]=Ul(Lr),[_d]=Kt(Lr,[rL,JR]),ay=JR(),tA=O.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return h.jsx(sy.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?h.jsx(aL,{...i,ref:t}):h.jsx(sL,{...o,ref:t})})});tA.displayName=Lr;var[nA,oL]=_d(Lr),[rA,iL]=_d(Lr,{collapsible:!1}),sL=O.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=fn({prop:n,defaultProp:r??"",onChange:o,caller:Lr});return h.jsx(nA,{scope:e.__scopeAccordion,value:O.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:O.useCallback(()=>i&&l(""),[i,l]),children:h.jsx(rA,{scope:e.__scopeAccordion,collapsible:i,children:h.jsx(oA,{...s,ref:t})})})}),aL=O.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s,a]=fn({prop:n,defaultProp:r??[],onChange:o,caller:Lr}),l=O.useCallback(c=>a((d=[])=>[...d,c]),[a]),u=O.useCallback(c=>a((d=[])=>d.filter(f=>f!==c)),[a]);return h.jsx(nA,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:u,children:h.jsx(rA,{scope:e.__scopeAccordion,collapsible:!0,children:h.jsx(oA,{...i,ref:t})})})}),[lL,Md]=_d(Lr),oA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=O.useRef(null),l=Be(a,t),u=nL(n),d=gi(o)==="ltr",f=he(e.onKeyDown,p=>{if(!tL.includes(p.key))return;const g=p.target,m=u().filter(T=>!T.ref.current?.disabled),v=m.findIndex(T=>T.ref.current===g),y=m.length;if(v===-1)return;p.preventDefault();let x=v;const w=0,C=y-1,S=()=>{x=v+1,x>C&&(x=w)},R=()=>{x=v-1,x<w&&(x=C)};switch(p.key){case"Home":x=w;break;case"End":x=C;break;case"ArrowRight":i==="horizontal"&&(d?S():R());break;case"ArrowDown":i==="vertical"&&S();break;case"ArrowLeft":i==="horizontal"&&(d?R():S());break;case"ArrowUp":i==="vertical"&&R();break}const I=x%y;m[I].ref.current?.focus()});return h.jsx(lL,{scope:n,disabled:r,direction:o,orientation:i,children:h.jsx(sy.Slot,{scope:n,children:h.jsx(Ee.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),Fc="AccordionItem",[uL,ly]=_d(Fc),iA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Md(Fc,n),s=oL(Fc,n),a=ay(n),l=$t(),u=r&&s.value.includes(r)||!1,c=i.disabled||e.disabled;return h.jsx(uL,{scope:n,open:u,disabled:c,triggerId:l,children:h.jsx(eA,{"data-orientation":i.orientation,"data-state":dA(u),...a,...o,ref:t,disabled:c,open:u,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});iA.displayName=Fc;var sA="AccordionHeader",aA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Md(Lr,n),i=ly(sA,n);return h.jsx(Ee.h3,{"data-orientation":o.orientation,"data-state":dA(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});aA.displayName=sA;var xb="AccordionTrigger",lA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Md(Lr,n),i=ly(xb,n),s=iL(xb,n),a=ay(n);return h.jsx(sy.ItemSlot,{scope:n,children:h.jsx(KF,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});lA.displayName=xb;var uA="AccordionContent",cA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Md(Lr,n),i=ly(uA,n),s=ay(n);return h.jsx(QF,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});cA.displayName=uA;function dA(e){return e?"open":"closed"}var cL=tA,dL=iA,fL=aA,pL=lA,hL=cA;function fA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=fA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _o(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=fA(e))&&(r&&(r+=" "),r+=t);return r}const gL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mL=(e,t)=>({classGroupId:e,validator:t}),pA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lc="-",J0=[],bL="arbitrary..",vL=e=>{const t=xL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return yL(s);const a=s.split(Lc),l=a[0]===""&&a.length>1?1:0;return hA(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],u=n[s];return l?u?gL(u,l):l:u||J0}return n[s]||J0}}},hA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=hA(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(Lc):e.slice(t).join(Lc),l=s.length;for(let u=0;u<l;u++){const c=s[u];if(c.validator(a))return c.classGroupId}},yL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?bL+r:void 0})(),xL=e=>{const{theme:t,classGroups:n}=e;return wL(n,t)},wL=(e,t)=>{const n=pA();for(const r in e){const o=e[r];uy(o,n,r,t)}return n},uy=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];CL(s,t,n,r)}},CL=(e,t,n,r)=>{if(typeof e=="string"){SL(e,t,n);return}if(typeof e=="function"){EL(e,t,n,r);return}IL(e,t,n,r)},SL=(e,t,n)=>{const r=e===""?t:gA(t,e);r.classGroupId=n},EL=(e,t,n,r)=>{if(RL(e)){uy(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mL(n,e))},IL=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];uy(l,gA(t,a),n,r)}},gA=(e,t)=>{let n=e;const r=t.split(Lc),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=pA(),n.nextPart.set(s,a)),n=a}return n},RL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,AL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},wb="!",K0=":",TL=[],Q0=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),NL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,u;const c=o.length;for(let m=0;m<c;m++){const v=o[m];if(s===0&&a===0){if(v===K0){i.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){u=m;continue}}v==="["?s++:v==="]"?s--:v==="("?a++:v===")"&&a--}const d=i.length===0?o:o.slice(l);let f=d,p=!1;d.endsWith(wb)?(f=d.slice(0,-1),p=!0):d.startsWith(wb)&&(f=d.slice(1),p=!0);const g=u&&u>l?u-l:void 0;return Q0(i,p,f,g)};if(t){const o=t+K0,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Q0(TL,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},OL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},PL=e=>({cache:AL(e.cacheSize),parseClassName:NL(e),sortModifiers:OL(e),...vL(e)}),_L=/\s+/,ML=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(_L);let l="";for(let u=a.length-1;u>=0;u-=1){const c=a[u],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}=n(c);if(d){l=c+(l.length>0?" "+l:l);continue}let v=!!m,y=r(v?g.substring(0,m):g);if(!y){if(!v){l=c+(l.length>0?" "+l:l);continue}if(y=r(g),!y){l=c+(l.length>0?" "+l:l);continue}v=!1}const x=f.length===0?"":f.length===1?f[0]:i(f).join(":"),w=p?x+wb:x,C=w+y;if(s.indexOf(C)>-1)continue;s.push(C);const S=o(y,v);for(let R=0;R<S.length;++R){const I=S[R];s.push(w+I)}l=c+(l.length>0?" "+l:l)}return l},DL=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=mA(n))&&(o&&(o+=" "),o+=r);return o},mA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mA(e[r]))&&(n&&(n+=" "),n+=t);return n},ew=(e,...t)=>{let n,r,o,i;const s=l=>{const u=t.reduce((c,d)=>d(c),e());return n=PL(u),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const u=r(l);if(u)return u;const c=ML(l,n);return o(l,c),c};return i=s,(...l)=>i(DL(...l))},kL=[],tn=e=>{const t=n=>n[e]||kL;return t.isThemeGetter=!0,t},bA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jL=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,FL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LL=/\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$/,BL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,VL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$L=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xo=e=>jL.test(e),nt=e=>!!e&&!Number.isNaN(Number(e)),Zo=e=>!!e&&Number.isInteger(Number(e)),op=e=>e.endsWith("%")&&nt(e.slice(0,-1)),Co=e=>FL.test(e),yA=()=>!0,GL=e=>LL.test(e)&&!BL.test(e),cy=()=>!1,HL=e=>VL.test(e),WL=e=>$L.test(e),zL=e=>!Re(e)&&!Te(e),qL=e=>mi(e,CA,cy),Re=e=>bA.test(e),Bi=e=>mi(e,SA,GL),tw=e=>mi(e,eB,nt),UL=e=>mi(e,IA,yA),YL=e=>mi(e,EA,cy),nw=e=>mi(e,xA,cy),XL=e=>mi(e,wA,WL),Du=e=>mi(e,RA,HL),Te=e=>vA.test(e),ka=e=>us(e,SA),ZL=e=>us(e,EA),rw=e=>us(e,xA),JL=e=>us(e,CA),KL=e=>us(e,wA),ku=e=>us(e,RA,!0),QL=e=>us(e,IA,!0),mi=(e,t,n)=>{const r=bA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},us=(e,t,n=!1)=>{const r=vA.exec(e);return r?r[1]?t(r[1]):n:!1},xA=e=>e==="position"||e==="percentage",wA=e=>e==="image"||e==="url",CA=e=>e==="length"||e==="size"||e==="bg-size",SA=e=>e==="length",eB=e=>e==="number",EA=e=>e==="family-name",IA=e=>e==="number"||e==="weight",RA=e=>e==="shadow",ow=()=>{const e=tn("color"),t=tn("font"),n=tn("text"),r=tn("font-weight"),o=tn("tracking"),i=tn("leading"),s=tn("breakpoint"),a=tn("container"),l=tn("spacing"),u=tn("radius"),c=tn("shadow"),d=tn("inset-shadow"),f=tn("text-shadow"),p=tn("drop-shadow"),g=tn("blur"),m=tn("perspective"),v=tn("aspect"),y=tn("ease"),x=tn("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...C(),Te,Re],R=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],T=()=>[Te,Re,l],M=()=>[Xo,"full","auto",...T()],V=()=>[Zo,"none","subgrid",Te,Re],A=()=>["auto",{span:["full",Zo,Te,Re]},Zo,Te,Re],P=()=>[Zo,"auto",Te,Re],N=()=>["auto","min","max","fr",Te,Re],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...T()],$=()=>[Xo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],G=()=>[Xo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],z=()=>[Xo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],H=()=>[e,Te,Re],ne=()=>[...C(),rw,nw,{position:[Te,Re]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",JL,qL,{size:[Te,Re]}],K=()=>[op,ka,Bi],U=()=>["","none","full",u,Te,Re],oe=()=>["",nt,ka,Bi],X=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[nt,op,rw,nw],se=()=>["","none",g,Te,Re],ae=()=>["none",nt,Te,Re],F=()=>["none",nt,Te,Re],Z=()=>[nt,Te,Re],k=()=>[Xo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Co],breakpoint:[Co],color:[yA],container:[Co],"drop-shadow":[Co],ease:["in","out","in-out"],font:[zL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Co],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Co],shadow:[Co],spacing:["px",nt],text:[Co],"text-shadow":[Co],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xo,Re,Te,v]}],container:["container"],columns:[{columns:[nt,Re,Te,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:S()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Zo,"auto",Te,Re]}],basis:[{basis:[Xo,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,Xo,"auto","initial","none",Re]}],grow:[{grow:["",nt,Te,Re]}],shrink:[{shrink:["",nt,Te,Re]}],order:[{order:[Zo,"first","last","none",Te,Re]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[a,"screen",...$()]}],"min-w":[{"min-w":[a,"screen","none",...$()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,ka,Bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,QL,UL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",op,Re]}],"font-family":[{font:[ZL,YL,t]}],"font-features":[{"font-features":[Re]}],"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:[o,Te,Re]}],"line-clamp":[{"line-clamp":[nt,"none",Te,tw]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",Te,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",Te,Bi]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[nt,"auto",Te,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Re]}],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",Te,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zo,Te,Re],radial:["",Te,Re],conic:[Zo,Te,Re]},KL,XL]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,Te,Re]}],"outline-w":[{outline:["",nt,ka,Bi]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",c,ku,Du]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",d,ku,Du]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[nt,Bi]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",f,ku,Du]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[nt,Te,Re]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Te,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Re]}],filter:[{filter:["","none",Te,Re]}],blur:[{blur:se()}],brightness:[{brightness:[nt,Te,Re]}],contrast:[{contrast:[nt,Te,Re]}],"drop-shadow":[{"drop-shadow":["","none",p,ku,Du]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",nt,Te,Re]}],"hue-rotate":[{"hue-rotate":[nt,Te,Re]}],invert:[{invert:["",nt,Te,Re]}],saturate:[{saturate:[nt,Te,Re]}],sepia:[{sepia:["",nt,Te,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Re]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[nt,Te,Re]}],"backdrop-contrast":[{"backdrop-contrast":[nt,Te,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,Te,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,Te,Re]}],"backdrop-invert":[{"backdrop-invert":["",nt,Te,Re]}],"backdrop-opacity":[{"backdrop-opacity":[nt,Te,Re]}],"backdrop-saturate":[{"backdrop-saturate":[nt,Te,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,Te,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",Te,Re]}],ease:[{ease:["linear","initial",y,Te,Re]}],delay:[{delay:[nt,Te,Re]}],animate:[{animate:["none",x,Te,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Te,Re]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[Te,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:k()}],"translate-x":[{"translate-x":k()}],"translate-y":[{"translate-y":k()}],"translate-z":[{"translate-z":k()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",Te,Re]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Te,Re]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[nt,ka,Bi,tw]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},tB=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:o={},override:i={}})=>(Ja(e,"cacheSize",t),Ja(e,"prefix",n),Ja(e,"experimentalParseClassName",r),ju(e.theme,i.theme),ju(e.classGroups,i.classGroups),ju(e.conflictingClassGroups,i.conflictingClassGroups),ju(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Ja(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Fu(e.theme,o.theme),Fu(e.classGroups,o.classGroups),Fu(e.conflictingClassGroups,o.conflictingClassGroups),Fu(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),AA(e,o,"orderSensitiveModifiers"),e),Ja=(e,t,n)=>{n!==void 0&&(e[t]=n)},ju=(e,t)=>{if(t)for(const n in t)Ja(e,n,t[n])},Fu=(e,t)=>{if(t)for(const n in t)AA(e,t,n)},AA=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},nB=(e,...t)=>typeof e=="function"?ew(ow,e,...t):ew(()=>tB(ow(),e),...t),TA=6048e5,rB=864e5,iw=Symbol.for("constructDateFrom");function Jt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&iw in e?e[iw](t):e instanceof Date?new e.constructor(t):new Date(t)}function St(e,t){return Jt(t||e,e)}function dy(e,t,n){const r=St(e,n?.in);return isNaN(t)?Jt(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function fy(e,t,n){const r=St(e,n?.in);if(isNaN(t))return Jt(e,NaN);if(!t)return r;const o=r.getDate(),i=Jt(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return o>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}let oB={};function Yl(){return oB}function Yi(e,t){const n=Yl(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=St(e,t?.in),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function wl(e,t){return Yi(e,{...t,weekStartsOn:1})}function NA(e,t){const n=St(e,t?.in),r=n.getFullYear(),o=Jt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=wl(o),s=Jt(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const a=wl(s);return n.getTime()>=i.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function sw(e){const t=St(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ha(e,...t){const n=Jt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Cl(e,t){const n=St(e,t?.in);return n.setHours(0,0,0,0),n}function py(e,t,n){const[r,o]=ha(n?.in,e,t),i=Cl(r),s=Cl(o),a=+i-sw(i),l=+s-sw(s);return Math.round((a-l)/rB)}function iB(e,t){const n=NA(e,t),r=Jt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),wl(r)}function sB(e,t,n){return dy(e,t*7,n)}function aB(e,t,n){return fy(e,t*12,n)}function lB(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Jt.bind(null,o));const i=St(o,r);(!n||n<i||isNaN(+i))&&(n=i)}),Jt(r,n||NaN)}function uB(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Jt.bind(null,o));const i=St(o,r);(!n||n>i||isNaN(+i))&&(n=i)}),Jt(r,n||NaN)}function Cb(e,t,n){const[r,o]=ha(n?.in,e,t);return+Cl(r)==+Cl(o)}function OA(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function PA(e){return!(!OA(e)&&typeof e!="number"||isNaN(+St(e)))}function _A(e,t,n){const[r,o]=ha(n?.in,e,t),i=r.getFullYear()-o.getFullYear(),s=r.getMonth()-o.getMonth();return i*12+s}function MA(e,t){const n=St(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function DA(e,t){const[n,r]=ha(e,t.start,t.end);return{start:n,end:r}}function cB(e,t){const{start:n,end:r}=DA(t?.in,e);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=1;const l=[];for(;+s<=i;)l.push(Jt(n,s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function Sb(e,t){const n=St(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function dB(e,t){const n=St(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function kA(e,t){const n=St(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function fB(e,t){const{start:n,end:r}=DA(t?.in,e);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setMonth(0,1);let a=1;const l=[];for(;+s<=i;)l.push(Jt(n,s)),s.setFullYear(s.getFullYear()+a);return o?l.reverse():l}function jA(e,t){const n=Yl(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=St(e,t?.in),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function pB(e,t){return jA(e,{...t,weekStartsOn:1})}const hB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},gB=(e,t,n)=>{let r;const o=hB[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ip(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const mB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},yB={date:ip({formats:mB,defaultWidth:"full"}),time:ip({formats:bB,defaultWidth:"full"}),dateTime:ip({formats:vB,defaultWidth:"full"})},xB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wB=(e,t,n,r)=>xB[e];function ja(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const CB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},SB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},EB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},IB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},AB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},TB=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},NB={ordinalNumber:TB,era:ja({values:CB,defaultWidth:"wide"}),quarter:ja({values:SB,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ja({values:EB,defaultWidth:"wide"}),day:ja({values:IB,defaultWidth:"wide"}),dayPeriod:ja({values:RB,defaultWidth:"wide",formattingValues:AB,defaultFormattingWidth:"wide"})};function Fa(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?PB(a,d=>d.test(s)):OB(a,d=>d.test(s));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(s.length);return{value:u,rest:c}}}function OB(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function PB(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _B(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const MB=/^(\d+)(th|st|nd|rd)?/i,DB=/\d+/i,kB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jB={any:[/^b/i,/^(a|c)/i]},FB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},LB={any:[/1/i,/2/i,/3/i,/4/i]},BB={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},VB={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$B={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},GB={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},HB={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},WB={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},zB={ordinalNumber:_B({matchPattern:MB,parsePattern:DB,valueCallback:e=>parseInt(e,10)}),era:Fa({matchPatterns:kB,defaultMatchWidth:"wide",parsePatterns:jB,defaultParseWidth:"any"}),quarter:Fa({matchPatterns:FB,defaultMatchWidth:"wide",parsePatterns:LB,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Fa({matchPatterns:BB,defaultMatchWidth:"wide",parsePatterns:VB,defaultParseWidth:"any"}),day:Fa({matchPatterns:$B,defaultMatchWidth:"wide",parsePatterns:GB,defaultParseWidth:"any"}),dayPeriod:Fa({matchPatterns:HB,defaultMatchWidth:"any",parsePatterns:WB,defaultParseWidth:"any"})},js={code:"en-US",formatDistance:gB,formatLong:yB,formatRelative:wB,localize:NB,match:zB,options:{weekStartsOn:0,firstWeekContainsDate:1}};function qB(e,t){const n=St(e,t?.in);return py(n,kA(n))+1}function hy(e,t){const n=St(e,t?.in),r=+wl(n)-+iB(n);return Math.round(r/TA)+1}function FA(e,t){const n=St(e,t?.in),r=n.getFullYear(),o=Yl(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=Jt(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Yi(s,t),l=Jt(t?.in||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=Yi(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function UB(e,t){const n=Yl(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=FA(e,t),i=Jt(t?.in||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Yi(i,t)}function gy(e,t){const n=St(e,t?.in),r=+Yi(n,t)-+UB(n,t);return Math.round(r/TA)+1}function Ct(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Jo={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ct(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ct(n+1,2)},d(e,t){return Ct(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ct(e.getHours()%12||12,t.length)},H(e,t){return Ct(e.getHours(),t.length)},m(e,t){return Ct(e.getMinutes(),t.length)},s(e,t){return Ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ct(o,t.length)}},Os={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},aw={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Jo.y(e,t)},Y:function(e,t,n,r){const o=FA(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Ct(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ct(i,t.length)},R:function(e,t){const n=NA(e);return Ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ct(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ct(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ct(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Jo.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ct(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=gy(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ct(o,t.length)},I:function(e,t,n){const r=hy(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ct(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Jo.d(e,t)},D:function(e,t,n){const r=qB(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ct(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ct(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ct(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Ct(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Os.noon:r===0?o=Os.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Os.evening:r>=12?o=Os.afternoon:r>=4?o=Os.morning:o=Os.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Jo.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Jo.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Jo.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Jo.s(e,t)},S:function(e,t){return Jo.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return uw(r);case"XXXX":case"XX":return Hi(r);default:return Hi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return uw(r);case"xxxx":case"xx":return Hi(r);default:return Hi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+lw(r,":");default:return"GMT"+Hi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+lw(r,":");default:return"GMT"+Hi(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ct(r,t.length)},T:function(e,t,n){return Ct(+e,t.length)}};function lw(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+Ct(i,2)}function uw(e,t){return e%60===0?(e>0?"-":"+")+Ct(Math.abs(e)/60,2):Hi(e,t)}function Hi(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ct(Math.trunc(r/60),2),i=Ct(r%60,2);return n+o+t+i}const cw=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},LA=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},YB=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return cw(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",cw(r,t)).replace("{{time}}",LA(o,t))},XB={p:LA,P:YB},ZB=/^D+$/,JB=/^Y+$/,KB=["D","DD","YY","YYYY"];function QB(e){return ZB.test(e)}function eV(e){return JB.test(e)}function tV(e,t,n){const r=nV(e,t,n);if(console.warn(r),KB.includes(e))throw new RangeError(r)}function nV(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,iV=/^'([^]*?)'?$/,sV=/''/g,aV=/[a-zA-Z]/;function ti(e,t,n){const r=Yl(),o=n?.locale??r.locale??js,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=St(e,n?.in);if(!PA(a))throw new RangeError("Invalid time value");let l=t.match(oV).map(c=>{const d=c[0];if(d==="p"||d==="P"){const f=XB[d];return f(c,o.formatLong)}return c}).join("").match(rV).map(c=>{if(c==="''")return{isToken:!1,value:"'"};const d=c[0];if(d==="'")return{isToken:!1,value:lV(c)};if(aw[d])return{isToken:!0,value:c};if(d.match(aV))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:c}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(c=>{if(!c.isToken)return c.value;const d=c.value;(!n?.useAdditionalWeekYearTokens&&eV(d)||!n?.useAdditionalDayOfYearTokens&&QB(d))&&tV(d,t,String(e));const f=aw[d[0]];return f(a,d,o.localize,u)}).join("")}function lV(e){const t=e.match(iV);return t?t[1].replace(sV,"'"):e}function uV(e,t){const n=St(e,t?.in),r=n.getFullYear(),o=n.getMonth(),i=Jt(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function cV(e,t){return St(e,t?.in).getMonth()}function dV(e,t){return St(e,t?.in).getFullYear()}function fV(e,t){return+St(e)>+St(t)}function pV(e,t){return+St(e)<+St(t)}function hV(e,t,n){const[r,o]=ha(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function gV(e,t,n){const[r,o]=ha(n?.in,e,t);return r.getFullYear()===o.getFullYear()}function dw(e,t,n){return dy(e,-t,n)}function mV(e,t,n){const r=St(e,n?.in),o=r.getFullYear(),i=r.getDate(),s=Jt(e,0);s.setFullYear(o,t,15),s.setHours(0,0,0,0);const a=uV(s);return r.setMonth(t,Math.min(i,a)),r}function bV(e,t,n){const r=St(e,n?.in);return isNaN(+r)?Jt(e,NaN):(r.setFullYear(t),r)}function fw(e,t,n){return fy(e,-1,n)}const vV=nB({prefix:"ui"});function L(...e){return vV(_o(e))}function yV(...e){return t=>{for(const n of e)typeof n=="function"?n(t):n!=null&&(n.current=t)}}const qi=(e,t="MMM d, yyyy h:mmaaa",n)=>PA(e)?ti(e,t,n):ti(new Date,t,n);function BA({...e}){return h.jsx(cL,{"data-slot":"accordion",...e})}function VA({className:e,...t}){return h.jsx(dL,{"data-slot":"accordion-item",className:L("ui:border-b ui:last:border-b-0",e),...t})}function $A({className:e,children:t,...n}){return h.jsx(fL,{className:"ui:flex",children:h.jsxs(pL,{"data-slot":"accordion-trigger",className:L("ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:flex ui:flex-1 ui:items-start ui:justify-between ui:gap-4 ui:rounded-md ui:py-4 ui:text-left ui:text-sm ui:font-medium ui:transition-all ui:outline-none ui:hover:underline ui:focus-visible:ring-[3px] ui:disabled:pointer-events-none ui:disabled:opacity-50 ui:[&[data-state=open]>svg]:rotate-180",e),...n,children:[t,h.jsx(Oe.ChevronDownIcon,{className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4 ui:shrink-0 ui:translate-y-0.5 ui:transition-transform ui:duration-200"})]})})}function GA({className:e,wrapperClassName:t,children:n,...r}){return h.jsx(hL,{"data-slot":"accordion-content",className:L("ui:data-[state=closed]:animate-accordion-up ui:data-[state=open]:animate-accordion-down ui:overflow-hidden ui:text-sm",t),...r,children:h.jsx("div",{className:L("ui:pt-0 ui:pb-4",e),children:n})})}var HA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xV="VisuallyHidden",WA=b.forwardRef((e,t)=>h.jsx(Ee.span,{...e,ref:t,style:{...HA,...e.style}}));WA.displayName=xV;var wV=WA;function rn(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function CV(e,t=globalThis?.document){const n=rn(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var SV="DismissableLayer",Eb="dismissableLayer.update",EV="dismissableLayer.pointerDownOutside",IV="dismissableLayer.focusOutside",pw,zA=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cs=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=b.useContext(zA),[c,d]=b.useState(null),f=c?.ownerDocument??globalThis?.document,[,p]=b.useState({}),g=Be(t,I=>d(I)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),x=c?m.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=y,S=TV(I=>{const T=I.target,M=[...u.branches].some(V=>V.contains(T));!C||M||(o?.(I),s?.(I),I.defaultPrevented||a?.())},f),R=NV(I=>{const T=I.target;[...u.branches].some(V=>V.contains(T))||(i?.(I),s?.(I),I.defaultPrevented||a?.())},f);return CV(I=>{x===u.layers.size-1&&(r?.(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},f),b.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(pw=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),hw(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=pw)}},[c,f,n,u]),b.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),hw())},[c,u]),b.useEffect(()=>{const I=()=>p({});return document.addEventListener(Eb,I),()=>document.removeEventListener(Eb,I)},[]),h.jsx(Ee.div,{...l,ref:g,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,R.onFocusCapture),onBlurCapture:he(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,S.onPointerDownCapture)})});cs.displayName=SV;var RV="DismissableLayerBranch",AV=b.forwardRef((e,t)=>{const n=b.useContext(zA),r=b.useRef(null),o=Be(t,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(Ee.div,{...e,ref:o})});AV.displayName=RV;function TV(e,t=globalThis?.document){const n=rn(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){qA(EV,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function NV(e,t=globalThis?.document){const n=rn(e),r=b.useRef(!1);return b.useEffect(()=>{const o=i=>{i.target&&!r.current&&qA(IV,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hw(){const e=new CustomEvent(Eb);document.dispatchEvent(e)}function qA(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ZR(o,i):o.dispatchEvent(i)}var sp="focusScope.autoFocusOnMount",ap="focusScope.autoFocusOnUnmount",gw={bubbles:!1,cancelable:!0},OV="FocusScope",Xl=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=b.useState(null),u=rn(o),c=rn(i),d=b.useRef(null),f=Be(t,m=>l(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(w){if(p.paused||!a)return;const C=w.target;a.contains(C)?d.current=C:Ko(d.current,{select:!0})},v=function(w){if(p.paused||!a)return;const C=w.relatedTarget;C!==null&&(a.contains(C)||Ko(d.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Ko(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(y);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[r,a,p.paused]),b.useEffect(()=>{if(a){bw.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(sp,gw);a.addEventListener(sp,u),a.dispatchEvent(y),y.defaultPrevented||(PV(jV(UA(a)),{select:!0}),document.activeElement===m&&Ko(a))}return()=>{a.removeEventListener(sp,u),setTimeout(()=>{const y=new CustomEvent(ap,gw);a.addEventListener(ap,c),a.dispatchEvent(y),y.defaultPrevented||Ko(m??document.body,{select:!0}),a.removeEventListener(ap,c),bw.remove(p)},0)}}},[a,u,c,p]);const g=b.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const x=m.currentTarget,[w,C]=_V(x);w&&C?!m.shiftKey&&y===C?(m.preventDefault(),n&&Ko(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&Ko(C,{select:!0})):y===x&&m.preventDefault()}},[n,r,p.paused]);return h.jsx(Ee.div,{tabIndex:-1,...s,ref:f,onKeyDown:g})});Xl.displayName=OV;function PV(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ko(r,{select:t}),document.activeElement!==n)return}function _V(e){const t=UA(e),n=mw(t,e),r=mw(t.reverse(),e);return[n,r]}function UA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mw(e,t){for(const n of e)if(!MV(n,{upTo:t}))return n}function MV(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function DV(e){return e instanceof HTMLInputElement&&"select"in e}function Ko(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&DV(e)&&t&&e.select()}}var bw=kV();function kV(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=vw(e,t),e.unshift(t)},remove(t){e=vw(e,t),e[0]?.resume()}}}function vw(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jV(e){return e.filter(t=>t.tagName!=="A")}var FV="Portal",ds=b.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=b.useState(!1);qt(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?Qv.createPortal(h.jsx(Ee.div,{...r,ref:t}),s):null});ds.displayName=FV;var lp=0;function Dd(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yw()),document.body.insertAdjacentElement("beforeend",e[1]??yw()),lp++,()=>{lp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lp--}},[])}function yw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qr=function(){return Qr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Qr.apply(this,arguments)};function YA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function LV(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ic="right-scroll-bar-position",Rc="width-before-scroll-bar",BV="with-scroll-bars-hidden",VV="--removed-body-scroll-bar-size";function up(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $V(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var GV=typeof window<"u"?b.useLayoutEffect:b.useEffect,xw=new WeakMap;function HV(e,t){var n=$V(null,function(r){return e.forEach(function(o){return up(o,r)})});return GV(function(){var r=xw.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||up(a,null)}),i.forEach(function(a){o.has(a)||up(a,s)})}xw.set(n,e)},[e]),n}function WV(e){return e}function zV(e,t){t===void 0&&(t=WV);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var c=s;s=[],c.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){s.push(c),u()},filter:function(c){return s=s.filter(c),n}}}};return o}function qV(e){e===void 0&&(e={});var t=zV(null);return t.options=Qr({async:!0,ssr:!1},e),t}var XA=function(e){var t=e.sideCar,n=YA(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,Qr({},n))};XA.isSideCarExport=!0;function UV(e,t){return e.useMedium(t),XA}var ZA=qV(),cp=function(){},kd=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:cp,onWheelCapture:cp,onTouchMoveCapture:cp}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,w=e.gapMode,C=YA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,R=HV([n,t]),I=Qr(Qr({},C),o);return b.createElement(b.Fragment,null,c&&b.createElement(S,{sideCar:ZA,removeScrollBar:u,shards:d,noRelative:p,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),s?b.cloneElement(b.Children.only(a),Qr(Qr({},I),{ref:R})):b.createElement(x,Qr({},I,{className:l,ref:R}),a))});kd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kd.classNames={fullWidth:Rc,zeroRight:Ic};var YV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=YV();return t&&e.setAttribute("nonce",t),e}function ZV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var KV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XV())&&(ZV(t,n),JV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QV=function(){var e=KV();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},JA=function(){var e=QV(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},e4={left:0,top:0,right:0,gap:0},dp=function(e){return parseInt(e||"",10)||0},t4=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[dp(n),dp(r),dp(o)]},n4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return e4;var t=t4(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},r4=JA(),qs="data-scroll-locked",o4=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),O=require("react"),Qv=require("react-dom"),Oe=require("lucide-react"),Mn=require("react-hook-form"),ey=require("sonner"),MF=require("@tanstack/react-query");function UR(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=UR(O),ao=UR(Qv);function DF(e,t){const n=b.createContext(t),r=i=>{const{children:s,...a}=i,l=b.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=b.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Kt(e,t=[]){let n=[];function r(i,s){const a=b.createContext(s),l=n.length;n=[...n,s];const u=d=>{const{scope:f,children:p,...g}=d,m=f?.[e]?.[l]||a,v=b.useMemo(()=>g,Object.values(g));return h.jsx(m.Provider,{value:v,children:p})};u.displayName=i+"Provider";function c(d,f){const p=f?.[e]?.[l]||a,g=b.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>b.createContext(s));return function(a){const l=a?.[e]||i;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,kF(o,...t)]}function kF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Z0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function oo(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Z0(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Z0(e[o],null)}}}}function Be(...e){return b.useCallback(oo(...e),e)}function Ui(e){const t=jF(e),n=b.forwardRef((r,o)=>{const{children:i,...s}=r,a=b.Children.toArray(i),l=a.find(FF);if(l){const u=l.props.children,c=a.map(d=>d===l?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:d);return h.jsx(t,{...s,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,c):null})}return h.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function jF(e){const t=b.forwardRef((n,r)=>{const{children:o,...i}=n;if(b.isValidElement(o)){const s=BF(o),a=LF(i,o.props);return o.type!==b.Fragment&&(a.ref=r?oo(r,s):s),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YR=Symbol("radix.slottable");function XR(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=YR,t}function FF(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YR}function LF(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function BF(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ul(e){const t=e+"CollectionProvider",[n,r]=Kt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:y}=m,x=O.useRef(null),w=O.useRef(new Map).current;return h.jsx(o,{scope:v,itemMap:w,collectionRef:x,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Ui(a),u=O.forwardRef((m,v)=>{const{scope:y,children:x}=m,w=i(a,y),C=Be(v,w.collectionRef);return h.jsx(l,{ref:C,children:x})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=Ui(c),p=O.forwardRef((m,v)=>{const{scope:y,children:x,...w}=m,C=O.useRef(null),S=Be(v,C),R=i(c,y);return O.useEffect(()=>(R.itemMap.set(C,{ref:C,...w}),()=>{R.itemMap.delete(C)})),h.jsx(f,{[d]:"",ref:S,children:x})});p.displayName=c;function g(m){const v=i(e+"CollectionConsumer",m);return O.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((R,I)=>w.indexOf(R.ref.current)-w.indexOf(I.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},g,r]}function he(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qt=globalThis?.document?b.useLayoutEffect:()=>{},VF=b[" useInsertionEffect ".trim().toString()]||qt;function fn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=$F({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const c=b.useRef(e!==void 0);b.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=b.useCallback(c=>{if(a){const d=GF(c)?c(e):c;d!==e&&s.current?.(d)}else i(c)},[a,e,i,s]);return[l,u]}function $F({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),o=b.useRef(n),i=b.useRef(t);return VF(()=>{i.current=t},[t]),b.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function GF(e){return typeof e=="function"}var HF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=HF.reduce((e,t)=>{const n=Ui(`Primitive.${t}`),r=b.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ZR(e,t){e&&ao.flushSync(()=>e.dispatchEvent(t))}function WF(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Ht=e=>{const{present:t,children:n}=e,r=zF(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=Be(r.ref,qF(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:i}):null};Ht.displayName="Presence";function zF(e){const[t,n]=b.useState(),r=b.useRef(null),o=b.useRef(e),i=b.useRef("none"),s=e?"mounted":"unmounted",[a,l]=WF(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Mu(r.current);i.current=a==="mounted"?u:"none"},[a]),qt(()=>{const u=r.current,c=o.current;if(c!==e){const f=i.current,p=Mu(u);e?l("MOUNT"):p==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qt(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const m=Mu(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=p=>{p.target===t&&(i.current=Mu(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Mu(e){return e?.animationName||"none"}function qF(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var UF=b[" useId ".trim().toString()]||(()=>{}),YF=0;function $t(e){const[t,n]=b.useState(UF());return qt(()=>{n(r=>r??String(YF++))},[e]),t?`radix-${t}`:""}var Pd="Collapsible",[XF,JR]=Kt(Pd),[ZF,ty]=XF(Pd),KR=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,u]=fn({prop:r,defaultProp:o??!1,onChange:s,caller:Pd});return h.jsx(ZF,{scope:n,disabled:i,contentId:$t(),open:l,onOpenToggle:b.useCallback(()=>u(c=>!c),[u]),children:h.jsx(Ee.div,{"data-state":iy(l),"data-disabled":i?"":void 0,...a,ref:t})})});KR.displayName=Pd;var QR="CollapsibleTrigger",ny=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ty(QR,n);return h.jsx(Ee.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":iy(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:he(e.onClick,o.onOpenToggle)})});ny.displayName=QR;var ry="CollapsibleContent",oy=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ty(ry,e.__scopeCollapsible);return h.jsx(Ht,{present:n||o.open,children:({present:i})=>h.jsx(JF,{...r,ref:t,present:i})})});oy.displayName=ry;var JF=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=ty(ry,n),[a,l]=b.useState(r),u=b.useRef(null),c=Be(t,u),d=b.useRef(0),f=d.current,p=b.useRef(0),g=p.current,m=s.open||a,v=b.useRef(m),y=b.useRef(void 0);return b.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),qt(()=>{const x=u.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();d.current=w.height,p.current=w.width,v.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),l(r)}},[s.open,r]),h.jsx(Ee.div,{"data-state":iy(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&o})});function iy(e){return e?"open":"closed"}var eA=KR,KF=ny,QF=oy,eL=b.createContext(void 0);function gi(e){const t=b.useContext(eL);return e||t||"ltr"}var Lr="Accordion",tL=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[sy,nL,rL]=Ul(Lr),[_d]=Kt(Lr,[rL,JR]),ay=JR(),tA=O.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return h.jsx(sy.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?h.jsx(aL,{...i,ref:t}):h.jsx(sL,{...o,ref:t})})});tA.displayName=Lr;var[nA,oL]=_d(Lr),[rA,iL]=_d(Lr,{collapsible:!1}),sL=O.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=fn({prop:n,defaultProp:r??"",onChange:o,caller:Lr});return h.jsx(nA,{scope:e.__scopeAccordion,value:O.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:O.useCallback(()=>i&&l(""),[i,l]),children:h.jsx(rA,{scope:e.__scopeAccordion,collapsible:i,children:h.jsx(oA,{...s,ref:t})})})}),aL=O.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s,a]=fn({prop:n,defaultProp:r??[],onChange:o,caller:Lr}),l=O.useCallback(c=>a((d=[])=>[...d,c]),[a]),u=O.useCallback(c=>a((d=[])=>d.filter(f=>f!==c)),[a]);return h.jsx(nA,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:u,children:h.jsx(rA,{scope:e.__scopeAccordion,collapsible:!0,children:h.jsx(oA,{...i,ref:t})})})}),[lL,Md]=_d(Lr),oA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=O.useRef(null),l=Be(a,t),u=nL(n),d=gi(o)==="ltr",f=he(e.onKeyDown,p=>{if(!tL.includes(p.key))return;const g=p.target,m=u().filter(T=>!T.ref.current?.disabled),v=m.findIndex(T=>T.ref.current===g),y=m.length;if(v===-1)return;p.preventDefault();let x=v;const w=0,C=y-1,S=()=>{x=v+1,x>C&&(x=w)},R=()=>{x=v-1,x<w&&(x=C)};switch(p.key){case"Home":x=w;break;case"End":x=C;break;case"ArrowRight":i==="horizontal"&&(d?S():R());break;case"ArrowDown":i==="vertical"&&S();break;case"ArrowLeft":i==="horizontal"&&(d?R():S());break;case"ArrowUp":i==="vertical"&&R();break}const I=x%y;m[I].ref.current?.focus()});return h.jsx(lL,{scope:n,disabled:r,direction:o,orientation:i,children:h.jsx(sy.Slot,{scope:n,children:h.jsx(Ee.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),Fc="AccordionItem",[uL,ly]=_d(Fc),iA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Md(Fc,n),s=oL(Fc,n),a=ay(n),l=$t(),u=r&&s.value.includes(r)||!1,c=i.disabled||e.disabled;return h.jsx(uL,{scope:n,open:u,disabled:c,triggerId:l,children:h.jsx(eA,{"data-orientation":i.orientation,"data-state":dA(u),...a,...o,ref:t,disabled:c,open:u,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});iA.displayName=Fc;var sA="AccordionHeader",aA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Md(Lr,n),i=ly(sA,n);return h.jsx(Ee.h3,{"data-orientation":o.orientation,"data-state":dA(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});aA.displayName=sA;var xb="AccordionTrigger",lA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Md(Lr,n),i=ly(xb,n),s=iL(xb,n),a=ay(n);return h.jsx(sy.ItemSlot,{scope:n,children:h.jsx(KF,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});lA.displayName=xb;var uA="AccordionContent",cA=O.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Md(Lr,n),i=ly(uA,n),s=ay(n);return h.jsx(QF,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});cA.displayName=uA;function dA(e){return e?"open":"closed"}var cL=tA,dL=iA,fL=aA,pL=lA,hL=cA;function fA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=fA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _o(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=fA(e))&&(r&&(r+=" "),r+=t);return r}const gL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mL=(e,t)=>({classGroupId:e,validator:t}),pA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lc="-",J0=[],bL="arbitrary..",vL=e=>{const t=xL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return yL(s);const a=s.split(Lc),l=a[0]===""&&a.length>1?1:0;return hA(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],u=n[s];return l?u?gL(u,l):l:u||J0}return n[s]||J0}}},hA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=hA(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(Lc):e.slice(t).join(Lc),l=s.length;for(let u=0;u<l;u++){const c=s[u];if(c.validator(a))return c.classGroupId}},yL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?bL+r:void 0})(),xL=e=>{const{theme:t,classGroups:n}=e;return wL(n,t)},wL=(e,t)=>{const n=pA();for(const r in e){const o=e[r];uy(o,n,r,t)}return n},uy=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];CL(s,t,n,r)}},CL=(e,t,n,r)=>{if(typeof e=="string"){SL(e,t,n);return}if(typeof e=="function"){EL(e,t,n,r);return}IL(e,t,n,r)},SL=(e,t,n)=>{const r=e===""?t:gA(t,e);r.classGroupId=n},EL=(e,t,n,r)=>{if(RL(e)){uy(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mL(n,e))},IL=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];uy(l,gA(t,a),n,r)}},gA=(e,t)=>{let n=e;const r=t.split(Lc),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=pA(),n.nextPart.set(s,a)),n=a}return n},RL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,AL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},wb="!",K0=":",TL=[],Q0=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),NL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,u;const c=o.length;for(let m=0;m<c;m++){const v=o[m];if(s===0&&a===0){if(v===K0){i.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){u=m;continue}}v==="["?s++:v==="]"?s--:v==="("?a++:v===")"&&a--}const d=i.length===0?o:o.slice(l);let f=d,p=!1;d.endsWith(wb)?(f=d.slice(0,-1),p=!0):d.startsWith(wb)&&(f=d.slice(1),p=!0);const g=u&&u>l?u-l:void 0;return Q0(i,p,f,g)};if(t){const o=t+K0,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Q0(TL,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},OL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},PL=e=>({cache:AL(e.cacheSize),parseClassName:NL(e),sortModifiers:OL(e),...vL(e)}),_L=/\s+/,ML=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(_L);let l="";for(let u=a.length-1;u>=0;u-=1){const c=a[u],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}=n(c);if(d){l=c+(l.length>0?" "+l:l);continue}let v=!!m,y=r(v?g.substring(0,m):g);if(!y){if(!v){l=c+(l.length>0?" "+l:l);continue}if(y=r(g),!y){l=c+(l.length>0?" "+l:l);continue}v=!1}const x=f.length===0?"":f.length===1?f[0]:i(f).join(":"),w=p?x+wb:x,C=w+y;if(s.indexOf(C)>-1)continue;s.push(C);const S=o(y,v);for(let R=0;R<S.length;++R){const I=S[R];s.push(w+I)}l=c+(l.length>0?" "+l:l)}return l},DL=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=mA(n))&&(o&&(o+=" "),o+=r);return o},mA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mA(e[r]))&&(n&&(n+=" "),n+=t);return n},ew=(e,...t)=>{let n,r,o,i;const s=l=>{const u=t.reduce((c,d)=>d(c),e());return n=PL(u),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const u=r(l);if(u)return u;const c=ML(l,n);return o(l,c),c};return i=s,(...l)=>i(DL(...l))},kL=[],tn=e=>{const t=n=>n[e]||kL;return t.isThemeGetter=!0,t},bA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jL=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,FL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LL=/\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$/,BL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,VL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$L=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xo=e=>jL.test(e),nt=e=>!!e&&!Number.isNaN(Number(e)),Zo=e=>!!e&&Number.isInteger(Number(e)),op=e=>e.endsWith("%")&&nt(e.slice(0,-1)),Co=e=>FL.test(e),yA=()=>!0,GL=e=>LL.test(e)&&!BL.test(e),cy=()=>!1,HL=e=>VL.test(e),WL=e=>$L.test(e),zL=e=>!Re(e)&&!Te(e),qL=e=>mi(e,CA,cy),Re=e=>bA.test(e),Bi=e=>mi(e,SA,GL),tw=e=>mi(e,eB,nt),UL=e=>mi(e,IA,yA),YL=e=>mi(e,EA,cy),nw=e=>mi(e,xA,cy),XL=e=>mi(e,wA,WL),Du=e=>mi(e,RA,HL),Te=e=>vA.test(e),ka=e=>us(e,SA),ZL=e=>us(e,EA),rw=e=>us(e,xA),JL=e=>us(e,CA),KL=e=>us(e,wA),ku=e=>us(e,RA,!0),QL=e=>us(e,IA,!0),mi=(e,t,n)=>{const r=bA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},us=(e,t,n=!1)=>{const r=vA.exec(e);return r?r[1]?t(r[1]):n:!1},xA=e=>e==="position"||e==="percentage",wA=e=>e==="image"||e==="url",CA=e=>e==="length"||e==="size"||e==="bg-size",SA=e=>e==="length",eB=e=>e==="number",EA=e=>e==="family-name",IA=e=>e==="number"||e==="weight",RA=e=>e==="shadow",ow=()=>{const e=tn("color"),t=tn("font"),n=tn("text"),r=tn("font-weight"),o=tn("tracking"),i=tn("leading"),s=tn("breakpoint"),a=tn("container"),l=tn("spacing"),u=tn("radius"),c=tn("shadow"),d=tn("inset-shadow"),f=tn("text-shadow"),p=tn("drop-shadow"),g=tn("blur"),m=tn("perspective"),v=tn("aspect"),y=tn("ease"),x=tn("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...C(),Te,Re],R=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],T=()=>[Te,Re,l],M=()=>[Xo,"full","auto",...T()],V=()=>[Zo,"none","subgrid",Te,Re],A=()=>["auto",{span:["full",Zo,Te,Re]},Zo,Te,Re],P=()=>[Zo,"auto",Te,Re],N=()=>["auto","min","max","fr",Te,Re],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...T()],$=()=>[Xo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],G=()=>[Xo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],z=()=>[Xo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],H=()=>[e,Te,Re],ne=()=>[...C(),rw,nw,{position:[Te,Re]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",JL,qL,{size:[Te,Re]}],K=()=>[op,ka,Bi],U=()=>["","none","full",u,Te,Re],oe=()=>["",nt,ka,Bi],X=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[nt,op,rw,nw],se=()=>["","none",g,Te,Re],ae=()=>["none",nt,Te,Re],F=()=>["none",nt,Te,Re],Z=()=>[nt,Te,Re],k=()=>[Xo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Co],breakpoint:[Co],color:[yA],container:[Co],"drop-shadow":[Co],ease:["in","out","in-out"],font:[zL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Co],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Co],shadow:[Co],spacing:["px",nt],text:[Co],"text-shadow":[Co],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xo,Re,Te,v]}],container:["container"],columns:[{columns:[nt,Re,Te,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:S()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Zo,"auto",Te,Re]}],basis:[{basis:[Xo,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,Xo,"auto","initial","none",Re]}],grow:[{grow:["",nt,Te,Re]}],shrink:[{shrink:["",nt,Te,Re]}],order:[{order:[Zo,"first","last","none",Te,Re]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[a,"screen",...$()]}],"min-w":[{"min-w":[a,"screen","none",...$()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,ka,Bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,QL,UL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",op,Re]}],"font-family":[{font:[ZL,YL,t]}],"font-features":[{"font-features":[Re]}],"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:[o,Te,Re]}],"line-clamp":[{"line-clamp":[nt,"none",Te,tw]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",Te,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",Te,Bi]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[nt,"auto",Te,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Re]}],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",Te,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zo,Te,Re],radial:["",Te,Re],conic:[Zo,Te,Re]},KL,XL]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,Te,Re]}],"outline-w":[{outline:["",nt,ka,Bi]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",c,ku,Du]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",d,ku,Du]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[nt,Bi]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",f,ku,Du]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[nt,Te,Re]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Te,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Re]}],filter:[{filter:["","none",Te,Re]}],blur:[{blur:se()}],brightness:[{brightness:[nt,Te,Re]}],contrast:[{contrast:[nt,Te,Re]}],"drop-shadow":[{"drop-shadow":["","none",p,ku,Du]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",nt,Te,Re]}],"hue-rotate":[{"hue-rotate":[nt,Te,Re]}],invert:[{invert:["",nt,Te,Re]}],saturate:[{saturate:[nt,Te,Re]}],sepia:[{sepia:["",nt,Te,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Re]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[nt,Te,Re]}],"backdrop-contrast":[{"backdrop-contrast":[nt,Te,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,Te,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,Te,Re]}],"backdrop-invert":[{"backdrop-invert":["",nt,Te,Re]}],"backdrop-opacity":[{"backdrop-opacity":[nt,Te,Re]}],"backdrop-saturate":[{"backdrop-saturate":[nt,Te,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,Te,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",Te,Re]}],ease:[{ease:["linear","initial",y,Te,Re]}],delay:[{delay:[nt,Te,Re]}],animate:[{animate:["none",x,Te,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Te,Re]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[Te,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:k()}],"translate-x":[{"translate-x":k()}],"translate-y":[{"translate-y":k()}],"translate-z":[{"translate-z":k()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",Te,Re]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Te,Re]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[nt,ka,Bi,tw]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},tB=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:o={},override:i={}})=>(Ja(e,"cacheSize",t),Ja(e,"prefix",n),Ja(e,"experimentalParseClassName",r),ju(e.theme,i.theme),ju(e.classGroups,i.classGroups),ju(e.conflictingClassGroups,i.conflictingClassGroups),ju(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Ja(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Fu(e.theme,o.theme),Fu(e.classGroups,o.classGroups),Fu(e.conflictingClassGroups,o.conflictingClassGroups),Fu(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),AA(e,o,"orderSensitiveModifiers"),e),Ja=(e,t,n)=>{n!==void 0&&(e[t]=n)},ju=(e,t)=>{if(t)for(const n in t)Ja(e,n,t[n])},Fu=(e,t)=>{if(t)for(const n in t)AA(e,t,n)},AA=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},nB=(e,...t)=>typeof e=="function"?ew(ow,e,...t):ew(()=>tB(ow(),e),...t),TA=6048e5,rB=864e5,iw=Symbol.for("constructDateFrom");function Jt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&iw in e?e[iw](t):e instanceof Date?new e.constructor(t):new Date(t)}function St(e,t){return Jt(t||e,e)}function dy(e,t,n){const r=St(e,n?.in);return isNaN(t)?Jt(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function fy(e,t,n){const r=St(e,n?.in);if(isNaN(t))return Jt(e,NaN);if(!t)return r;const o=r.getDate(),i=Jt(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return o>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}let oB={};function Yl(){return oB}function Yi(e,t){const n=Yl(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=St(e,t?.in),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function wl(e,t){return Yi(e,{...t,weekStartsOn:1})}function NA(e,t){const n=St(e,t?.in),r=n.getFullYear(),o=Jt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=wl(o),s=Jt(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const a=wl(s);return n.getTime()>=i.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function sw(e){const t=St(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ha(e,...t){const n=Jt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Cl(e,t){const n=St(e,t?.in);return n.setHours(0,0,0,0),n}function py(e,t,n){const[r,o]=ha(n?.in,e,t),i=Cl(r),s=Cl(o),a=+i-sw(i),l=+s-sw(s);return Math.round((a-l)/rB)}function iB(e,t){const n=NA(e,t),r=Jt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),wl(r)}function sB(e,t,n){return dy(e,t*7,n)}function aB(e,t,n){return fy(e,t*12,n)}function lB(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Jt.bind(null,o));const i=St(o,r);(!n||n<i||isNaN(+i))&&(n=i)}),Jt(r,n||NaN)}function uB(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Jt.bind(null,o));const i=St(o,r);(!n||n>i||isNaN(+i))&&(n=i)}),Jt(r,n||NaN)}function Cb(e,t,n){const[r,o]=ha(n?.in,e,t);return+Cl(r)==+Cl(o)}function OA(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function PA(e){return!(!OA(e)&&typeof e!="number"||isNaN(+St(e)))}function _A(e,t,n){const[r,o]=ha(n?.in,e,t),i=r.getFullYear()-o.getFullYear(),s=r.getMonth()-o.getMonth();return i*12+s}function MA(e,t){const n=St(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function DA(e,t){const[n,r]=ha(e,t.start,t.end);return{start:n,end:r}}function cB(e,t){const{start:n,end:r}=DA(t?.in,e);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=1;const l=[];for(;+s<=i;)l.push(Jt(n,s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function Sb(e,t){const n=St(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function dB(e,t){const n=St(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function kA(e,t){const n=St(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function fB(e,t){const{start:n,end:r}=DA(t?.in,e);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setMonth(0,1);let a=1;const l=[];for(;+s<=i;)l.push(Jt(n,s)),s.setFullYear(s.getFullYear()+a);return o?l.reverse():l}function jA(e,t){const n=Yl(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=St(e,t?.in),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function pB(e,t){return jA(e,{...t,weekStartsOn:1})}const hB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},gB=(e,t,n)=>{let r;const o=hB[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ip(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const mB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},yB={date:ip({formats:mB,defaultWidth:"full"}),time:ip({formats:bB,defaultWidth:"full"}),dateTime:ip({formats:vB,defaultWidth:"full"})},xB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wB=(e,t,n,r)=>xB[e];function ja(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const CB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},SB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},EB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},IB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},AB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},TB=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},NB={ordinalNumber:TB,era:ja({values:CB,defaultWidth:"wide"}),quarter:ja({values:SB,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ja({values:EB,defaultWidth:"wide"}),day:ja({values:IB,defaultWidth:"wide"}),dayPeriod:ja({values:RB,defaultWidth:"wide",formattingValues:AB,defaultFormattingWidth:"wide"})};function Fa(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?PB(a,d=>d.test(s)):OB(a,d=>d.test(s));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(s.length);return{value:u,rest:c}}}function OB(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function PB(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _B(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const MB=/^(\d+)(th|st|nd|rd)?/i,DB=/\d+/i,kB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jB={any:[/^b/i,/^(a|c)/i]},FB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},LB={any:[/1/i,/2/i,/3/i,/4/i]},BB={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},VB={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$B={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},GB={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},HB={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},WB={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},zB={ordinalNumber:_B({matchPattern:MB,parsePattern:DB,valueCallback:e=>parseInt(e,10)}),era:Fa({matchPatterns:kB,defaultMatchWidth:"wide",parsePatterns:jB,defaultParseWidth:"any"}),quarter:Fa({matchPatterns:FB,defaultMatchWidth:"wide",parsePatterns:LB,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Fa({matchPatterns:BB,defaultMatchWidth:"wide",parsePatterns:VB,defaultParseWidth:"any"}),day:Fa({matchPatterns:$B,defaultMatchWidth:"wide",parsePatterns:GB,defaultParseWidth:"any"}),dayPeriod:Fa({matchPatterns:HB,defaultMatchWidth:"any",parsePatterns:WB,defaultParseWidth:"any"})},js={code:"en-US",formatDistance:gB,formatLong:yB,formatRelative:wB,localize:NB,match:zB,options:{weekStartsOn:0,firstWeekContainsDate:1}};function qB(e,t){const n=St(e,t?.in);return py(n,kA(n))+1}function hy(e,t){const n=St(e,t?.in),r=+wl(n)-+iB(n);return Math.round(r/TA)+1}function FA(e,t){const n=St(e,t?.in),r=n.getFullYear(),o=Yl(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=Jt(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Yi(s,t),l=Jt(t?.in||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=Yi(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function UB(e,t){const n=Yl(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=FA(e,t),i=Jt(t?.in||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Yi(i,t)}function gy(e,t){const n=St(e,t?.in),r=+Yi(n,t)-+UB(n,t);return Math.round(r/TA)+1}function Ct(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Jo={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ct(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ct(n+1,2)},d(e,t){return Ct(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ct(e.getHours()%12||12,t.length)},H(e,t){return Ct(e.getHours(),t.length)},m(e,t){return Ct(e.getMinutes(),t.length)},s(e,t){return Ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ct(o,t.length)}},Os={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},aw={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Jo.y(e,t)},Y:function(e,t,n,r){const o=FA(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Ct(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ct(i,t.length)},R:function(e,t){const n=NA(e);return Ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ct(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ct(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ct(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Jo.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ct(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=gy(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ct(o,t.length)},I:function(e,t,n){const r=hy(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ct(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Jo.d(e,t)},D:function(e,t,n){const r=qB(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ct(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ct(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ct(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Ct(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Os.noon:r===0?o=Os.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Os.evening:r>=12?o=Os.afternoon:r>=4?o=Os.morning:o=Os.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Jo.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Jo.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Jo.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Jo.s(e,t)},S:function(e,t){return Jo.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return uw(r);case"XXXX":case"XX":return Hi(r);default:return Hi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return uw(r);case"xxxx":case"xx":return Hi(r);default:return Hi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+lw(r,":");default:return"GMT"+Hi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+lw(r,":");default:return"GMT"+Hi(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ct(r,t.length)},T:function(e,t,n){return Ct(+e,t.length)}};function lw(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+Ct(i,2)}function uw(e,t){return e%60===0?(e>0?"-":"+")+Ct(Math.abs(e)/60,2):Hi(e,t)}function Hi(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ct(Math.trunc(r/60),2),i=Ct(r%60,2);return n+o+t+i}const cw=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},LA=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},YB=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return cw(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",cw(r,t)).replace("{{time}}",LA(o,t))},XB={p:LA,P:YB},ZB=/^D+$/,JB=/^Y+$/,KB=["D","DD","YY","YYYY"];function QB(e){return ZB.test(e)}function eV(e){return JB.test(e)}function tV(e,t,n){const r=nV(e,t,n);if(console.warn(r),KB.includes(e))throw new RangeError(r)}function nV(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,iV=/^'([^]*?)'?$/,sV=/''/g,aV=/[a-zA-Z]/;function ti(e,t,n){const r=Yl(),o=n?.locale??r.locale??js,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=St(e,n?.in);if(!PA(a))throw new RangeError("Invalid time value");let l=t.match(oV).map(c=>{const d=c[0];if(d==="p"||d==="P"){const f=XB[d];return f(c,o.formatLong)}return c}).join("").match(rV).map(c=>{if(c==="''")return{isToken:!1,value:"'"};const d=c[0];if(d==="'")return{isToken:!1,value:lV(c)};if(aw[d])return{isToken:!0,value:c};if(d.match(aV))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:c}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(c=>{if(!c.isToken)return c.value;const d=c.value;(!n?.useAdditionalWeekYearTokens&&eV(d)||!n?.useAdditionalDayOfYearTokens&&QB(d))&&tV(d,t,String(e));const f=aw[d[0]];return f(a,d,o.localize,u)}).join("")}function lV(e){const t=e.match(iV);return t?t[1].replace(sV,"'"):e}function uV(e,t){const n=St(e,t?.in),r=n.getFullYear(),o=n.getMonth(),i=Jt(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function cV(e,t){return St(e,t?.in).getMonth()}function dV(e,t){return St(e,t?.in).getFullYear()}function fV(e,t){return+St(e)>+St(t)}function pV(e,t){return+St(e)<+St(t)}function hV(e,t,n){const[r,o]=ha(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function gV(e,t,n){const[r,o]=ha(n?.in,e,t);return r.getFullYear()===o.getFullYear()}function dw(e,t,n){return dy(e,-t,n)}function mV(e,t,n){const r=St(e,n?.in),o=r.getFullYear(),i=r.getDate(),s=Jt(e,0);s.setFullYear(o,t,15),s.setHours(0,0,0,0);const a=uV(s);return r.setMonth(t,Math.min(i,a)),r}function bV(e,t,n){const r=St(e,n?.in);return isNaN(+r)?Jt(e,NaN):(r.setFullYear(t),r)}function fw(e,t,n){return fy(e,-1,n)}const vV=nB({prefix:"ui"});function L(...e){return vV(_o(e))}function yV(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const o=r(t);typeof o=="function"&&n.push(o)}else r!=null&&(r.current=t);if(n.length>0)return()=>{for(const r of n)r()}}}const qi=(e,t="MMM d, yyyy h:mmaaa",n)=>PA(e)?ti(e,t,n):ti(new Date,t,n);function BA({...e}){return h.jsx(cL,{"data-slot":"accordion",...e})}function VA({className:e,...t}){return h.jsx(dL,{"data-slot":"accordion-item",className:L("ui:border-b ui:last:border-b-0",e),...t})}function $A({className:e,children:t,...n}){return h.jsx(fL,{className:"ui:flex",children:h.jsxs(pL,{"data-slot":"accordion-trigger",className:L("ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:flex ui:flex-1 ui:items-start ui:justify-between ui:gap-4 ui:rounded-md ui:py-4 ui:text-left ui:text-sm ui:font-medium ui:transition-all ui:outline-none ui:hover:underline ui:focus-visible:ring-[3px] ui:disabled:pointer-events-none ui:disabled:opacity-50 ui:[&[data-state=open]>svg]:rotate-180",e),...n,children:[t,h.jsx(Oe.ChevronDownIcon,{className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4 ui:shrink-0 ui:translate-y-0.5 ui:transition-transform ui:duration-200"})]})})}function GA({className:e,wrapperClassName:t,children:n,...r}){return h.jsx(hL,{"data-slot":"accordion-content",className:L("ui:data-[state=closed]:animate-accordion-up ui:data-[state=open]:animate-accordion-down ui:overflow-hidden ui:text-sm",t),...r,children:h.jsx("div",{className:L("ui:pt-0 ui:pb-4",e),children:n})})}var HA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xV="VisuallyHidden",WA=b.forwardRef((e,t)=>h.jsx(Ee.span,{...e,ref:t,style:{...HA,...e.style}}));WA.displayName=xV;var wV=WA;function rn(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function CV(e,t=globalThis?.document){const n=rn(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var SV="DismissableLayer",Eb="dismissableLayer.update",EV="dismissableLayer.pointerDownOutside",IV="dismissableLayer.focusOutside",pw,zA=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cs=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=b.useContext(zA),[c,d]=b.useState(null),f=c?.ownerDocument??globalThis?.document,[,p]=b.useState({}),g=Be(t,I=>d(I)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),x=c?m.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=y,S=TV(I=>{const T=I.target,M=[...u.branches].some(V=>V.contains(T));!C||M||(o?.(I),s?.(I),I.defaultPrevented||a?.())},f),R=NV(I=>{const T=I.target;[...u.branches].some(V=>V.contains(T))||(i?.(I),s?.(I),I.defaultPrevented||a?.())},f);return CV(I=>{x===u.layers.size-1&&(r?.(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},f),b.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(pw=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),hw(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=pw)}},[c,f,n,u]),b.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),hw())},[c,u]),b.useEffect(()=>{const I=()=>p({});return document.addEventListener(Eb,I),()=>document.removeEventListener(Eb,I)},[]),h.jsx(Ee.div,{...l,ref:g,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,R.onFocusCapture),onBlurCapture:he(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,S.onPointerDownCapture)})});cs.displayName=SV;var RV="DismissableLayerBranch",AV=b.forwardRef((e,t)=>{const n=b.useContext(zA),r=b.useRef(null),o=Be(t,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(Ee.div,{...e,ref:o})});AV.displayName=RV;function TV(e,t=globalThis?.document){const n=rn(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){qA(EV,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function NV(e,t=globalThis?.document){const n=rn(e),r=b.useRef(!1);return b.useEffect(()=>{const o=i=>{i.target&&!r.current&&qA(IV,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hw(){const e=new CustomEvent(Eb);document.dispatchEvent(e)}function qA(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ZR(o,i):o.dispatchEvent(i)}var sp="focusScope.autoFocusOnMount",ap="focusScope.autoFocusOnUnmount",gw={bubbles:!1,cancelable:!0},OV="FocusScope",Xl=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=b.useState(null),u=rn(o),c=rn(i),d=b.useRef(null),f=Be(t,m=>l(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(w){if(p.paused||!a)return;const C=w.target;a.contains(C)?d.current=C:Ko(d.current,{select:!0})},v=function(w){if(p.paused||!a)return;const C=w.relatedTarget;C!==null&&(a.contains(C)||Ko(d.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Ko(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(y);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[r,a,p.paused]),b.useEffect(()=>{if(a){bw.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(sp,gw);a.addEventListener(sp,u),a.dispatchEvent(y),y.defaultPrevented||(PV(jV(UA(a)),{select:!0}),document.activeElement===m&&Ko(a))}return()=>{a.removeEventListener(sp,u),setTimeout(()=>{const y=new CustomEvent(ap,gw);a.addEventListener(ap,c),a.dispatchEvent(y),y.defaultPrevented||Ko(m??document.body,{select:!0}),a.removeEventListener(ap,c),bw.remove(p)},0)}}},[a,u,c,p]);const g=b.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const x=m.currentTarget,[w,C]=_V(x);w&&C?!m.shiftKey&&y===C?(m.preventDefault(),n&&Ko(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&Ko(C,{select:!0})):y===x&&m.preventDefault()}},[n,r,p.paused]);return h.jsx(Ee.div,{tabIndex:-1,...s,ref:f,onKeyDown:g})});Xl.displayName=OV;function PV(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ko(r,{select:t}),document.activeElement!==n)return}function _V(e){const t=UA(e),n=mw(t,e),r=mw(t.reverse(),e);return[n,r]}function UA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mw(e,t){for(const n of e)if(!MV(n,{upTo:t}))return n}function MV(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function DV(e){return e instanceof HTMLInputElement&&"select"in e}function Ko(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&DV(e)&&t&&e.select()}}var bw=kV();function kV(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=vw(e,t),e.unshift(t)},remove(t){e=vw(e,t),e[0]?.resume()}}}function vw(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jV(e){return e.filter(t=>t.tagName!=="A")}var FV="Portal",ds=b.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=b.useState(!1);qt(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?Qv.createPortal(h.jsx(Ee.div,{...r,ref:t}),s):null});ds.displayName=FV;var lp=0;function Dd(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yw()),document.body.insertAdjacentElement("beforeend",e[1]??yw()),lp++,()=>{lp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lp--}},[])}function yw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qr=function(){return Qr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Qr.apply(this,arguments)};function YA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function LV(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ic="right-scroll-bar-position",Rc="width-before-scroll-bar",BV="with-scroll-bars-hidden",VV="--removed-body-scroll-bar-size";function up(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $V(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var GV=typeof window<"u"?b.useLayoutEffect:b.useEffect,xw=new WeakMap;function HV(e,t){var n=$V(null,function(r){return e.forEach(function(o){return up(o,r)})});return GV(function(){var r=xw.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||up(a,null)}),i.forEach(function(a){o.has(a)||up(a,s)})}xw.set(n,e)},[e]),n}function WV(e){return e}function zV(e,t){t===void 0&&(t=WV);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var c=s;s=[],c.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){s.push(c),u()},filter:function(c){return s=s.filter(c),n}}}};return o}function qV(e){e===void 0&&(e={});var t=zV(null);return t.options=Qr({async:!0,ssr:!1},e),t}var XA=function(e){var t=e.sideCar,n=YA(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,Qr({},n))};XA.isSideCarExport=!0;function UV(e,t){return e.useMedium(t),XA}var ZA=qV(),cp=function(){},kd=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:cp,onWheelCapture:cp,onTouchMoveCapture:cp}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,w=e.gapMode,C=YA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,R=HV([n,t]),I=Qr(Qr({},C),o);return b.createElement(b.Fragment,null,c&&b.createElement(S,{sideCar:ZA,removeScrollBar:u,shards:d,noRelative:p,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),s?b.cloneElement(b.Children.only(a),Qr(Qr({},I),{ref:R})):b.createElement(x,Qr({},I,{className:l,ref:R}),a))});kd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kd.classNames={fullWidth:Rc,zeroRight:Ic};var YV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=YV();return t&&e.setAttribute("nonce",t),e}function ZV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var KV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XV())&&(ZV(t,n),JV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QV=function(){var e=KV();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},JA=function(){var e=QV(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},e4={left:0,top:0,right:0,gap:0},dp=function(e){return parseInt(e||"",10)||0},t4=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[dp(n),dp(r),dp(o)]},n4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return e4;var t=t4(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},r4=JA(),qs="data-scroll-locked",o4=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(BV,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -63,7 +63,7 @@ ${n.map(([i,s])=>{const a=s.theme?.[r]||s.color;return a?` --color-${i}: ${a};`
|
|
|
63
63
|
`)}
|
|
64
64
|
}
|
|
65
65
|
`).join(`
|
|
66
|
-
`)}}):null},JX=Sx;function KX({active:e,payload:t,className:n,indicator:r="dot",hideLabel:o=!1,hideIndicator:i=!1,label:s,labelFormatter:a,labelClassName:l,formatter:u,color:c,nameKey:d,labelKey:f}){const{config:p}=GM(),g=b.useMemo(()=>{if(o||!t?.length)return null;const[v]=t,y=`${f||v?.dataKey||v?.name||"value"}`,x=ov(p,v,y),w=!f&&typeof s=="string"?p[s]?.label||s:x?.label;return a?h.jsx("div",{className:L("ui:font-medium",l),children:a(w,t)}):w?h.jsx("div",{className:L("ui:font-medium",l),children:w}):null},[s,a,t,o,l,p,f]);if(!e||!t?.length)return null;const m=t.length===1&&r!=="dot";return h.jsxs("div",{className:L("ui:border-border/50 ui:bg-background ui:grid ui:min-w-[8rem] ui:items-start ui:gap-1.5 ui:rounded-lg ui:border ui:px-2.5 ui:py-1.5 ui:text-xs ui:shadow-xl",n),children:[m?null:g,h.jsx("div",{className:"ui:grid ui:gap-1.5",children:t.filter(v=>v.type!=="none").map((v,y)=>{const x=`${d||v.name||v.dataKey||"value"}`,w=ov(p,v,x),C=c||v.payload.fill||v.color;return h.jsx("div",{className:L("ui:[&>svg]:text-muted-foreground ui:flex ui:w-full ui:flex-wrap ui:items-stretch ui:gap-2 ui:[&>svg]:h-2.5 ui:[&>svg]:w-2.5",r==="dot"&&"ui:items-center"),children:u&&v?.value!==void 0&&v.name?u(v.value,v.name,v,y,v.payload):h.jsxs(h.Fragment,{children:[w?.icon?h.jsx(w.icon,{}):!i&&h.jsx("div",{className:L("ui:shrink-0 ui:rounded-[2px] ui:border-(--color-border) ui:bg-(--color-bg)",{"ui:h-2.5 ui:w-2.5":r==="dot","ui:w-1":r==="line","ui:w-0 ui:border-[1.5px] ui:border-dashed ui:bg-transparent":r==="dashed","ui:my-0.5":m&&r==="dashed"}),style:{"--color-bg":C,"--color-border":C}}),h.jsxs("div",{className:L("ui:flex ui:flex-1 ui:justify-between ui:leading-none ui:gap-2",m?"ui:items-end":"ui:items-center"),children:[h.jsxs("div",{className:"ui:grid ui:gap-1.5",children:[m?g:null,h.jsx("span",{className:"ui:text-muted-foreground",children:w?.label||v.name})]}),v.value&&h.jsx("span",{className:"ui:text-foreground ui:font-mono ui:font-medium ui:tabular-nums",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}const QX=wx;function e8({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:o}){const{config:i}=GM();return n?.length?h.jsx("div",{className:L("ui:flex ui:items-center ui:justify-center ui:gap-4",r==="top"?"ui:pb-3":"ui:pt-3",e),children:n.filter(s=>s.type!=="none").map(s=>{const a=`${o||s.dataKey||"value"}`,l=ov(i,s,a);return h.jsxs("div",{className:L("ui:[&>svg]:text-muted-foreground ui:flex ui:items-center ui:gap-1.5 ui:[&>svg]:h-3 ui:[&>svg]:w-3"),children:[l?.icon&&!t?h.jsx(l.icon,{}):h.jsx("div",{className:"ui:h-2 ui:w-2 ui:shrink-0 ui:rounded-[2px]",style:{backgroundColor:s.color}}),l?.label]},s.value)})}):null}function ov(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let o=n;return n in t&&typeof t[n]=="string"?o=t[n]:r&&n in r&&typeof r[n]=="string"&&(o=r[n]),o in e?e[o]:e[n]}function WM({className:e,...t}){return h.jsx(kT,{"data-slot":"checkbox",className:L("ui:peer ui:border-input ui:dark:bg-input/30 ui:data-[state=checked]:bg-primary ui:data-[state=checked]:text-primary-foreground ui:dark:data-[state=checked]:bg-primary ui:data-[state=checked]:border-primary ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:size-4 ui:shrink-0 ui:rounded-[4px] ui:border ui:shadow-xs ui:transition-shadow ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",e),...t,children:h.jsx(FT,{"data-slot":"checkbox-indicator",className:"ui:grid ui:place-content-center ui:text-current ui:transition-none",children:h.jsx(Oe.CheckIcon,{className:"ui:size-3.5"})})})}function t8({...e}){return h.jsx(eA,{"data-slot":"collapsible",...e})}function n8({...e}){return h.jsx(ny,{"data-slot":"collapsible-trigger",...e})}function r8({...e}){return h.jsx(oy,{"data-slot":"collapsible-content",...e})}var RE=1,o8=.9,i8=.8,s8=.17,Rm=.1,Am=.999,a8=.9999,l8=.99,u8=/[\\\/_+.#"@\[\(\{&]/,c8=/[\\\/_+.#"@\[\(\{&]/g,d8=/[\s-]/,zM=/[\s-]/g;function iv(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?RE:l8;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),u=n.indexOf(l,o),c=0,d,f,p,g;u>=0;)d=iv(e,t,n,r,u+1,i+1,s),d>c&&(u===o?d*=RE:u8.test(e.charAt(u-1))?(d*=i8,p=e.slice(o,u-1).match(c8),p&&o>0&&(d*=Math.pow(Am,p.length))):d8.test(e.charAt(u-1))?(d*=o8,g=e.slice(o,u-1).match(zM),g&&o>0&&(d*=Math.pow(Am,g.length))):(d*=s8,o>0&&(d*=Math.pow(Am,u-o))),e.charAt(u)!==t.charAt(i)&&(d*=a8)),(d<Rm&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(f=iv(e,t,n,r,u+1,i+2,s),f*Rm>d&&(d=f*Rm)),d>c&&(c=d),u=n.indexOf(l,u+1);return s[a]=c,c}function AE(e){return e.toLowerCase().replace(zM," ")}function f8(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,iv(e,t,AE(e),AE(t),0,0,{})}var Ba='[cmdk-group=""]',Tm='[cmdk-group-items=""]',p8='[cmdk-group-heading=""]',qM='[cmdk-item=""]',TE=`${qM}:not([aria-disabled="true"])`,sv="cmdk-item-select",Fs="data-value",h8=(e,t,n)=>f8(e,t,n),UM=b.createContext(void 0),mu=()=>b.useContext(UM),YM=b.createContext(void 0),Ex=()=>b.useContext(YM),XM=b.createContext(void 0),ZM=b.forwardRef((e,t)=>{let n=Ls(()=>{var W,J;return{search:"",value:(J=(W=e.value)!=null?W:e.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ls(()=>new Set),o=Ls(()=>new Map),i=Ls(()=>new Map),s=Ls(()=>new Set),a=JM(e),{label:l,children:u,value:c,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:m=!1,vimBindings:v=!0,...y}=e,x=$t(),w=$t(),C=$t(),S=b.useRef(null),R=I8();ts(()=>{if(c!==void 0){let W=c.trim();n.current.value=W,I.emit()}},[c]),ts(()=>{R(6,N)},[]);let I=b.useMemo(()=>({subscribe:W=>(s.current.add(W),()=>s.current.delete(W)),snapshot:()=>n.current,setState:(W,J,K)=>{var U,oe,X,te;if(!Object.is(n.current[W],J)){if(n.current[W]=J,W==="search")P(),V(),R(1,A);else if(W==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(C);Q?Q.focus():(U=document.getElementById(x))==null||U.focus()}if(R(7,()=>{var Q;n.current.selectedItemId=(Q=B())==null?void 0:Q.id,I.emit()}),K||R(5,N),((oe=a.current)==null?void 0:oe.value)!==void 0){let Q=J??"";(te=(X=a.current).onValueChange)==null||te.call(X,Q);return}}I.emit()}},emit:()=>{s.current.forEach(W=>W())}}),[]),T=b.useMemo(()=>({value:(W,J,K)=>{var U;J!==((U=i.current.get(W))==null?void 0:U.value)&&(i.current.set(W,{value:J,keywords:K}),n.current.filtered.items.set(W,M(J,K)),R(2,()=>{V(),I.emit()}))},item:(W,J)=>(r.current.add(W),J&&(o.current.has(J)?o.current.get(J).add(W):o.current.set(J,new Set([W]))),R(3,()=>{P(),V(),n.current.value||A(),I.emit()}),()=>{i.current.delete(W),r.current.delete(W),n.current.filtered.items.delete(W);let K=B();R(4,()=>{P(),K?.getAttribute("id")===W&&A(),I.emit()})}),group:W=>(o.current.has(W)||o.current.set(W,new Set),()=>{i.current.delete(W),o.current.delete(W)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:x,inputId:C,labelId:w,listInnerRef:S}),[]);function M(W,J){var K,U;let oe=(U=(K=a.current)==null?void 0:K.filter)!=null?U:h8;return W?oe(W,n.current.search,J):0}function V(){if(!n.current.search||a.current.shouldFilter===!1)return;let W=n.current.filtered.items,J=[];n.current.filtered.groups.forEach(U=>{let oe=o.current.get(U),X=0;oe.forEach(te=>{let Q=W.get(te);X=Math.max(Q,X)}),J.push([U,X])});let K=S.current;j().sort((U,oe)=>{var X,te;let Q=U.getAttribute("id"),se=oe.getAttribute("id");return((X=W.get(se))!=null?X:0)-((te=W.get(Q))!=null?te:0)}).forEach(U=>{let oe=U.closest(Tm);oe?oe.appendChild(U.parentElement===oe?U:U.closest(`${Tm} > *`)):K.appendChild(U.parentElement===K?U:U.closest(`${Tm} > *`))}),J.sort((U,oe)=>oe[1]-U[1]).forEach(U=>{var oe;let X=(oe=S.current)==null?void 0:oe.querySelector(`${Ba}[${Fs}="${encodeURIComponent(U[0])}"]`);X?.parentElement.appendChild(X)})}function A(){let W=j().find(K=>K.getAttribute("aria-disabled")!=="true"),J=W?.getAttribute(Fs);I.setState("value",J||void 0)}function P(){var W,J,K,U;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let X of r.current){let te=(J=(W=i.current.get(X))==null?void 0:W.value)!=null?J:"",Q=(U=(K=i.current.get(X))==null?void 0:K.keywords)!=null?U:[],se=M(te,Q);n.current.filtered.items.set(X,se),se>0&&oe++}for(let[X,te]of o.current)for(let Q of te)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=oe}function N(){var W,J,K;let U=B();U&&(((W=U.parentElement)==null?void 0:W.firstChild)===U&&((K=(J=U.closest(Ba))==null?void 0:J.querySelector(p8))==null||K.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function B(){var W;return(W=S.current)==null?void 0:W.querySelector(`${qM}[aria-selected="true"]`)}function j(){var W;return Array.from(((W=S.current)==null?void 0:W.querySelectorAll(TE))||[])}function D(W){let J=j()[W];J&&I.setState("value",J.getAttribute(Fs))}function $(W){var J;let K=B(),U=j(),oe=U.findIndex(te=>te===K),X=U[oe+W];(J=a.current)!=null&&J.loop&&(X=oe+W<0?U[U.length-1]:oe+W===U.length?U[0]:U[oe+W]),X&&I.setState("value",X.getAttribute(Fs))}function G(W){let J=B(),K=J?.closest(Ba),U;for(;K&&!U;)K=W>0?S8(K,Ba):E8(K,Ba),U=K?.querySelector(TE);U?I.setState("value",U.getAttribute(Fs)):$(W)}let z=()=>D(j().length-1),H=W=>{W.preventDefault(),W.metaKey?z():W.altKey?G(1):$(1)},ne=W=>{W.preventDefault(),W.metaKey?D(0):W.altKey?G(-1):$(-1)};return b.createElement(kn.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:W=>{var J;(J=y.onKeyDown)==null||J.call(y,W);let K=W.nativeEvent.isComposing||W.keyCode===229;if(!(W.defaultPrevented||K))switch(W.key){case"n":case"j":{v&&W.ctrlKey&&H(W);break}case"ArrowDown":{H(W);break}case"p":case"k":{v&&W.ctrlKey&&ne(W);break}case"ArrowUp":{ne(W);break}case"Home":{W.preventDefault(),D(0);break}case"End":{W.preventDefault(),z();break}case"Enter":{W.preventDefault();let U=B();if(U){let oe=new Event(sv);U.dispatchEvent(oe)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:A8},l),Rf(e,W=>b.createElement(YM.Provider,{value:I},b.createElement(UM.Provider,{value:T},W))))}),g8=b.forwardRef((e,t)=>{var n,r;let o=$t(),i=b.useRef(null),s=b.useContext(XM),a=mu(),l=JM(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s?.forceMount;ts(()=>{if(!u)return a.item(o,s?.id)},[u]);let c=KM(o,i,[e.value,e.children,i],e.keywords),d=Ex(),f=fi(R=>R.value&&R.value===c.current),p=fi(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);b.useEffect(()=>{let R=i.current;if(!(!R||e.disabled))return R.addEventListener(sv,g),()=>R.removeEventListener(sv,g)},[p,e.onSelect,e.disabled]);function g(){var R,I;m(),(I=(R=l.current).onSelect)==null||I.call(R,c.current)}function m(){d.setState("value",c.current,!0)}if(!p)return null;let{disabled:v,value:y,onSelect:x,forceMount:w,keywords:C,...S}=e;return b.createElement(kn.div,{ref:oo(i,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||a.getDisablePointerSelection()?void 0:m,onClick:v?void 0:g},e.children)}),m8=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=$t(),a=b.useRef(null),l=b.useRef(null),u=$t(),c=mu(),d=fi(p=>o||c.filter()===!1?!0:p.search?p.filtered.groups.has(s):!0);ts(()=>c.group(s),[]),KM(s,a,[e.value,e.heading,l]);let f=b.useMemo(()=>({id:s,forceMount:o}),[o]);return b.createElement(kn.div,{ref:oo(a,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Rf(e,p=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(XM.Provider,{value:f},p))))}),b8=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),i=fi(s=>!s.search);return!n&&!i?null:b.createElement(kn.div,{ref:oo(o,t),...r,"cmdk-separator":"",role:"separator"})}),v8=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=Ex(),s=fi(u=>u.search),a=fi(u=>u.selectedItemId),l=mu();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(kn.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n?.(u.target.value)}})}),y8=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=b.useRef(null),s=b.useRef(null),a=fi(u=>u.selectedItemId),l=mu();return b.useEffect(()=>{if(s.current&&i.current){let u=s.current,c=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=u.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),b.createElement(kn.div,{ref:oo(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},Rf(e,u=>b.createElement("div",{ref:oo(s,l.listInnerRef),"cmdk-list-sizer":""},u)))}),x8=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return b.createElement(Jl,{open:n,onOpenChange:r},b.createElement(Kl,{container:s},b.createElement(Ql,{"cmdk-overlay":"",className:o}),b.createElement(eu,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(ZM,{ref:t,...a}))))}),w8=b.forwardRef((e,t)=>fi(n=>n.filtered.count===0)?b.createElement(kn.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),C8=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return b.createElement(kn.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Rf(e,s=>b.createElement("div",{"aria-hidden":!0},s)))}),bs=Object.assign(ZM,{List:y8,Item:g8,Input:v8,Group:m8,Separator:b8,Dialog:x8,Empty:w8,Loading:C8});function S8(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function E8(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function JM(e){let t=b.useRef(e);return ts(()=>{t.current=e}),t}var ts=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Ls(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function fi(e){let t=Ex(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function KM(e,t,n,r=[]){let o=b.useRef(),i=mu();return ts(()=>{var s;let a=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(Fs,a),o.current=a}),o}var I8=()=>{let[e,t]=b.useState(),n=Ls(()=>new Map);return ts(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function R8(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Rf({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(R8(t),{ref:t.ref},n(t.props.children)):n(t)}var A8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const QM=O.createContext(void 0);function Ix({...e}){return h.jsx(Jl,{"data-slot":"dialog",...e})}function eD({...e}){return h.jsx(Ld,{"data-slot":"dialog-trigger",...e})}function tD({...e}){return h.jsx(Kl,{"data-slot":"dialog-portal",...e})}function T8({...e}){return h.jsx(fs,{"data-slot":"dialog-close",...e})}function nD({className:e,...t}){return h.jsx(Ql,{"data-slot":"dialog-overlay",className:L("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function Rx({className:e,children:t,showCloseButton:n=!0,overlayClassName:r,ref:o,...i}){const[s,a]=b.useState(),l=b.useCallback(u=>{if(u){const c=parseInt(getComputedStyle(u).zIndex,10);isNaN(c)||a(c)}},[e]);return h.jsxs(tD,{"data-slot":"dialog-portal",children:[h.jsx(nD,{className:r}),h.jsxs(eu,{"data-slot":"dialog-content",ref:yV(o,l),className:L("ui:bg-background ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:fixed ui:top-[50%] ui:left-[50%] ui:z-50 ui:grid ui:w-full ui:max-w-[calc(100%-2rem)] ui:translate-x-[-50%] ui:translate-y-[-50%] ui:gap-4 ui:rounded-lg ui:border ui:p-6 ui:shadow-lg ui:duration-200 ui:outline-none ui:sm:max-w-lg",e),...i,children:[h.jsx(QM.Provider,{value:s,children:t}),n&&h.jsxs(fs,{"data-slot":"dialog-close",className:"ui:ring-offset-background ui:focus:ring-ring ui:data-[state=open]:bg-accent ui:data-[state=open]:text-muted-foreground ui:absolute ui:top-4 ui:right-4 ui:rounded-xs ui:opacity-70 ui:transition-opacity ui:hover:opacity-100 ui:focus:ring-2 ui:focus:ring-offset-2 ui:focus:outline-hidden ui:disabled:pointer-events-none ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",children:[h.jsx(Oe.XIcon,{}),h.jsx("span",{className:"ui:sr-only",children:"Close"})]})]})]})}function Ax({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:L("ui:flex ui:flex-col ui:gap-2 ui:text-center ui:sm:text-left",e),...t})}function N8({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-footer",className:L("ui:flex ui:flex-col-reverse ui:gap-2 ui:sm:flex-row ui:sm:justify-end",e),...t})}function Tx({className:e,...t}){return h.jsx(Bd,{"data-slot":"dialog-title",className:L("ui:text-lg ui:leading-none ui:font-semibold",e),...t})}function rD({className:e,...t}){return h.jsx(Vd,{"data-slot":"dialog-description",className:L("ui:text-muted-foreground ui:text-sm",e),...t})}function oD({className:e,...t}){return h.jsx(bs,{shouldFilter:!1,"data-slot":"command",className:L("ui:bg-popover ui:text-popover-foreground ui:flex ui:h-full ui:w-full ui:flex-col ui:overflow-hidden ui:rounded-md",e),...t})}function O8({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:o=!0,...i}){return h.jsxs(Ix,{...i,children:[h.jsxs(Ax,{className:"ui:sr-only",children:[h.jsx(Tx,{children:e}),h.jsx(rD,{children:t})]}),h.jsx(Rx,{className:L("ui:overflow-hidden ui:p-0",r),showCloseButton:o,children:h.jsx(oD,{className:"ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:**:data-[slot=command-input-wrapper]:h-12 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:font-medium ui:[&_[cmdk-group]]:px-2 ui:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 ui:[&_[cmdk-input-wrapper]_svg]:h-5 ui:[&_[cmdk-input-wrapper]_svg]:w-5 ui:[&_[cmdk-input]]:h-12 ui:[&_[cmdk-item]]:px-2 ui:[&_[cmdk-item]]:py-3 ui:[&_[cmdk-item]_svg]:h-5 ui:[&_[cmdk-item]_svg]:w-5",children:n})})]})}function P8({containerClassName:e,className:t,...n}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:L("ui:flex ui:h-9 ui:items-center ui:gap-2 ui:border-b ui:px-3",e),children:[h.jsx(Oe.SearchIcon,{className:"ui:size-4 ui:shrink-0 ui:opacity-50"}),h.jsx(bs.Input,{"data-slot":"command-input",className:L("ui:placeholder:text-muted-foreground ui:flex ui:h-10 ui:w-full ui:rounded-md ui:bg-transparent ui:py-3 ui:text-sm ui:outline-hidden ui:disabled:cursor-not-allowed ui:disabled:opacity-50",t),...n})]})}function _8({className:e,...t}){return h.jsx(bs.List,{"data-slot":"command-list",className:L("ui:max-h-[300px] ui:scroll-py-1 ui:overflow-x-hidden ui:overflow-y-auto",e),...t})}function M8({...e}){return h.jsx(bs.Empty,{"data-slot":"command-empty",className:"ui:py-6 ui:text-center ui:text-sm",...e})}function D8({className:e,...t}){return h.jsx(bs.Group,{"data-slot":"command-group",className:L("ui:text-foreground ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:overflow-hidden ui:p-1 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:py-1.5 ui:[&_[cmdk-group-heading]]:text-xs ui:[&_[cmdk-group-heading]]:font-medium",e),...t})}function k8({className:e,...t}){return h.jsx(bs.Separator,{"data-slot":"command-separator",className:L("ui:bg-border ui:-mx-1 ui:h-px",e),...t})}function j8({className:e,...t}){return h.jsx(bs.Item,{"data-slot":"command-item",className:L("ui:data-[selected=true]:bg-accent ui:data-[selected=true]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled=true]:pointer-events-none ui:data-[disabled=true]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...t})}function F8({className:e,...t}){return h.jsx("span",{"data-slot":"command-shortcut",className:L("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}const iD=({title:e,className:t,titleClassName:n,header:r="",children:o})=>h.jsxs("div",{className:L("ui:bg-white ui:border ui:border-gray-200 ui:rounded-lg ui:shadow",e?"ui:p-4 ui:mt-4":"ui:p-2 ui:items-center",t),children:[r,!r&&e&&h.jsx("h3",{className:L("ui:text-xl ui:text-black-900 ui:font-semibold",n),children:e}),o]}),L8=({onCreate:e,onDelete:t,showCreate:n=!0,className:r})=>h.jsxs("div",{className:L("ui:h-full ui:mt-6 ui:flex ui:gap-2",r),children:[h.jsxs(In,{children:[h.jsx(Vt,{condition:n,children:h.jsx(Oe.PlusCircle,{color:"green",size:20,onClick:e,className:"ui:cursor-pointer ui:h-full"})}),h.jsx(Qi,{children:h.jsx("div",{className:"ui:size-5"})})]}),h.jsx(Oe.CircleX,{color:"red",size:20,onClick:t,className:"ui:cursor-pointer ui:h-full"})]});var B8="Label",sD=b.forwardRef((e,t)=>h.jsx(kn.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));sD.displayName=B8;var V8=sD;function yr({className:e,variant:t="default",...n}){return h.jsx(V8,{"data-slot":"label",className:L(C9({variant:t}),e),...n})}function Af({description:e,className:t}){return h.jsx("p",{className:L("ui:text-gray-500 ui:text-xs ui:mt-1",t),children:e})}const aD=({label:e,name:t,description:n,onCheckedChange:r,...o})=>h.jsxs("article",{children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(WM,{...o,id:t,onCheckedChange:r}),h.jsx(yr,{htmlFor:t,children:e})]}),n&&h.jsx(Af,{description:n})]});function Nm({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=b.useRef(e!==void 0),[i,s]=b.useState(t),a=o?e:i;if(process.env.NODE_ENV!=="production"){b.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
66
|
+
`)}}):null},JX=Sx;function KX({active:e,payload:t,className:n,indicator:r="dot",hideLabel:o=!1,hideIndicator:i=!1,label:s,labelFormatter:a,labelClassName:l,formatter:u,color:c,nameKey:d,labelKey:f}){const{config:p}=GM(),g=b.useMemo(()=>{if(o||!t?.length)return null;const[v]=t,y=`${f||v?.dataKey||v?.name||"value"}`,x=ov(p,v,y),w=!f&&typeof s=="string"?p[s]?.label||s:x?.label;return a?h.jsx("div",{className:L("ui:font-medium",l),children:a(w,t)}):w?h.jsx("div",{className:L("ui:font-medium",l),children:w}):null},[s,a,t,o,l,p,f]);if(!e||!t?.length)return null;const m=t.length===1&&r!=="dot";return h.jsxs("div",{className:L("ui:border-border/50 ui:bg-background ui:grid ui:min-w-[8rem] ui:items-start ui:gap-1.5 ui:rounded-lg ui:border ui:px-2.5 ui:py-1.5 ui:text-xs ui:shadow-xl",n),children:[m?null:g,h.jsx("div",{className:"ui:grid ui:gap-1.5",children:t.filter(v=>v.type!=="none").map((v,y)=>{const x=`${d||v.name||v.dataKey||"value"}`,w=ov(p,v,x),C=c||v.payload.fill||v.color;return h.jsx("div",{className:L("ui:[&>svg]:text-muted-foreground ui:flex ui:w-full ui:flex-wrap ui:items-stretch ui:gap-2 ui:[&>svg]:h-2.5 ui:[&>svg]:w-2.5",r==="dot"&&"ui:items-center"),children:u&&v?.value!==void 0&&v.name?u(v.value,v.name,v,y,v.payload):h.jsxs(h.Fragment,{children:[w?.icon?h.jsx(w.icon,{}):!i&&h.jsx("div",{className:L("ui:shrink-0 ui:rounded-[2px] ui:border-(--color-border) ui:bg-(--color-bg)",{"ui:h-2.5 ui:w-2.5":r==="dot","ui:w-1":r==="line","ui:w-0 ui:border-[1.5px] ui:border-dashed ui:bg-transparent":r==="dashed","ui:my-0.5":m&&r==="dashed"}),style:{"--color-bg":C,"--color-border":C}}),h.jsxs("div",{className:L("ui:flex ui:flex-1 ui:justify-between ui:leading-none ui:gap-2",m?"ui:items-end":"ui:items-center"),children:[h.jsxs("div",{className:"ui:grid ui:gap-1.5",children:[m?g:null,h.jsx("span",{className:"ui:text-muted-foreground",children:w?.label||v.name})]}),v.value&&h.jsx("span",{className:"ui:text-foreground ui:font-mono ui:font-medium ui:tabular-nums",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}const QX=wx;function e8({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:o}){const{config:i}=GM();return n?.length?h.jsx("div",{className:L("ui:flex ui:items-center ui:justify-center ui:gap-4",r==="top"?"ui:pb-3":"ui:pt-3",e),children:n.filter(s=>s.type!=="none").map(s=>{const a=`${o||s.dataKey||"value"}`,l=ov(i,s,a);return h.jsxs("div",{className:L("ui:[&>svg]:text-muted-foreground ui:flex ui:items-center ui:gap-1.5 ui:[&>svg]:h-3 ui:[&>svg]:w-3"),children:[l?.icon&&!t?h.jsx(l.icon,{}):h.jsx("div",{className:"ui:h-2 ui:w-2 ui:shrink-0 ui:rounded-[2px]",style:{backgroundColor:s.color}}),l?.label]},s.value)})}):null}function ov(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let o=n;return n in t&&typeof t[n]=="string"?o=t[n]:r&&n in r&&typeof r[n]=="string"&&(o=r[n]),o in e?e[o]:e[n]}function WM({className:e,...t}){return h.jsx(kT,{"data-slot":"checkbox",className:L("ui:peer ui:border-input ui:dark:bg-input/30 ui:data-[state=checked]:bg-primary ui:data-[state=checked]:text-primary-foreground ui:dark:data-[state=checked]:bg-primary ui:data-[state=checked]:border-primary ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:size-4 ui:shrink-0 ui:rounded-[4px] ui:border ui:shadow-xs ui:transition-shadow ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",e),...t,children:h.jsx(FT,{"data-slot":"checkbox-indicator",className:"ui:grid ui:place-content-center ui:text-current ui:transition-none",children:h.jsx(Oe.CheckIcon,{className:"ui:size-3.5"})})})}function t8({...e}){return h.jsx(eA,{"data-slot":"collapsible",...e})}function n8({...e}){return h.jsx(ny,{"data-slot":"collapsible-trigger",...e})}function r8({...e}){return h.jsx(oy,{"data-slot":"collapsible-content",...e})}var RE=1,o8=.9,i8=.8,s8=.17,Rm=.1,Am=.999,a8=.9999,l8=.99,u8=/[\\\/_+.#"@\[\(\{&]/,c8=/[\\\/_+.#"@\[\(\{&]/g,d8=/[\s-]/,zM=/[\s-]/g;function iv(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?RE:l8;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),u=n.indexOf(l,o),c=0,d,f,p,g;u>=0;)d=iv(e,t,n,r,u+1,i+1,s),d>c&&(u===o?d*=RE:u8.test(e.charAt(u-1))?(d*=i8,p=e.slice(o,u-1).match(c8),p&&o>0&&(d*=Math.pow(Am,p.length))):d8.test(e.charAt(u-1))?(d*=o8,g=e.slice(o,u-1).match(zM),g&&o>0&&(d*=Math.pow(Am,g.length))):(d*=s8,o>0&&(d*=Math.pow(Am,u-o))),e.charAt(u)!==t.charAt(i)&&(d*=a8)),(d<Rm&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(f=iv(e,t,n,r,u+1,i+2,s),f*Rm>d&&(d=f*Rm)),d>c&&(c=d),u=n.indexOf(l,u+1);return s[a]=c,c}function AE(e){return e.toLowerCase().replace(zM," ")}function f8(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,iv(e,t,AE(e),AE(t),0,0,{})}var Ba='[cmdk-group=""]',Tm='[cmdk-group-items=""]',p8='[cmdk-group-heading=""]',qM='[cmdk-item=""]',TE=`${qM}:not([aria-disabled="true"])`,sv="cmdk-item-select",Fs="data-value",h8=(e,t,n)=>f8(e,t,n),UM=b.createContext(void 0),mu=()=>b.useContext(UM),YM=b.createContext(void 0),Ex=()=>b.useContext(YM),XM=b.createContext(void 0),ZM=b.forwardRef((e,t)=>{let n=Ls(()=>{var W,J;return{search:"",value:(J=(W=e.value)!=null?W:e.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ls(()=>new Set),o=Ls(()=>new Map),i=Ls(()=>new Map),s=Ls(()=>new Set),a=JM(e),{label:l,children:u,value:c,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:m=!1,vimBindings:v=!0,...y}=e,x=$t(),w=$t(),C=$t(),S=b.useRef(null),R=I8();ts(()=>{if(c!==void 0){let W=c.trim();n.current.value=W,I.emit()}},[c]),ts(()=>{R(6,N)},[]);let I=b.useMemo(()=>({subscribe:W=>(s.current.add(W),()=>s.current.delete(W)),snapshot:()=>n.current,setState:(W,J,K)=>{var U,oe,X,te;if(!Object.is(n.current[W],J)){if(n.current[W]=J,W==="search")P(),V(),R(1,A);else if(W==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(C);Q?Q.focus():(U=document.getElementById(x))==null||U.focus()}if(R(7,()=>{var Q;n.current.selectedItemId=(Q=B())==null?void 0:Q.id,I.emit()}),K||R(5,N),((oe=a.current)==null?void 0:oe.value)!==void 0){let Q=J??"";(te=(X=a.current).onValueChange)==null||te.call(X,Q);return}}I.emit()}},emit:()=>{s.current.forEach(W=>W())}}),[]),T=b.useMemo(()=>({value:(W,J,K)=>{var U;J!==((U=i.current.get(W))==null?void 0:U.value)&&(i.current.set(W,{value:J,keywords:K}),n.current.filtered.items.set(W,M(J,K)),R(2,()=>{V(),I.emit()}))},item:(W,J)=>(r.current.add(W),J&&(o.current.has(J)?o.current.get(J).add(W):o.current.set(J,new Set([W]))),R(3,()=>{P(),V(),n.current.value||A(),I.emit()}),()=>{i.current.delete(W),r.current.delete(W),n.current.filtered.items.delete(W);let K=B();R(4,()=>{P(),K?.getAttribute("id")===W&&A(),I.emit()})}),group:W=>(o.current.has(W)||o.current.set(W,new Set),()=>{i.current.delete(W),o.current.delete(W)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:x,inputId:C,labelId:w,listInnerRef:S}),[]);function M(W,J){var K,U;let oe=(U=(K=a.current)==null?void 0:K.filter)!=null?U:h8;return W?oe(W,n.current.search,J):0}function V(){if(!n.current.search||a.current.shouldFilter===!1)return;let W=n.current.filtered.items,J=[];n.current.filtered.groups.forEach(U=>{let oe=o.current.get(U),X=0;oe.forEach(te=>{let Q=W.get(te);X=Math.max(Q,X)}),J.push([U,X])});let K=S.current;j().sort((U,oe)=>{var X,te;let Q=U.getAttribute("id"),se=oe.getAttribute("id");return((X=W.get(se))!=null?X:0)-((te=W.get(Q))!=null?te:0)}).forEach(U=>{let oe=U.closest(Tm);oe?oe.appendChild(U.parentElement===oe?U:U.closest(`${Tm} > *`)):K.appendChild(U.parentElement===K?U:U.closest(`${Tm} > *`))}),J.sort((U,oe)=>oe[1]-U[1]).forEach(U=>{var oe;let X=(oe=S.current)==null?void 0:oe.querySelector(`${Ba}[${Fs}="${encodeURIComponent(U[0])}"]`);X?.parentElement.appendChild(X)})}function A(){let W=j().find(K=>K.getAttribute("aria-disabled")!=="true"),J=W?.getAttribute(Fs);I.setState("value",J||void 0)}function P(){var W,J,K,U;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let X of r.current){let te=(J=(W=i.current.get(X))==null?void 0:W.value)!=null?J:"",Q=(U=(K=i.current.get(X))==null?void 0:K.keywords)!=null?U:[],se=M(te,Q);n.current.filtered.items.set(X,se),se>0&&oe++}for(let[X,te]of o.current)for(let Q of te)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=oe}function N(){var W,J,K;let U=B();U&&(((W=U.parentElement)==null?void 0:W.firstChild)===U&&((K=(J=U.closest(Ba))==null?void 0:J.querySelector(p8))==null||K.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function B(){var W;return(W=S.current)==null?void 0:W.querySelector(`${qM}[aria-selected="true"]`)}function j(){var W;return Array.from(((W=S.current)==null?void 0:W.querySelectorAll(TE))||[])}function D(W){let J=j()[W];J&&I.setState("value",J.getAttribute(Fs))}function $(W){var J;let K=B(),U=j(),oe=U.findIndex(te=>te===K),X=U[oe+W];(J=a.current)!=null&&J.loop&&(X=oe+W<0?U[U.length-1]:oe+W===U.length?U[0]:U[oe+W]),X&&I.setState("value",X.getAttribute(Fs))}function G(W){let J=B(),K=J?.closest(Ba),U;for(;K&&!U;)K=W>0?S8(K,Ba):E8(K,Ba),U=K?.querySelector(TE);U?I.setState("value",U.getAttribute(Fs)):$(W)}let z=()=>D(j().length-1),H=W=>{W.preventDefault(),W.metaKey?z():W.altKey?G(1):$(1)},ne=W=>{W.preventDefault(),W.metaKey?D(0):W.altKey?G(-1):$(-1)};return b.createElement(kn.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:W=>{var J;(J=y.onKeyDown)==null||J.call(y,W);let K=W.nativeEvent.isComposing||W.keyCode===229;if(!(W.defaultPrevented||K))switch(W.key){case"n":case"j":{v&&W.ctrlKey&&H(W);break}case"ArrowDown":{H(W);break}case"p":case"k":{v&&W.ctrlKey&&ne(W);break}case"ArrowUp":{ne(W);break}case"Home":{W.preventDefault(),D(0);break}case"End":{W.preventDefault(),z();break}case"Enter":{W.preventDefault();let U=B();if(U){let oe=new Event(sv);U.dispatchEvent(oe)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:A8},l),Rf(e,W=>b.createElement(YM.Provider,{value:I},b.createElement(UM.Provider,{value:T},W))))}),g8=b.forwardRef((e,t)=>{var n,r;let o=$t(),i=b.useRef(null),s=b.useContext(XM),a=mu(),l=JM(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s?.forceMount;ts(()=>{if(!u)return a.item(o,s?.id)},[u]);let c=KM(o,i,[e.value,e.children,i],e.keywords),d=Ex(),f=fi(R=>R.value&&R.value===c.current),p=fi(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);b.useEffect(()=>{let R=i.current;if(!(!R||e.disabled))return R.addEventListener(sv,g),()=>R.removeEventListener(sv,g)},[p,e.onSelect,e.disabled]);function g(){var R,I;m(),(I=(R=l.current).onSelect)==null||I.call(R,c.current)}function m(){d.setState("value",c.current,!0)}if(!p)return null;let{disabled:v,value:y,onSelect:x,forceMount:w,keywords:C,...S}=e;return b.createElement(kn.div,{ref:oo(i,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||a.getDisablePointerSelection()?void 0:m,onClick:v?void 0:g},e.children)}),m8=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=$t(),a=b.useRef(null),l=b.useRef(null),u=$t(),c=mu(),d=fi(p=>o||c.filter()===!1?!0:p.search?p.filtered.groups.has(s):!0);ts(()=>c.group(s),[]),KM(s,a,[e.value,e.heading,l]);let f=b.useMemo(()=>({id:s,forceMount:o}),[o]);return b.createElement(kn.div,{ref:oo(a,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Rf(e,p=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(XM.Provider,{value:f},p))))}),b8=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),i=fi(s=>!s.search);return!n&&!i?null:b.createElement(kn.div,{ref:oo(o,t),...r,"cmdk-separator":"",role:"separator"})}),v8=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=Ex(),s=fi(u=>u.search),a=fi(u=>u.selectedItemId),l=mu();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(kn.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n?.(u.target.value)}})}),y8=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=b.useRef(null),s=b.useRef(null),a=fi(u=>u.selectedItemId),l=mu();return b.useEffect(()=>{if(s.current&&i.current){let u=s.current,c=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=u.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),b.createElement(kn.div,{ref:oo(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},Rf(e,u=>b.createElement("div",{ref:oo(s,l.listInnerRef),"cmdk-list-sizer":""},u)))}),x8=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return b.createElement(Jl,{open:n,onOpenChange:r},b.createElement(Kl,{container:s},b.createElement(Ql,{"cmdk-overlay":"",className:o}),b.createElement(eu,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(ZM,{ref:t,...a}))))}),w8=b.forwardRef((e,t)=>fi(n=>n.filtered.count===0)?b.createElement(kn.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),C8=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return b.createElement(kn.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Rf(e,s=>b.createElement("div",{"aria-hidden":!0},s)))}),bs=Object.assign(ZM,{List:y8,Item:g8,Input:v8,Group:m8,Separator:b8,Dialog:x8,Empty:w8,Loading:C8});function S8(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function E8(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function JM(e){let t=b.useRef(e);return ts(()=>{t.current=e}),t}var ts=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Ls(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function fi(e){let t=Ex(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function KM(e,t,n,r=[]){let o=b.useRef(),i=mu();return ts(()=>{var s;let a=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(Fs,a),o.current=a}),o}var I8=()=>{let[e,t]=b.useState(),n=Ls(()=>new Map);return ts(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function R8(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Rf({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(R8(t),{ref:t.ref},n(t.props.children)):n(t)}var A8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const QM=O.createContext(void 0);function Ix({...e}){return h.jsx(Jl,{"data-slot":"dialog",...e})}function eD({...e}){return h.jsx(Ld,{"data-slot":"dialog-trigger",...e})}function tD({...e}){return h.jsx(Kl,{"data-slot":"dialog-portal",...e})}function T8({...e}){return h.jsx(fs,{"data-slot":"dialog-close",...e})}function nD({className:e,...t}){return h.jsx(Ql,{"data-slot":"dialog-overlay",className:L("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function Rx({className:e,children:t,showCloseButton:n=!0,overlayClassName:r,ref:o,...i}){const[s,a]=b.useState(),l=b.useCallback(u=>{u&&a(u)},[e]);return h.jsxs(tD,{"data-slot":"dialog-portal",children:[h.jsx(nD,{className:r}),h.jsxs(eu,{"data-slot":"dialog-content",ref:yV(o,l),className:L("ui:bg-background ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:fixed ui:top-[50%] ui:left-[50%] ui:z-50 ui:grid ui:w-full ui:max-w-[calc(100%-2rem)] ui:translate-x-[-50%] ui:translate-y-[-50%] ui:gap-4 ui:rounded-lg ui:border ui:p-6 ui:shadow-lg ui:duration-200 ui:outline-none ui:sm:max-w-lg",e),...i,children:[h.jsx(QM.Provider,{value:s,children:t}),n&&h.jsxs(fs,{"data-slot":"dialog-close",className:"ui:ring-offset-background ui:focus:ring-ring ui:data-[state=open]:bg-accent ui:data-[state=open]:text-muted-foreground ui:absolute ui:top-4 ui:right-4 ui:rounded-xs ui:opacity-70 ui:transition-opacity ui:hover:opacity-100 ui:focus:ring-2 ui:focus:ring-offset-2 ui:focus:outline-hidden ui:disabled:pointer-events-none ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",children:[h.jsx(Oe.XIcon,{}),h.jsx("span",{className:"ui:sr-only",children:"Close"})]})]})]})}function Ax({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:L("ui:flex ui:flex-col ui:gap-2 ui:text-center ui:sm:text-left",e),...t})}function N8({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-footer",className:L("ui:flex ui:flex-col-reverse ui:gap-2 ui:sm:flex-row ui:sm:justify-end",e),...t})}function Tx({className:e,...t}){return h.jsx(Bd,{"data-slot":"dialog-title",className:L("ui:text-lg ui:leading-none ui:font-semibold",e),...t})}function rD({className:e,...t}){return h.jsx(Vd,{"data-slot":"dialog-description",className:L("ui:text-muted-foreground ui:text-sm",e),...t})}function oD({className:e,...t}){return h.jsx(bs,{shouldFilter:!1,"data-slot":"command",className:L("ui:bg-popover ui:text-popover-foreground ui:flex ui:h-full ui:w-full ui:flex-col ui:overflow-hidden ui:rounded-md",e),...t})}function O8({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:o=!0,...i}){return h.jsxs(Ix,{...i,children:[h.jsxs(Ax,{className:"ui:sr-only",children:[h.jsx(Tx,{children:e}),h.jsx(rD,{children:t})]}),h.jsx(Rx,{className:L("ui:overflow-hidden ui:p-0",r),showCloseButton:o,children:h.jsx(oD,{className:"ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:**:data-[slot=command-input-wrapper]:h-12 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:font-medium ui:[&_[cmdk-group]]:px-2 ui:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 ui:[&_[cmdk-input-wrapper]_svg]:h-5 ui:[&_[cmdk-input-wrapper]_svg]:w-5 ui:[&_[cmdk-input]]:h-12 ui:[&_[cmdk-item]]:px-2 ui:[&_[cmdk-item]]:py-3 ui:[&_[cmdk-item]_svg]:h-5 ui:[&_[cmdk-item]_svg]:w-5",children:n})})]})}function P8({containerClassName:e,className:t,...n}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:L("ui:flex ui:h-9 ui:items-center ui:gap-2 ui:border-b ui:px-3",e),children:[h.jsx(Oe.SearchIcon,{className:"ui:size-4 ui:shrink-0 ui:opacity-50"}),h.jsx(bs.Input,{"data-slot":"command-input",className:L("ui:placeholder:text-muted-foreground ui:flex ui:h-10 ui:w-full ui:rounded-md ui:bg-transparent ui:py-3 ui:text-sm ui:outline-hidden ui:disabled:cursor-not-allowed ui:disabled:opacity-50",t),...n})]})}function _8({className:e,...t}){return h.jsx(bs.List,{"data-slot":"command-list",className:L("ui:max-h-[300px] ui:scroll-py-1 ui:overflow-x-hidden ui:overflow-y-auto",e),...t})}function M8({...e}){return h.jsx(bs.Empty,{"data-slot":"command-empty",className:"ui:py-6 ui:text-center ui:text-sm",...e})}function D8({className:e,...t}){return h.jsx(bs.Group,{"data-slot":"command-group",className:L("ui:text-foreground ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:overflow-hidden ui:p-1 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:py-1.5 ui:[&_[cmdk-group-heading]]:text-xs ui:[&_[cmdk-group-heading]]:font-medium",e),...t})}function k8({className:e,...t}){return h.jsx(bs.Separator,{"data-slot":"command-separator",className:L("ui:bg-border ui:-mx-1 ui:h-px",e),...t})}function j8({className:e,...t}){return h.jsx(bs.Item,{"data-slot":"command-item",className:L("ui:data-[selected=true]:bg-accent ui:data-[selected=true]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled=true]:pointer-events-none ui:data-[disabled=true]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...t})}function F8({className:e,...t}){return h.jsx("span",{"data-slot":"command-shortcut",className:L("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}const iD=({title:e,className:t,titleClassName:n,header:r="",children:o})=>h.jsxs("div",{className:L("ui:bg-white ui:border ui:border-gray-200 ui:rounded-lg ui:shadow",e?"ui:p-4 ui:mt-4":"ui:p-2 ui:items-center",t),children:[r,!r&&e&&h.jsx("h3",{className:L("ui:text-xl ui:text-black-900 ui:font-semibold",n),children:e}),o]}),L8=({onCreate:e,onDelete:t,showCreate:n=!0,className:r})=>h.jsxs("div",{className:L("ui:h-full ui:mt-6 ui:flex ui:gap-2",r),children:[h.jsxs(In,{children:[h.jsx(Vt,{condition:n,children:h.jsx(Oe.PlusCircle,{color:"green",size:20,onClick:e,className:"ui:cursor-pointer ui:h-full"})}),h.jsx(Qi,{children:h.jsx("div",{className:"ui:size-5"})})]}),h.jsx(Oe.CircleX,{color:"red",size:20,onClick:t,className:"ui:cursor-pointer ui:h-full"})]});var B8="Label",sD=b.forwardRef((e,t)=>h.jsx(kn.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));sD.displayName=B8;var V8=sD;function yr({className:e,variant:t="default",...n}){return h.jsx(V8,{"data-slot":"label",className:L(C9({variant:t}),e),...n})}function Af({description:e,className:t}){return h.jsx("p",{className:L("ui:text-gray-500 ui:text-xs ui:mt-1",t),children:e})}const aD=({label:e,name:t,description:n,onCheckedChange:r,...o})=>h.jsxs("article",{children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(WM,{...o,id:t,onCheckedChange:r}),h.jsx(yr,{htmlFor:t,children:e})]}),n&&h.jsx(Af,{description:n})]});function Nm({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=b.useRef(e!==void 0),[i,s]=b.useState(t),a=o?e:i;if(process.env.NODE_ENV!=="production"){b.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
67
67
|
`))},[r,n,e]);const{current:u}=b.useRef(t);b.useEffect(()=>{!o&&JSON.stringify(u)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
68
68
|
`))},[JSON.stringify(t)])}const l=b.useCallback(u=>{o||s(u)},[]);return[a,l]}const NE={};function gr(e,t){const n=b.useRef(NE);return n.current===NE&&(n.current=e(t)),n}const Om=b[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],$8=Om&&Om!==b.useLayoutEffect?Om:e=>e();function ke(e){const t=gr(G8).current;return t.next=e,$8(t.effect),t.trampoline}function G8(){const e={next:void 0,callback:H8,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function H8(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const W8=()=>{},Ge=typeof document<"u"?b.useLayoutEffect:W8,Nx=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(Nx.displayName="CompositeListContext");function z8(){return b.useContext(Nx)}function lD(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,i=ke(o),s=b.useRef(0),a=gr(U8).current,l=gr(q8).current,[u,c]=b.useState(0),d=b.useRef(u),f=ke((y,x)=>{l.set(y,x??null),d.current+=1,c(d.current)}),p=ke(y=>{l.delete(y),d.current+=1,c(d.current)}),g=b.useMemo(()=>{const y=new Map;return Array.from(l.keys()).filter(w=>w.isConnected).sort(Y8).forEach((w,C)=>{const S=l.get(w)??{};y.set(w,{...S,index:C})}),y},[l,u]);Ge(()=>{if(typeof MutationObserver!="function"||g.size===0)return;const y=new MutationObserver(x=>{const w=new Set,C=S=>w.has(S)?w.delete(S):w.add(S);x.forEach(S=>{S.removedNodes.forEach(C),S.addedNodes.forEach(C)}),w.size===0&&(d.current+=1,c(d.current))});return g.forEach((x,w)=>{w.parentElement&&y.observe(w.parentElement,{childList:!0})}),()=>{y.disconnect()}},[g]),Ge(()=>{d.current===u&&(n.current.length!==g.size&&(n.current.length=g.size),r&&r.current.length!==g.size&&(r.current.length=g.size),s.current=g.size),i(g)},[i,g,n,r,u]),Ge(()=>()=>{n.current=[]},[n]),Ge(()=>()=>{r&&(r.current=[])},[r]);const m=ke(y=>(a.add(y),()=>{a.delete(y)}));Ge(()=>{a.forEach(y=>y(g))},[a,g]);const v=b.useMemo(()=>({register:f,unregister:p,subscribeMapChange:m,elementsRef:n,labelsRef:r,nextIndexRef:s}),[f,p,m,n,r,s]);return h.jsx(Nx.Provider,{value:v,children:t})}function q8(){return new Map}function U8(){return new Set}function Y8(e,t){const 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}const uD=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(uD.displayName="DirectionContext");function cD(){return b.useContext(uD)?.direction??"ltr"}function Gr(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}function kl(e,t,n,r){const o=gr(dD).current;return Z8(o,e,t,n,r)&&fD(o,[e,t,n,r]),o.callback}function X8(e){const t=gr(dD).current;return J8(t,e)&&fD(t,e),t.callback}function dD(){return{callback:null,cleanup:null,refs:[]}}function Z8(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function J8(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function fD(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const i=t[o];if(i!=null)switch(typeof i){case"function":{const s=i(n);typeof s=="function"&&(r[o]=s);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const i=t[o];if(i!=null)switch(typeof i){case"function":{const s=r[o];typeof s=="function"?s():i(null);break}case"object":{i.current=null;break}}}}}}}const K8=parseInt(b.version,10);function Ox(e){return K8>=e}function OE(e){if(!b.isValidElement(e))return null;const t=e,n=t.props;return(Ox(19)?n?.ref:t.ref)??null}function av(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Q8(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const i=t[r](o);i!=null&&Object.assign(n,i);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function e7(e,t){return typeof e=="function"?e(t):e}function t7(e,t){return typeof e=="function"?e(t):e}const dl={};function pD(e,t,n,r,o){let i={...lv(e,dl)};return t&&(i=Nc(i,t)),n&&(i=Nc(i,n)),r&&(i=Nc(i,r)),i}function n7(e){if(e.length===0)return dl;if(e.length===1)return lv(e[0],dl);let t={...lv(e[0],dl)};for(let n=1;n<e.length;n+=1)t=Nc(t,e[n]);return t}function Nc(e,t){return hD(t)?t(e):r7(e,t)}function r7(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=av(e.style,r);break}case"className":{e[n]=gD(e.className,r);break}default:o7(n,r)?e[n]=i7(e[n],r):e[n]=r}}return e}function o7(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function hD(e){return typeof e=="function"}function lv(e,t){return hD(e)?e(t):e??dl}function i7(e,t){return t?e?n=>{if(s7(n)){const o=n;uv(o);const i=t(o);return o.baseUIHandlerPrevented||e?.(o),i}const r=t(n);return e?.(n),r}:t:e}function uv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function gD(e,t){return t?e?t+" "+e:t:e}function s7(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ft(){}const Xu=Object.freeze([]),En=Object.freeze({}),a7={style:{transition:"none"}},l7="data-base-ui-click-trigger",u7={fallbackAxisSide:"none"},c7={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function jn(e,t,n={}){const r=t.render,o=d7(t,n);if(n.enabled===!1)return null;const i=n.state??En;return p7(e,r,o,i)}function d7(e,t={}){const{className:n,style:r,render:o}=e,{state:i=En,ref:s,props:a,stateAttributesMapping:l,enabled:u=!0}=t,c=u?e7(n,i):void 0,d=u?t7(r,i):void 0,f=u?Q8(i,l):En,p=u?av(f,Array.isArray(a)?n7(a):a)??En:En;return typeof document<"u"&&(u?Array.isArray(s)?p.ref=X8([p.ref,OE(o),...s]):p.ref=kl(p.ref,OE(o),s):kl(null,null)),u?(c!==void 0&&(p.className=gD(p.className,c)),d!==void 0&&(p.style=av(p.style,d)),p):En}const f7=Symbol.for("react.lazy");function p7(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=pD(n,t.props);o.ref=n.ref;let i=t;if(i?.$$typeof===f7&&(i=b.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!b.isValidElement(i))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
|
|
69
69
|
`));return b.cloneElement(i,o)}if(e&&typeof e=="string")return h7(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Gr(8))}function h7(e,t){return e==="button"?O.createElement("button",{type:"button",...t,key:t.key}):e==="img"?O.createElement("img",{alt:"",...t,key:t.key}):b.createElement(e,t)}const sr="none",cv="trigger-press",g7="trigger-hover",Px="outside-press",m7="item-press",PE="clear-press",b7="chip-remove-press",zs="input-change",ei="input-clear",v7="input-press",Tf="focus-out",mD="escape-key",fl="list-navigation";function Qe(e,t,n,r){let o=!1,i=!1;const s=En;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){i=!0},get isCanceled(){return o},get isPropagationAllowed(){return i},trigger:n,...s}}function Va(e,t,n){const r=n??En;return{reason:e,event:t??new Event("base-ui"),...r}}const dv={...b};let _E=0;function y7(e,t="mui"){const[n,r]=b.useState(e),o=e||n;return b.useEffect(()=>{n==null&&(_E+=1,r(`${t}-${_E}`))},[n,t]),o}const ME=dv.useId;function _x(e,t){if(ME!==void 0){const n=ME();return e??(t?`${t}-${n}`:n)}return y7(e,t)}function bD(e){return _x(e,"base-ui")}const x7=[];function vD(e){b.useEffect(e,x7)}const Zu=null;let DE=globalThis.requestAnimationFrame;class w7{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&DE!==requestAnimationFrame&&(DE=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ju=new w7;class Zr{static create(){return new Zr}static request(t){return Ju.request(t)}static cancel(t){return Ju.cancel(t)}currentId=Zu;request(t){this.cancel(),this.currentId=Ju.request(()=>{this.currentId=Zu,t()})}cancel=()=>{this.currentId!==Zu&&(Ju.cancel(this.currentId),this.currentId=Zu)};disposeEffect=()=>this.cancel}function Mx(){const e=gr(Zr.create).current;return vD(e.disposeEffect),e}function Io(e){return e==null?e:"current"in e?e.current:e}let jl=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const C7={[jl.startingStyle]:""},S7={[jl.endingStyle]:""},Dx={transitionStatus(e){return e==="starting"?C7:e==="ending"?S7:null}};function E7(e,t=!1,n=!0){const r=Mx();return ke((o,i=null)=>{r.cancel();function s(){ao.flushSync(o)}const a=Io(e);if(a==null)return;const l=a;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let u=function(){const d=jl.startingStyle;if(!l.hasAttribute(d)){r.request(c);return}const f=new MutationObserver(()=>{l.hasAttribute(d)||(f.disconnect(),c())});f.observe(l,{attributes:!0,attributeFilter:[d]}),i?.addEventListener("abort",()=>f.disconnect(),{once:!0})},c=function(){Promise.all(l.getAnimations().map(d=>d.finished)).then(()=>{i?.aborted||s()}).catch(()=>{const d=l.getAnimations();if(n){if(i?.aborted)return;s()}else d.length>0&&d.some(f=>f.pending||f.playState!=="finished")&&c()})};if(t){u();return}r.request(c)}})}function kx(e,t=!1,n=!1){const[r,o]=b.useState(e&&t?"idle":void 0),[i,s]=b.useState(e);return e&&!i&&(s(!0),o("starting")),!e&&i&&r!=="ending"&&!n&&o("ending"),!e&&!i&&r==="ending"&&o(void 0),Ge(()=>{if(!e&&i&&r!=="ending"&&n){const a=Zr.request(()=>{o("ending")});return()=>{Zr.cancel(a)}}},[e,i,r,n]),Ge(()=>{if(!e||t)return;const a=Zr.request(()=>{o(void 0)});return()=>{Zr.cancel(a)}},[t,e]),Ge(()=>{if(!e||!t)return;e&&i&&r!=="idle"&&o("starting");const a=Zr.request(()=>{o("idle")});return()=>{Zr.cancel(a)}},[t,e,i,o,r]),b.useMemo(()=>({mounted:i,setMounted:s,transitionStatus:r}),[i,r])}let yD=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function xD(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:i}=e,{register:s,unregister:a,subscribeMapChange:l,elementsRef:u,labelsRef:c,nextIndexRef:d}=z8(),f=b.useRef(-1),[p,g]=b.useState(i??(o===yD.GuessFromOrder?()=>{if(f.current===-1){const y=d.current;d.current+=1,f.current=y}return f.current}:-1)),m=b.useRef(null),v=b.useCallback(y=>{if(m.current=y,p!==-1&&y!==null&&(u.current[p]=y,c)){const x=t!==void 0;c.current[p]=x?t:r?.current?.textContent??y.textContent}},[p,u,c,t,r]);return Ge(()=>{if(i!=null)return;const y=m.current;if(y)return s(y,n),()=>{a(y)}},[i,s,a,n]),Ge(()=>{if(i==null)return l(y=>{const x=m.current?y.get(m.current)?.index:null;x!=null&&g(x)})},[i,l,g]),b.useMemo(()=>({ref:v,index:p}),[p,v])}let fv;process.env.NODE_ENV!=="production"&&(fv=new Set);function kE(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");fv.has(t)||(fv.add(t),console.error(`Base UI: ${t}`))}}const wD=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(wD.displayName="CompositeRootContext");function I7(e=!1){const t=b.useContext(wD);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Gr(16));return t}function R7(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:i}=e,s=r&&t!==!1,a=r&&t===!1;return{props:b.useMemo(()=>{const u={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(u.tabIndex=o,!i&&n&&(u.tabIndex=t?o:-1)),(i&&(t||s)||!i&&n)&&(u["aria-disabled"]=n),i&&(!t||a)&&(u.disabled=n),u},[r,n,t,s,a,i,o])}}function Nf(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,i=b.useRef(null),s=I7(!0)!==void 0,a=ke(()=>{const f=i.current;return!!(f?.tagName==="A"&&f?.href)}),{props:l}=R7({focusableWhenDisabled:n,disabled:t,composite:s,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&b.useEffect(()=>{if(!i.current)return;const f=i.current.tagName==="BUTTON";if(o){if(!f){const p=dv.captureOwnerStack?.()||"";kE(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${p}`)}}else if(f){const p=dv.captureOwnerStack?.()||"";kE(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${p}`)}},[o]);const u=b.useCallback(()=>{const f=i.current;A7(f)&&s&&t&&l.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,l.disabled,s]);Ge(u,[u]);const c=b.useCallback((f={})=>{const{onClick:p,onMouseDown:g,onKeyUp:m,onKeyDown:v,onPointerDown:y,...x}=f;return pD({type:o?"button":void 0,onClick(C){if(t){C.preventDefault();return}p?.(C)},onMouseDown(C){t||g?.(C)},onKeyDown(C){if(t||(uv(C),v?.(C)),C.baseUIHandlerPrevented)return;const S=C.target===C.currentTarget&&!o&&!a()&&!t,R=C.key==="Enter",I=C.key===" ";S&&((I||R)&&C.preventDefault(),R&&p?.(C))},onKeyUp(C){t||(uv(C),m?.(C)),!C.baseUIHandlerPrevented&&C.target===C.currentTarget&&!o&&!t&&C.key===" "&&p?.(C)},onPointerDown(C){if(t){C.preventDefault();return}y?.(C)}},o?void 0:{role:"button"},l,x)},[t,l,o,a]),d=ke(f=>{i.current=f,u()});return{getButtonProps:c,buttonRef:d}}function A7(e){return zt(e)&&e.tagName==="BUTTON"}const vs=typeof navigator<"u",Pm=O7(),CD=_7(),jx=P7(),SD=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ED=Pm.platform==="MacIntel"&&Pm.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Pm.platform),jE=vs&&/firefox/i.test(jx),T7=vs&&/apple/i.test(navigator.vendor),cd=vs&&/android/i.test(CD)||/android/i.test(jx);vs&&CD.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const N7=jx.includes("jsdom/");function O7(){if(!vs)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function P7(){if(!vs)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function _7(){if(!vs)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const pv="data-base-ui-focusable",ID="active",RD="selected",M7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ai="ArrowLeft",li="ArrowRight",Fx="ArrowUp",bu="ArrowDown";function Ao(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ft(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ab(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _n(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Rr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function D7(e){return e.matches("html,body")}function Lx(e){return zt(e)&&e.matches(M7)}function hv(e){return e?e.getAttribute("role")==="combobox"&&Lx(e):!1}function gv(e){return e?e.hasAttribute(pv)?e:e.querySelector(`[${pv}]`)||e:null}function Xs(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...Xs(e,o.id,n)])}function FE(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(i=>i.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Tt(e){e.preventDefault(),e.stopPropagation()}function k7(e){return"nativeEvent"in e}function AD(e){return e.pointerType===""&&e.isTrusted?!0:cd&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function TD(e){return N7?!1:!cd&&e.width===0&&e.height===0||cd&&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 LE(e,t){return["mouse","pen"].includes(e)}function ND(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ku(e,t,n){return Math.floor(e/t)!==n}function pl(e,t){return t<0||t>=e.current.length}function _m(e,t){return vn(e,{disabledIndices:t})}function BE(e,t){return vn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function vn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let i=t;do i+=n?-o:o;while(i>=0&&i<=e.current.length-1&&hl(e,i,r));return i}function j7(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:c=!1}){let d=u;const f=[],p={};let g=!1;{let y=null,x=-1;e.current.forEach((w,C)=>{if(w==null)return;const S=w.closest('[role="row"]');S&&(g=!0),(S!==y||x===-1)&&(y=S,x+=1,f[x]=[]),f[x].push(C),p[C]=x})}const m=g&&f.length>0&&f.some(y=>y.length!==i);function v(y){if(!m||u===-1)return;const x=p[u];if(x==null)return;const w=f[x].indexOf(u);let C=y==="up"?x-1:x+1;r&&(C<0?C=f.length-1:C>=f.length&&(C=0));const S=new Set;for(;C>=0&&C<f.length&&!S.has(C);){S.add(C);const R=f[C];if(R.length===0){C=y==="up"?C-1:C+1;continue}const I=Math.min(w,R.length-1);for(let T=I;T>=0;T-=1){const M=R[T];if(!hl(e,M,s))return M}C=y==="up"?C-1:C+1,r&&(C<0?C=f.length-1:C>=f.length&&(C=0))}}if(t.key===Fx){const y=v("up");if(y!==void 0)c&&Tt(t),d=y;else{if(c&&Tt(t),u===-1)d=l;else if(d=vn(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),r&&(u-i<a||d<0)){const x=u%i,w=l%i,C=l-(w-x);w===x?d=l:d=w>x?C:C-i}pl(e,d)&&(d=u)}}if(t.key===bu){const y=v("down");y!==void 0?(c&&Tt(t),d=y):(c&&Tt(t),u===-1?d=a:(d=vn(e,{startingIndex:u,amount:i,disabledIndices:s}),r&&u+i>l&&(d=vn(e,{startingIndex:u%i-i,amount:i,disabledIndices:s}))),pl(e,d)&&(d=u))}if(n==="both"){const y=Ws(u/i);t.key===(o?ai:li)&&(c&&Tt(t),u%i!==i-1?(d=vn(e,{startingIndex:u,disabledIndices:s}),r&&Ku(d,i,y)&&(d=vn(e,{startingIndex:u-u%i-1,disabledIndices:s}))):r&&(d=vn(e,{startingIndex:u-u%i-1,disabledIndices:s})),Ku(d,i,y)&&(d=u)),t.key===(o?li:ai)&&(c&&Tt(t),u%i!==0?(d=vn(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Ku(d,i,y)&&(d=vn(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s}))):r&&(d=vn(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s})),Ku(d,i,y)&&(d=u));const x=Ws(l/i)===y;pl(e,d)&&(r&&x?d=t.key===(o?li:ai)?l:vn(e,{startingIndex:u-u%i-1,disabledIndices:s}):d=u)}return d}function F7(e,t,n){const r=[];let o=0;return e.forEach(({width:i,height:s},a)=>{if(i>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${a} is greater than grid columns`);let l=!1;for(;!l;){const u=[];for(let c=0;c<i;c+=1)for(let d=0;d<s;d+=1)u.push(o+c+d*t);o%t+i<=t&&u.every(c=>r[c]==null)?(u.forEach(c=>{r[c]=a}),l=!0):o+=1}}),[...r]}function L7(e,t,n,r,o){if(e===-1)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e);default:return-1}}function B7(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function hl(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}var V7=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],dd=V7.join(","),OD=typeof Element>"u",ua=OD?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fd=!OD&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},pd=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):pd(t.parentNode));return s},$7=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},PD=function(t,n,r){if(pd(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(dd));return n&&ua.call(t,dd)&&o.unshift(t),o=o.filter(r),o},hd=function(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!pd(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=hd(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=ua.call(s,dd);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!pd(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var p=hd(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return o},_D=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},MD=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||$7(t))&&!_D(t)?0:t.tabIndex},G7=function(t,n){var r=MD(t);return r<0&&n&&!_D(t)?0:r},H7=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},DD=function(t){return t.tagName==="INPUT"},W7=function(t){return DD(t)&&t.type==="hidden"},z7=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},q7=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},U7=function(t){if(!t.name)return!0;var n=t.form||fd(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){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",s.message),!1}var i=q7(o,t.form);return!i||i===t},Y7=function(t){return DD(t)&&t.type==="radio"},X7=function(t){return Y7(t)&&!U7(t)},Z7=function(t){var n,r=t&&fd(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var u,c,d;r=fd(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},VE=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},J7=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var s=ua.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(ua.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var u=t.parentElement,c=fd(t);if(u&&!u.shadowRoot&&o(u)===!0)return VE(t);t.assignedSlot?t=t.assignedSlot:!u&&c!==t.ownerDocument?t=c.host:t=u}t=l}if(Z7(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return VE(t);return!1},K7=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ua.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},mv=function(t,n){return!(n.disabled||W7(n)||J7(n,t)||z7(n)||K7(n))},bv=function(t,n){return!(X7(n)||MD(n)<0||!mv(t,n))},Q7=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},kD=function(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=G7(a,s),u=s?kD(o.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:u})}),r.sort(H7).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Of=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hd([t],n.includeContainer,{filter:bv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Q7}):r=PD(t,n.includeContainer,bv.bind(null,n)),kD(r)},eZ=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hd([t],n.includeContainer,{filter:mv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=PD(t,n.includeContainer,mv.bind(null,n)),r},jD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ua.call(t,dd)===!1?!1:bv(n,t)};function Wt(e){return e?.ownerDocument||document}const vu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function FD(e,t){const n=Of(e,vu()),r=n.length;if(r===0)return;const o=Ao(Wt(e)),i=n.indexOf(o),s=i===-1?t===1?0:r-1:i+t;return n[s]}function LD(e){return FD(Wt(e).body,1)||e}function BD(e){return FD(Wt(e).body,-1)||e}function gl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function tZ(e){Of(e,vu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function $E(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Pf(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,i=ke(o),s=E7(r,n,!1);b.useEffect(()=>{if(!t)return;const a=new AbortController;return s(i,a.signal),()=>{a.abort()}},[t,n,i,s])}const $a=0;class ca{static create(){return new ca}currentId=$a;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=$a,n()},t)}isStarted(){return this.currentId!==$a}clear=()=>{this.currentId!==$a&&(clearTimeout(this.currentId),this.currentId=$a)};disposeEffect=()=>this.clear}function ns(){const e=gr(ca.create).current;return vD(e.disposeEffect),e}let GE={},HE={},WE="";function nZ(e){if(typeof document>"u")return!1;const t=Wt(e);return cn(t).innerWidth-t.documentElement.clientWidth>0}function rZ(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Wt(e),r=n.documentElement,o=n.body,i=vi(r)?r:o,s=i.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",i.style.overflowY="scroll";const l=i.offsetWidth;i.style.overflowY="hidden";const u=i.offsetWidth;return i.style.overflowY=s,r.style.scrollbarGutter=a,l===u}function oZ(e){const t=Wt(e),n=t.documentElement,r=t.body,o=vi(n)?n:r,i={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,i)}}function iZ(e){const t=Wt(e),n=t.documentElement,r=t.body,o=cn(n);let i=0,s=0,a=!1;const l=Zr.create();if(SD&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const f=o.getComputedStyle(n),p=o.getComputedStyle(r),v=(f.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,s=n.scrollLeft,GE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},WE=n.style.scrollBehavior,HE={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};const y=n.scrollHeight>n.clientHeight,x=n.scrollWidth>n.clientWidth,w=f.overflowY==="scroll"||p.overflowY==="scroll",C=f.overflowX==="scroll"||p.overflowX==="scroll",S=Math.max(0,o.innerWidth-r.clientWidth),R=Math.max(0,o.innerHeight-r.clientHeight),I=parseFloat(p.marginTop)+parseFloat(p.marginBottom),T=parseFloat(p.marginLeft)+parseFloat(p.marginRight),M=vi(n)?n:r;if(a=rZ(e),a){n.style.scrollbarGutter=v,M.style.overflowY="hidden",M.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||w)&&(n.style.overflowY="scroll"),(x||C)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||R?`calc(100dvh - ${I+R}px)`:"100dvh",width:T||S?`calc(100vw - ${T+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=i,r.scrollLeft=s,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function c(){Object.assign(n.style,GE),Object.assign(r.style,HE),a||(n.scrollTop=i,n.scrollLeft=s,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=WE)}function d(){c(),l.request(u)}return u(),o.addEventListener("resize",d),()=>{l.cancel(),c(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",d)}}class sZ{lockCount=0;restore=null;timeoutLock=ca.create();timeoutUnlock=ca.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Wt(t).documentElement,o=cn(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Ft;return}const i=ED||!nZ(t);this.restore=i?oZ(t):iZ(t)}}const aZ=new sZ;function lZ(e=!0,t=null){Ge(()=>{if(e)return aZ.acquire(t)},[e,t])}function ur(e){const t=gr(uZ,e).current;return t.next=e,Ge(t.effect),t}function uZ(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function cZ(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(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)}}}const VD=b.createContext(null);process.env.NODE_ENV!=="production"&&(VD.displayName="FloatingNodeContext");const $D=b.createContext(null);process.env.NODE_ENV!=="production"&&($D.displayName="FloatingTreeContext");const GD=()=>b.useContext(VD)?.id||null,_f=e=>{const t=b.useContext($D);return e??t};function gd(e){return`data-base-ui-${e}`}const HD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Bx={...HD,position:"fixed",top:0,left:0},dZ={...HD,position:"absolute"},Fl=b.forwardRef(function(t,n){const[r,o]=b.useState();Ge(()=>{T7&&o("button")},[]);const i={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:Bx,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Fl.displayName="FocusGuard");let zE=0;function ml(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(zE);const i=()=>e?.focus({preventScroll:n});o?i():zE=requestAnimationFrame(i)}const Zs={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function qE(e){return e==="inert"?Zs.inert:e==="aria-hidden"?Zs["aria-hidden"]:Zs.none}let Qu=new WeakSet,ec={},Mm=0;const WD=e=>e&&(e.host||WD(e.parentNode)),fZ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=WD(n);return e.contains(r)?r:null}).filter(n=>n!=null);function pZ(e,t,n,r){const o="data-base-ui-inert",i=r?"inert":n?"aria-hidden":null,s=fZ(t,e),a=new Set,l=new Set(s),u=[];ec[o]||(ec[o]=new WeakMap);const c=ec[o];s.forEach(d),f(t),a.clear();function d(p){!p||a.has(p)||(a.add(p),p.parentNode&&d(p.parentNode))}function f(p){!p||l.has(p)||[].forEach.call(p.children,g=>{if(bi(g)!=="script")if(a.has(g))f(g);else{const m=i?g.getAttribute(i):null,v=m!==null&&m!=="false",y=qE(i),x=(y.get(g)||0)+1,w=(c.get(g)||0)+1;y.set(g,x),c.set(g,w),u.push(g),x===1&&v&&Qu.add(g),w===1&&g.setAttribute(o,""),!v&&i&&g.setAttribute(i,i==="inert"?"":"true")}})}return Mm+=1,()=>{u.forEach(p=>{const g=qE(i),v=(g.get(p)||0)-1,y=(c.get(p)||0)-1;g.set(p,v),c.set(p,y),v||(!Qu.has(p)&&i&&p.removeAttribute(i),Qu.delete(p)),y||p.removeAttribute(o)}),Mm-=1,Mm||(Zs.inert=new WeakMap,Zs["aria-hidden"]=new WeakMap,Zs.none=new WeakMap,Qu=new WeakSet,ec={})}}function hZ(e,t=!1,n=!1){const r=Wt(e[0]).body;return pZ(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Vx=b.createContext(null);process.env.NODE_ENV!=="production"&&(Vx.displayName="PortalContext");const zD=()=>b.useContext(Vx),gZ=gd("portal");function mZ(e={}){const{ref:t,container:n,componentProps:r=En,elementProps:o}=e,i=_x(),a=zD()?.portalNode,[l,u]=b.useState(null),[c,d]=b.useState(null),f=ke(v=>{v!==null&&d(v)}),p=b.useRef(null);Ge(()=>{if(n===null){p.current&&(p.current=null,d(null),u(null));return}if(i==null)return;const v=(n&&(Sy(n)?n:n.current))??a??document.body;if(v==null){p.current&&(p.current=null,d(null),u(null));return}p.current!==v&&(p.current=v,d(null),u(v))},[n,a,i]);const g=jn("div",r,{ref:[t,f],props:[{id:i,[gZ]:""},o]});return{portalNode:c,portalSubtree:l&&g?ao.createPortal(g,l):null}}const qD=b.forwardRef(function(t,n){const{children:r,container:o,className:i,render:s,renderGuards:a,...l}=t,{portalNode:u,portalSubtree:c}=mZ({container:o,ref:n,componentProps:t,elementProps:l}),d=b.useRef(null),f=b.useRef(null),p=b.useRef(null),g=b.useRef(null),[m,v]=b.useState(null),y=m?.modal,x=m?.open,w=typeof a=="boolean"?a:!!m&&!m.modal&&m.open&&!!u;b.useEffect(()=>{if(!u||y)return;function S(R){u&&R.relatedTarget&&gl(R)&&(R.type==="focusin"?$E:tZ)(u)}return u.addEventListener("focusin",S,!0),u.addEventListener("focusout",S,!0),()=>{u.removeEventListener("focusin",S,!0),u.removeEventListener("focusout",S,!0)}},[u,y]),b.useEffect(()=>{!u||x||$E(u)},[x,u]);const C=b.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:g,portalNode:u,setFocusManagerState:v}),[u]);return h.jsxs(b.Fragment,{children:[c,h.jsxs(Vx.Provider,{value:C,children:[w&&u&&h.jsx(Fl,{"data-type":"outside",ref:d,onFocus:S=>{if(gl(S,u))p.current?.focus();else{const R=m?m.domReference:null;BD(R)?.focus()}}}),w&&u&&h.jsx("span",{"aria-owns":u.id,style:c7}),u&&ao.createPortal(r,u),w&&u&&h.jsx(Fl,{"data-type":"outside",ref:f,onFocus:S=>{if(gl(S,u))g.current?.focus();else{const R=m?m.domReference:null;LD(R)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Qe(Tf,S.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(qD.displayName="FloatingPortal");function bZ(e,t){const 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"):""}const UE=20;let ni=[];function $x(){ni=ni.filter(e=>e.deref()?.isConnected)}function vZ(e){$x(),e&&bi(e)!=="body"&&(ni.push(new WeakRef(e)),ni.length>UE&&(ni=ni.slice(-UE)))}function Dm(){return $x(),ni[ni.length-1]?.deref()}function yZ(e){if(!e)return null;const t=vu();return jD(e,t)?e:Of(e,t)[0]||e}function xZ(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Wn(e).display!=="none"}function YE(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=vu(),o=eZ(e,n).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return jD(s,n)||s.hasAttribute("data-tabindex")&&!a.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||o.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 wZ(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:i=!0,restoreFocus:s=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:c,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p}=e,g="rootStore"in t?t.rootStore:t,m=g.useState("open"),v=g.useState("domReferenceElement"),y=g.useState("floatingElement"),{events:x,dataRef:w}=g.context,C=ke(()=>w.current.floatingContext?.nodeId),S=o===!1,R=hv(v)&&S,I=b.useRef(["content"]),T=ur(o),M=ur(i),V=ur(u),A=_f(p),P=zD(),N=b.useRef(null),B=b.useRef(null),j=b.useRef(!1),D=b.useRef(!1),$=b.useRef(!1),G=b.useRef(-1),z=b.useRef(""),H=b.useRef(""),ne=b.useRef(null),W=b.useRef(null),J=kl(ne,f,P?.beforeInsideRef),K=kl(W,P?.afterInsideRef),U=ns(),oe=ns(),X=Mx(),te=P!=null,Q=gv(y),se=ke((Z=Q)=>Z?Of(Z,vu()):[]),ae=ke(Z=>{const k=se(Z);return I.current.map(()=>k).filter(Boolean).flat()});b.useEffect(()=>{if(r||!a)return;function Z(ie){ie.key==="Tab"&&ft(Q,Ao(Wt(Q)))&&se().length===0&&!R&&Tt(ie)}const k=Wt(Q);return k.addEventListener("keydown",Z),()=>{k.removeEventListener("keydown",Z)}},[r,v,Q,a,I,R,se,ae]),b.useEffect(()=>{if(r||!m)return;const Z=Wt(Q);function k(){$.current=!1}function ie(le){const pe=_n(le),re=ft(y,pe)||ft(v,pe)||ft(P?.portalNode,pe);$.current=!re,H.current=le.pointerType||"keyboard",pe?.closest(`[${l7}]`)&&(D.current=!0)}function Y(){H.current="keyboard"}return Z.addEventListener("pointerdown",ie,!0),Z.addEventListener("pointerup",k,!0),Z.addEventListener("pointercancel",k,!0),Z.addEventListener("keydown",Y,!0),()=>{Z.removeEventListener("pointerdown",ie,!0),Z.removeEventListener("pointerup",k,!0),Z.removeEventListener("pointercancel",k,!0),Z.removeEventListener("keydown",Y,!0)}},[r,y,v,Q,m,P]),b.useEffect(()=>{if(r||!l)return;const Z=Wt(Q);function k(){D.current=!0,oe.start(0,()=>{D.current=!1})}function ie(fe){const de=_n(fe),we=se().indexOf(de);we!==-1&&(G.current=we)}function Y(fe){const de=fe.relatedTarget,ve=fe.currentTarget,we=_n(fe);queueMicrotask(()=>{const Se=C(),Ye=g.context.triggerElements,at=de?.hasAttribute(gd("focus-guard"))&&[ne.current,W.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Io(d),Io(c)].includes(de),Xe=!(ft(v,de)||ft(y,de)||ft(de,y)||ft(P?.portalNode,de)||de!=null&&Ye.hasElement(de)||Ye.hasMatchingElement(Ue=>ft(Ue,de))||at||A&&(Xs(A.nodesRef.current,Se).find(Ue=>ft(Ue.context?.elements.floating,de)||ft(Ue.context?.elements.domReference,de))||FE(A.nodesRef.current,Se).find(Ue=>[Ue.context?.elements.floating,gv(Ue.context?.elements.floating)].includes(de)||Ue.context?.elements.domReference===de)));if(ve===v&&Q&&YE(Q,I),s&&ve!==v&&!xZ(we)&&Ao(Z)===Z.body){if(zt(Q)&&(Q.focus(),s==="popup")){X.request(()=>{Q.focus()});return}const Ue=G.current,rt=se(),et=rt[Ue]||rt[rt.length-1]||Q;zt(et)&&et.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(R||!a)&&de&&Xe&&!D.current&&(R||de!==Dm())&&(j.current=!0,g.setOpen(!1,Qe(Tf,fe)))})}function le(){$.current||(w.current.insideReactTree=!0,U.start(0,()=>{w.current.insideReactTree=!1}))}const pe=zt(v)?v:null,re=[];if(!(!y&&!pe))return pe&&(pe.addEventListener("focusout",Y),pe.addEventListener("pointerdown",k),re.push(()=>{pe.removeEventListener("focusout",Y),pe.removeEventListener("pointerdown",k)})),y&&(y.addEventListener("focusin",ie),y.addEventListener("focusout",Y),P&&(y.addEventListener("focusout",le,!0),re.push(()=>{y.removeEventListener("focusout",le,!0)})),re.push(()=>{y.removeEventListener("focusin",ie),y.removeEventListener("focusout",Y)})),()=>{re.forEach(fe=>{fe()})}},[r,v,y,Q,a,A,P,g,l,s,se,R,C,I,w,U,oe,X,c,d]),b.useEffect(()=>{if(r||!y||!m)return;const Z=Array.from(P?.portalNode?.querySelectorAll(`[${gd("portal")}]`)||[]),ie=(A?FE(A.nodesRef.current,C()):[]).find(le=>hv(le.context?.elements.domReference||null))?.context?.elements.domReference,Y=[y,ie,...Z,N.current,B.current,ne.current,W.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Io(d),Io(c),R?v:null].filter(le=>le!=null);return hZ(Y,a||R)},[m,r,v,y,a,I,P,R,A,C,c,d]),Ge(()=>{if(!m||r||!zt(Q))return;const Z=Wt(Q),k=Ao(Z);queueMicrotask(()=>{const ie=ae(Q),Y=T.current,le=typeof Y=="function"?Y(V.current||""):Y;if(le===void 0||le===!1)return;let pe;le===!0||le===null?pe=ie[0]||Q:pe=Io(le),pe=pe||ie[0]||Q,!ft(Q,k)&&ml(pe,{preventScroll:pe===Q})})},[r,m,Q,S,ae,T,V]),Ge(()=>{if(r||!Q)return;const Z=Wt(Q),k=Ao(Z);vZ(k);function ie(pe){if(pe.open||(z.current=bZ(pe.nativeEvent,H.current)),pe.reason===g7&&pe.nativeEvent.type==="mouseleave"&&(j.current=!0),pe.reason===Px)if(pe.nested)j.current=!1;else if(AD(pe.nativeEvent)||TD(pe.nativeEvent))j.current=!1;else{let re=!1;document.createElement("div").focus({get preventScroll(){return re=!0,!1}}),re?j.current=!1:j.current=!0}}x.on("openchange",ie);const Y=Z.createElement("span");Y.setAttribute("tabindex","-1"),Y.setAttribute("aria-hidden","true"),Object.assign(Y.style,Bx),te&&v&&v.insertAdjacentElement("afterend",Y);function le(){const pe=M.current;let re=typeof pe=="function"?pe(z.current):pe;if(re===void 0||re===!1)return null;if(re===null&&(re=!0),typeof re=="boolean"){const de=v||Dm();return de&&de.isConnected?de:Y}const fe=v||Dm()||Y;return Io(re)||fe}return()=>{x.off("openchange",ie);const pe=Ao(Z),re=ft(y,pe)||A&&Xs(A.nodesRef.current,C(),!1).some(de=>ft(de.context?.elements.floating,pe)),fe=le();queueMicrotask(()=>{const de=yZ(fe),ve=typeof M.current!="boolean";M.current&&!j.current&&zt(de)&&(!(!ve&&de!==pe&&pe!==Z.body)||re)&&de.focus({preventScroll:!0}),Y.remove(),j.current=!1})}},[r,y,Q,M,w,x,A,te,v,C]),Ge(()=>{if(!SD||m||!y)return;const Z=Ao(Wt(y));!zt(Z)||!Lx(Z)||ft(y,Z)&&Z.blur()},[m,y]),Ge(()=>{if(!(r||!P))return P.setFocusManagerState({modal:a,closeOnFocusOut:l,open:m,onOpenChange:g.setOpen,domReference:v}),()=>{P.setFocusManagerState(null)}},[r,P,a,m,g,l,v]),Ge(()=>{if(!(r||!Q))return YE(Q,I),()=>{queueMicrotask($x)}},[r,Q,I]);const F=!r&&(a?!R:!0)&&(te||a);return h.jsxs(b.Fragment,{children:[F&&h.jsx(Fl,{"data-type":"inside",ref:J,onFocus:Z=>{if(a){const k=ae();ml(k[k.length-1])}else P?.portalNode&&(j.current=!1,gl(Z,P.portalNode)?LD(v)?.focus():Io(d??P.beforeOutsideRef)?.focus())}}),n,F&&h.jsx(Fl,{"data-type":"inside",ref:K,onFocus:Z=>{a?ml(ae()[0]):P?.portalNode&&(l&&(j.current=!0),gl(Z,P.portalNode)?BD(v)?.focus():Io(c??P.afterOutsideRef)?.focus())}})]})}function UD(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:i="click",toggle:s=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:c=cv}=t,d=b.useRef(void 0),f=Mx(),p=ns(),g=b.useMemo(()=>({onPointerDown(m){d.current=m.pointerType},onMouseDown(m){const v=d.current,y=m.nativeEvent,x=n.select("open");if(m.button!==0||i==="click"||LE(v)&&a)return;const w=r.current.openEvent,C=w?.type,S=n.select("domReferenceElement")!==m.currentTarget,R=x&&S||!(x&&s&&(!(w&&l)||C==="click"||C==="mousedown"));if(Lx(y.target)){const T=Qe(c,y,y.target);R&&v==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,T)}):n.setOpen(R,T);return}const I=m.currentTarget;f.request(()=>{const T=Qe(c,y,I);R&&v==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,T)}):n.setOpen(R,T)})},onClick(m){if(i==="mousedown-only")return;const v=d.current;if(i==="mousedown"&&v){d.current=void 0;return}if(LE(v)&&a)return;const y=n.select("open"),x=r.current.openEvent,w=n.select("domReferenceElement")!==m.currentTarget,C=y&&w||!(y&&s&&(!(x&&l)||ND(x))),S=Qe(c,m.nativeEvent,m.currentTarget);C&&v==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,S)}):n.setOpen(C,S)},onKeyDown(){d.current=void 0}}),[r,i,a,n,l,s,f,p,u,c]);return b.useMemo(()=>o?{reference:g}:En,[o,g])}const CZ={intentional:"onClick",sloppy:"onPointerDown"};function SZ(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function EZ(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),i=n.useState("referenceElement"),s=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:l}=n.context,{enabled:u=!0,escapeKey:c=!0,outsidePress:d=!0,outsidePressEvent:f="sloppy",referencePress:p=!1,referencePressEvent:g="sloppy",ancestorScroll:m=!1,bubbles:v,externalTree:y}=t,x=_f(y),w=ke(typeof d=="function"?d:()=>!1),C=typeof d=="function"?w:d,S=b.useRef(!1),{escapeKey:R,outsidePress:I}=SZ(v),T=b.useRef(null),M=ns(),V=ns(),A=ke(()=>{V.clear(),l.current.insideReactTree=!1}),P=b.useRef(!1),N=b.useRef(""),B=ke(F=>{N.current=F.pointerType}),j=ke(()=>{const F=N.current,Z=F==="pen"||!F?"mouse":F,k=typeof f=="function"?f():f;return typeof k=="string"?k:k[Z]}),D=ke(F=>{if(!r||!u||!c||F.key!=="Escape"||P.current)return;const Z=l.current.floatingContext?.nodeId,k=x?Xs(x.nodesRef.current,Z):[];if(!R&&k.length>0){let le=!0;if(k.forEach(pe=>{pe.context?.open&&!pe.context.dataRef.current.__escapeKeyBubbles&&(le=!1)}),!le)return}const ie=k7(F)?F.nativeEvent:F,Y=Qe(mD,ie);n.setOpen(!1,Y),!R&&!Y.isPropagationAllowed&&F.stopPropagation()}),$=ke(F=>{const Z=j();return Z==="intentional"&&F.type!=="click"||Z==="sloppy"&&F.type==="click"}),G=ke(()=>{l.current.insideReactTree=!0,V.start(0,A)}),z=ke((F,Z=!1)=>{if($(F)){A();return}if(l.current.insideReactTree){A();return}if(j()==="intentional"&&Z||typeof C=="function"&&!C(F))return;const k=_n(F),ie=`[${gd("inert")}]`,Y=Wt(n.select("floatingElement")).querySelectorAll(ie),le=n.context.triggerElements;if(k&&(le.hasElement(k)||le.hasMatchingElement(ve=>ft(ve,k))))return;let pe=Nt(k)?k:null;for(;pe&&!Oo(pe);){const ve=Mo(pe);if(Oo(ve)||!Nt(ve))break;pe=ve}if(Y.length&&Nt(k)&&!D7(k)&&!ft(k,n.select("floatingElement"))&&Array.from(Y).every(ve=>!ft(pe,ve)))return;if(zt(k)&&!("touches"in F)){const ve=Oo(k),we=Wn(k),Se=/auto|scroll/,Ye=ve||Se.test(we.overflowX),at=ve||Se.test(we.overflowY),Xe=Ye&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,Ue=at&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,rt=we.direction==="rtl",et=Ue&&(rt?F.offsetX<=k.offsetWidth-k.clientWidth:F.offsetX>k.clientWidth),gt=Xe&&F.offsetY>k.clientHeight;if(et||gt)return}const re=l.current.floatingContext?.nodeId,fe=x&&Xs(x.nodesRef.current,re).some(ve=>Rr(F,ve.context?.elements.floating));if(Rr(F,n.select("floatingElement"))||Rr(F,n.select("domReferenceElement"))||fe)return;const de=x?Xs(x.nodesRef.current,re):[];if(de.length>0){let ve=!0;if(de.forEach(we=>{we.context?.open&&!we.context.dataRef.current.__outsidePressBubbles&&(ve=!1)}),!ve)return}n.setOpen(!1,Qe(Px,F)),A()}),H=ke(F=>{j()!=="sloppy"||F.pointerType==="touch"||!n.select("open")||!u||Rr(F,n.select("floatingElement"))||Rr(F,n.select("domReferenceElement"))||z(F)}),ne=ke(F=>{if(j()!=="sloppy"||!n.select("open")||!u||Rr(F,n.select("floatingElement"))||Rr(F,n.select("domReferenceElement")))return;const Z=F.touches[0];Z&&(T.current={startTime:Date.now(),startX:Z.clientX,startY:Z.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}),W=ke(F=>{const Z=_n(F);function k(){ne(F),Z?.removeEventListener(F.type,k)}Z?.addEventListener(F.type,k)}),J=ke(F=>{const Z=S.current;if(S.current=!1,M.clear(),F.type==="mousedown"&&T.current&&!T.current.dismissOnMouseDown)return;const k=_n(F);function ie(){F.type==="pointerdown"?H(F):z(F,Z),k?.removeEventListener(F.type,ie)}k?.addEventListener(F.type,ie)}),K=ke(F=>{if(j()!=="sloppy"||!T.current||Rr(F,n.select("floatingElement"))||Rr(F,n.select("domReferenceElement")))return;const Z=F.touches[0];if(!Z)return;const k=Math.abs(Z.clientX-T.current.startX),ie=Math.abs(Z.clientY-T.current.startY),Y=Math.sqrt(k*k+ie*ie);Y>5&&(T.current.dismissOnTouchEnd=!0),Y>10&&(z(F),M.clear(),T.current=null)}),U=ke(F=>{const Z=_n(F);function k(){K(F),Z?.removeEventListener(F.type,k)}Z?.addEventListener(F.type,k)}),oe=ke(F=>{j()!=="sloppy"||!T.current||Rr(F,n.select("floatingElement"))||Rr(F,n.select("domReferenceElement"))||(T.current.dismissOnTouchEnd&&z(F),M.clear(),T.current=null)}),X=ke(F=>{const Z=_n(F);function k(){oe(F),Z?.removeEventListener(F.type,k)}Z?.addEventListener(F.type,k)});b.useEffect(()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=I;const F=new ca;function Z(pe){n.setOpen(!1,Qe(sr,pe))}function k(){F.clear(),P.current=!0}function ie(){F.start(qd()?5:0,()=>{P.current=!1})}const Y=Wt(o);Y.addEventListener("pointerdown",B,!0),c&&(Y.addEventListener("keydown",D),Y.addEventListener("compositionstart",k),Y.addEventListener("compositionend",ie)),C&&(Y.addEventListener("click",J,!0),Y.addEventListener("pointerdown",J,!0),Y.addEventListener("touchstart",W,!0),Y.addEventListener("touchmove",U,!0),Y.addEventListener("touchend",X,!0),Y.addEventListener("mousedown",J,!0));let le=[];return m&&(Nt(s)&&(le=si(s)),Nt(o)&&(le=le.concat(si(o))),!Nt(i)&&i&&i.contextElement&&(le=le.concat(si(i.contextElement)))),le=le.filter(pe=>pe!==Y.defaultView?.visualViewport),le.forEach(pe=>{pe.addEventListener("scroll",Z,{passive:!0})}),()=>{Y.removeEventListener("pointerdown",B,!0),c&&(Y.removeEventListener("keydown",D),Y.removeEventListener("compositionstart",k),Y.removeEventListener("compositionend",ie)),C&&(Y.removeEventListener("click",J,!0),Y.removeEventListener("pointerdown",J,!0),Y.removeEventListener("touchstart",W,!0),Y.removeEventListener("touchmove",U,!0),Y.removeEventListener("touchend",X,!0),Y.removeEventListener("mousedown",J,!0)),le.forEach(pe=>{pe.removeEventListener("scroll",Z)}),F.clear(),S.current=!1}},[l,o,i,s,c,C,r,a,m,u,R,I,D,z,J,H,W,U,X,B,n]),b.useEffect(A,[C,A]);const te=b.useMemo(()=>({onKeyDown:D,...p&&{[CZ[g]]:F=>{n.setOpen(!1,Qe(cv,F.nativeEvent))},...g!=="intentional"&&{onClick(F){n.setOpen(!1,Qe(cv,F.nativeEvent))}}}}),[D,n,p,g]),Q=ke(F=>{const Z=_n(F.nativeEvent);!ft(n.select("floatingElement"),Z)||F.button!==0||(S.current=!0)}),se=ke(F=>{!r||!u||F.button!==0||(S.current=!0)}),ae=b.useMemo(()=>({onKeyDown:D,onPointerDown:Q,onMouseDown:Q,onMouseUp:Q,onClickCapture:G,onMouseDownCapture(F){G(),se(F)},onPointerDownCapture(F){G(),se(F)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[D,Q,G,se]);return b.useMemo(()=>u?{reference:te,floating:ae,trigger:te}:{},[u,te,ae])}var IZ=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(i){({stack:o}=i)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
@@ -83,9 +83,9 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
83
83
|
${s.right}px ${s.bottom}px,
|
|
84
84
|
${s.right}px ${s.top}px,
|
|
85
85
|
${s.left}px ${s.top}px
|
|
86
|
-
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});process.env.NODE_ENV!=="production"&&(QD.displayName="InternalBackdrop");function yJ(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const Hx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Hx.displayName="ComboboxRootContext");const Wx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Wx.displayName="ComboboxFloatingContext");const zx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(zx.displayName="ComboboxDerivedItemsContext");const qx=b.createContext("");process.env.NODE_ENV!=="production"&&(qx.displayName="ComboboxInputValueContext");function Yn(){const e=b.useContext(Hx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":Gr(22));return e}function Df(){const e=b.useContext(Wx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":Gr(23));return e}function Ii(){const e=b.useContext(zx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":Gr(24));return e}function Ux(){return b.useContext(qx)}const xJ=(e,t)=>Object.is(e,t);function rs(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wJ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:rs(t,r,n))}function bd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:rs(r,t,n))}function CJ(e,t,n){return e.filter(r=>!rs(t,r,n))}function yv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Yx(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function SJ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Yx(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Pn(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return yv(e)}function Ga(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?yv(e.value):yv(e)}function ek(e,t,n){function r(){return Pn(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=Yx(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=o.find(s=>s.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=o.find(s=>s&&s.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function EJ(e,t,n){return e.reduce((r,o,i)=>(i>0&&r.push(", "),r.push(h.jsx(b.Fragment,{children:ek(o,t,n)},i)),r),[])}const be={id:De(e=>e.id),query:De(e=>e.query),items:De(e=>e.items),selectedValue:De(e=>e.selectedValue),hasSelectionChips:De(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:De(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:De((e,t)=>t?SJ(e.items):!1),open:De(e=>e.open),mounted:De(e=>e.mounted),forceMounted:De(e=>e.forceMounted),inline:De(e=>e.inline),activeIndex:De(e=>e.activeIndex),selectedIndex:De(e=>e.selectedIndex),isActive:De((e,t)=>e.activeIndex===t),isSelected:De((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(o=>rs(t,o,n)):rs(t,r,n)}),transitionStatus:De(e=>e.transitionStatus),popupProps:De(e=>e.popupProps),inputProps:De(e=>e.inputProps),triggerProps:De(e=>e.triggerProps),getItemProps:De(e=>e.getItemProps),positionerElement:De(e=>e.positionerElement),listElement:De(e=>e.listElement),triggerElement:De(e=>e.triggerElement),inputElement:De(e=>e.inputElement),popupSide:De(e=>e.popupSide),openMethod:De(e=>e.openMethod),inputInsidePopup:De(e=>e.inputInsidePopup),selectionMode:De(e=>e.selectionMode),listRef:De(e=>e.listRef),labelsRef:De(e=>e.labelsRef),popupRef:De(e=>e.popupRef),emptyRef:De(e=>e.emptyRef),inputRef:De(e=>e.inputRef),keyboardActiveRef:De(e=>e.keyboardActiveRef),chipsContainerRef:De(e=>e.chipsContainerRef),clearRef:De(e=>e.clearRef),valuesRef:De(e=>e.valuesRef),allValuesRef:De(e=>e.allValuesRef),name:De(e=>e.name),disabled:De(e=>e.disabled),readOnly:De(e=>e.readOnly),required:De(e=>e.required),grid:De(e=>e.grid),isGrouped:De(e=>e.isGrouped),virtualized:De(e=>e.virtualized),onOpenChangeComplete:De(e=>e.onOpenChangeComplete),openOnInputClick:De(e=>e.openOnInputClick),itemToStringLabel:De(e=>e.itemToStringLabel),isItemEqualToValue:De(e=>e.isItemEqualToValue),modal:De(e=>e.modal),autoHighlight:De(e=>e.autoHighlight),submitOnItemClick:De(e=>e.submitOnItemClick)};let nI=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const IJ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},RJ={valid(e){return e===null?null:e?{[nI.valid]:""}:{[nI.invalid]:""}}},tk=b.createContext({invalid:void 0,name:void 0,validityData:{state:IJ,errors:[],error:"",value:"",initialValue:null},setValidityData:Ft,disabled:void 0,touched:!1,setTouched:Ft,dirty:!1,setDirty:Ft,filled:!1,setFilled:Ft,focused:!1,setFocused:Ft,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=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(tk.displayName="FieldRootContext");function yu(e=!0){const t=b.useContext(tk);if(t.setValidityData===Ft&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Gr(28));return t}function AJ(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const nk=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ft,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(nk.displayName="FormContext");function rk(){return b.useContext(nk)}function TJ(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=rk(),{invalid:l,markedDirtyRef:u,validityData:c,setValidityData:d}=yu(),f=ke(e.getValue);Ge(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),c.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,c.initialValue,f]),Ge(()=>{!t||!r||a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:AJ(c,l),validate(p=!0){let g=n;g===void 0&&(g=f()),u.current=!0,p?ao.flushSync(()=>s(g)):s(g)}})},[s,i,t,a,f,r,l,u,o,c,n]),Ge(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const ok=b.createContext({controlId:void 0,registerControlId:Ft,labelId:void 0,setLabelId:Ft,messageIds:[],setMessageIds:Ft,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(ok.displayName="LabelableContext");function Xx(){return b.useContext(ok)}function ik(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=Xx(),s=bD(t),a=n?o:void 0,l=gr(()=>Symbol("labelable-control")),u=b.useRef(!1),c=b.useRef(t!=null),d=ke(()=>{!u.current||i===Ft||(u.current=!1,i(l.current,void 0))});return Ge(()=>{if(i===Ft)return;let f;if(n){const p=r?.current;Nt(p)&&p.closest("label")!=null?f=t??null:f=a??s}else if(t!=null)c.current=!0,f=t;else if(c.current)f=s;else{d();return}if(f===void 0){d();return}u.current=!0,i(l.current,f)},[t,r,a,i,n,s,l,d]),b.useEffect(()=>d,[d]),o??s}function NJ(e,t){return(n,r)=>{if(n==null)return!1;const o=Pn(n,t);return e.contains(o,r)}}function OJ(e,t,n){return(r,o)=>{if(r==null)return!1;if(!o)return!0;const i=Pn(r,t),s=n!=null?Pn(n,t):"";return s&&e.contains(s,o)&&s.length===o.length?!0:e.contains(i,o)}}const rI=new Map;function sk(e){return Array.isArray(e)?e.map(t=>sk(t)).join(","):e==null?"":String(e)}function PJ(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${sk(e.locale)}|${JSON.stringify(t)}`,r=rI.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(s,a,l){if(!a)return!0;const u=Pn(s,l);for(let c=0;c<=u.length-a.length;c+=1)if(o.compare(u.slice(c,c+a.length),a)===0)return!0;return!1},startsWith(s,a,l){if(!a)return!0;const u=Pn(s,l);return o.compare(u.slice(0,a.length),a)===0},endsWith(s,a,l){if(!a)return!0;const u=Pn(s,l),c=a.length;return u.length>=c&&o.compare(u.slice(u.length-c),a)===0}};return rI.set(n,i),i}const _J=PJ;function ic(e,t){const n=b.useRef(e),r=ke(t);Ge(()=>{n.current!==e&&r(n.current)},[e,r]),Ge(()=>{n.current=e},[e])}const ak=Symbol("none"),$i={value:ak,index:-1};function MJ(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:u,name:c,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:g,grid:m=!1,items:v,filteredItems:y,filter:x,openOnInputClick:w=!0,autoHighlight:C=!1,keepHighlight:S=!1,highlightItemOnHover:R=!0,loopFocus:I=!0,itemToStringLabel:T,itemToStringValue:M,isItemEqualToValue:V=xJ,virtualized:A=!1,inline:P=!1,fillInputOnItemPress:N=!0,modal:B=!1,limit:j=-1,autoComplete:D="list",formAutoComplete:$,locale:G,submitOnItemClick:z=!1}=e,{clearErrors:H}=rk(),{setDirty:ne,validityData:W,shouldValidateOnChange:J,setFilled:K,name:U,disabled:oe,setTouched:X,setFocused:te,validationMode:Q,validation:se}=yu(),ae=ik({id:t}),F=_J({locale:G}),[Z,k]=b.useState(!1),[ie,Y]=b.useState(null),le=b.useRef([]),pe=b.useRef([]),re=b.useRef(null),fe=b.useRef(null),de=b.useRef(null),ve=b.useRef(!0),we=b.useRef(!1),Se=b.useRef(null),Ye=b.useRef(null),at=b.useRef(null),Xe=b.useRef($i),Ue=b.useRef(null),rt=b.useRef([]),et=b.useRef([]),gt=oe||d,ct=U??c,ot=l==="multiple",mt=l==="single",Ot=a!==void 0||s!==void 0,Bt=v!==void 0,tt=y!==void 0;let Ze;C==="always"?Ze="always":Ze=C?"input-change":!1;const[ee,ye]=Nm({controlled:o,default:ot?r??Xu:r,name:"Combobox",state:"selectedValue"}),ge=b.useMemo(()=>x===null?()=>!0:x!==void 0?x:mt&&!Z?OJ(F,T,ee):NJ(F,T),[x,mt,ee,Z,F,T]),xe=gr(()=>Ot?s??"":mt?Pn(ee,T):"").current,[Ae,Ie]=Nm({controlled:a,default:xe,name:"Combobox",state:"inputValue"}),[qe,Pt]=Nm({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),lt=Yx(v),it=ie??(Ae===""?"":String(Ae).trim()),_t=mt?Pn(ee,T):"",Et=mt&&!Z&&it!==""&&_t!==""&&_t.length===it.length&&F.contains(_t,it),sn=Et?"":it,wr=Bt&&tt&&Et,Zn=b.useMemo(()=>v?lt?v.flatMap(Ce=>Ce.items):v:Xu,[v,lt]),pn=b.useMemo(()=>{if(y&&!wr)return y;if(!v)return Xu;if(lt){const Me=v,Ke=[];let It=0;for(const st of Me){if(j>-1&&It>=j)break;const Dt=sn===""?st.items:st.items.filter(Ur=>ge(Ur,sn,T));if(Dt.length===0)continue;const tr=j>-1?j-It:1/0,Nn=Dt.slice(0,tr);if(Nn.length>0){const Ur={...st,items:Nn};Ke.push(Ur),It+=Nn.length}}return Ke}if(sn==="")return j>-1?Zn.slice(0,j):Zn;const Ce=[];for(const Me of Zn){if(j>-1&&Ce.length>=j)break;ge(Me,sn,T)&&Ce.push(Me)}return Ce},[y,wr,v,lt,sn,j,ge,T,Zn]),Qt=b.useMemo(()=>lt?pn.flatMap(Me=>Me.items):pn,[pn,lt]),Ve=gr(()=>new ZD({id:ae,selectedValue:ee,open:qe,filter:ge,query:it,items:v,selectionMode:l,listRef:le,labelsRef:pe,popupRef:re,emptyRef:de,inputRef:fe,keyboardActiveRef:ve,chipsContainerRef:Se,clearRef:Ye,valuesRef:rt,allValuesRef:et,selectionEventRef:at,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,openOnInputClick:w,itemToStringLabel:T,isItemEqualToValue:V,modal:B,autoHighlight:Ze,submitOnItemClick:z,hasInputValue:Ot,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:P,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Ft,setOpen:Ft,setInputValue:Ft,setSelectedValue:Ft,setIndices:Ft,onItemHighlighted:Ft,handleSelection:Ft,getItemProps:()=>En,forceMount:Ft,requestSubmit:Ft})).current,Jn=l==="none"?Ae:ee,Ea=b.useMemo(()=>l==="none"?Jn:Array.isArray(ee)?ee.map(Ce=>Ga(Ce,M)):Ga(ee,M),[Jn,M,l,ee]),Ni=ke(u),Oi=ke(n),Go=me(Ve,be.activeIndex),on=me(Ve,be.selectedIndex),Ho=me(Ve,be.positionerElement),Rs=me(Ve,be.listElement),bo=me(Ve,be.triggerElement),Pi=me(Ve,be.inputElement),Cn=me(Ve,be.inline),Mt=me(Ve,be.inputInsidePopup),Ia=ur(bo),{mounted:As,setMounted:Ra,transitionStatus:_i}=kx(qe),{openMethod:Ts,triggerProps:zr,reset:Ns}=cJ(qe);TJ({id:ae,name:ct,commit:se.commit,value:Jn,controlRef:Mt?Ia:fe,getValue:()=>Ea});const Cr=ke(()=>{v?pe.current=Qt.map(Ce=>Pn(Ce,T)):Ve.set("forceMounted",!0)}),Kn=b.useRef(ee);Ge(()=>{ee!==Kn.current&&Cr()},[Cr,ee]);const an=ke(Ce=>{Ve.update(Ce);const Me=Ce.type||"none";if(Ce.activeIndex!==void 0)if(Ce.activeIndex===null)Xe.current!==$i&&(Xe.current=$i,Ni(void 0,Va(Me,void 0,{index:-1})));else{const Ke=rt.current[Ce.activeIndex];Xe.current={value:Ke,index:Ce.activeIndex},Ni(Ke,Va(Me,void 0,{index:Ce.activeIndex}))}}),Tn=ke((Ce,Me)=>{if(we.current=Me.reason===ei,e.onInputValueChange?.(Ce,Me),!Me.isCanceled){if(Me.reason===zs){const Ke=Me.event,It=Ke.inputType;if(Ke.type==="compositionend"||It!=null&&It!==""&&It!=="insertReplacementText"){const Dt=Ce.trim()!=="";Dt&&k(!0),Ue.current={hasQuery:Dt},Dt&&Ze&&Ve.state.activeIndex==null&&Ve.set("activeIndex",0)}}Ie(Ce)}}),vo=ke((Ce,Me)=>{if(qe!==Ce&&(Me.reason==="escape-key"&&Bt&&Qt.length===0&&!Ve.state.emptyRef.current&&Me.allowPropagation(),e.onOpenChange?.(Ce,Me),!Me.isCanceled&&(!Ce&&Z&&(mt?(Cn||Y(it),it===""&&k(!1)):ot&&(Cn||Mt?an({activeIndex:null}):Y(it),Tn("",Qe(ei,Me.event)))),Pt(Ce),!Ce&&Mt&&(Me.reason===Tf||Me.reason===Px)&&(X(!0),te(!1),Q==="onBlur")))){const Ke=l==="none"?Ae:ee;se.commit(Ke)}}),Wo=ke((Ce,Me)=>{if(i?.(Ce,Me),Me.isCanceled)return;ye(Ce),(l==="none"&&re.current&&N||mt&&!Ve.state.inputInsidePopup)&&Tn(Pn(Ce,T),Qe(Me.reason,Me.event)),mt&&Ce!=null&&Me.reason!==zs&&Z&&!Cn&&Y(it)}),Aa=ke((Ce,Me)=>{let Ke=Me;if(Ke===void 0){if(Go===null)return;Ke=rt.current[Go]}const It=_n(Ce),st=at.current??Ce;at.current=null;const Dt=Qe(m7,st),tr=It?.closest("a")?.getAttribute("href");if(tr){tr.startsWith("#")&&vo(!1,Dt);return}if(ot){const Nn=Array.isArray(ee)?ee:[],Uo=wJ(Nn,Ke,Ve.state.isItemEqualToValue)?CJ(Nn,Ke,Ve.state.isItemEqualToValue):[...Nn,Ke];if(Wo(Uo,Dt),!(fe.current?fe.current.value.trim()!=="":!1))return;Ve.state.inputInsidePopup?Tn("",Qe(ei,Dt.event)):vo(!1,Dt)}else Wo(Ke,Dt),vo(!1,Dt)}),Mi=ke(()=>{if(!Ve.state.submitOnItemClick)return;const Ce=Ve.state.inputElement?.form;Ce&&typeof Ce.requestSubmit=="function"&&Ce.requestSubmit()}),qr=ke(()=>{if(Ra(!1),Oi?.(!1),k(!1),Ns(),Y(null),an(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ot&&fe.current&&fe.current.value!==""&&!we.current&&Tn("",Qe(ei)),mt)if(Ve.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Tn("",Qe(ei));else{const Ce=Pn(ee,T);fe.current&&fe.current.value!==Ce&&Tn(Ce,Qe(Ce===""?ei:sr))}}),Di=b.useMemo(()=>Cn&&Ho?{current:Ho.closest('[role="dialog"]')}:re,[Cn,Ho]);Pf({enabled:!e.actionsRef,open:qe,ref:Di,onComplete(){qe||qr()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:qr}),[qr]),Ge(function(){if(qe||l==="none")return;const Me=v?Zn:et.current;if(ot){const Ke=Array.isArray(ee)?ee:[],It=Ke[Ke.length-1],st=bd(Me,It,V);an({selectedIndex:st===-1?null:st})}else{const Ke=bd(Me,ee,V);an({selectedIndex:Ke===-1?null:Ke})}},[qe,ee,v,l,Zn,ot,V,an]),Ge(()=>{v&&(rt.current=Qt,le.current.length=Qt.length)},[v,Qt]),Ge(()=>{const Ce=Ue.current;if(Ce&&(Ce.hasQuery?Ze&&Ve.set("activeIndex",0):Ze==="always"&&Ve.set("activeIndex",0),Ue.current=null),!qe&&!Cn)return;const Ke=Bt||tt?Qt:rt.current,It=Ve.state.activeIndex;if(It==null){if(Ze==="always"&&Ke.length>0){Ve.set("activeIndex",0);return}Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Va(sr,void 0,{index:-1})));return}if(It>=Ke.length){Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Va(sr,void 0,{index:-1}))),Ve.set("activeIndex",null);return}const st=Ke[It],Dt=Xe.current.value,tr=Dt!==ak&&rs(st,Dt,Ve.state.isItemEqualToValue);(Xe.current.index!==It||!tr)&&(Xe.current={value:st,index:It},Ve.state.onItemHighlighted(st,Va(sr,void 0,{index:It})))},[Go,Ze,tt,Bt,Qt,Cn,qe,Ve]),Ge(()=>{if(l==="none"){K(String(Ae)!=="");return}K(ot?Array.isArray(ee)&&ee.length>0:ee!=null)},[K,l,Ae,ee,ot]),b.useEffect(()=>{Bt&&Ze&&Qt.length===0&&an({activeIndex:null})},[Bt,Ze,Qt.length,an]),ic(it,()=>{!qe||it===""||it===String(xe)||k(!0)}),ic(ee,()=>{if(l!=="none"&&(H(ct),ne(ee!==W.initialValue),J()?se.commit(ee):se.commit(ee,!0),mt&&!Ot&&!Mt)){const Ce=Pn(ee,T);Ae!==Ce&&Tn(Ce,Qe(sr))}}),ic(Ae,()=>{l==="none"&&(H(ct),ne(Ae!==W.initialValue),J()?se.commit(Ae):se.commit(Ae,!0))}),ic(v,()=>{if(!mt||Ot||Mt||Z)return;const Ce=Pn(ee,T);Ae!==Ce&&Tn(Ce,Qe(sr))});const Qn=JD({open:Cn?!0:qe,onOpenChange:vo,elements:{reference:Mt?bo:Pi,floating:Ho}});let zo,qo;Cn||(zo=m?"grid":"listbox",qo=qe?"true":"false");const Ta=b.useMemo(()=>{const Ce=Pi?.tagName==="INPUT",Me=Ce||qe,Ke=Ce?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Me&&(Ke.role="combobox",Ke["aria-expanded"]=qo,Ke["aria-haspopup"]=zo,Ke["aria-controls"]=qe?Rs?.id:void 0,Ke["aria-autocomplete"]=D),{reference:Ke,floating:{role:"presentation"}}},[Pi,qe,qo,zo,Rs?.id,D]),Na=UD(Qn,{enabled:!f&&!gt&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Mt?0:50,reason:v7}),Oa=EZ(Qn,{enabled:!f&&!gt&&!Cn,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Cn?!0:void 0,outsidePress(Ce){const Me=_n(Ce);return!ft(bo,Me)&&!ft(Ye.current,Me)&&!ft(Se.current,Me)}}),Pa=aJ(Qn,{enabled:!f&&!gt,id:ae,listRef:le,activeIndex:Go,selectedIndex:on,virtual:!0,loopFocus:I,allowEscape:I&&!Ze,focusItemOnOpen:Z||l==="none"&&!Ze?!1:"auto",focusItemOnHover:R,resetOnPointerLeave:!S,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:Xu,onNavigate(Ce,Me){!Me&&!qe||_i==="ending"||an(Me?{activeIndex:Ce,type:ve.current?"keyboard":"pointer"}:{activeIndex:Ce})}}),{getReferenceProps:yo,getFloatingProps:ki,getItemProps:ji}=rJ([Ta,Na,Oa,Pa]);yJ(()=>{Ve.update({inline:P,popupProps:ki(),inputProps:yo(),triggerProps:zr,getItemProps:ji,setOpen:vo,setInputValue:Tn,setSelectedValue:Wo,setIndices:an,onItemHighlighted:Ni,handleSelection:Aa,forceMount:Cr,requestSubmit:Mi})}),Ge(()=>{Ve.update({id:ae,selectedValue:ee,open:qe,mounted:As,transitionStatus:_i,items:v,inline:P,popupProps:ki(),inputProps:yo(),triggerProps:zr,openMethod:Ts,getItemProps:ji,selectionMode:l,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,onOpenChangeComplete:Oi,openOnInputClick:w,itemToStringLabel:T,modal:B,autoHighlight:Ze,isItemEqualToValue:V,submitOnItemClick:z,hasInputValue:Ot,requestSubmit:Mi})},[Ve,ae,ee,qe,As,_i,v,ki,yo,ji,Ts,zr,l,ct,gt,f,p,se,m,lt,A,Oi,w,T,B,V,z,Ot,P,Mi,Ze]);const xo=kl(g,se.inputRef),Bn=b.useMemo(()=>({query:it,hasItems:Bt,filteredItems:pn,flatFilteredItems:Qt}),[it,Bt,pn,Qt]),Sr=b.useMemo(()=>Array.isArray(Jn)?"":Ga(Jn,M),[Jn,M]),Er=ot&&Array.isArray(ee)&&ee.length>0,Fi=ot||l==="none"?void 0:ct,er=b.useMemo(()=>!ot||!Array.isArray(ee)||!ct?null:ee.map(Ce=>{const Me=Ga(Ce,M);return h.jsx("input",{type:"hidden",name:ct,value:Me},Me)}),[ot,ee,ct,M]),_a=h.jsxs(b.Fragment,{children:[e.children,h.jsx("input",{...se.getInputValidationProps({onFocus(){if(Mt){bo?.focus();return}(fe.current||bo)?.focus()},onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;const Me=Ce.target.value,Ke=Qe(sr,Ce.nativeEvent);function It(){if(ot)return;if(l==="none"){ne(Me!==W.initialValue),Tn(Me,Ke),J()&&se.commit(Me);return}const st=rt.current.find(Dt=>Ga(Dt,M).toLowerCase()===Me.toLowerCase());st!=null&&(ne(st!==W.initialValue),Wo?.(st,Ke),J()&&se.commit(st))}v?It():(Cr(),queueMicrotask(It))}}),id:ae&&Fi==null?`${ae}-hidden-input`:void 0,name:Fi,autoComplete:$,disabled:gt,required:p&&!Er,readOnly:f,value:Sr,ref:xo,style:Fi?dZ:Bx,tabIndex:-1,"aria-hidden":!0}),er]});return h.jsx(Hx.Provider,{value:Ve,children:h.jsx(Wx.Provider,{value:Qn,children:h.jsx(zx.Provider,{value:Bn,children:h.jsx(qx.Provider,{value:Ae,children:_a})})})})}const lk={...bJ,...RJ,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function DJ(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const i=parseFloat(n.width)||0,s=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,a),c=Math.max(t.height,s,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const sc=2,uk=b.forwardRef(function(t,n){const{render:r,className:o,nativeButton:i=!0,disabled:s=!1,id:a,...l}=t,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:p,validation:g}=yu(),{labelId:m}=Xx(),v=Yn(),{filteredItems:y}=Ii(),x=me(v,be.selectionMode),w=me(v,be.disabled),C=me(v,be.readOnly),S=me(v,be.required),R=me(v,be.mounted),I=me(v,be.popupSide),T=me(v,be.positionerElement),M=me(v,be.listElement),V=me(v,be.triggerProps),A=me(v,be.triggerElement),P=me(v,be.inputInsidePopup),N=me(v,be.id),B=me(v,be.open),j=me(v,be.selectedValue),D=me(v,be.activeIndex),$=me(v,be.selectedIndex),G=me(v,be.hasSelectedValue),z=Df(),H=Ux(),ne=ns(),W=c||w||s,J=y.length===0,K=R&&T?I:null;ik({id:P?a:void 0});const U=P?a??N:a,oe=b.useRef("");function X(Y){oe.current=Y.pointerType}const te=z.useState("domReferenceElement");b.useEffect(()=>{P&&A&&A!==te&&z.set("domReferenceElement",A)},[A,te,z,P]);const{reference:Q}=lJ(z,{enabled:!B&&!C&&!w&&x==="single",listRef:v.state.labelsRef,activeIndex:D,selectedIndex:$,onMatch(Y){const le=v.state.valuesRef.current[Y];le!==void 0&&v.state.setSelectedValue(le,Qe("none"))}}),{reference:se}=UD(z,{enabled:!C&&!w,event:"mousedown"}),{buttonRef:ae,getButtonProps:F}=Nf({native:i,disabled:W}),Z={...u,open:B,disabled:W,popupSide:K,listEmpty:J,placeholder:!G},k=ke(Y=>{v.set("triggerElement",Y)});return jn("button",t,{ref:[n,ae,k],state:Z,props:[V,se,Q,{id:U,tabIndex:P?0:-1,role:P?"combobox":void 0,"aria-expanded":B?"true":"false","aria-haspopup":P?"dialog":"listbox","aria-controls":B?M?.id:void 0,"aria-required":P&&S||void 0,"aria-labelledby":m,onPointerDown:X,onPointerEnter:X,onFocus(){f(!0),!(W||C)&&ne.start(0,v.state.forceMount)},onBlur(Y){if(!ft(T,Y.relatedTarget)&&(d(!0),f(!1),p==="onBlur")){const le=x==="none"?H:j;g.commit(le)}},onMouseDown(Y){if(W||C||(P||z.set("domReferenceElement",Y.currentTarget),v.state.forceMount(),oe.current!=="touch"&&(v.state.inputRef.current?.focus(),P||Y.preventDefault()),B))return;const le=Wt(Y.currentTarget);function pe(re){if(!A)return;const fe=_n(re),de=v.state.positionerElement,ve=v.state.listElement;if(ft(A,fe)||ft(de,fe)||ft(ve,fe)||fe===A)return;const we=DJ(A),Se=re.clientX>=we.left-sc&&re.clientX<=we.right+sc,Ye=re.clientY>=we.top-sc&&re.clientY<=we.bottom+sc;Se&&Ye||v.state.setOpen(!1,Qe("cancel-open",re))}P&&le.addEventListener("mouseup",pe,{once:!0})},onKeyDown(Y){W||C||(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Tt(Y),v.state.setOpen(!0,Qe(fl,Y.nativeEvent)),v.state.inputRef.current?.focus())}},g?g.getValidationProps(l):l,F],stateAttributesMapping:lk})});process.env.NODE_ENV!=="production"&&(uk.displayName="ComboboxTrigger");const Zx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Zx.displayName="ComboboxChipsContext");function ck(){return b.useContext(Zx)}const Jx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jx.displayName="ComboboxPositionerContext");function Kx(e){const t=b.useContext(Jx);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":Gr(21));return t}const Qx=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,id:s,...a}=t,{state:l,disabled:u,setTouched:c,setFocused:d,validationMode:f,validation:p}=yu(),{labelId:g}=Xx(),m=ck(),y=!!Kx(!0),x=Yn(),{filteredItems:w}=Ii(),C=Ux(),S=cD(),R=me(x,be.required),I=me(x,be.disabled),T=me(x,be.readOnly),M=me(x,be.name),V=me(x,be.selectionMode),A=me(x,be.autoHighlight),P=me(x,be.inputProps),N=me(x,be.triggerProps),B=me(x,be.open),j=me(x,be.mounted),D=me(x,be.selectedValue),$=me(x,be.popupSide),G=me(x,be.positionerElement),z=me(x,be.id),H=me(x,be.inline),ne=!!A,W=j&&G?$:null,J=u||I||i,K=w.length===0,oe=bD(s??(y||H?void 0:z)),[X,te]=b.useState(null),Q=b.useRef(!1),se=b.useRef(null),ae=b.useRef(!1),F=ke(Y=>{const le=y||x.state.inline;le&&!x.state.hasInputValue&&x.state.setInputValue("",Qe(sr)),x.update({inputElement:Y,inputInsidePopup:le})}),Z={...l,open:B,disabled:J,readOnly:T,popupSide:W,listEmpty:K};function k(Y){if(!m)return;let le;const{highlightedChipIndex:pe}=m;if(pe!==void 0){if(Y.key==="ArrowLeft")Y.preventDefault(),pe>0?le=pe-1:le=void 0;else if(Y.key==="ArrowRight")Y.preventDefault(),pe<D.length-1?le=pe+1:le=void 0;else if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault();const re=pe>=D.length-1?D.length-2:pe;le=re>=0?re:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return le}return Y.key==="ArrowLeft"&&(Y.currentTarget.selectionStart??0)===0&&D.length>0?(Y.preventDefault(),le=Math.max(D.length-1,0)):Y.key==="Backspace"&&Y.currentTarget.value===""&&D.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Y.preventDefault()),le}return jn("input",t,{state:Z,ref:[n,x.state.inputRef,F],props:[P,N,{type:"text",value:t.value??X??C,"aria-readonly":T||void 0,"aria-required":R||void 0,"aria-labelledby":g,disabled:J,readOnly:T,required:V==="none"?R:void 0,...V==="none"&&M&&{name:M},id:oe,onFocus(){if(d(!0),!H||!ae.current)return;ae.current=!1;const Y=se.current;Y==null||!Object.hasOwn(x.state.valuesRef.current,Y)||x.state.setIndices({activeIndex:Y})},onBlur(){c(!0),d(!1);const Y=x.state.activeIndex;if(H&&Y!==null&&A!=="always"&&(se.current=Y,ae.current=!0,x.state.setIndices({activeIndex:null})),f==="onBlur"){const le=V==="none"?C:D;p.commit(le)}},onCompositionStart(Y){cd||(Q.current=!0,te(Y.currentTarget.value))},onCompositionEnd(Y){Q.current=!1;const le=Y.currentTarget.value;te(null),x.state.setInputValue(le,Qe(zs,Y.nativeEvent))},onChange(Y){const le=Y.nativeEvent.inputType,pe=!le||le==="insertReplacementText",re=Q.current||!pe;if(Q.current){const we=Y.currentTarget.value;te(we),we===""&&!x.state.openOnInputClick&&!x.state.inputInsidePopup&&x.state.setOpen(!1,Qe(ei,Y.nativeEvent));const Se=we.trim(),Ye=ne&&Se!=="";!T&&!J&&Se&&re&&(x.state.setOpen(!0,Qe(zs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!Ye&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"});return}x.state.setInputValue(Y.currentTarget.value,Qe(zs,Y.nativeEvent));const fe=Y.currentTarget.value==="",de=Qe(ei,Y.nativeEvent);fe&&!x.state.inputInsidePopup&&(V==="single"&&x.state.setSelectedValue(null,de),x.state.openOnInputClick||x.state.setOpen(!1,de));const ve=Y.currentTarget.value.trim();!T&&!J&&ve&&re&&(x.state.setOpen(!0,Qe(zs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!ne&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Y){if(J||T||Y.ctrlKey||Y.shiftKey||Y.altKey||Y.metaKey)return;x.state.keyboardActiveRef.current=!0;const le=Y.currentTarget,pe=le.scrollWidth-le.clientWidth,re=S==="rtl";if(Y.key==="Home"){Tt(Y);const ve=jE&&re?le.value.length:0;le.setSelectionRange(ve,ve),le.scrollLeft=0;return}if(Y.key==="End"){Tt(Y);const ve=jE&&re?0:le.value.length;le.setSelectionRange(ve,ve),le.scrollLeft=re?-pe:pe;return}if(!j&&Y.key==="Escape"){const ve=V==="multiple"&&Array.isArray(D)?D.length===0:D===null,we=Qe(mD,Y.nativeEvent),Se=V==="multiple"?[]:null;x.state.setInputValue("",we),x.state.setSelectedValue(Se,we),!ve&&!x.state.inline&&!we.isPropagationAllowed&&Y.stopPropagation();return}if(m&&Y.key==="Backspace"&&le.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(D)&&D.length>0){const ve=D.slice(0,-1);x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),x.state.setSelectedValue(ve,Qe(sr,Y.nativeEvent));return}const fe=m?.highlightedChipIndex!==void 0,de=k(Y);if(m?.setHighlightedChipIndex(de),de!==void 0?m?.chipsRef.current[de]?.focus():fe&&x.state.inputRef.current?.focus(),Y.which!==229&&Y.key==="Enter"&&B){const ve=x.state.activeIndex,we=Y.nativeEvent;if(ve===null){x.state.setOpen(!1,Qe(sr,we));return}Tt(Y);const Se=x.state.listRef.current[ve];Se&&(x.state.selectionEventRef.current=we,Se.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(a):a],stateAttributesMapping:lk})});process.env.NODE_ENV!=="production"&&(Qx.displayName="ComboboxInput");const kJ={...Dx,...mJ},dk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,keepMounted:a=!1,...l}=t,{disabled:u}=yu(),c=Yn(),d=me(c,be.selectionMode),f=me(c,be.disabled),p=me(c,be.readOnly),g=me(c,be.open),m=me(c,be.selectedValue),v=me(c,be.hasSelectionChips),y=Ux();let x=!1;d==="none"?x=y!=="":d==="single"?x=m!=null:x=v;const w=u||f||i,{buttonRef:C,getButtonProps:S}=Nf({native:s,disabled:w}),{mounted:R,transitionStatus:I,setMounted:T}=kx(x),M={disabled:w,open:g,transitionStatus:I};Pf({open:x,ref:c.state.clearRef,onComplete(){x||T(!1)}});const V=jn("button",t,{state:M,ref:[n,C,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(P){P.preventDefault()},onClick(P){if(w||p)return;const N=c.state.keyboardActiveRef;c.state.setInputValue("",Qe(PE,P.nativeEvent)),d!=="none"?(c.state.setSelectedValue(Array.isArray(m)?[]:null,Qe(PE,P.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:N.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:N.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},l,S],stateAttributesMapping:kJ});return a||R?V:null});process.env.NODE_ENV!=="production"&&(dk.displayName="ComboboxClear");const fk=b.createContext(null);process.env.NODE_ENV!=="production"&&(fk.displayName="GroupCollectionContext");function jJ(){return b.useContext(fk)}function FJ(e){const{children:t}=e,{filteredItems:n}=Ii(),r=jJ(),o=r?r.items:n;return o?h.jsx(b.Fragment,{children:o.map(t)}):null}const pk=b.forwardRef(function(t,n){var r;const{render:o,className:i,children:s,...a}=t,l=Yn(),u=Df(),c=!!Kx(!0),{filteredItems:d}=Ii(),f=me(l,be.items),p=me(l,be.labelsRef),g=me(l,be.listRef),m=me(l,be.selectionMode),v=me(l,be.grid),y=me(l,be.popupProps),x=me(l,be.disabled),w=me(l,be.readOnly),C=me(l,be.virtualized),S=m==="multiple",R=d.length===0,I=ke(N=>{l.set("positionerElement",N)}),T=ke(N=>{l.set("listElement",N)}),M=b.useMemo(()=>typeof s=="function"?r||(r=h.jsx(FJ,{children:s})):s,[s]),V={empty:R},A=u.useState("floatingId"),P=jn("div",t,{state:V,ref:[n,T,c?null:I],props:[y,{children:M,tabIndex:-1,id:A,role:v?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(N){if(!(x||w)&&N.key==="Enter"){const B=l.state.activeIndex;if(B==null)return;Tt(N);const j=N.nativeEvent,D=l.state.listRef.current[B];D&&(l.state.selectionEventRef.current=j,D.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return C?P:h.jsx(lD,{elementsRef:g,labelsRef:f?void 0:p,children:P})});process.env.NODE_ENV!=="production"&&(pk.displayName="ComboboxList");const e0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(e0.displayName="ComboboxPortalContext");function LJ(){const e=b.useContext(e0);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":Gr(20));return e}const hk=b.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,i=Yn(),s=me(i,be.mounted),a=me(i,be.forceMounted);return s||r||a?h.jsx(e0.Provider,{value:r,children:h.jsx(qD,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(hk.displayName="ComboboxPortal");const BJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:d="real"}=io(e,t)||{};if(u==null)return{};const f=Cy(c),p={x:n,y:r},g=Hd(o),m=Gd(g),v=await s.getDimensions(u),y=g==="y",x=y?"top":"left",w=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[g]-p[g]-i.floating[m],R=p[g]-i.reference[g],I=d==="real"?await s.getOffsetParent?.(u):a.floating;let T=a.floating[C]||i.floating[m];(!T||!await s.isElement?.(I))&&(T=a.floating[C]||i.floating[m]);const M=S/2-R/2,V=T/2-v[m]/2-1,A=Math.min(f[x],V),P=Math.min(f[w],V),N=A,B=T-v[m]-P,j=T/2-v[m]/2+M,D=$c(N,j,B),$=!l.arrow&&Lo(o)!=null&&j!==D&&i.reference[m]/2-(j<N?A:P)-v[m]/2<0,G=$?j<N?j-N:j-B:0;return{[g]:p[g]+G,data:{[g]:D,centerOffset:j-D-G,...$&&{alignmentOffset:G}},reset:$}}}),VJ=(e,t)=>({...BJ(e),options:[e,t]}),$J={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await nN().fn(e)).data?.referenceHidden||i}}}},GJ={sideX:"left",sideY:"top"};function gk(e,t,n){const 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 oI(e,t,n){const{rects:r,placement:o}=e;return{side:gk(t,Gn(o),n),align:Lo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function HJ(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:C}=e,[S,R]=b.useState(null);!g&&S!==null&&R(null);const I=m.side||"flip",T=m.align||"flip",M=m.fallbackAxisSide||"end",V=typeof t=="function"?t:void 0,A=ke(V),P=V?A:t,N=ur(t),j=cD()==="rtl",D=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],$=i==="center"?D:`${D}-${i}`;let G=l;const z=1,H=r==="bottom"?z:0,ne=r==="top"?z:0,W=r==="right"?z:0,J=r==="left"?z:0;typeof G=="number"?G={top:G+H,right:G+J,bottom:G+ne,left:G+W}:G&&(G={top:(G.top||0)+H,right:(G.right||0)+J,bottom:(G.bottom||0)+ne,left:(G.left||0)+W});const K={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},U=b.useRef(null),oe=ur(o),X=ur(s),se=[JT(tt=>{const Ze=oI(tt,r,j),ee=typeof oe.current=="function"?oe.current(Ze):oe.current,ye=typeof X.current=="function"?X.current(Ze):X.current;return{mainAxis:ee,crossAxis:ye,alignmentAxis:ye}},[typeof o!="function"?o:0,typeof s!="function"?s:0,j,r])],ae=T==="none"&&I!=="shift",F=!ae&&(u||v||I==="shift"),Z=I==="none"?null:eN({...K,padding:{top:G.top+z,right:G.right+z,bottom:G.bottom+z,left:G.left+z},mainAxis:!v&&I==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:M}),k=ae?null:KT(tt=>{const Ze=Wt(tt.elements.floating).documentElement;return{...K,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:F,limiter:u||v?void 0:QT(ee=>{if(!U.current)return{};const{width:ye,height:ge}=U.current.getBoundingClientRect(),xe=fr(Gn(ee.placement)),Ae=xe==="y"?ye:ge,Ie=xe==="y"?G.left+G.right:G.top+G.bottom;return{offset:Ae/2+Ie/2}})}},[K,u,v,G,T]);I==="shift"||T==="shift"||i==="center"?se.push(k,Z):se.push(Z,k),se.push(tN({...K,apply({elements:{floating:tt},rects:{reference:Ze},availableWidth:ee,availableHeight:ye}){const ge=tt.style;ge.setProperty("--available-width",`${ee}px`),ge.setProperty("--available-height",`${ye}px`),ge.setProperty("--anchor-width",`${Ze.width}px`),ge.setProperty("--anchor-height",`${Ze.height}px`)}}),VJ(()=>({element:U.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(tt){const{elements:Ze,middlewareData:ee,placement:ye,rects:ge,y:xe}=tt,Ae=Gn(ye),Ie=fr(Ae),qe=U.current,Pt=ee.arrow?.x||0,lt=ee.arrow?.y||0,it=qe?.clientWidth||0,_t=qe?.clientHeight||0,Et=Pt+it/2,sn=lt+_t/2,wr=Math.abs(ee.shift?.y||0),Zn=ge.reference.height/2,pn=typeof o=="function"?o(oI(tt,r,j)):o,Qt=wr>pn,Ve={top:`${Et}px calc(100% + ${pn}px)`,bottom:`${Et}px ${-pn}px`,left:`calc(100% + ${pn}px) ${sn}px`,right:`${-pn}px ${sn}px`}[Ae],Jn=`${Et}px ${ge.reference.y+Zn-xe}px`;return Ze.floating.style.setProperty("--transform-origin",F&&Ie==="y"&&Qt?Jn:Ve),{}}},$J,x),Ge(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const ie=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Y,elements:le,x:pe,y:re,middlewareData:fe,update:de,placement:ve,context:we,isPositioned:Se,floatingStyles:Ye}=nJ({rootContext:p,placement:$,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...tt)=>Wc(...tt,ie),nodeId:y,externalTree:C}),{sideX:at,sideY:Xe}=fe.adaptiveOrigin||GJ,Ue=Se?n:"fixed",rt=b.useMemo(()=>{const tt=x?{position:Ue,[at]:pe,[Xe]:re}:{position:Ue,...Ye};return Se||(tt.opacity=0),tt},[x,Ue,at,pe,Xe,re,Ye,Se]),et=b.useRef(null);Ge(()=>{if(!g)return;const tt=N.current,Ze=typeof tt=="function"?tt():tt,ye=(iI(Ze)?Ze.current:Ze)||null||null;ye!==et.current&&(Y.setPositionReference(ye),et.current=ye)},[g,Y,P,N]),b.useEffect(()=>{if(!g)return;const tt=N.current;typeof tt!="function"&&iI(tt)&&tt.current!==et.current&&(Y.setPositionReference(tt.current),et.current=tt.current)},[g,Y,P,N]),b.useEffect(()=>{if(f&&g&&le.domReference&&le.floating)return Wc(le.domReference,le.floating,de,ie)},[f,g,le,de,ie]);const gt=Gn(ve),ct=gk(r,gt,j),ot=Lo(ve)||"center",mt=!!fe.hide?.referenceHidden;Ge(()=>{w&&g&&Se&&R(gt)},[w,g,Se,gt]);const Ot=b.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Bt=fe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:rt,arrowStyles:Ot,arrowRef:U,arrowUncentered:Bt,side:ct,align:ot,physicalSide:gt,anchorHidden:mt,refs:Y,context:we,isPositioned:Se,update:de}),[rt,Ot,U,Bt,ct,ot,gt,mt,Y,we,Se,de])}function iI(e){return e!=null&&"current"in e}function mk(e){return e==="starting"?a7:En}const bk=b.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=u7,...y}=t,x=Yn(),{filteredItems:w}=Ii(),C=Df(),S=LJ(),R=me(x,be.modal),I=me(x,be.open),T=me(x,be.mounted),M=me(x,be.openMethod),V=me(x,be.triggerElement),A=me(x,be.inputElement),P=me(x,be.inputInsidePopup),N=me(x,be.transitionStatus),B=w.length===0,D=HJ({anchor:i??(P?V:A),floatingRootContext:C,positionMethod:s,mounted:T,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:v,lazyFlip:!0});lZ(I&&R&&M!=="touch",V);const $=b.useMemo(()=>{const W={...D.positionerStyles};return I||(W.pointerEvents="none"),{role:"presentation",hidden:!T,style:W}},[I,T,D.positionerStyles]),G={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:B};Ge(()=>{x.set("popupSide",D.side)},[x,D.side]);const z=b.useMemo(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,anchorHidden:D.anchorHidden,isPositioned:D.isPositioned}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.anchorHidden,D.isPositioned]),H=ke(W=>{x.set("positionerElement",W)}),ne=jn("div",t,{state:G,ref:[n,H],props:[$,mk(N),y],stateAttributesMapping:KD});return h.jsxs(Jx.Provider,{value:z,children:[T&&R&&h.jsx(QD,{inert:vJ(!I),cutout:A??V}),ne]})});process.env.NODE_ENV!=="production"&&(bk.displayName="ComboboxPositioner");const WJ={...KD,...Dx},vk=b.forwardRef(function(t,n){const{render:r,className:o,initialFocus:i,finalFocus:s,...a}=t,l=Yn(),u=Kx(),c=Df(),{filteredItems:d}=Ii(),f=me(l,be.mounted),p=me(l,be.open),g=me(l,be.openMethod),m=me(l,be.transitionStatus),v=me(l,be.inputInsidePopup),y=me(l,be.inputElement),x=d.length===0;Pf({open:p,ref:l.state.popupRef,onComplete(){p&&l.state.onOpenChangeComplete(!0)}});const w={open:p,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:m,empty:x},C=jn("div",t,{state:w,ref:[n,l.state.popupRef],props:[{role:v?"dialog":"presentation",tabIndex:-1,onFocus(T){const M=_n(T.nativeEvent);g!=="touch"&&(ft(l.state.listElement,M)||M===T.currentTarget)&&l.state.inputRef.current?.focus()}},mk(m),a],stateAttributesMapping:WJ}),R=i===void 0?v?T=>T==="touch"?l.state.popupRef.current:y:!1:i;let I;return s!=null?I=s:I=v?void 0:!1,h.jsx(wZ,{context:c,disabled:!f,modal:!v,openInteractionType:g,initialFocus:R,returnFocus:I,children:C})});process.env.NODE_ENV!=="production"&&(vk.displayName="ComboboxPopup");const t0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(t0.displayName="ComboboxItemContext");function yk(){const e=b.useContext(t0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.":Gr(19));return e}const xk=b.createContext(!1);process.env.NODE_ENV!=="production"&&(xk.displayName="ComboboxRowContext");function zJ(){return b.useContext(xk)}const wk=b.memo(b.forwardRef(function(t,n){const{render:r,className:o,value:i=null,index:s,disabled:a=!1,nativeButton:l=!1,...u}=t,c=b.useRef(!1),d=b.useRef(null),f=xD({index:s,textRef:d,indexGuessBehavior:yD.GuessFromOrder}),p=Yn(),g=zJ(),{flatFilteredItems:m,hasItems:v}=Ii(),y=me(p,be.open),x=me(p,be.selectionMode),w=me(p,be.readOnly),C=me(p,be.virtualized),S=me(p,be.isItemEqualToValue),R=x!=="none",I=s??(C?bd(m,i,S):f.index),T=f.index!==-1,M=me(p,be.id),V=me(p,be.isActive,I),A=me(p,be.isSelected,i),P=me(p,be.getItemProps),N=b.useRef(null),B=M!=null&&T?`${M}-${I}`:void 0,j=A&&R;Ge(()=>{if(!(T&&(C||s!=null)))return;const U=p.state.listRef.current;return U[I]=N.current,()=>{delete U[I]}},[T,C,I,s,p]),Ge(()=>{if(!T||v)return;const K=p.state.valuesRef.current;return K[I]=i,x!=="none"&&p.state.allValuesRef.current.push(i),()=>{delete K[I]}},[T,v,I,i,p,x]),Ge(()=>{if(!y){c.current=!1;return}if(!T||v)return;const K=p.state.selectedValue,U=Array.isArray(K)?K[K.length-1]:K;rs(i,U,S)&&p.set("selectedIndex",I)},[T,v,y,p,I,i,S]);const D={disabled:a,selected:j,highlighted:V},$=P({active:V,selected:j});$.id=void 0,$.onFocus=void 0;const{getButtonProps:G,buttonRef:z}=Nf({disabled:a,focusableWhenDisabled:!0,native:l});function H(K){function U(){p.state.handleSelection(K,i)}p.state.submitOnItemClick?(ao.flushSync(U),p.state.requestSubmit()):U()}const ne={id:B,role:g?"gridcell":"option","aria-selected":R?j:void 0,tabIndex:void 0,onPointerDownCapture(K){c.current=!0,K.preventDefault()},onClick(K){a||w||H(K.nativeEvent)},onMouseUp(K){const U=c.current;c.current=!1,!(a||w||K.button!==0||U||!V)&&H(K.nativeEvent)}},W=jn("div",t,{ref:[z,n,f.ref,N],state:D,props:[$,ne,u,G]}),J=b.useMemo(()=>({selected:j,textRef:d}),[j,d]);return h.jsx(t0.Provider,{value:J,children:W})}));process.env.NODE_ENV!=="production"&&(wk.displayName="ComboboxItem");const Ck=b.forwardRef(function(t,n){const{render:r,className:o,children:i,...s}=t,{filteredItems:a}=Ii(),l=Yn(),u=a.length===0?i:null;return jn("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});process.env.NODE_ENV!=="production"&&(Ck.displayName="ComboboxEmpty");const Sk=b.forwardRef(function(t,n){const{className:r,render:o,orientation:i="horizontal",...s}=t;return jn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},s]})});process.env.NODE_ENV!=="production"&&(Sk.displayName="Separator");function qJ(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...s}=e;return h.jsx(MJ,{...s,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function UJ(e){const{children:t,placeholder:n}=e,r=Yn(),o=me(r,be.itemToStringLabel),i=me(r,be.selectedValue),s=me(r,be.items),a=me(r,be.selectionMode)==="multiple",l=me(r,be.hasSelectedValue),u=!l&&n!=null&&t==null,c=me(r,be.hasNullItemLabel,u);let d=null;return typeof t=="function"?d=t(i):t!=null?d=t:!l&&n!=null&&!c?d=n:a&&Array.isArray(i)?d=EJ(i,s,o):d=ek(i,s,o),h.jsx(b.Fragment,{children:d})}const Ek=b.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=yk();return r||o?h.jsx(Ik,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(Ek.displayName="ComboboxItemIndicator");const Ik=b.memo(b.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=yk(),a=b.useRef(null),{transitionStatus:l,setMounted:u}=kx(s),d=jn("span",e,{ref:[t,a],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:Dx});return Pf({open:s,ref:a,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!=="production"&&(Ik.displayName="Inner");const Rk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Yn(),a=me(s,be.open),l=me(s,be.hasSelectionChips),[u,c]=b.useState(void 0);a&&u!==void 0&&c(void 0);const d=b.useRef([]),f=jn("div",t,{ref:[n,s.state.chipsContainerRef],props:[l?{role:"toolbar"}:En,i]}),p=b.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:c,chipsRef:d}),[u,c,d]);return h.jsx(Zx.Provider,{value:p,children:h.jsx(lD,{elementsRef:d,children:f})})});process.env.NODE_ENV!=="production"&&(Rk.displayName="ComboboxChips");const n0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(n0.displayName="ComboboxChipContext");function YJ(){const e=b.useContext(n0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":Gr(17));return e}const Ak=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Yn(),{setHighlightedChipIndex:a,chipsRef:l}=ck(),u=me(s,be.disabled),c=me(s,be.readOnly),d=me(s,be.selectedValue),{ref:f,index:p}=xD();function g(x){let w=p;if(x.key==="ArrowLeft")x.preventDefault(),p>0?w=p-1:w=void 0;else if(x.key==="ArrowRight")x.preventDefault(),p<d.length-1?w=p+1:w=void 0;else if(x.key==="Backspace"||x.key==="Delete"){const C=p>=d.length-1?d.length-2:p;w=C>=0?C:void 0,Tt(x),s.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),s.state.setSelectedValue(d.filter((S,R)=>R!==p),Qe(sr,x.nativeEvent))}else x.key==="Enter"||x.key===" "?(Tt(x),w=void 0):x.key==="ArrowDown"||x.key==="ArrowUp"?(Tt(x),s.state.setOpen(!0,Qe(fl,x.nativeEvent)),w=void 0):x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&(w=void 0);return w}const v=jn("div",t,{ref:[n,f],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":c||void 0,onKeyDown(x){if(u||c)return;const w=g(x);ao.flushSync(()=>{a(w)}),w===void 0?s.state.inputRef.current?.focus():l.current[w]?.focus()},onMouseDown(x){c||(x.preventDefault(),!u&&s.state.inputRef.current?.focus())}},i]}),y=b.useMemo(()=>({index:p}),[p]);return h.jsx(n0.Provider,{value:y,children:v})});process.env.NODE_ENV!=="production"&&(Ak.displayName="ComboboxChip");const Tk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,...a}=t,l=Yn(),{index:u}=YJ(),c=me(l,be.disabled),d=me(l,be.readOnly),f=me(l,be.selectedValue),p=me(l,be.isItemEqualToValue),g=c||i,{buttonRef:m,getButtonProps:v}=Nf({native:s,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function x(S){const R=l.state.activeIndex;if(R==null)return;const I=bd(l.state.valuesRef.current,S,p);I!==-1&&R===I&&l.state.setIndices({activeIndex:null,type:l.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(S){const R=Qe(b7,S.nativeEvent),I=f[u];return x(I),l.state.setSelectedValue(f.filter((T,M)=>M!==u),R),l.state.inputRef.current?.focus(),R}return jn("button",t,{ref:[n,m],state:y,props:[{tabIndex:-1,onClick(S){if(g||d)return;w(S).isPropagationAllowed||S.stopPropagation()},onKeyDown(S){g||d||(S.key==="Enter"||S.key===" ")&&(w(S).isPropagationAllowed||Tt(S))}},a,v]})});process.env.NODE_ENV!=="production"&&(Tk.displayName="ComboboxChipRemove");const Nk=()=>O.useContext(QM);function xa({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:L("ui:file:text-foreground ui:placeholder:text-muted-foreground ui:selection:bg-primary ui:selection:text-primary-foreground ui:dark:bg-input/30 ui:border-input ui:h-10 ui:w-full ui:min-w-0 ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-1 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:file:inline-flex ui:file:h-7 ui:file:border-0 ui:file:bg-transparent ui:file:text-sm ui:file:font-medium ui:disabled:pointer-events-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm","ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:focus-visible:ring-[3px]","ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive",e),...n})}function Ok({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:L("ui:border-input ui:placeholder:text-muted-foreground ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:dark:bg-input/30 ui:flex ui:field-sizing-content ui:min-h-16 ui:w-full ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-2 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm",e),...t})}function XJ({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:L("ui:group/input-group ui:border-input ui:dark:bg-input/30 ui:relative ui:flex ui:w-full ui:items-center ui:rounded-md ui:border ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none","ui:h-9 ui:min-w-0 ui:has-[>textarea]:h-auto","ui:has-[>[data-align=inline-start]]:[&>input]:pl-2","ui:has-[>[data-align=inline-end]]:[&>input]:pr-2","ui:has-[>[data-align=block-start]]:h-auto ui:has-[>[data-align=block-start]]:flex-col ui:has-[>[data-align=block-start]]:[&>input]:pb-3","ui:has-[>[data-align=block-end]]:h-auto ui:has-[>[data-align=block-end]]:flex-col ui:has-[>[data-align=block-end]]:[&>input]:pt-3","ui:has-[[data-slot=input-group-control]:focus-visible]:border-ring ui:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 ui:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","ui:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ui:has-[[data-slot][aria-invalid=true]]:border-destructive ui:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const ZJ=Si("ui:text-muted-foreground ui:flex ui:h-auto ui:cursor-text ui:items-center ui:justify-center ui:gap-2 ui:py-1.5 ui:text-sm ui:font-medium ui:select-none ui:[&>svg:not([class*=size-])]:size-4 ui:[&>kbd]:rounded-[calc(var(--radius)-5px)] ui:group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"ui:order-first ui:pl-3 ui:has-[>button]:ml-[-0.45rem] ui:has-[>kbd]:ml-[-0.35rem]","inline-end":"ui:order-last ui:pr-3 ui:has-[>button]:mr-[-0.45rem] ui:has-[>kbd]:mr-[-0.35rem]","block-start":"ui:order-first ui:w-full ui:justify-start ui:px-3 ui:pt-3 ui:[.border-b]:pb-3 ui:group-has-[>input]/input-group:pt-2.5","block-end":"ui:order-last ui:w-full ui:justify-start ui:px-3 ui:pb-3 ui:[.border-t]:pt-3 ui:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function JJ({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:L(ZJ({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const KJ=Si("ui:text-sm ui:shadow-none ui:flex ui:gap-2 ui:items-center",{variants:{size:{xs:"ui:h-6 ui:gap-1 ui:px-2 ui:rounded-[calc(var(--radius)-5px)] ui:[&>svg:not([class*=size-])]:size-3.5 ui:has-[>svg]:px-2",sm:"ui:h-8 ui:px-2.5 ui:gap-1.5 ui:rounded-md ui:has-[>svg]:px-2.5","icon-xs":"ui:size-6 ui:rounded-[calc(var(--radius)-5px)] ui:p-0 ui:has-[>svg]:p-0","icon-sm":"ui:size-8 ui:p-0 ui:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Pk({className:e,type:t="button",variant:n="ghost",size:r="xs",...o}){return h.jsx(Ut,{type:t,"data-size":r,variant:n,className:L(KJ({size:r}),e),...o})}function QJ({className:e,...t}){return h.jsx(xa,{"data-slot":"input-group-control",className:L("ui:flex-1 ui:rounded-none ui:border-0 ui:bg-transparent ui:shadow-none ui:focus-visible:ring-0 ui:dark:bg-transparent",e),...t})}const eK=qJ;function Lm({...e}){return h.jsx(UJ,{"data-slot":"combobox-value",...e})}function _k({className:e,children:t,...n}){return h.jsxs(uk,{"data-slot":"combobox-trigger",className:L("ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(Oe.ChevronDownIcon,{"data-slot":"combobox-trigger-icon",className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4"})]})}function tK({className:e,...t}){return h.jsx(dk,{"data-slot":"combobox-clear",render:h.jsx(Pk,{variant:"ghost",size:"icon-xs",className:"ui:rounded-md"}),className:L(e),...t,children:h.jsx(Oe.XIcon,{className:"ui:pointer-events-none"})})}function sI({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:o=!1,...i}){return h.jsxs(XJ,{className:L("ui:w-auto ui:shrink-0",e),children:[h.jsx(Qx,{render:h.jsx(QJ,{disabled:n}),...i}),h.jsxs(JJ,{align:"inline-end",children:[r&&h.jsx(Pk,{size:"icon-xs",variant:"ghost",asChild:!0,"data-slot":"input-group-button",className:"ui:group-has-data-[slot=combobox-clear]/input-group:hidden ui:data-pressed:bg-transparent",disabled:n,children:h.jsx(_k,{className:"ui:rounded-md"})}),o&&h.jsx(tK,{disabled:n})]}),t]})}function nK({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:o=0,anchor:i,...s}){const a=Nk();return h.jsx(hk,{children:h.jsx(bk,{side:t,sideOffset:n,align:r,alignOffset:o,anchor:i,className:"ui:isolate ui:z-50 ui:pointer-events-auto",style:a!=null?{zIndex:a+1}:void 0,children:h.jsx(vk,{"data-slot":"combobox-content","data-chips":!!i,className:L("ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:flex ui:min-h-0 ui:max-h-96 ui:flex-col ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",e),...s})})})}function rK({className:e,...t}){return h.jsx(pk,{"data-slot":"combobox-list",className:L("ui:min-h-0 ui:flex-1 ui:overflow-y-auto ui:scroll-py-1 ui:p-1 ui:data-empty:p-0",e),...t})}function oK({className:e,children:t,...n}){return h.jsxs(wk,{"data-slot":"combobox-item",className:L("ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(Ek,{"data-slot":"combobox-item-indicator",render:h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center"}),children:h.jsx(Oe.CheckIcon,{className:"ui:pointer-events-none ui:size-4 ui:pointer-coarse:size-5"})})]})}function iK({className:e,...t}){return h.jsx(Ck,{"data-slot":"combobox-empty",className:L("ui:hidden ui:w-full ui:shrink-0 ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:text-muted-foreground ui:group-data-empty/combobox-content:flex",e),...t})}function sK({className:e,...t}){return h.jsx(Sk,{"data-slot":"combobox-separator",className:L("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function aK({className:e,...t}){return h.jsx(Rk,{"data-slot":"combobox-chips",className:L("ui:dark:bg-input/30 ui:border-input ui:focus-within:border-ring ui:focus-within:ring-ring/50 ui:has-aria-invalid:ring-destructive/20 ui:dark:has-aria-invalid:ring-destructive/40 ui:has-aria-invalid:border-destructive ui:dark:has-aria-invalid:border-destructive/50 ui:flex ui:min-h-9 ui:flex-wrap ui:items-center ui:gap-1.5 ui:rounded-md ui:border ui:bg-transparent ui:bg-clip-padding ui:px-2.5 ui:py-1.5 ui:text-sm ui:shadow-xs ui:transition-[color,box-shadow] ui:focus-within:ring-[3px] ui:has-aria-invalid:ring-[3px] ui:has-data-[slot=combobox-chip]:px-1.5",e),...t})}function lK({className:e,children:t,showRemove:n=!0,...r}){return h.jsxs(Ak,{"data-slot":"combobox-chip",className:L("ui:bg-muted ui:text-foreground ui:flex ui:h-[calc(--spacing(5.5))] ui:w-fit ui:items-center ui:justify-center ui:gap-1 ui:rounded-sm ui:px-1.5 ui:text-xs ui:font-medium ui:whitespace-nowrap ui:has-disabled:pointer-events-none ui:has-disabled:cursor-not-allowed ui:has-disabled:opacity-50 ui:has-data-[slot=combobox-chip-remove]:pr-0",e),...r,children:[t,n&&h.jsx(Tk,{render:h.jsx(Ut,{variant:"ghost",size:"xs",className:"ui:hover:bg-transparent"}),className:"ui:-ml-1 ui:opacity-50 ui:hover:opacity-100","data-slot":"combobox-chip-remove",children:h.jsx(Oe.XIcon,{className:"ui:pointer-events-none"})})]})}function uK({className:e,...t}){return h.jsx(Qx,{"data-slot":"combobox-chip-input",className:L("ui:min-w-16 ui:flex-1 ui:outline-none",e),...t})}function cK(){return b.useRef(null)}const dK=e=>e.label,fK=(e,t)=>e.value===t.value,r0=({items:e,label:t,multiple:n=!1,hasClearButton:r=!1,disabled:o=!1,placeholder:i="Select...",containerClassName:s,emptyMessage:a="No results found.",hasAllOption:l=!1,allOptionLabel:u="All",inputMode:c="input",renderPopupTrigger:d,onInputChange:f,value:p,onValueChange:g})=>{const m=cK(),v=p??[],y=O.useMemo(()=>e.filter(R=>!R.disabled),[e]),x=n&&v.length===y.length&&y.length>0,w=O.useCallback(()=>{const I=v.length===y.length&&y.length>0?[]:y;g(I)},[y,v.length,g]),C=O.useCallback(R=>{Array.isArray(R)?g(R):g(R===null?[]:[R])},[g]),S=O.useCallback(R=>{f?.(R.target.value)},[f]);return h.jsxs("article",{className:s,children:[t&&h.jsx(yr,{className:"ui:mb-2",children:t}),h.jsxs(eK,{multiple:n,autoHighlight:!0,items:e,itemToStringValue:dK,isItemEqualToValue:fK,disabled:o,value:n?v:v[0]??null,onValueChange:C,children:[h.jsxs(In,{children:[h.jsx(Vt,{condition:c==="popup",children:h.jsx(_k,{render:d?d(h.jsx(Lm,{placeholder:i}),v):h.jsx(Ut,{variant:"outline",className:"ui:w-full ui:h-10 ui:font-normal ui:text-left ui:overflow-hidden ui:truncate ui:line-clamp-1",children:h.jsx(Lm,{placeholder:i})})})}),h.jsx(Vt,{condition:n&&c==="input",children:h.jsx(aK,{ref:m,className:"ui:w-full",children:h.jsx(Lm,{children:R=>h.jsxs(O.Fragment,{children:[R.map(I=>h.jsx(lK,{children:I.label},I.value)),h.jsx(uK,{placeholder:R.length?"":i,onChange:S})]})})})}),h.jsx(Vt,{condition:!n&&c==="input",children:h.jsx(sI,{className:"ui:w-full",placeholder:i,showClear:r,disabled:o,onChange:S})})]}),h.jsxs(nK,{className:"ui:min-w-64",anchor:m&&n&&c==="input"?m:void 0,children:[c==="popup"&&h.jsx(sI,{showTrigger:!1,placeholder:"Search...",onChange:S}),h.jsx(iK,{children:a}),l&&n&&h.jsxs("div",{className:"ui:shrink-0 ui:group-data-empty/combobox-content:hidden",children:[h.jsx("div",{className:L("ui:p-1 ui:pb-0",c==="popup"?"ui:mt-1":""),children:h.jsxs("div",{role:"option","aria-selected":x,onClick:w,className:L("ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none","ui:hover:bg-accent ui:hover:text-accent-foreground"),children:[u,x&&h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center",children:h.jsx(Oe.CheckIcon,{className:"ui:pointer-events-none ui:size-4"})})]})}),h.jsx(sK,{})]}),h.jsx(rK,{children:R=>h.jsx(oK,{value:R,disabled:!!R?.disabled,children:R.label},R.value)})]})]})]})},pK="dd/MM/yyyy",hK=({date:e,format:t=pK})=>e?h.jsx(h.Fragment,{children:qi(e,t)}):null;function o0({...e}){return h.jsx(cG,{"data-slot":"popover",...e})}const kf=b.forwardRef(({...e},t)=>h.jsx(RO,{"data-slot":"popover-trigger",ref:t,...e}));kf.displayName=RO.displayName;const jf=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>h.jsx(dG,{children:h.jsx(AO,{ref:o,"data-slot":"popover-content",align:t,sideOffset:n,className:L("ui-lib-root ui:z-[102] ui:w-72 ui:rounded-md ui:border ui:bg-popover ui:p-4 ui:text-popover-foreground ui:shadow-md ui:outline-none ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",e),...r})}));jf.displayName=AO.displayName;const Mk=b.forwardRef(({...e},t)=>h.jsx(IO,{"data-slot":"popover-anchor",ref:t,...e}));Mk.displayName=IO.displayName;const Dk=({start:e,end:t,onConfirm:n,className:r,triggerButtonClassName:o,label:i,placeholder:s,confirmLabel:a="Confirm",disabledCondition:l,dateLocale:u})=>{const[c,d]=O.useState(!1),[f,p]=O.useState(e&&t?{from:e,to:t}:void 0),g=()=>{!f?.from||!f?.to||(n({from:f.from,to:f.to}),d(!1))};return h.jsxs("div",{className:L("ui:grid ui:gap-2",r),children:[i&&h.jsx(yr,{children:i}),h.jsxs(o0,{open:c,onOpenChange:d,children:[h.jsx(kf,{asChild:!0,children:h.jsxs(Ut,{id:"date",variant:"outline",className:L("ui:h-auto ui:text-muted-foreground ui:justify-start ui:text-left ui:font-normal",!f&&"ui:text-muted-foreground",o),children:[h.jsx(Oe.Calendar,{className:"ui:h-4 ui:w-4"}),f?.from?f.to?h.jsxs(h.Fragment,{children:[qi(f.from,"LLL dd, y",{locale:u})," -",qi(f.to,"LLL dd, y",{locale:u})]}):qi(f.from,"LLL dd, y",{locale:u}):h.jsx("span",{children:s})]})}),h.jsxs(jf,{className:"ui:w-auto ui:p-0",align:"start",children:[h.jsx(nx,{mode:"range",defaultMonth:f?.from??new Date,selected:f,onSelect:p,numberOfMonths:2,disabled:l,locale:u}),h.jsx("div",{className:L("ui:px-3 ui:pb-4 ui:pt-2","ui:flex ui:justify-start ui:md:justify-end"),children:h.jsx(Ut,{variant:"success",onClick:g,className:"ui:w-full ui:md:w-max",children:a})})]})]})]})};function kk({value:e,onChange:t,className:n,inputClassName:r,name:o,placeholder:i,label:s}){const[a,l]=O.useState(e),u=O.useRef(null),c=O.useRef(t);O.useEffect(()=>{c.current=t},[t]);const d=O.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.length>=3?c.current(p):c.current("")},300)},[]),f=p=>{const g=decodeURIComponent(p);l(g),d(g)};return h.jsxs("search",{className:L("ui:w-full",n),children:[s&&h.jsx(yr,{htmlFor:o,className:"ui:leading-6 ui:w-full ui:mb-2",children:s}),h.jsx(xa,{type:"search",name:o,id:o,"data-test-id":o,placeholder:i,value:a,onChange:({target:p})=>f(p.value),className:L("ui:max-h-10",r),autoFocus:!0})]})}const gK=({banner:e,campaignName:t,isControlled:n,open:r,setOpen:o,imageClassName:i})=>h.jsxs(Ix,{...n&&{open:r,onOpenChange:o},children:[!n&&h.jsx(eD,{asChild:!0,children:h.jsx("div",{className:"ui:cursor-pointer",children:h.jsx("img",{className:L("ui:w-full ui:max-w-80 ui:mx-auto ui:mt-4! ui:scale-100 ui:hover:scale-110 ui:transition-all ui:duration-300 ui:aspect-video",i),src:e,alt:t})})}),h.jsxs(Rx,{className:"ui:max-w-2xl",children:[h.jsx(Ax,{children:h.jsx(Tx,{children:t})}),h.jsx("img",{className:L("ui:w-full ui:aspect-video",i),src:e,alt:t})]})]});function mK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const jk=O.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),xu=()=>{const e=O.useContext(jk);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};mK(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
86
|
+
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});process.env.NODE_ENV!=="production"&&(QD.displayName="InternalBackdrop");function yJ(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const Hx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Hx.displayName="ComboboxRootContext");const Wx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Wx.displayName="ComboboxFloatingContext");const zx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(zx.displayName="ComboboxDerivedItemsContext");const qx=b.createContext("");process.env.NODE_ENV!=="production"&&(qx.displayName="ComboboxInputValueContext");function Yn(){const e=b.useContext(Hx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":Gr(22));return e}function Df(){const e=b.useContext(Wx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":Gr(23));return e}function Ii(){const e=b.useContext(zx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":Gr(24));return e}function Ux(){return b.useContext(qx)}const xJ=(e,t)=>Object.is(e,t);function rs(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wJ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:rs(t,r,n))}function bd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:rs(r,t,n))}function CJ(e,t,n){return e.filter(r=>!rs(t,r,n))}function yv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Yx(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function SJ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Yx(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Pn(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return yv(e)}function Ga(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?yv(e.value):yv(e)}function ek(e,t,n){function r(){return Pn(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=Yx(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=o.find(s=>s.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=o.find(s=>s&&s.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function EJ(e,t,n){return e.reduce((r,o,i)=>(i>0&&r.push(", "),r.push(h.jsx(b.Fragment,{children:ek(o,t,n)},i)),r),[])}const be={id:De(e=>e.id),query:De(e=>e.query),items:De(e=>e.items),selectedValue:De(e=>e.selectedValue),hasSelectionChips:De(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:De(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:De((e,t)=>t?SJ(e.items):!1),open:De(e=>e.open),mounted:De(e=>e.mounted),forceMounted:De(e=>e.forceMounted),inline:De(e=>e.inline),activeIndex:De(e=>e.activeIndex),selectedIndex:De(e=>e.selectedIndex),isActive:De((e,t)=>e.activeIndex===t),isSelected:De((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(o=>rs(t,o,n)):rs(t,r,n)}),transitionStatus:De(e=>e.transitionStatus),popupProps:De(e=>e.popupProps),inputProps:De(e=>e.inputProps),triggerProps:De(e=>e.triggerProps),getItemProps:De(e=>e.getItemProps),positionerElement:De(e=>e.positionerElement),listElement:De(e=>e.listElement),triggerElement:De(e=>e.triggerElement),inputElement:De(e=>e.inputElement),popupSide:De(e=>e.popupSide),openMethod:De(e=>e.openMethod),inputInsidePopup:De(e=>e.inputInsidePopup),selectionMode:De(e=>e.selectionMode),listRef:De(e=>e.listRef),labelsRef:De(e=>e.labelsRef),popupRef:De(e=>e.popupRef),emptyRef:De(e=>e.emptyRef),inputRef:De(e=>e.inputRef),keyboardActiveRef:De(e=>e.keyboardActiveRef),chipsContainerRef:De(e=>e.chipsContainerRef),clearRef:De(e=>e.clearRef),valuesRef:De(e=>e.valuesRef),allValuesRef:De(e=>e.allValuesRef),name:De(e=>e.name),disabled:De(e=>e.disabled),readOnly:De(e=>e.readOnly),required:De(e=>e.required),grid:De(e=>e.grid),isGrouped:De(e=>e.isGrouped),virtualized:De(e=>e.virtualized),onOpenChangeComplete:De(e=>e.onOpenChangeComplete),openOnInputClick:De(e=>e.openOnInputClick),itemToStringLabel:De(e=>e.itemToStringLabel),isItemEqualToValue:De(e=>e.isItemEqualToValue),modal:De(e=>e.modal),autoHighlight:De(e=>e.autoHighlight),submitOnItemClick:De(e=>e.submitOnItemClick)};let nI=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const IJ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},RJ={valid(e){return e===null?null:e?{[nI.valid]:""}:{[nI.invalid]:""}}},tk=b.createContext({invalid:void 0,name:void 0,validityData:{state:IJ,errors:[],error:"",value:"",initialValue:null},setValidityData:Ft,disabled:void 0,touched:!1,setTouched:Ft,dirty:!1,setDirty:Ft,filled:!1,setFilled:Ft,focused:!1,setFocused:Ft,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=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(tk.displayName="FieldRootContext");function yu(e=!0){const t=b.useContext(tk);if(t.setValidityData===Ft&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Gr(28));return t}function AJ(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const nk=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ft,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(nk.displayName="FormContext");function rk(){return b.useContext(nk)}function TJ(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=rk(),{invalid:l,markedDirtyRef:u,validityData:c,setValidityData:d}=yu(),f=ke(e.getValue);Ge(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),c.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,c.initialValue,f]),Ge(()=>{!t||!r||a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:AJ(c,l),validate(p=!0){let g=n;g===void 0&&(g=f()),u.current=!0,p?ao.flushSync(()=>s(g)):s(g)}})},[s,i,t,a,f,r,l,u,o,c,n]),Ge(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const ok=b.createContext({controlId:void 0,registerControlId:Ft,labelId:void 0,setLabelId:Ft,messageIds:[],setMessageIds:Ft,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(ok.displayName="LabelableContext");function Xx(){return b.useContext(ok)}function ik(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=Xx(),s=bD(t),a=n?o:void 0,l=gr(()=>Symbol("labelable-control")),u=b.useRef(!1),c=b.useRef(t!=null),d=ke(()=>{!u.current||i===Ft||(u.current=!1,i(l.current,void 0))});return Ge(()=>{if(i===Ft)return;let f;if(n){const p=r?.current;Nt(p)&&p.closest("label")!=null?f=t??null:f=a??s}else if(t!=null)c.current=!0,f=t;else if(c.current)f=s;else{d();return}if(f===void 0){d();return}u.current=!0,i(l.current,f)},[t,r,a,i,n,s,l,d]),b.useEffect(()=>d,[d]),o??s}function NJ(e,t){return(n,r)=>{if(n==null)return!1;const o=Pn(n,t);return e.contains(o,r)}}function OJ(e,t,n){return(r,o)=>{if(r==null)return!1;if(!o)return!0;const i=Pn(r,t),s=n!=null?Pn(n,t):"";return s&&e.contains(s,o)&&s.length===o.length?!0:e.contains(i,o)}}const rI=new Map;function sk(e){return Array.isArray(e)?e.map(t=>sk(t)).join(","):e==null?"":String(e)}function PJ(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${sk(e.locale)}|${JSON.stringify(t)}`,r=rI.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(s,a,l){if(!a)return!0;const u=Pn(s,l);for(let c=0;c<=u.length-a.length;c+=1)if(o.compare(u.slice(c,c+a.length),a)===0)return!0;return!1},startsWith(s,a,l){if(!a)return!0;const u=Pn(s,l);return o.compare(u.slice(0,a.length),a)===0},endsWith(s,a,l){if(!a)return!0;const u=Pn(s,l),c=a.length;return u.length>=c&&o.compare(u.slice(u.length-c),a)===0}};return rI.set(n,i),i}const _J=PJ;function ic(e,t){const n=b.useRef(e),r=ke(t);Ge(()=>{n.current!==e&&r(n.current)},[e,r]),Ge(()=>{n.current=e},[e])}const ak=Symbol("none"),$i={value:ak,index:-1};function MJ(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:u,name:c,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:g,grid:m=!1,items:v,filteredItems:y,filter:x,openOnInputClick:w=!0,autoHighlight:C=!1,keepHighlight:S=!1,highlightItemOnHover:R=!0,loopFocus:I=!0,itemToStringLabel:T,itemToStringValue:M,isItemEqualToValue:V=xJ,virtualized:A=!1,inline:P=!1,fillInputOnItemPress:N=!0,modal:B=!1,limit:j=-1,autoComplete:D="list",formAutoComplete:$,locale:G,submitOnItemClick:z=!1}=e,{clearErrors:H}=rk(),{setDirty:ne,validityData:W,shouldValidateOnChange:J,setFilled:K,name:U,disabled:oe,setTouched:X,setFocused:te,validationMode:Q,validation:se}=yu(),ae=ik({id:t}),F=_J({locale:G}),[Z,k]=b.useState(!1),[ie,Y]=b.useState(null),le=b.useRef([]),pe=b.useRef([]),re=b.useRef(null),fe=b.useRef(null),de=b.useRef(null),ve=b.useRef(!0),we=b.useRef(!1),Se=b.useRef(null),Ye=b.useRef(null),at=b.useRef(null),Xe=b.useRef($i),Ue=b.useRef(null),rt=b.useRef([]),et=b.useRef([]),gt=oe||d,ct=U??c,ot=l==="multiple",mt=l==="single",Ot=a!==void 0||s!==void 0,Bt=v!==void 0,tt=y!==void 0;let Ze;C==="always"?Ze="always":Ze=C?"input-change":!1;const[ee,ye]=Nm({controlled:o,default:ot?r??Xu:r,name:"Combobox",state:"selectedValue"}),ge=b.useMemo(()=>x===null?()=>!0:x!==void 0?x:mt&&!Z?OJ(F,T,ee):NJ(F,T),[x,mt,ee,Z,F,T]),xe=gr(()=>Ot?s??"":mt?Pn(ee,T):"").current,[Ae,Ie]=Nm({controlled:a,default:xe,name:"Combobox",state:"inputValue"}),[qe,Pt]=Nm({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),lt=Yx(v),it=ie??(Ae===""?"":String(Ae).trim()),_t=mt?Pn(ee,T):"",Et=mt&&!Z&&it!==""&&_t!==""&&_t.length===it.length&&F.contains(_t,it),sn=Et?"":it,wr=Bt&&tt&&Et,Zn=b.useMemo(()=>v?lt?v.flatMap(Ce=>Ce.items):v:Xu,[v,lt]),pn=b.useMemo(()=>{if(y&&!wr)return y;if(!v)return Xu;if(lt){const Me=v,Ke=[];let It=0;for(const st of Me){if(j>-1&&It>=j)break;const Dt=sn===""?st.items:st.items.filter(Ur=>ge(Ur,sn,T));if(Dt.length===0)continue;const tr=j>-1?j-It:1/0,Nn=Dt.slice(0,tr);if(Nn.length>0){const Ur={...st,items:Nn};Ke.push(Ur),It+=Nn.length}}return Ke}if(sn==="")return j>-1?Zn.slice(0,j):Zn;const Ce=[];for(const Me of Zn){if(j>-1&&Ce.length>=j)break;ge(Me,sn,T)&&Ce.push(Me)}return Ce},[y,wr,v,lt,sn,j,ge,T,Zn]),Qt=b.useMemo(()=>lt?pn.flatMap(Me=>Me.items):pn,[pn,lt]),Ve=gr(()=>new ZD({id:ae,selectedValue:ee,open:qe,filter:ge,query:it,items:v,selectionMode:l,listRef:le,labelsRef:pe,popupRef:re,emptyRef:de,inputRef:fe,keyboardActiveRef:ve,chipsContainerRef:Se,clearRef:Ye,valuesRef:rt,allValuesRef:et,selectionEventRef:at,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,openOnInputClick:w,itemToStringLabel:T,isItemEqualToValue:V,modal:B,autoHighlight:Ze,submitOnItemClick:z,hasInputValue:Ot,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:P,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Ft,setOpen:Ft,setInputValue:Ft,setSelectedValue:Ft,setIndices:Ft,onItemHighlighted:Ft,handleSelection:Ft,getItemProps:()=>En,forceMount:Ft,requestSubmit:Ft})).current,Jn=l==="none"?Ae:ee,Ea=b.useMemo(()=>l==="none"?Jn:Array.isArray(ee)?ee.map(Ce=>Ga(Ce,M)):Ga(ee,M),[Jn,M,l,ee]),Ni=ke(u),Oi=ke(n),Go=me(Ve,be.activeIndex),on=me(Ve,be.selectedIndex),Ho=me(Ve,be.positionerElement),Rs=me(Ve,be.listElement),bo=me(Ve,be.triggerElement),Pi=me(Ve,be.inputElement),Cn=me(Ve,be.inline),Mt=me(Ve,be.inputInsidePopup),Ia=ur(bo),{mounted:As,setMounted:Ra,transitionStatus:_i}=kx(qe),{openMethod:Ts,triggerProps:zr,reset:Ns}=cJ(qe);TJ({id:ae,name:ct,commit:se.commit,value:Jn,controlRef:Mt?Ia:fe,getValue:()=>Ea});const Cr=ke(()=>{v?pe.current=Qt.map(Ce=>Pn(Ce,T)):Ve.set("forceMounted",!0)}),Kn=b.useRef(ee);Ge(()=>{ee!==Kn.current&&Cr()},[Cr,ee]);const an=ke(Ce=>{Ve.update(Ce);const Me=Ce.type||"none";if(Ce.activeIndex!==void 0)if(Ce.activeIndex===null)Xe.current!==$i&&(Xe.current=$i,Ni(void 0,Va(Me,void 0,{index:-1})));else{const Ke=rt.current[Ce.activeIndex];Xe.current={value:Ke,index:Ce.activeIndex},Ni(Ke,Va(Me,void 0,{index:Ce.activeIndex}))}}),Tn=ke((Ce,Me)=>{if(we.current=Me.reason===ei,e.onInputValueChange?.(Ce,Me),!Me.isCanceled){if(Me.reason===zs){const Ke=Me.event,It=Ke.inputType;if(Ke.type==="compositionend"||It!=null&&It!==""&&It!=="insertReplacementText"){const Dt=Ce.trim()!=="";Dt&&k(!0),Ue.current={hasQuery:Dt},Dt&&Ze&&Ve.state.activeIndex==null&&Ve.set("activeIndex",0)}}Ie(Ce)}}),vo=ke((Ce,Me)=>{if(qe!==Ce&&(Me.reason==="escape-key"&&Bt&&Qt.length===0&&!Ve.state.emptyRef.current&&Me.allowPropagation(),e.onOpenChange?.(Ce,Me),!Me.isCanceled&&(!Ce&&Z&&(mt?(Cn||Y(it),it===""&&k(!1)):ot&&(Cn||Mt?an({activeIndex:null}):Y(it),Tn("",Qe(ei,Me.event)))),Pt(Ce),!Ce&&Mt&&(Me.reason===Tf||Me.reason===Px)&&(X(!0),te(!1),Q==="onBlur")))){const Ke=l==="none"?Ae:ee;se.commit(Ke)}}),Wo=ke((Ce,Me)=>{if(i?.(Ce,Me),Me.isCanceled)return;ye(Ce),(l==="none"&&re.current&&N||mt&&!Ve.state.inputInsidePopup)&&Tn(Pn(Ce,T),Qe(Me.reason,Me.event)),mt&&Ce!=null&&Me.reason!==zs&&Z&&!Cn&&Y(it)}),Aa=ke((Ce,Me)=>{let Ke=Me;if(Ke===void 0){if(Go===null)return;Ke=rt.current[Go]}const It=_n(Ce),st=at.current??Ce;at.current=null;const Dt=Qe(m7,st),tr=It?.closest("a")?.getAttribute("href");if(tr){tr.startsWith("#")&&vo(!1,Dt);return}if(ot){const Nn=Array.isArray(ee)?ee:[],Uo=wJ(Nn,Ke,Ve.state.isItemEqualToValue)?CJ(Nn,Ke,Ve.state.isItemEqualToValue):[...Nn,Ke];if(Wo(Uo,Dt),!(fe.current?fe.current.value.trim()!=="":!1))return;Ve.state.inputInsidePopup?Tn("",Qe(ei,Dt.event)):vo(!1,Dt)}else Wo(Ke,Dt),vo(!1,Dt)}),Mi=ke(()=>{if(!Ve.state.submitOnItemClick)return;const Ce=Ve.state.inputElement?.form;Ce&&typeof Ce.requestSubmit=="function"&&Ce.requestSubmit()}),qr=ke(()=>{if(Ra(!1),Oi?.(!1),k(!1),Ns(),Y(null),an(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ot&&fe.current&&fe.current.value!==""&&!we.current&&Tn("",Qe(ei)),mt)if(Ve.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Tn("",Qe(ei));else{const Ce=Pn(ee,T);fe.current&&fe.current.value!==Ce&&Tn(Ce,Qe(Ce===""?ei:sr))}}),Di=b.useMemo(()=>Cn&&Ho?{current:Ho.closest('[role="dialog"]')}:re,[Cn,Ho]);Pf({enabled:!e.actionsRef,open:qe,ref:Di,onComplete(){qe||qr()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:qr}),[qr]),Ge(function(){if(qe||l==="none")return;const Me=v?Zn:et.current;if(ot){const Ke=Array.isArray(ee)?ee:[],It=Ke[Ke.length-1],st=bd(Me,It,V);an({selectedIndex:st===-1?null:st})}else{const Ke=bd(Me,ee,V);an({selectedIndex:Ke===-1?null:Ke})}},[qe,ee,v,l,Zn,ot,V,an]),Ge(()=>{v&&(rt.current=Qt,le.current.length=Qt.length)},[v,Qt]),Ge(()=>{const Ce=Ue.current;if(Ce&&(Ce.hasQuery?Ze&&Ve.set("activeIndex",0):Ze==="always"&&Ve.set("activeIndex",0),Ue.current=null),!qe&&!Cn)return;const Ke=Bt||tt?Qt:rt.current,It=Ve.state.activeIndex;if(It==null){if(Ze==="always"&&Ke.length>0){Ve.set("activeIndex",0);return}Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Va(sr,void 0,{index:-1})));return}if(It>=Ke.length){Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Va(sr,void 0,{index:-1}))),Ve.set("activeIndex",null);return}const st=Ke[It],Dt=Xe.current.value,tr=Dt!==ak&&rs(st,Dt,Ve.state.isItemEqualToValue);(Xe.current.index!==It||!tr)&&(Xe.current={value:st,index:It},Ve.state.onItemHighlighted(st,Va(sr,void 0,{index:It})))},[Go,Ze,tt,Bt,Qt,Cn,qe,Ve]),Ge(()=>{if(l==="none"){K(String(Ae)!=="");return}K(ot?Array.isArray(ee)&&ee.length>0:ee!=null)},[K,l,Ae,ee,ot]),b.useEffect(()=>{Bt&&Ze&&Qt.length===0&&an({activeIndex:null})},[Bt,Ze,Qt.length,an]),ic(it,()=>{!qe||it===""||it===String(xe)||k(!0)}),ic(ee,()=>{if(l!=="none"&&(H(ct),ne(ee!==W.initialValue),J()?se.commit(ee):se.commit(ee,!0),mt&&!Ot&&!Mt)){const Ce=Pn(ee,T);Ae!==Ce&&Tn(Ce,Qe(sr))}}),ic(Ae,()=>{l==="none"&&(H(ct),ne(Ae!==W.initialValue),J()?se.commit(Ae):se.commit(Ae,!0))}),ic(v,()=>{if(!mt||Ot||Mt||Z)return;const Ce=Pn(ee,T);Ae!==Ce&&Tn(Ce,Qe(sr))});const Qn=JD({open:Cn?!0:qe,onOpenChange:vo,elements:{reference:Mt?bo:Pi,floating:Ho}});let zo,qo;Cn||(zo=m?"grid":"listbox",qo=qe?"true":"false");const Ta=b.useMemo(()=>{const Ce=Pi?.tagName==="INPUT",Me=Ce||qe,Ke=Ce?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Me&&(Ke.role="combobox",Ke["aria-expanded"]=qo,Ke["aria-haspopup"]=zo,Ke["aria-controls"]=qe?Rs?.id:void 0,Ke["aria-autocomplete"]=D),{reference:Ke,floating:{role:"presentation"}}},[Pi,qe,qo,zo,Rs?.id,D]),Na=UD(Qn,{enabled:!f&&!gt&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Mt?0:50,reason:v7}),Oa=EZ(Qn,{enabled:!f&&!gt&&!Cn,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Cn?!0:void 0,outsidePress(Ce){const Me=_n(Ce);return!ft(bo,Me)&&!ft(Ye.current,Me)&&!ft(Se.current,Me)}}),Pa=aJ(Qn,{enabled:!f&&!gt,id:ae,listRef:le,activeIndex:Go,selectedIndex:on,virtual:!0,loopFocus:I,allowEscape:I&&!Ze,focusItemOnOpen:Z||l==="none"&&!Ze?!1:"auto",focusItemOnHover:R,resetOnPointerLeave:!S,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:Xu,onNavigate(Ce,Me){!Me&&!qe||_i==="ending"||an(Me?{activeIndex:Ce,type:ve.current?"keyboard":"pointer"}:{activeIndex:Ce})}}),{getReferenceProps:yo,getFloatingProps:ki,getItemProps:ji}=rJ([Ta,Na,Oa,Pa]);yJ(()=>{Ve.update({inline:P,popupProps:ki(),inputProps:yo(),triggerProps:zr,getItemProps:ji,setOpen:vo,setInputValue:Tn,setSelectedValue:Wo,setIndices:an,onItemHighlighted:Ni,handleSelection:Aa,forceMount:Cr,requestSubmit:Mi})}),Ge(()=>{Ve.update({id:ae,selectedValue:ee,open:qe,mounted:As,transitionStatus:_i,items:v,inline:P,popupProps:ki(),inputProps:yo(),triggerProps:zr,openMethod:Ts,getItemProps:ji,selectionMode:l,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,onOpenChangeComplete:Oi,openOnInputClick:w,itemToStringLabel:T,modal:B,autoHighlight:Ze,isItemEqualToValue:V,submitOnItemClick:z,hasInputValue:Ot,requestSubmit:Mi})},[Ve,ae,ee,qe,As,_i,v,ki,yo,ji,Ts,zr,l,ct,gt,f,p,se,m,lt,A,Oi,w,T,B,V,z,Ot,P,Mi,Ze]);const xo=kl(g,se.inputRef),Bn=b.useMemo(()=>({query:it,hasItems:Bt,filteredItems:pn,flatFilteredItems:Qt}),[it,Bt,pn,Qt]),Sr=b.useMemo(()=>Array.isArray(Jn)?"":Ga(Jn,M),[Jn,M]),Er=ot&&Array.isArray(ee)&&ee.length>0,Fi=ot||l==="none"?void 0:ct,er=b.useMemo(()=>!ot||!Array.isArray(ee)||!ct?null:ee.map(Ce=>{const Me=Ga(Ce,M);return h.jsx("input",{type:"hidden",name:ct,value:Me},Me)}),[ot,ee,ct,M]),_a=h.jsxs(b.Fragment,{children:[e.children,h.jsx("input",{...se.getInputValidationProps({onFocus(){if(Mt){bo?.focus();return}(fe.current||bo)?.focus()},onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;const Me=Ce.target.value,Ke=Qe(sr,Ce.nativeEvent);function It(){if(ot)return;if(l==="none"){ne(Me!==W.initialValue),Tn(Me,Ke),J()&&se.commit(Me);return}const st=rt.current.find(Dt=>Ga(Dt,M).toLowerCase()===Me.toLowerCase());st!=null&&(ne(st!==W.initialValue),Wo?.(st,Ke),J()&&se.commit(st))}v?It():(Cr(),queueMicrotask(It))}}),id:ae&&Fi==null?`${ae}-hidden-input`:void 0,name:Fi,autoComplete:$,disabled:gt,required:p&&!Er,readOnly:f,value:Sr,ref:xo,style:Fi?dZ:Bx,tabIndex:-1,"aria-hidden":!0}),er]});return h.jsx(Hx.Provider,{value:Ve,children:h.jsx(Wx.Provider,{value:Qn,children:h.jsx(zx.Provider,{value:Bn,children:h.jsx(qx.Provider,{value:Ae,children:_a})})})})}const lk={...bJ,...RJ,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function DJ(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const i=parseFloat(n.width)||0,s=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,a),c=Math.max(t.height,s,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const sc=2,uk=b.forwardRef(function(t,n){const{render:r,className:o,nativeButton:i=!0,disabled:s=!1,id:a,...l}=t,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:p,validation:g}=yu(),{labelId:m}=Xx(),v=Yn(),{filteredItems:y}=Ii(),x=me(v,be.selectionMode),w=me(v,be.disabled),C=me(v,be.readOnly),S=me(v,be.required),R=me(v,be.mounted),I=me(v,be.popupSide),T=me(v,be.positionerElement),M=me(v,be.listElement),V=me(v,be.triggerProps),A=me(v,be.triggerElement),P=me(v,be.inputInsidePopup),N=me(v,be.id),B=me(v,be.open),j=me(v,be.selectedValue),D=me(v,be.activeIndex),$=me(v,be.selectedIndex),G=me(v,be.hasSelectedValue),z=Df(),H=Ux(),ne=ns(),W=c||w||s,J=y.length===0,K=R&&T?I:null;ik({id:P?a:void 0});const U=P?a??N:a,oe=b.useRef("");function X(Y){oe.current=Y.pointerType}const te=z.useState("domReferenceElement");b.useEffect(()=>{P&&A&&A!==te&&z.set("domReferenceElement",A)},[A,te,z,P]);const{reference:Q}=lJ(z,{enabled:!B&&!C&&!w&&x==="single",listRef:v.state.labelsRef,activeIndex:D,selectedIndex:$,onMatch(Y){const le=v.state.valuesRef.current[Y];le!==void 0&&v.state.setSelectedValue(le,Qe("none"))}}),{reference:se}=UD(z,{enabled:!C&&!w,event:"mousedown"}),{buttonRef:ae,getButtonProps:F}=Nf({native:i,disabled:W}),Z={...u,open:B,disabled:W,popupSide:K,listEmpty:J,placeholder:!G},k=ke(Y=>{v.set("triggerElement",Y)});return jn("button",t,{ref:[n,ae,k],state:Z,props:[V,se,Q,{id:U,tabIndex:P?0:-1,role:P?"combobox":void 0,"aria-expanded":B?"true":"false","aria-haspopup":P?"dialog":"listbox","aria-controls":B?M?.id:void 0,"aria-required":P&&S||void 0,"aria-labelledby":m,onPointerDown:X,onPointerEnter:X,onFocus(){f(!0),!(W||C)&&ne.start(0,v.state.forceMount)},onBlur(Y){if(!ft(T,Y.relatedTarget)&&(d(!0),f(!1),p==="onBlur")){const le=x==="none"?H:j;g.commit(le)}},onMouseDown(Y){if(W||C||(P||z.set("domReferenceElement",Y.currentTarget),v.state.forceMount(),oe.current!=="touch"&&(v.state.inputRef.current?.focus(),P||Y.preventDefault()),B))return;const le=Wt(Y.currentTarget);function pe(re){if(!A)return;const fe=_n(re),de=v.state.positionerElement,ve=v.state.listElement;if(ft(A,fe)||ft(de,fe)||ft(ve,fe)||fe===A)return;const we=DJ(A),Se=re.clientX>=we.left-sc&&re.clientX<=we.right+sc,Ye=re.clientY>=we.top-sc&&re.clientY<=we.bottom+sc;Se&&Ye||v.state.setOpen(!1,Qe("cancel-open",re))}P&&le.addEventListener("mouseup",pe,{once:!0})},onKeyDown(Y){W||C||(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Tt(Y),v.state.setOpen(!0,Qe(fl,Y.nativeEvent)),v.state.inputRef.current?.focus())}},g?g.getValidationProps(l):l,F],stateAttributesMapping:lk})});process.env.NODE_ENV!=="production"&&(uk.displayName="ComboboxTrigger");const Zx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Zx.displayName="ComboboxChipsContext");function ck(){return b.useContext(Zx)}const Jx=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jx.displayName="ComboboxPositionerContext");function Kx(e){const t=b.useContext(Jx);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":Gr(21));return t}const Qx=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,id:s,...a}=t,{state:l,disabled:u,setTouched:c,setFocused:d,validationMode:f,validation:p}=yu(),{labelId:g}=Xx(),m=ck(),y=!!Kx(!0),x=Yn(),{filteredItems:w}=Ii(),C=Ux(),S=cD(),R=me(x,be.required),I=me(x,be.disabled),T=me(x,be.readOnly),M=me(x,be.name),V=me(x,be.selectionMode),A=me(x,be.autoHighlight),P=me(x,be.inputProps),N=me(x,be.triggerProps),B=me(x,be.open),j=me(x,be.mounted),D=me(x,be.selectedValue),$=me(x,be.popupSide),G=me(x,be.positionerElement),z=me(x,be.id),H=me(x,be.inline),ne=!!A,W=j&&G?$:null,J=u||I||i,K=w.length===0,oe=bD(s??(y||H?void 0:z)),[X,te]=b.useState(null),Q=b.useRef(!1),se=b.useRef(null),ae=b.useRef(!1),F=ke(Y=>{const le=y||x.state.inline;le&&!x.state.hasInputValue&&x.state.setInputValue("",Qe(sr)),x.update({inputElement:Y,inputInsidePopup:le})}),Z={...l,open:B,disabled:J,readOnly:T,popupSide:W,listEmpty:K};function k(Y){if(!m)return;let le;const{highlightedChipIndex:pe}=m;if(pe!==void 0){if(Y.key==="ArrowLeft")Y.preventDefault(),pe>0?le=pe-1:le=void 0;else if(Y.key==="ArrowRight")Y.preventDefault(),pe<D.length-1?le=pe+1:le=void 0;else if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault();const re=pe>=D.length-1?D.length-2:pe;le=re>=0?re:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return le}return Y.key==="ArrowLeft"&&(Y.currentTarget.selectionStart??0)===0&&D.length>0?(Y.preventDefault(),le=Math.max(D.length-1,0)):Y.key==="Backspace"&&Y.currentTarget.value===""&&D.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Y.preventDefault()),le}return jn("input",t,{state:Z,ref:[n,x.state.inputRef,F],props:[P,N,{type:"text",value:t.value??X??C,"aria-readonly":T||void 0,"aria-required":R||void 0,"aria-labelledby":g,disabled:J,readOnly:T,required:V==="none"?R:void 0,...V==="none"&&M&&{name:M},id:oe,onFocus(){if(d(!0),!H||!ae.current)return;ae.current=!1;const Y=se.current;Y==null||!Object.hasOwn(x.state.valuesRef.current,Y)||x.state.setIndices({activeIndex:Y})},onBlur(){c(!0),d(!1);const Y=x.state.activeIndex;if(H&&Y!==null&&A!=="always"&&(se.current=Y,ae.current=!0,x.state.setIndices({activeIndex:null})),f==="onBlur"){const le=V==="none"?C:D;p.commit(le)}},onCompositionStart(Y){cd||(Q.current=!0,te(Y.currentTarget.value))},onCompositionEnd(Y){Q.current=!1;const le=Y.currentTarget.value;te(null),x.state.setInputValue(le,Qe(zs,Y.nativeEvent))},onChange(Y){const le=Y.nativeEvent.inputType,pe=!le||le==="insertReplacementText",re=Q.current||!pe;if(Q.current){const we=Y.currentTarget.value;te(we),we===""&&!x.state.openOnInputClick&&!x.state.inputInsidePopup&&x.state.setOpen(!1,Qe(ei,Y.nativeEvent));const Se=we.trim(),Ye=ne&&Se!=="";!T&&!J&&Se&&re&&(x.state.setOpen(!0,Qe(zs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!Ye&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"});return}x.state.setInputValue(Y.currentTarget.value,Qe(zs,Y.nativeEvent));const fe=Y.currentTarget.value==="",de=Qe(ei,Y.nativeEvent);fe&&!x.state.inputInsidePopup&&(V==="single"&&x.state.setSelectedValue(null,de),x.state.openOnInputClick||x.state.setOpen(!1,de));const ve=Y.currentTarget.value.trim();!T&&!J&&ve&&re&&(x.state.setOpen(!0,Qe(zs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!ne&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Y){if(J||T||Y.ctrlKey||Y.shiftKey||Y.altKey||Y.metaKey)return;x.state.keyboardActiveRef.current=!0;const le=Y.currentTarget,pe=le.scrollWidth-le.clientWidth,re=S==="rtl";if(Y.key==="Home"){Tt(Y);const ve=jE&&re?le.value.length:0;le.setSelectionRange(ve,ve),le.scrollLeft=0;return}if(Y.key==="End"){Tt(Y);const ve=jE&&re?0:le.value.length;le.setSelectionRange(ve,ve),le.scrollLeft=re?-pe:pe;return}if(!j&&Y.key==="Escape"){const ve=V==="multiple"&&Array.isArray(D)?D.length===0:D===null,we=Qe(mD,Y.nativeEvent),Se=V==="multiple"?[]:null;x.state.setInputValue("",we),x.state.setSelectedValue(Se,we),!ve&&!x.state.inline&&!we.isPropagationAllowed&&Y.stopPropagation();return}if(m&&Y.key==="Backspace"&&le.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(D)&&D.length>0){const ve=D.slice(0,-1);x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),x.state.setSelectedValue(ve,Qe(sr,Y.nativeEvent));return}const fe=m?.highlightedChipIndex!==void 0,de=k(Y);if(m?.setHighlightedChipIndex(de),de!==void 0?m?.chipsRef.current[de]?.focus():fe&&x.state.inputRef.current?.focus(),Y.which!==229&&Y.key==="Enter"&&B){const ve=x.state.activeIndex,we=Y.nativeEvent;if(ve===null){x.state.setOpen(!1,Qe(sr,we));return}Tt(Y);const Se=x.state.listRef.current[ve];Se&&(x.state.selectionEventRef.current=we,Se.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(a):a],stateAttributesMapping:lk})});process.env.NODE_ENV!=="production"&&(Qx.displayName="ComboboxInput");const kJ={...Dx,...mJ},dk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,keepMounted:a=!1,...l}=t,{disabled:u}=yu(),c=Yn(),d=me(c,be.selectionMode),f=me(c,be.disabled),p=me(c,be.readOnly),g=me(c,be.open),m=me(c,be.selectedValue),v=me(c,be.hasSelectionChips),y=Ux();let x=!1;d==="none"?x=y!=="":d==="single"?x=m!=null:x=v;const w=u||f||i,{buttonRef:C,getButtonProps:S}=Nf({native:s,disabled:w}),{mounted:R,transitionStatus:I,setMounted:T}=kx(x),M={disabled:w,open:g,transitionStatus:I};Pf({open:x,ref:c.state.clearRef,onComplete(){x||T(!1)}});const V=jn("button",t,{state:M,ref:[n,C,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(P){P.preventDefault()},onClick(P){if(w||p)return;const N=c.state.keyboardActiveRef;c.state.setInputValue("",Qe(PE,P.nativeEvent)),d!=="none"?(c.state.setSelectedValue(Array.isArray(m)?[]:null,Qe(PE,P.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:N.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:N.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},l,S],stateAttributesMapping:kJ});return a||R?V:null});process.env.NODE_ENV!=="production"&&(dk.displayName="ComboboxClear");const fk=b.createContext(null);process.env.NODE_ENV!=="production"&&(fk.displayName="GroupCollectionContext");function jJ(){return b.useContext(fk)}function FJ(e){const{children:t}=e,{filteredItems:n}=Ii(),r=jJ(),o=r?r.items:n;return o?h.jsx(b.Fragment,{children:o.map(t)}):null}const pk=b.forwardRef(function(t,n){var r;const{render:o,className:i,children:s,...a}=t,l=Yn(),u=Df(),c=!!Kx(!0),{filteredItems:d}=Ii(),f=me(l,be.items),p=me(l,be.labelsRef),g=me(l,be.listRef),m=me(l,be.selectionMode),v=me(l,be.grid),y=me(l,be.popupProps),x=me(l,be.disabled),w=me(l,be.readOnly),C=me(l,be.virtualized),S=m==="multiple",R=d.length===0,I=ke(N=>{l.set("positionerElement",N)}),T=ke(N=>{l.set("listElement",N)}),M=b.useMemo(()=>typeof s=="function"?r||(r=h.jsx(FJ,{children:s})):s,[s]),V={empty:R},A=u.useState("floatingId"),P=jn("div",t,{state:V,ref:[n,T,c?null:I],props:[y,{children:M,tabIndex:-1,id:A,role:v?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(N){if(!(x||w)&&N.key==="Enter"){const B=l.state.activeIndex;if(B==null)return;Tt(N);const j=N.nativeEvent,D=l.state.listRef.current[B];D&&(l.state.selectionEventRef.current=j,D.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return C?P:h.jsx(lD,{elementsRef:g,labelsRef:f?void 0:p,children:P})});process.env.NODE_ENV!=="production"&&(pk.displayName="ComboboxList");const e0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(e0.displayName="ComboboxPortalContext");function LJ(){const e=b.useContext(e0);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":Gr(20));return e}const hk=b.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,i=Yn(),s=me(i,be.mounted),a=me(i,be.forceMounted);return s||r||a?h.jsx(e0.Provider,{value:r,children:h.jsx(qD,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(hk.displayName="ComboboxPortal");const BJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:d="real"}=io(e,t)||{};if(u==null)return{};const f=Cy(c),p={x:n,y:r},g=Hd(o),m=Gd(g),v=await s.getDimensions(u),y=g==="y",x=y?"top":"left",w=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[g]-p[g]-i.floating[m],R=p[g]-i.reference[g],I=d==="real"?await s.getOffsetParent?.(u):a.floating;let T=a.floating[C]||i.floating[m];(!T||!await s.isElement?.(I))&&(T=a.floating[C]||i.floating[m]);const M=S/2-R/2,V=T/2-v[m]/2-1,A=Math.min(f[x],V),P=Math.min(f[w],V),N=A,B=T-v[m]-P,j=T/2-v[m]/2+M,D=$c(N,j,B),$=!l.arrow&&Lo(o)!=null&&j!==D&&i.reference[m]/2-(j<N?A:P)-v[m]/2<0,G=$?j<N?j-N:j-B:0;return{[g]:p[g]+G,data:{[g]:D,centerOffset:j-D-G,...$&&{alignmentOffset:G}},reset:$}}}),VJ=(e,t)=>({...BJ(e),options:[e,t]}),$J={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await nN().fn(e)).data?.referenceHidden||i}}}},GJ={sideX:"left",sideY:"top"};function gk(e,t,n){const 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 oI(e,t,n){const{rects:r,placement:o}=e;return{side:gk(t,Gn(o),n),align:Lo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function HJ(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:C}=e,[S,R]=b.useState(null);!g&&S!==null&&R(null);const I=m.side||"flip",T=m.align||"flip",M=m.fallbackAxisSide||"end",V=typeof t=="function"?t:void 0,A=ke(V),P=V?A:t,N=ur(t),j=cD()==="rtl",D=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],$=i==="center"?D:`${D}-${i}`;let G=l;const z=1,H=r==="bottom"?z:0,ne=r==="top"?z:0,W=r==="right"?z:0,J=r==="left"?z:0;typeof G=="number"?G={top:G+H,right:G+J,bottom:G+ne,left:G+W}:G&&(G={top:(G.top||0)+H,right:(G.right||0)+J,bottom:(G.bottom||0)+ne,left:(G.left||0)+W});const K={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},U=b.useRef(null),oe=ur(o),X=ur(s),se=[JT(tt=>{const Ze=oI(tt,r,j),ee=typeof oe.current=="function"?oe.current(Ze):oe.current,ye=typeof X.current=="function"?X.current(Ze):X.current;return{mainAxis:ee,crossAxis:ye,alignmentAxis:ye}},[typeof o!="function"?o:0,typeof s!="function"?s:0,j,r])],ae=T==="none"&&I!=="shift",F=!ae&&(u||v||I==="shift"),Z=I==="none"?null:eN({...K,padding:{top:G.top+z,right:G.right+z,bottom:G.bottom+z,left:G.left+z},mainAxis:!v&&I==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:M}),k=ae?null:KT(tt=>{const Ze=Wt(tt.elements.floating).documentElement;return{...K,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:F,limiter:u||v?void 0:QT(ee=>{if(!U.current)return{};const{width:ye,height:ge}=U.current.getBoundingClientRect(),xe=fr(Gn(ee.placement)),Ae=xe==="y"?ye:ge,Ie=xe==="y"?G.left+G.right:G.top+G.bottom;return{offset:Ae/2+Ie/2}})}},[K,u,v,G,T]);I==="shift"||T==="shift"||i==="center"?se.push(k,Z):se.push(Z,k),se.push(tN({...K,apply({elements:{floating:tt},rects:{reference:Ze},availableWidth:ee,availableHeight:ye}){const ge=tt.style;ge.setProperty("--available-width",`${ee}px`),ge.setProperty("--available-height",`${ye}px`),ge.setProperty("--anchor-width",`${Ze.width}px`),ge.setProperty("--anchor-height",`${Ze.height}px`)}}),VJ(()=>({element:U.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(tt){const{elements:Ze,middlewareData:ee,placement:ye,rects:ge,y:xe}=tt,Ae=Gn(ye),Ie=fr(Ae),qe=U.current,Pt=ee.arrow?.x||0,lt=ee.arrow?.y||0,it=qe?.clientWidth||0,_t=qe?.clientHeight||0,Et=Pt+it/2,sn=lt+_t/2,wr=Math.abs(ee.shift?.y||0),Zn=ge.reference.height/2,pn=typeof o=="function"?o(oI(tt,r,j)):o,Qt=wr>pn,Ve={top:`${Et}px calc(100% + ${pn}px)`,bottom:`${Et}px ${-pn}px`,left:`calc(100% + ${pn}px) ${sn}px`,right:`${-pn}px ${sn}px`}[Ae],Jn=`${Et}px ${ge.reference.y+Zn-xe}px`;return Ze.floating.style.setProperty("--transform-origin",F&&Ie==="y"&&Qt?Jn:Ve),{}}},$J,x),Ge(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const ie=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Y,elements:le,x:pe,y:re,middlewareData:fe,update:de,placement:ve,context:we,isPositioned:Se,floatingStyles:Ye}=nJ({rootContext:p,placement:$,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...tt)=>Wc(...tt,ie),nodeId:y,externalTree:C}),{sideX:at,sideY:Xe}=fe.adaptiveOrigin||GJ,Ue=Se?n:"fixed",rt=b.useMemo(()=>{const tt=x?{position:Ue,[at]:pe,[Xe]:re}:{position:Ue,...Ye};return Se||(tt.opacity=0),tt},[x,Ue,at,pe,Xe,re,Ye,Se]),et=b.useRef(null);Ge(()=>{if(!g)return;const tt=N.current,Ze=typeof tt=="function"?tt():tt,ye=(iI(Ze)?Ze.current:Ze)||null||null;ye!==et.current&&(Y.setPositionReference(ye),et.current=ye)},[g,Y,P,N]),b.useEffect(()=>{if(!g)return;const tt=N.current;typeof tt!="function"&&iI(tt)&&tt.current!==et.current&&(Y.setPositionReference(tt.current),et.current=tt.current)},[g,Y,P,N]),b.useEffect(()=>{if(f&&g&&le.domReference&&le.floating)return Wc(le.domReference,le.floating,de,ie)},[f,g,le,de,ie]);const gt=Gn(ve),ct=gk(r,gt,j),ot=Lo(ve)||"center",mt=!!fe.hide?.referenceHidden;Ge(()=>{w&&g&&Se&&R(gt)},[w,g,Se,gt]);const Ot=b.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Bt=fe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:rt,arrowStyles:Ot,arrowRef:U,arrowUncentered:Bt,side:ct,align:ot,physicalSide:gt,anchorHidden:mt,refs:Y,context:we,isPositioned:Se,update:de}),[rt,Ot,U,Bt,ct,ot,gt,mt,Y,we,Se,de])}function iI(e){return e!=null&&"current"in e}function mk(e){return e==="starting"?a7:En}const bk=b.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=u7,...y}=t,x=Yn(),{filteredItems:w}=Ii(),C=Df(),S=LJ(),R=me(x,be.modal),I=me(x,be.open),T=me(x,be.mounted),M=me(x,be.openMethod),V=me(x,be.triggerElement),A=me(x,be.inputElement),P=me(x,be.inputInsidePopup),N=me(x,be.transitionStatus),B=w.length===0,D=HJ({anchor:i??(P?V:A),floatingRootContext:C,positionMethod:s,mounted:T,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:v,lazyFlip:!0});lZ(I&&R&&M!=="touch",V);const $=b.useMemo(()=>{const W={...D.positionerStyles};return I||(W.pointerEvents="none"),{role:"presentation",hidden:!T,style:W}},[I,T,D.positionerStyles]),G={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:B};Ge(()=>{x.set("popupSide",D.side)},[x,D.side]);const z=b.useMemo(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,anchorHidden:D.anchorHidden,isPositioned:D.isPositioned}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.anchorHidden,D.isPositioned]),H=ke(W=>{x.set("positionerElement",W)}),ne=jn("div",t,{state:G,ref:[n,H],props:[$,mk(N),y],stateAttributesMapping:KD});return h.jsxs(Jx.Provider,{value:z,children:[T&&R&&h.jsx(QD,{inert:vJ(!I),cutout:A??V}),ne]})});process.env.NODE_ENV!=="production"&&(bk.displayName="ComboboxPositioner");const WJ={...KD,...Dx},vk=b.forwardRef(function(t,n){const{render:r,className:o,initialFocus:i,finalFocus:s,...a}=t,l=Yn(),u=Kx(),c=Df(),{filteredItems:d}=Ii(),f=me(l,be.mounted),p=me(l,be.open),g=me(l,be.openMethod),m=me(l,be.transitionStatus),v=me(l,be.inputInsidePopup),y=me(l,be.inputElement),x=d.length===0;Pf({open:p,ref:l.state.popupRef,onComplete(){p&&l.state.onOpenChangeComplete(!0)}});const w={open:p,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:m,empty:x},C=jn("div",t,{state:w,ref:[n,l.state.popupRef],props:[{role:v?"dialog":"presentation",tabIndex:-1,onFocus(T){const M=_n(T.nativeEvent);g!=="touch"&&(ft(l.state.listElement,M)||M===T.currentTarget)&&l.state.inputRef.current?.focus()}},mk(m),a],stateAttributesMapping:WJ}),R=i===void 0?v?T=>T==="touch"?l.state.popupRef.current:y:!1:i;let I;return s!=null?I=s:I=v?void 0:!1,h.jsx(wZ,{context:c,disabled:!f,modal:!v,openInteractionType:g,initialFocus:R,returnFocus:I,children:C})});process.env.NODE_ENV!=="production"&&(vk.displayName="ComboboxPopup");const t0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(t0.displayName="ComboboxItemContext");function yk(){const e=b.useContext(t0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.":Gr(19));return e}const xk=b.createContext(!1);process.env.NODE_ENV!=="production"&&(xk.displayName="ComboboxRowContext");function zJ(){return b.useContext(xk)}const wk=b.memo(b.forwardRef(function(t,n){const{render:r,className:o,value:i=null,index:s,disabled:a=!1,nativeButton:l=!1,...u}=t,c=b.useRef(!1),d=b.useRef(null),f=xD({index:s,textRef:d,indexGuessBehavior:yD.GuessFromOrder}),p=Yn(),g=zJ(),{flatFilteredItems:m,hasItems:v}=Ii(),y=me(p,be.open),x=me(p,be.selectionMode),w=me(p,be.readOnly),C=me(p,be.virtualized),S=me(p,be.isItemEqualToValue),R=x!=="none",I=s??(C?bd(m,i,S):f.index),T=f.index!==-1,M=me(p,be.id),V=me(p,be.isActive,I),A=me(p,be.isSelected,i),P=me(p,be.getItemProps),N=b.useRef(null),B=M!=null&&T?`${M}-${I}`:void 0,j=A&&R;Ge(()=>{if(!(T&&(C||s!=null)))return;const U=p.state.listRef.current;return U[I]=N.current,()=>{delete U[I]}},[T,C,I,s,p]),Ge(()=>{if(!T||v)return;const K=p.state.valuesRef.current;return K[I]=i,x!=="none"&&p.state.allValuesRef.current.push(i),()=>{delete K[I]}},[T,v,I,i,p,x]),Ge(()=>{if(!y){c.current=!1;return}if(!T||v)return;const K=p.state.selectedValue,U=Array.isArray(K)?K[K.length-1]:K;rs(i,U,S)&&p.set("selectedIndex",I)},[T,v,y,p,I,i,S]);const D={disabled:a,selected:j,highlighted:V},$=P({active:V,selected:j});$.id=void 0,$.onFocus=void 0;const{getButtonProps:G,buttonRef:z}=Nf({disabled:a,focusableWhenDisabled:!0,native:l});function H(K){function U(){p.state.handleSelection(K,i)}p.state.submitOnItemClick?(ao.flushSync(U),p.state.requestSubmit()):U()}const ne={id:B,role:g?"gridcell":"option","aria-selected":R?j:void 0,tabIndex:void 0,onPointerDownCapture(K){c.current=!0,K.preventDefault()},onClick(K){a||w||H(K.nativeEvent)},onMouseUp(K){const U=c.current;c.current=!1,!(a||w||K.button!==0||U||!V)&&H(K.nativeEvent)}},W=jn("div",t,{ref:[z,n,f.ref,N],state:D,props:[$,ne,u,G]}),J=b.useMemo(()=>({selected:j,textRef:d}),[j,d]);return h.jsx(t0.Provider,{value:J,children:W})}));process.env.NODE_ENV!=="production"&&(wk.displayName="ComboboxItem");const Ck=b.forwardRef(function(t,n){const{render:r,className:o,children:i,...s}=t,{filteredItems:a}=Ii(),l=Yn(),u=a.length===0?i:null;return jn("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});process.env.NODE_ENV!=="production"&&(Ck.displayName="ComboboxEmpty");const Sk=b.forwardRef(function(t,n){const{className:r,render:o,orientation:i="horizontal",...s}=t;return jn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},s]})});process.env.NODE_ENV!=="production"&&(Sk.displayName="Separator");function qJ(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...s}=e;return h.jsx(MJ,{...s,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function UJ(e){const{children:t,placeholder:n}=e,r=Yn(),o=me(r,be.itemToStringLabel),i=me(r,be.selectedValue),s=me(r,be.items),a=me(r,be.selectionMode)==="multiple",l=me(r,be.hasSelectedValue),u=!l&&n!=null&&t==null,c=me(r,be.hasNullItemLabel,u);let d=null;return typeof t=="function"?d=t(i):t!=null?d=t:!l&&n!=null&&!c?d=n:a&&Array.isArray(i)?d=EJ(i,s,o):d=ek(i,s,o),h.jsx(b.Fragment,{children:d})}const Ek=b.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=yk();return r||o?h.jsx(Ik,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(Ek.displayName="ComboboxItemIndicator");const Ik=b.memo(b.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=yk(),a=b.useRef(null),{transitionStatus:l,setMounted:u}=kx(s),d=jn("span",e,{ref:[t,a],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:Dx});return Pf({open:s,ref:a,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!=="production"&&(Ik.displayName="Inner");const Rk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Yn(),a=me(s,be.open),l=me(s,be.hasSelectionChips),[u,c]=b.useState(void 0);a&&u!==void 0&&c(void 0);const d=b.useRef([]),f=jn("div",t,{ref:[n,s.state.chipsContainerRef],props:[l?{role:"toolbar"}:En,i]}),p=b.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:c,chipsRef:d}),[u,c,d]);return h.jsx(Zx.Provider,{value:p,children:h.jsx(lD,{elementsRef:d,children:f})})});process.env.NODE_ENV!=="production"&&(Rk.displayName="ComboboxChips");const n0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(n0.displayName="ComboboxChipContext");function YJ(){const e=b.useContext(n0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":Gr(17));return e}const Ak=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Yn(),{setHighlightedChipIndex:a,chipsRef:l}=ck(),u=me(s,be.disabled),c=me(s,be.readOnly),d=me(s,be.selectedValue),{ref:f,index:p}=xD();function g(x){let w=p;if(x.key==="ArrowLeft")x.preventDefault(),p>0?w=p-1:w=void 0;else if(x.key==="ArrowRight")x.preventDefault(),p<d.length-1?w=p+1:w=void 0;else if(x.key==="Backspace"||x.key==="Delete"){const C=p>=d.length-1?d.length-2:p;w=C>=0?C:void 0,Tt(x),s.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),s.state.setSelectedValue(d.filter((S,R)=>R!==p),Qe(sr,x.nativeEvent))}else x.key==="Enter"||x.key===" "?(Tt(x),w=void 0):x.key==="ArrowDown"||x.key==="ArrowUp"?(Tt(x),s.state.setOpen(!0,Qe(fl,x.nativeEvent)),w=void 0):x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&(w=void 0);return w}const v=jn("div",t,{ref:[n,f],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":c||void 0,onKeyDown(x){if(u||c)return;const w=g(x);ao.flushSync(()=>{a(w)}),w===void 0?s.state.inputRef.current?.focus():l.current[w]?.focus()},onMouseDown(x){c||(x.preventDefault(),!u&&s.state.inputRef.current?.focus())}},i]}),y=b.useMemo(()=>({index:p}),[p]);return h.jsx(n0.Provider,{value:y,children:v})});process.env.NODE_ENV!=="production"&&(Ak.displayName="ComboboxChip");const Tk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,...a}=t,l=Yn(),{index:u}=YJ(),c=me(l,be.disabled),d=me(l,be.readOnly),f=me(l,be.selectedValue),p=me(l,be.isItemEqualToValue),g=c||i,{buttonRef:m,getButtonProps:v}=Nf({native:s,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function x(S){const R=l.state.activeIndex;if(R==null)return;const I=bd(l.state.valuesRef.current,S,p);I!==-1&&R===I&&l.state.setIndices({activeIndex:null,type:l.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(S){const R=Qe(b7,S.nativeEvent),I=f[u];return x(I),l.state.setSelectedValue(f.filter((T,M)=>M!==u),R),l.state.inputRef.current?.focus(),R}return jn("button",t,{ref:[n,m],state:y,props:[{tabIndex:-1,onClick(S){if(g||d)return;w(S).isPropagationAllowed||S.stopPropagation()},onKeyDown(S){g||d||(S.key==="Enter"||S.key===" ")&&(w(S).isPropagationAllowed||Tt(S))}},a,v]})});process.env.NODE_ENV!=="production"&&(Tk.displayName="ComboboxChipRemove");const Nk=()=>({layer:O.useContext(QM)});function xa({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:L("ui:file:text-foreground ui:placeholder:text-muted-foreground ui:selection:bg-primary ui:selection:text-primary-foreground ui:dark:bg-input/30 ui:border-input ui:h-10 ui:w-full ui:min-w-0 ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-1 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:file:inline-flex ui:file:h-7 ui:file:border-0 ui:file:bg-transparent ui:file:text-sm ui:file:font-medium ui:disabled:pointer-events-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm","ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:focus-visible:ring-[3px]","ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive",e),...n})}function Ok({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:L("ui:border-input ui:placeholder:text-muted-foreground ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:dark:bg-input/30 ui:flex ui:field-sizing-content ui:min-h-16 ui:w-full ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-2 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm",e),...t})}function XJ({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:L("ui:group/input-group ui:border-input ui:dark:bg-input/30 ui:relative ui:flex ui:w-full ui:items-center ui:rounded-md ui:border ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none","ui:h-9 ui:min-w-0 ui:has-[>textarea]:h-auto","ui:has-[>[data-align=inline-start]]:[&>input]:pl-2","ui:has-[>[data-align=inline-end]]:[&>input]:pr-2","ui:has-[>[data-align=block-start]]:h-auto ui:has-[>[data-align=block-start]]:flex-col ui:has-[>[data-align=block-start]]:[&>input]:pb-3","ui:has-[>[data-align=block-end]]:h-auto ui:has-[>[data-align=block-end]]:flex-col ui:has-[>[data-align=block-end]]:[&>input]:pt-3","ui:has-[[data-slot=input-group-control]:focus-visible]:border-ring ui:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 ui:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","ui:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ui:has-[[data-slot][aria-invalid=true]]:border-destructive ui:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const ZJ=Si("ui:text-muted-foreground ui:flex ui:h-auto ui:cursor-text ui:items-center ui:justify-center ui:gap-2 ui:py-1.5 ui:text-sm ui:font-medium ui:select-none ui:[&>svg:not([class*=size-])]:size-4 ui:[&>kbd]:rounded-[calc(var(--radius)-5px)] ui:group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"ui:order-first ui:pl-3 ui:has-[>button]:ml-[-0.45rem] ui:has-[>kbd]:ml-[-0.35rem]","inline-end":"ui:order-last ui:pr-3 ui:has-[>button]:mr-[-0.45rem] ui:has-[>kbd]:mr-[-0.35rem]","block-start":"ui:order-first ui:w-full ui:justify-start ui:px-3 ui:pt-3 ui:[.border-b]:pb-3 ui:group-has-[>input]/input-group:pt-2.5","block-end":"ui:order-last ui:w-full ui:justify-start ui:px-3 ui:pb-3 ui:[.border-t]:pt-3 ui:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function JJ({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:L(ZJ({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const KJ=Si("ui:text-sm ui:shadow-none ui:flex ui:gap-2 ui:items-center",{variants:{size:{xs:"ui:h-6 ui:gap-1 ui:px-2 ui:rounded-[calc(var(--radius)-5px)] ui:[&>svg:not([class*=size-])]:size-3.5 ui:has-[>svg]:px-2",sm:"ui:h-8 ui:px-2.5 ui:gap-1.5 ui:rounded-md ui:has-[>svg]:px-2.5","icon-xs":"ui:size-6 ui:rounded-[calc(var(--radius)-5px)] ui:p-0 ui:has-[>svg]:p-0","icon-sm":"ui:size-8 ui:p-0 ui:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Pk({className:e,type:t="button",variant:n="ghost",size:r="xs",...o}){return h.jsx(Ut,{type:t,"data-size":r,variant:n,className:L(KJ({size:r}),e),...o})}function QJ({className:e,...t}){return h.jsx(xa,{"data-slot":"input-group-control",className:L("ui:flex-1 ui:rounded-none ui:border-0 ui:bg-transparent ui:shadow-none ui:focus-visible:ring-0 ui:dark:bg-transparent",e),...t})}const eK=qJ;function Lm({...e}){return h.jsx(UJ,{"data-slot":"combobox-value",...e})}function _k({className:e,children:t,...n}){return h.jsxs(uk,{"data-slot":"combobox-trigger",className:L("ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(Oe.ChevronDownIcon,{"data-slot":"combobox-trigger-icon",className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4"})]})}function tK({className:e,...t}){return h.jsx(dk,{"data-slot":"combobox-clear",render:h.jsx(Pk,{variant:"ghost",size:"icon-xs",className:"ui:rounded-md"}),className:L(e),...t,children:h.jsx(Oe.XIcon,{className:"ui:pointer-events-none"})})}function sI({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:o=!1,...i}){return h.jsxs(XJ,{className:L("ui:w-auto ui:shrink-0",e),children:[h.jsx(Qx,{render:h.jsx(QJ,{disabled:n}),...i}),h.jsxs(JJ,{align:"inline-end",children:[r&&h.jsx(Pk,{size:"icon-xs",variant:"ghost",asChild:!0,"data-slot":"input-group-button",className:"ui:group-has-data-[slot=combobox-clear]/input-group:hidden ui:data-pressed:bg-transparent",disabled:n,children:h.jsx(_k,{className:"ui:rounded-md"})}),o&&h.jsx(tK,{disabled:n})]}),t]})}function nK({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:o=0,anchor:i,...s}){const{layer:a}=Nk();return h.jsx(hk,{container:a??void 0,children:h.jsx(bk,{side:t,sideOffset:n,align:r,alignOffset:o,anchor:i,className:"ui:isolate ui:z-50 ui:pointer-events-auto",children:h.jsx(vk,{"data-slot":"combobox-content","data-chips":!!i,className:L("ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:flex ui:min-h-0 ui:max-h-96 ui:flex-col ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",e),...s})})})}function rK({className:e,...t}){return h.jsx(pk,{"data-slot":"combobox-list",className:L("ui:min-h-0 ui:flex-1 ui:overflow-y-auto ui:scroll-py-1 ui:p-1 ui:data-empty:p-0",e),...t})}function oK({className:e,children:t,...n}){return h.jsxs(wk,{"data-slot":"combobox-item",className:L("ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(Ek,{"data-slot":"combobox-item-indicator",render:h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center"}),children:h.jsx(Oe.CheckIcon,{className:"ui:pointer-events-none ui:size-4 ui:pointer-coarse:size-5"})})]})}function iK({className:e,...t}){return h.jsx(Ck,{"data-slot":"combobox-empty",className:L("ui:hidden ui:w-full ui:shrink-0 ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:text-muted-foreground ui:group-data-empty/combobox-content:flex",e),...t})}function sK({className:e,...t}){return h.jsx(Sk,{"data-slot":"combobox-separator",className:L("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function aK({className:e,...t}){return h.jsx(Rk,{"data-slot":"combobox-chips",className:L("ui:dark:bg-input/30 ui:border-input ui:focus-within:border-ring ui:focus-within:ring-ring/50 ui:has-aria-invalid:ring-destructive/20 ui:dark:has-aria-invalid:ring-destructive/40 ui:has-aria-invalid:border-destructive ui:dark:has-aria-invalid:border-destructive/50 ui:flex ui:min-h-9 ui:flex-wrap ui:items-center ui:gap-1.5 ui:rounded-md ui:border ui:bg-transparent ui:bg-clip-padding ui:px-2.5 ui:py-1.5 ui:text-sm ui:shadow-xs ui:transition-[color,box-shadow] ui:focus-within:ring-[3px] ui:has-aria-invalid:ring-[3px] ui:has-data-[slot=combobox-chip]:px-1.5",e),...t})}function lK({className:e,children:t,showRemove:n=!0,...r}){return h.jsxs(Ak,{"data-slot":"combobox-chip",className:L("ui:bg-muted ui:text-foreground ui:flex ui:h-[calc(--spacing(5.5))] ui:w-fit ui:items-center ui:justify-center ui:gap-1 ui:rounded-sm ui:px-1.5 ui:text-xs ui:font-medium ui:whitespace-nowrap ui:has-disabled:pointer-events-none ui:has-disabled:cursor-not-allowed ui:has-disabled:opacity-50 ui:has-data-[slot=combobox-chip-remove]:pr-0",e),...r,children:[t,n&&h.jsx(Tk,{render:h.jsx(Ut,{variant:"ghost",size:"xs",className:"ui:hover:bg-transparent"}),className:"ui:-ml-1 ui:opacity-50 ui:hover:opacity-100","data-slot":"combobox-chip-remove",children:h.jsx(Oe.XIcon,{className:"ui:pointer-events-none"})})]})}function uK({className:e,...t}){return h.jsx(Qx,{"data-slot":"combobox-chip-input",className:L("ui:min-w-16 ui:flex-1 ui:outline-none",e),...t})}function cK(){return b.useRef(null)}const dK=e=>e.label,fK=(e,t)=>e.value===t.value,r0=({items:e,label:t,multiple:n=!1,hasClearButton:r=!1,disabled:o=!1,placeholder:i="Select...",containerClassName:s,emptyMessage:a="No results found.",hasAllOption:l=!1,allOptionLabel:u="All",inputMode:c="input",renderPopupTrigger:d,onInputChange:f,value:p,onValueChange:g})=>{const m=cK(),v=p??[],y=O.useMemo(()=>e.filter(R=>!R.disabled),[e]),x=n&&v.length===y.length&&y.length>0,w=O.useCallback(()=>{const I=v.length===y.length&&y.length>0?[]:y;g(I)},[y,v.length,g]),C=O.useCallback(R=>{Array.isArray(R)?g(R):g(R===null?[]:[R])},[g]),S=O.useCallback(R=>{f?.(R.target.value)},[f]);return h.jsxs("article",{className:s,children:[t&&h.jsx(yr,{className:"ui:mb-2",children:t}),h.jsxs(eK,{multiple:n,autoHighlight:!0,items:e,itemToStringValue:dK,isItemEqualToValue:fK,disabled:o,value:n?v:v[0]??null,onValueChange:C,children:[h.jsxs(In,{children:[h.jsx(Vt,{condition:c==="popup",children:h.jsx(_k,{render:d?d(h.jsx(Lm,{placeholder:i}),v):h.jsx(Ut,{variant:"outline",className:"ui:w-full ui:h-10 ui:font-normal ui:text-left ui:overflow-hidden ui:truncate ui:line-clamp-1",children:h.jsx(Lm,{placeholder:i})})})}),h.jsx(Vt,{condition:n&&c==="input",children:h.jsx(aK,{ref:m,className:"ui:w-full",children:h.jsx(Lm,{children:R=>h.jsxs(O.Fragment,{children:[R.map(I=>h.jsx(lK,{children:I.label},I.value)),h.jsx(uK,{placeholder:R.length?"":i,onChange:S})]})})})}),h.jsx(Vt,{condition:!n&&c==="input",children:h.jsx(sI,{className:"ui:w-full",placeholder:i,showClear:r,disabled:o,onChange:S})})]}),h.jsxs(nK,{className:"ui:min-w-64",anchor:m&&n&&c==="input"?m:void 0,children:[c==="popup"&&h.jsx(sI,{showTrigger:!1,placeholder:"Search...",onChange:S}),h.jsx(iK,{children:a}),l&&n&&h.jsxs("div",{className:"ui:shrink-0 ui:group-data-empty/combobox-content:hidden",children:[h.jsx("div",{className:L("ui:p-1 ui:pb-0",c==="popup"?"ui:mt-1":""),children:h.jsxs("div",{role:"option","aria-selected":x,onClick:w,className:L("ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none","ui:hover:bg-accent ui:hover:text-accent-foreground"),children:[u,x&&h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center",children:h.jsx(Oe.CheckIcon,{className:"ui:pointer-events-none ui:size-4"})})]})}),h.jsx(sK,{})]}),h.jsx(rK,{children:R=>h.jsx(oK,{value:R,disabled:!!R?.disabled,children:R.label},R.value)})]})]})]})},pK="dd/MM/yyyy",hK=({date:e,format:t=pK})=>e?h.jsx(h.Fragment,{children:qi(e,t)}):null;function o0({...e}){return h.jsx(cG,{"data-slot":"popover",...e})}const kf=b.forwardRef(({...e},t)=>h.jsx(RO,{"data-slot":"popover-trigger",ref:t,...e}));kf.displayName=RO.displayName;const jf=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>h.jsx(dG,{children:h.jsx(AO,{ref:o,"data-slot":"popover-content",align:t,sideOffset:n,className:L("ui-lib-root ui:z-[102] ui:w-72 ui:rounded-md ui:border ui:bg-popover ui:p-4 ui:text-popover-foreground ui:shadow-md ui:outline-none ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",e),...r})}));jf.displayName=AO.displayName;const Mk=b.forwardRef(({...e},t)=>h.jsx(IO,{"data-slot":"popover-anchor",ref:t,...e}));Mk.displayName=IO.displayName;const Dk=({start:e,end:t,onConfirm:n,className:r,triggerButtonClassName:o,label:i,placeholder:s,confirmLabel:a="Confirm",disabledCondition:l,dateLocale:u})=>{const[c,d]=O.useState(!1),[f,p]=O.useState(e&&t?{from:e,to:t}:void 0),g=()=>{!f?.from||!f?.to||(n({from:f.from,to:f.to}),d(!1))};return h.jsxs("div",{className:L("ui:grid ui:gap-2",r),children:[i&&h.jsx(yr,{children:i}),h.jsxs(o0,{open:c,onOpenChange:d,children:[h.jsx(kf,{asChild:!0,children:h.jsxs(Ut,{id:"date",variant:"outline",className:L("ui:h-auto ui:text-muted-foreground ui:justify-start ui:text-left ui:font-normal",!f&&"ui:text-muted-foreground",o),children:[h.jsx(Oe.Calendar,{className:"ui:h-4 ui:w-4"}),f?.from?f.to?h.jsxs(h.Fragment,{children:[qi(f.from,"LLL dd, y",{locale:u})," -",qi(f.to,"LLL dd, y",{locale:u})]}):qi(f.from,"LLL dd, y",{locale:u}):h.jsx("span",{children:s})]})}),h.jsxs(jf,{className:"ui:w-auto ui:p-0",align:"start",children:[h.jsx(nx,{mode:"range",defaultMonth:f?.from??new Date,selected:f,onSelect:p,numberOfMonths:2,disabled:l,locale:u}),h.jsx("div",{className:L("ui:px-3 ui:pb-4 ui:pt-2","ui:flex ui:justify-start ui:md:justify-end"),children:h.jsx(Ut,{variant:"success",onClick:g,className:"ui:w-full ui:md:w-max",children:a})})]})]})]})};function kk({value:e,onChange:t,className:n,inputClassName:r,name:o,placeholder:i,label:s}){const[a,l]=O.useState(e),u=O.useRef(null),c=O.useRef(t);O.useEffect(()=>{c.current=t},[t]);const d=O.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.length>=3?c.current(p):c.current("")},300)},[]),f=p=>{const g=decodeURIComponent(p);l(g),d(g)};return h.jsxs("search",{className:L("ui:w-full",n),children:[s&&h.jsx(yr,{htmlFor:o,className:"ui:leading-6 ui:w-full ui:mb-2",children:s}),h.jsx(xa,{type:"search",name:o,id:o,"data-test-id":o,placeholder:i,value:a,onChange:({target:p})=>f(p.value),className:L("ui:max-h-10",r),autoFocus:!0})]})}const gK=({banner:e,campaignName:t,isControlled:n,open:r,setOpen:o,imageClassName:i})=>h.jsxs(Ix,{...n&&{open:r,onOpenChange:o},children:[!n&&h.jsx(eD,{asChild:!0,children:h.jsx("div",{className:"ui:cursor-pointer",children:h.jsx("img",{className:L("ui:w-full ui:max-w-80 ui:mx-auto ui:mt-4! ui:scale-100 ui:hover:scale-110 ui:transition-all ui:duration-300 ui:aspect-video",i),src:e,alt:t})})}),h.jsxs(Rx,{className:"ui:max-w-2xl",children:[h.jsx(Ax,{children:h.jsx(Tx,{children:t})}),h.jsx("img",{className:L("ui:w-full ui:aspect-video",i),src:e,alt:t})]})]});function mK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const jk=O.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),xu=()=>{const e=O.useContext(jk);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};mK(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
87
87
|
[data-state=closed]
|
|
88
|
-
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function bK(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function vK(){return i0(/^Mac/)}function yK(){return i0(/^iPhone/)}function aI(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function xK(){return i0(/^iPad/)||vK()&&navigator.maxTouchPoints>1}function Fk(){return yK()||xK()}function i0(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const wK=24,CK=typeof window<"u"?O.useLayoutEffect:O.useEffect;function lI(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Bm=typeof document<"u"&&window.visualViewport;function uI(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Lk(e){for(uI(e)&&(e=e.parentElement);e&&!uI(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const SK=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let ac=0,Vm;function EK(e={}){let{isDisabled:t}=e;CK(()=>{if(!t)return ac++,ac===1&&Fk()&&(Vm=IK()),()=>{ac--,ac===0&&Vm?.()}},[t])}function IK(){let e,t=0,n=d=>{e=Lk(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&f>t||p>=g&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;xv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;xv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",Bm&&(Bm.height<window.innerHeight?requestAnimationFrame(()=>{cI(f)}):Bm.addEventListener("resize",()=>cI(f),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,u=lI(RK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let c=lI(Ha(document,"touchstart",n,{passive:!1,capture:!0}),Ha(document,"touchmove",r,{passive:!1,capture:!0}),Ha(document,"touchend",o,{passive:!1,capture:!0}),Ha(document,"focus",i,!0),Ha(window,"scroll",s));return()=>{u(),c(),window.scrollTo(a,l)}}function RK(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ha(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function cI(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Lk(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+wK;i>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function xv(e){return e instanceof HTMLInputElement&&!SK.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function AK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function TK(...e){return t=>e.forEach(n=>AK(n,t))}function Bk(...e){return b.useCallback(TK(...e),e)}const Vk=new WeakMap;function nn(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Vk.set(e,r)}function NK(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Vk.get(e);n&&(e.style[t]=n[t])}const Xt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function lc(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Xt(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Xt(t)?5:4]):null)}function OK(e){return 8*(Math.log(e+1)-2)}function $m(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function PK(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const kt={DURATION:.5,EASE:[.32,.72,0,1]},$k=.4,_K=.25,MK=100,Gk=8,Gi=16,wv=26,Gm="vaul-dragging";function Hk(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function DK({defaultProp:e,onChange:t}){const n=O.useState(e),[r]=n,o=O.useRef(r),i=Hk(t);return O.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Wk({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=DK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Hk(n),l=O.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function kK({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:s,direction:a="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=Wk({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=O.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);O.useEffect(()=>{function I(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const g=O.useMemo(()=>c===n?.[n.length-1]||null,[n,c]),m=O.useMemo(()=>{var I;return(I=n?.findIndex(T=>T===c))!=null?I:null},[n,c]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,y=O.useMemo(()=>{const I=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n?.map(M=>{const V=typeof M=="string";let A=0;if(V&&(A=parseInt(M,10)),Xt(a)){const N=V?A:f?M*I.height:0;return f?a==="bottom"?I.height-N:-I.height+N:N}const P=V?A:f?M*I.width:0;return f?a==="right"?I.width-P:-I.width+P:P}))!=null?T:[]},[n,f,l]),x=O.useMemo(()=>m!==null?y?.[m]:null,[y,m]),w=O.useCallback(I=>{var T;const M=(T=y?.findIndex(V=>V===I))!=null?T:null;s(M),nn(r.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Xt(a)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`}),y&&M!==y.length-1&&i!==void 0&&M!==i&&M<i?nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"0"}):nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(M,0)])},[r.current,n,y,i,o,d]);O.useEffect(()=>{if(c||e){var I;const T=(I=n?.findIndex(M=>M===e||M===c))!=null?I:-1;y&&T!==-1&&typeof y[T]=="number"&&w(y[T])}},[c,e,n,y,w]);function C({draggedDistance:I,closeDrawer:T,velocity:M,dismissible:V}){if(i===void 0)return;const A=a==="bottom"||a==="right"?(x??0)-I:(x??0)+I,P=m===i-1,N=m===0,B=I>0;if(P&&nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),!u&&M>2&&!B){V?T():w(y[0]);return}if(!u&&M>2&&B&&y&&n){w(y[n.length-1]);return}const j=y?.reduce(($,G)=>typeof $!="number"||typeof G!="number"?$:Math.abs(G-A)<Math.abs($-A)?G:$),D=Xt(a)?window.innerHeight:window.innerWidth;if(M>$k&&Math.abs(I)<D*.4){const $=B?1:-1;if($>0&&g&&n){w(y[n.length-1]);return}if(N&&$<0&&V&&T(),m===null)return;w(y[m+$]);return}w(j)}function S({draggedDistance:I}){if(x===null)return;const T=a==="bottom"||a==="right"?x-I:x+I;(a==="bottom"||a==="right")&&T<y[y.length-1]||(a==="top"||a==="left")&&T>y[y.length-1]||nn(r.current,{transform:Xt(a)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function R(I,T){if(!n||typeof m!="number"||!y||i===void 0)return null;const M=m===i-1;if(m>=i&&T)return 0;if(M&&!T)return 1;if(!v&&!M)return null;const A=M?m+1:m-1,P=M?y[A]-y[A-1]:y[A+1]-y[A],N=I/Math.abs(P);return M?1-N:N}return{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:R,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:C,onDrag:S,snapPointsOffset:y}}const jK=()=>()=>{};function FK(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=xu(),i=O.useRef(null),s=O.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-wv)/window.innerWidth}O.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;PK(r&&!o?$m(document.body,{background:"black"}):jK,$m(l,{transformOrigin:Xt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`}));const u=$m(l,{borderRadius:`${Gk}px`,overflow:"hidden",...Xt(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},kt.DURATION*1e3)}}},[t,n,s])}let Wa=null;function LK({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[s,a]=O.useState(()=>typeof window<"u"?window.location.href:""),l=O.useRef(0),u=O.useCallback(()=>{if(aI()&&Wa===null&&e&&!i){Wa={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&l.current>=f&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),c=O.useCallback(()=>{if(aI()&&Wa!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Wa),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),Wa=null}},[s]);return O.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),O.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),O.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,r,s,t,n,u,c]),{restorePositionSetting:c}}function BK({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=_K,scrollLockTimeout:u=MK,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:x,noBodyStyles:w=!1,direction:C="bottom",defaultOpen:S=!1,disablePreventScroll:R=!0,snapToSequentialPoint:I=!1,preventScrollRestoration:T=!1,repositionInputs:M=!0,onAnimationEnd:V,container:A,autoFocus:P=!1}){var N,B;const[j=!1,D]=Wk({defaultProp:S,prop:e,onChange:ee=>{t?.(ee),!ee&&!x&&Xe(),setTimeout(()=>{V?.(ee)},kt.DURATION*1e3),ee&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[$,G]=O.useState(!1),[z,H]=O.useState(!1),[ne,W]=O.useState(!1),J=O.useRef(null),K=O.useRef(null),U=O.useRef(null),oe=O.useRef(null),X=O.useRef(null),te=O.useRef(!1),Q=O.useRef(null),se=O.useRef(0),ae=O.useRef(!1),F=O.useRef(!S),Z=O.useRef(0),k=O.useRef(null),ie=O.useRef(((N=k.current)==null?void 0:N.getBoundingClientRect().height)||0),Y=O.useRef(((B=k.current)==null?void 0:B.getBoundingClientRect().width)||0),le=O.useRef(0),pe=O.useCallback(ee=>{i&&ee===we.length-1&&(K.current=new Date)},[]),{activeSnapPoint:re,activeSnapPointIndex:fe,setActiveSnapPoint:de,onRelease:ve,snapPointsOffset:we,onDrag:Se,shouldFade:Ye,getPercentageDragged:at}=kK({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:k,fadeFromIndex:f,overlayRef:J,onSnapPointChange:pe,direction:C,container:A,snapToSequentialPoint:I});EK({isDisabled:!j||z||!v||ne||!$||!M||!R});const{restorePositionSetting:Xe}=LK({isOpen:j,modal:v,nested:x??!1,hasBeenOpened:$,preventScrollRestoration:T,noBodyStyles:w});function Ue(){return(window.innerWidth-wv)/window.innerWidth}function rt(ee){var ye,ge;!c&&!i||k.current&&!k.current.contains(ee.target)||(ie.current=((ye=k.current)==null?void 0:ye.getBoundingClientRect().height)||0,Y.current=((ge=k.current)==null?void 0:ge.getBoundingClientRect().width)||0,H(!0),U.current=new Date,Fk()&&window.addEventListener("touchend",()=>te.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),se.current=Xt(C)?ee.pageY:ee.pageX)}function et(ee,ye){var ge;let xe=ee;const Ae=(ge=window.getSelection())==null?void 0:ge.toString(),Ie=k.current?lc(k.current,C):null,qe=new Date;if(xe.tagName==="SELECT"||xe.hasAttribute("data-vaul-no-drag")||xe.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(K.current&&qe.getTime()-K.current.getTime()<500)return!1;if(Ie!==null&&(C==="bottom"?Ie>0:Ie<0))return!0;if(Ae&&Ae.length>0)return!1;if(X.current&&qe.getTime()-X.current.getTime()<u&&Ie===0||ye)return X.current=qe,!1;for(;xe;){if(xe.scrollHeight>xe.clientHeight){if(xe.scrollTop!==0)return X.current=new Date,!1;if(xe.getAttribute("role")==="dialog")return!0}xe=xe.parentNode}return!0}function gt(ee){if(k.current&&z){const ye=C==="bottom"||C==="right"?1:-1,ge=(se.current-(Xt(C)?ee.pageY:ee.pageX))*ye,xe=ge>0,Ae=i&&!c&&!xe;if(Ae&&fe===0)return;const Ie=Math.abs(ge),qe=document.querySelector("[data-vaul-drawer-wrapper]"),Pt=C==="bottom"||C==="top"?ie.current:Y.current;let lt=Ie/Pt;const it=at(Ie,xe);if(it!==null&&(lt=it),Ae&<>=1||!te.current&&!et(ee.target,xe))return;if(k.current.classList.add(Gm),te.current=!0,nn(k.current,{transition:"none"}),nn(J.current,{transition:"none"}),i&&Se({draggedDistance:ge}),xe&&!i){const Et=OK(ge),sn=Math.min(Et*-1,0)*ye;nn(k.current,{transform:Xt(C)?`translate3d(0, ${sn}px, 0)`:`translate3d(${sn}px, 0, 0)`});return}const _t=1-lt;if((Ye||f&&fe===f-1)&&(r?.(ee,lt),nn(J.current,{opacity:`${_t}`,transition:"none"},!0)),qe&&J.current&&s){const Et=Math.min(Ue()+lt*(1-Ue()),1),sn=8-lt*8,wr=Math.max(0,14-lt*14);nn(qe,{borderRadius:`${sn}px`,transform:Xt(C)?`scale(${Et}) translate3d(0, ${wr}px, 0)`:`scale(${Et}) translate3d(${wr}px, 0, 0)`,transition:"none"},!0)}if(!i){const Et=Ie*ye;nn(k.current,{transform:Xt(C)?`translate3d(0, ${Et}px, 0)`:`translate3d(${Et}px, 0, 0)`})}}}O.useEffect(()=>{window.requestAnimationFrame(()=>{F.current=!0})},[]),O.useEffect(()=>{var ee;function ye(){if(!k.current||!M)return;const ge=document.activeElement;if(xv(ge)||ae.current){var xe;const Ae=((xe=window.visualViewport)==null?void 0:xe.height)||0,Ie=window.innerHeight;let qe=Ie-Ae;const Pt=k.current.getBoundingClientRect().height||0,lt=Pt>Ie*.8;le.current||(le.current=Pt);const it=k.current.getBoundingClientRect().top;if(Math.abs(Z.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&we&&fe){const _t=we[fe]||0;qe+=_t}if(Z.current=qe,Pt>Ae||ae.current){const _t=k.current.getBoundingClientRect().height;let Et=_t;_t>Ae&&(Et=Ae-(lt?it:wv)),m?k.current.style.height=`${_t-Math.max(qe,0)}px`:k.current.style.height=`${Math.max(Et,Ae-it)}px`}else bK()||(k.current.style.height=`${le.current}px`);i&&i.length>0&&!ae.current?k.current.style.bottom="0px":k.current.style.bottom=`${Math.max(qe,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",ye),()=>{var ge;return(ge=window.visualViewport)==null?void 0:ge.removeEventListener("resize",ye)}},[fe,i,we]);function ct(ee){mt(),y?.(),ee||D(!1),setTimeout(()=>{i&&de(i[0])},kt.DURATION*1e3)}function ot(){if(!k.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),ye=lc(k.current,C);nn(k.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),nn(J.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),s&&ye&&ye>0&&j&&nn(ee,{borderRadius:`${Gk}px`,overflow:"hidden",...Xt(C)?{transform:`scale(${Ue()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ue()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`},!0)}function mt(){!z||!k.current||(k.current.classList.remove(Gm),te.current=!1,H(!1),oe.current=new Date)}function Ot(ee){if(!z||!k.current)return;k.current.classList.remove(Gm),te.current=!1,H(!1),oe.current=new Date;const ye=lc(k.current,C);if(!ee||!et(ee.target,!1)||!ye||Number.isNaN(ye)||U.current===null)return;const ge=oe.current.getTime()-U.current.getTime(),xe=se.current-(Xt(C)?ee.pageY:ee.pageX),Ae=Math.abs(xe)/ge;if(Ae>.05&&(W(!0),setTimeout(()=>{W(!1)},200)),i){ve({draggedDistance:xe*(C==="bottom"||C==="right"?1:-1),closeDrawer:ct,velocity:Ae,dismissible:c}),o?.(ee,!0);return}if(C==="bottom"||C==="right"?xe>0:xe<0){ot(),o?.(ee,!0);return}if(Ae>$k){ct(),o?.(ee,!1);return}var Ie;const qe=Math.min((Ie=k.current.getBoundingClientRect().height)!=null?Ie:0,window.innerHeight);var Pt;const lt=Math.min((Pt=k.current.getBoundingClientRect().width)!=null?Pt:0,window.innerWidth),it=C==="left"||C==="right";if(Math.abs(ye)>=(it?lt:qe)*l){ct(),o?.(ee,!1);return}o?.(ee,!0),ot()}O.useEffect(()=>(j&&(nn(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{NK(document.documentElement,"scrollBehavior")}),[j]);function Bt(ee){const ye=ee?(window.innerWidth-Gi)/window.innerWidth:1,ge=ee?-Gi:0;Q.current&&window.clearTimeout(Q.current),nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Xt(C)?`scale(${ye}) translate3d(0, ${ge}px, 0)`:`scale(${ye}) translate3d(${ge}px, 0, 0)`}),!ee&&k.current&&(Q.current=setTimeout(()=>{const xe=lc(k.current,C);nn(k.current,{transition:"none",transform:Xt(C)?`translate3d(0, ${xe}px, 0)`:`translate3d(${xe}px, 0, 0)`})},500))}function tt(ee,ye){if(ye<0)return;const ge=(window.innerWidth-Gi)/window.innerWidth,xe=ge+ye*(1-ge),Ae=-Gi+ye*Gi;nn(k.current,{transform:Xt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`,transition:"none"})}function Ze(ee,ye){const ge=Xt(C)?window.innerHeight:window.innerWidth,xe=ye?(ge-Gi)/ge:1,Ae=ye?-Gi:0;ye&&nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Xt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`})}return O.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),O.createElement(Jl,{defaultOpen:S,onOpenChange:ee=>{!c&&!ee||(ee?G(!0):ct(!0),D(ee))},open:j},O.createElement(jk.Provider,{value:{activeSnapPoint:re,snapPoints:i,setActiveSnapPoint:de,drawerRef:k,overlayRef:J,onOpenChange:t,onPress:rt,onRelease:Ot,onDrag:gt,dismissible:c,shouldAnimate:F,handleOnly:d,isOpen:j,isDragging:z,shouldFade:Ye,closeDrawer:ct,onNestedDrag:tt,onNestedOpenChange:Bt,onNestedRelease:Ze,keyboardIsOpen:ae,modal:v,snapPointsOffset:we,activeSnapPointIndex:fe,direction:C,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:w,container:A,autoFocus:P}},n))}const zk=O.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:s,modal:a,shouldAnimate:l}=xu(),u=Bk(t,n),c=r&&r.length>0;if(!a)return null;const d=O.useCallback(f=>o(f),[o]);return O.createElement(Ql,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&c?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});zk.displayName="Drawer.Overlay";const qk=O.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:s,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:x,autoFocus:w}=xu(),[C,S]=O.useState(!1),R=Bk(o,i),I=O.useRef(null),T=O.useRef(null),M=O.useRef(!1),V=m&&m.length>0;FK();const A=(N,B,j=0)=>{if(M.current)return!0;const D=Math.abs(N.y),$=Math.abs(N.x),G=$>D,z=["bottom","right"].includes(B)?1:-1;if(B==="left"||B==="right"){if(!(N.x*z<0)&&$>=0&&$<=j)return G}else if(!(N.y*z<0)&&D>=0&&D<=j)return!G;return M.current=!0,!0};O.useEffect(()=>{V&&window.requestAnimationFrame(()=>{S(!0)})},[]);function P(N){I.current=null,M.current=!1,a(N)}return O.createElement(eu,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":p&&V?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[d??0]}px`,...t}:t,onPointerDown:N=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,N),I.current={x:N.pageX,y:N.pageY},s(N))},onOpenAutoFocus:N=>{n?.(N),w||N.preventDefault()},onPointerDownOutside:N=>{if(e?.(N),!f||N.defaultPrevented){N.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:N=>{if(!f){N.preventDefault();return}},onPointerMove:N=>{if(T.current=N,y||(r.onPointerMove==null||r.onPointerMove.call(r,N),!I.current))return;const B=N.pageY-I.current.y,j=N.pageX-I.current.x,D=N.pointerType==="touch"?10:2;A({x:j,y:B},g,D)?l(N):(Math.abs(j)>D||Math.abs(B)>D)&&(I.current=null)},onPointerUp:N=>{r.onPointerUp==null||r.onPointerUp.call(r,N),I.current=null,M.current=!1,a(N)},onPointerOut:N=>{r.onPointerOut==null||r.onPointerOut.call(r,N),P(T.current)},onContextMenu:N=>{r.onContextMenu==null||r.onContextMenu.call(r,N),T.current&&P(T.current)}})});qk.displayName="Drawer.Content";const VK=250,$K=120,GK=O.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:f,onDrag:p}=xu(),g=O.useRef(null),m=O.useRef(!1);function v(){if(m.current){w();return}window.setTimeout(()=>{y()},$K)}function y(){if(i||e||m.current){w();return}if(w(),!s||s.length===0){u||o();return}if(a===s[s.length-1]&&u){o();return}const S=s.findIndex(I=>I===a);if(S===-1)return;const R=s[S+1];l(R)}function x(){g.current=window.setTimeout(()=>{m.current=!0},VK)}function w(){g.current&&window.clearTimeout(g.current),m.current=!1}return O.createElement("div",{onClick:v,onPointerCancel:w,onPointerDown:C=>{c&&f(C),x()},onPointerMove:C=>{c&&p(C)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},O.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});GK.displayName="Drawer.Handle";function HK(e){const t=xu(),{container:n=t.container,...r}=e;return O.createElement(Kl,{container:n,...r})}const Ri={Root:BK,Content:qk,Overlay:zk,Trigger:Ld,Portal:HK,Close:fs,Title:Bd,Description:Vd};function WK({...e}){return h.jsx(Ri.Root,{"data-slot":"drawer",...e})}function zK({...e}){return h.jsx(Ri.Trigger,{"data-slot":"drawer-trigger",...e})}function Uk({...e}){return h.jsx(Ri.Portal,{"data-slot":"drawer-portal",...e})}function qK({...e}){return h.jsx(Ri.Close,{"data-slot":"drawer-close",...e})}function Yk({className:e,...t}){return h.jsx(Ri.Overlay,{"data-slot":"drawer-overlay",className:L("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function UK({className:e,children:t,...n}){return h.jsxs(Uk,{"data-slot":"drawer-portal",children:[h.jsx(Yk,{}),h.jsxs(Ri.Content,{"data-slot":"drawer-content",className:L("ui:group/drawer-content ui:bg-background ui:fixed ui:flex ui:h-auto ui:flex-col ui:rounded-t-[10px] ui:z-100 ui:mt-24","ui:data-[vaul-drawer-direction=top]:inset-x-0 ui:data-[vaul-drawer-direction=top]:top-0 ui:data-[vaul-drawer-direction=top]:mb-24 ui:data-[vaul-drawer-direction=top]:max-h-[80vh] ui:data-[vaul-drawer-direction=top]:rounded-b-lg ui:data-[vaul-drawer-direction=top]:border-b","ui:data-[vaul-drawer-direction=bottom]:inset-x-0 ui:data-[vaul-drawer-direction=bottom]:bottom-0 ui:data-[vaul-drawer-direction=bottom]:mt-24 ui:data-[vaul-drawer-direction=bottom]:max-h-[80vh] ui:data-[vaul-drawer-direction=bottom]:rounded-t-lg ui:data-[vaul-drawer-direction=bottom]:border-t","ui:data-[vaul-drawer-direction=right]:inset-y-0 ui:data-[vaul-drawer-direction=right]:right-0 ui:data-[vaul-drawer-direction=right]:w-3/4 ui:data-[vaul-drawer-direction=right]:border-l ui:data-[vaul-drawer-direction=right]:sm:max-w-sm","ui:data-[vaul-drawer-direction=left]:inset-y-0 ui:data-[vaul-drawer-direction=left]:left-0 ui:data-[vaul-drawer-direction=left]:w-3/4 ui:data-[vaul-drawer-direction=left]:border-r ui:data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[h.jsx("div",{className:"ui:bg-muted ui:mx-auto ui:mt-4 ui:hidden ui:h-2 ui:w-[100px] ui:shrink-0 ui:rounded-full ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function YK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-header",className:L("ui:flex ui:flex-col ui:gap-0.5 ui:p-4 ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center ui:group-data-[vaul-drawer-direction=top]/drawer-content:text-center ui:md:gap-1.5 ui:md:text-left",e),...t})}function XK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-footer",className:L("ui:mt-auto ui:flex ui:flex-col ui:gap-2 ui:p-4",e),...t})}function ZK({className:e,...t}){return h.jsx(Ri.Title,{"data-slot":"drawer-title",className:L("ui:text-foreground ui:font-semibold",e),...t})}function JK({className:e,...t}){return h.jsx(Ri.Description,{"data-slot":"drawer-description",className:L("ui:text-muted-foreground ui:text-sm",e),...t})}function s0({...e}){return h.jsx(P3,{"data-slot":"dropdown-menu",...e})}function KK({...e}){return h.jsx(sO,{"data-slot":"dropdown-menu-portal",...e})}function a0({...e}){return h.jsx(_3,{"data-slot":"dropdown-menu-trigger",...e})}function l0({className:e,sideOffset:t=4,...n}){return h.jsx(sO,{children:h.jsx(M3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:L("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:max-h-(--radix-dropdown-menu-content-available-height) ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-x-hidden ui:overflow-y-auto ui:rounded-md ui:border ui:p-1 ui:shadow-md",e),...n})})}function QK({...e}){return h.jsx(D3,{"data-slot":"dropdown-menu-group",...e})}function Xk({className:e,inset:t,variant:n="default",...r}){return h.jsx(j3,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[variant=destructive]:text-destructive ui:data-[variant=destructive]:focus:bg-destructive/10 ui:dark:data-[variant=destructive]:focus:bg-destructive/20 ui:data-[variant=destructive]:focus:text-destructive ui:data-[variant=destructive]:*:[svg]:!text-destructive ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r})}function Cv({className:e,children:t,checked:n,...r}){return h.jsxs(F3,{"data-slot":"dropdown-menu-checkbox-item",className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(aO,{children:h.jsx(Oe.CheckIcon,{className:"ui:size-4"})})}),t]})}function eQ({...e}){return h.jsx(L3,{"data-slot":"dropdown-menu-radio-group",...e})}function tQ({className:e,children:t,...n}){return h.jsxs(B3,{"data-slot":"dropdown-menu-radio-item",className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(aO,{children:h.jsx(Oe.CircleIcon,{className:"ui:size-2 ui:fill-current"})})}),t]})}function nQ({className:e,inset:t,...n}){return h.jsx(k3,{"data-slot":"dropdown-menu-label","data-inset":t,className:L("ui:px-2 ui:py-1.5 ui:text-sm ui:font-medium ui:data-[inset]:pl-8",e),...n})}function rQ({className:e,...t}){return h.jsx(V3,{"data-slot":"dropdown-menu-separator",className:L("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function oQ({className:e,...t}){return h.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:L("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}function iQ({...e}){return h.jsx($3,{"data-slot":"dropdown-menu-sub",...e})}function sQ({className:e,inset:t,children:n,...r}){return h.jsxs(G3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[state=open]:bg-accent ui:data-[state=open]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(Oe.ChevronRightIcon,{className:"ui:ml-auto ui:size-4"})]})}function aQ({className:e,...t}){return h.jsx(H3,{"data-slot":"dropdown-menu-sub-content",className:L("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-hidden ui:rounded-md ui:border ui:p-1 ui:shadow-lg",e),...t})}function lQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:L("ui:flex ui:min-w-0 ui:flex-1 ui:flex-col ui:items-center ui:justify-center ui:gap-6 ui:rounded-lg ui:border-dashed ui:p-6 ui:text-center ui:text-balance ui:md:p-12",e),...t})}function uQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:L("ui:flex ui:max-w-sm ui:flex-col ui:items-center ui:gap-2 ui:text-center",e),...t})}const cQ=Si("ui:flex ui:shrink-0 ui:items-center ui:justify-center ui:mb-2 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0",{variants:{variant:{default:"ui:bg-transparent",icon:"ui:bg-muted ui:text-foreground ui:flex ui:size-10 ui:shrink-0 ui:items-center ui:justify-center ui:rounded-lg ui:[&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function dQ({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:L(cQ({variant:t,className:e})),...n})}function fQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:L("ui:text-lg ui:font-medium ui:tracking-tight",e),...t})}function pQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:L("ui:text-muted-foreground ui:[&>a:hover]:text-primary ui:text-sm/relaxed ui:[&>a]:underline ui:[&>a]:underline-offset-4",e),...t})}function hQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-content",className:L("ui:flex ui:w-full ui:max-w-sm ui:min-w-0 ui:flex-col ui:items-center ui:gap-4 ui:text-sm ui:text-balance",e),...t})}function Zk({message:e,className:t}){return h.jsx("p",{className:L("ui:text-red-500 ui:text-xs ui:mt-2 ui:has-error",t),children:e})}const Jk=b.createContext(null),Kk=b.createContext(null),Ff=()=>{const e=b.useContext(Jk),t=b.useContext(Kk);if(!e)throw new Error("useFormField must be used within <FormField>");if(!t)throw new Error("useFormField must be used within <FormItem>");const{id:n}=t,{name:r,error:o}=e;return{name:r,error:o,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`}},Fn=e=>h.jsx(Mn.Controller,{...e,render:t=>h.jsx(Jk.Provider,{value:{name:e.name,error:t.fieldState.error},children:e.render?.(t)})});function An({className:e,...t}){const n=b.useId();return h.jsx(Kk.Provider,{value:{id:n},children:h.jsx("div",{"data-slot":"form-item",className:L("ui:grid ui:gap-2",e),...t})})}function mr({className:e,required:t=!1,...n}){const{error:r,formItemId:o}=Ff();return h.jsxs(yr,{"data-slot":"form-label","data-error":!!r,htmlFor:o,className:L("ui:text-sm",r?"ui:text-destructive":"ui:text-black-950",e),...n,children:[n.children,t&&h.jsx("span",{className:"ui:text-destructive ml-1",children:"*"})]})}function qn(e){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=Ff();return h.jsx(Bo,{"data-slot":"form-control",id:n,"aria-invalid":!!t,"aria-describedby":t?`${r} ${o}`:r,...e})}function xr({className:e,...t}){const{formDescriptionId:n}=Ff();return h.jsx("p",{"data-slot":"form-description",id:n,className:L("ui:text-muted-foreground ui:text-sm",e),...t})}function Ln({className:e,showErrorPlaceholder:t,...n}){const{error:r,formMessageId:o}=Ff(),i=r?String(r.message??""):n.children;return i?h.jsx("p",{"data-slot":"form-message",id:o,className:L("ui:text-destructive ui:text-sm",e),...n,children:i}):t?h.jsx("p",{className:"ui:h-4"}):null}const Oc=({name:e,control:t,containerClassName:n,...r})=>{const o=Mn.useFormContext(),i=t??o?.control;if(!i)throw new Error("FormCheckbox must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:i,name:e,render:({field:s})=>h.jsxs(An,{className:n,children:[h.jsx(qn,{children:h.jsx(aD,{...s,checked:!!s.value,onCheckedChange:s.onChange,...r})}),h.jsx(Ln,{})]})})};function u0({delayDuration:e=0,...t}){return h.jsx(d9,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function c0({...e}){return h.jsx(u0,{children:h.jsx(f9,{"data-slot":"tooltip",...e})})}function d0({...e}){return h.jsx(p9,{"data-slot":"tooltip-trigger",...e})}function Lf({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(f_,{children:h.jsxs(p_,{"data-slot":"tooltip-content",sideOffset:t,className:L("ui:bg-foreground ui:text-background ui:animate-in ui:fade-in-0 ui:zoom-in-95 ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=closed]:zoom-out-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-fit ui:origin-(--radix-tooltip-content-transform-origin) ui:rounded-md ui:px-3 ui:py-1.5 ui:text-xs ui:text-balance",e),...r,children:[n,h.jsx(h9,{className:"ui:bg-foreground ui:fill-foreground ui:z-50 ui:size-2.5 ui:translate-y-[calc(-50%-2px)] ui:rotate-45 ui:rounded-[2px]"})]})})}const Qk=b.forwardRef(({children:e,...t},n)=>h.jsx(f_,{children:h.jsx(Lf,{ref:n,...t,children:e})}));Qk.displayName=p_.displayName;const ys=({trigger:e,content:t,asChild:n=!0,wrapTrigger:r=!0,triggerClassName:o="",contentClassName:i="ui:max-w-sm",disableContent:s=!1,isPortal:a=!1})=>s?e:h.jsxs(c0,{children:[h.jsx(d0,{asChild:n,children:r?h.jsx("div",{className:L("ui:truncate",o),children:e}):e}),a?h.jsx(Qk,{className:i,children:t}):h.jsx(Lf,{className:i,children:t})]}),gQ=({name:e,label:t,placeholder:n,items:r=[],description:o,multiple:i=!1,emptyMessage:s="No results found",containerClassName:a,hasClearButton:l=!1,hasAllOption:u=!1,allOptionLabel:c="All",disabled:d=!1,tooltipContent:f,control:p,inputMode:g="input"})=>{const m=Mn.useFormContext(),v=p??m?.control;if(!v)throw new Error("FormCombobox must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:v,name:e,render:({field:y})=>h.jsxs(An,{className:L("ui:flex ui:flex-col",a),children:[t&&h.jsxs(mr,{className:L({"ui:flex ui:items-center ui:gap-2":!!f}),children:[t,f&&h.jsx(ys,{triggerClassName:"ui:order-last",content:f,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(r0,{items:r,multiple:i,value:y.value,onValueChange:y.onChange,placeholder:n,emptyMessage:s,disabled:d,hasClearButton:l,hasAllOption:u,allOptionLabel:c,inputMode:g}),o&&h.jsx(xr,{children:o}),h.jsx(Ln,{})]})})};function e2({...e}){return h.jsx(oH,{"data-slot":"select",...e})}function mQ({...e}){return h.jsx(dH,{"data-slot":"select-group",...e})}function t2({...e}){return h.jsx(sH,{"data-slot":"select-value",...e})}function n2({className:e,size:t="default",children:n,...r}){return h.jsxs(iH,{"data-slot":"select-trigger","data-size":t,className:L("ui:flex ui:h-10 ui:w-full ui:items-center ui:justify-between ui:rounded-md ui:border-solid ui:border ui:border-input ui:bg-background ui:px-3 ui:py-2 ui:text-sm ui:placeholder:text-muted-foreground ui:hover:bg-background ui:focus:outline-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:[&>span]:line-clamp-1",e),...r,children:[n,h.jsx(aH,{asChild:!0,children:h.jsx(Oe.ChevronDownIcon,{className:"ui:size-4 ui:opacity-50"})})]})}function r2({className:e,children:t,position:n="item-aligned",isPortal:r=!1,align:o="center",style:i,...s}){const a=Nk(),l=a!=null?{zIndex:a+1,...i}:i,u=h.jsxs(uH,{"data-slot":"select-content",className:L("ui:relative ui:z-50 ui:max-h-96 ui:min-w-32 ui:overflow-hidden ui:rounded-md ui:border ui:bg-popover ui:text-popover-foreground ui:shadow-md ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"ui:data-[side=bottom]:translate-y-1 ui:data-[side=left]:-translate-x-1 ui:data-[side=right]:translate-x-1 ui:data-[side=top]:-translate-y-1",e),position:n,align:o,style:l,...s,children:[h.jsx(i2,{}),h.jsx(cH,{className:L("ui:p-1",n==="popper"&&"ui:h-(--radix-select-trigger-height) ui:w-full ui:min-w-(--radix-select-trigger-width) ui:scroll-my-1"),children:t}),h.jsx(s2,{})]});return r?h.jsx(lH,{children:u}):u}function bQ({className:e,...t}){return h.jsx(fH,{"data-slot":"select-label",className:L("ui:text-muted-foreground ui:px-2 ui:py-1.5 ui:text-xs",e),...t})}function o2({className:e,children:t,...n}){return h.jsxs(pH,{"data-slot":"select-item",className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4 ui:*:[span]:last:flex ui:*:[span]:last:items-center ui:*:[span]:last:gap-2",e),...n,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"ui:absolute ui:right-2 ui:flex ui:size-3.5 ui:items-center ui:justify-center",children:h.jsx(gH,{children:h.jsx(Oe.CheckIcon,{className:"ui:size-4"})})}),h.jsx(hH,{children:t})]})}function vQ({className:e,...t}){return h.jsx(vH,{"data-slot":"select-separator",className:L("ui:bg-border ui:pointer-events-none ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function i2({className:e,...t}){return h.jsx(mH,{"data-slot":"select-scroll-up-button",className:L("ui:flex ui:cursor-default ui:items-center ui:justify-center ui:py-1",e),...t,children:h.jsx(Oe.ChevronUpIcon,{className:"ui:size-4"})})}function s2({className:e,...t}){return h.jsx(bH,{"data-slot":"select-scroll-down-button",className:L("ui:flex ui:cursor-default ui:items-center ui:justify-center ui:py-1",e),...t,children:h.jsx(Oe.ChevronDownIcon,{className:"ui:size-4"})})}const yQ=({hasFormControlWrapper:e=!1,children:t})=>e?h.jsx(qn,{children:t}):t,f0=({options:e,placeholder:t,hasFormControlWrapper:n=!1,selectContentClassName:r,onChange:o,value:i,label:s,triggerClassName:a,labelClassName:l,containerClassName:u,isPortal:c=!1,...d})=>h.jsxs("article",{className:u,children:[s&&h.jsx(yr,{className:L("ui:mb-2 ui:block",l),children:s}),h.jsxs(e2,{onValueChange:o,value:i,...d,children:[h.jsx(yQ,{hasFormControlWrapper:n,children:h.jsx(n2,{className:L("ui:h-10",a),children:h.jsx(t2,{placeholder:t})})}),h.jsx(r2,{className:r,isPortal:c,children:e.map(f=>h.jsx(o2,{value:f.value,children:f.label},f.value))})]})]}),xQ=({name:e,label:t,options:n,placeholder:r,description:o,tooltipContent:i,hasRequiredIndicator:s=!1,containerClassName:a,control:l,...u})=>{const c=Mn.useFormContext(),d=l??c?.control;if(!d)throw new Error("FormSelect must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:d,name:e,render:({field:f})=>h.jsxs(An,{className:L("ui:w-full",a),children:[h.jsxs(mr,{className:i?"ui:flex ui:items-center ui:gap-2":void 0,children:[t,s&&h.jsx("span",{className:"ui:text-destructive",children:"*"}),i&&h.jsx(ys,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(f0,{...u,options:n,placeholder:r,hasFormControlWrapper:!0,value:f.value??"",onChange:p=>{f.onChange(p),f.onBlur()}}),o&&h.jsx(xr,{children:o}),h.jsx(Ln,{})]})})},wQ=({name:e,label:t,description:n,containerClassName:r,showErrorPlaceholder:o,step:i=60})=>{const{control:s}=Mn.useFormContext();return h.jsx(Fn,{control:s,name:e,render:({field:a})=>h.jsxs(An,{className:L("ui:flex ui:flex-col ui:gap-2 ui:w-full ui:space-y-0",r),children:[t&&h.jsx(mr,{children:t}),h.jsx(qn,{children:h.jsx(xa,{type:"time",step:i,className:"ui:bg-background ui:appearance-none [&::-webkit-calendar-picker-indicator]:ui:hidden [&::-webkit-calendar-picker-indicator]:ui:appearance-none",...a})}),n&&h.jsx(xr,{children:n}),h.jsx(Ln,{showErrorPlaceholder:o})]})})},CQ=({name:e,control:t,disabledCondition:n=!1,label:r,placeholder:o,description:i,containerClassName:s,triggerClassName:a,showErrorPlaceholder:l})=>{const u=Mn.useFormContext(),c=t??u?.control;if(!c)throw new Error("FormDatePicker must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:c,name:e,render:({field:d})=>h.jsxs(An,{className:L("ui:flex ui:flex-col",s),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(mr,{children:r})})}),h.jsxs(o0,{children:[h.jsx(qn,{children:h.jsx(kf,{asChild:!0,children:h.jsxs(Ut,{variant:"outline",className:L("ui:w-[240px] ui:pl-3 ui:text-left ui:font-normal",!d.value&&"ui:text-muted-foreground",a),children:[d.value?ti(new Date(d.value),"dd/MM/yyyy"):h.jsx("span",{children:o}),h.jsx(Oe.CalendarIcon,{className:"ui:ml-auto ui:h-4 ui:w-4 ui:opacity-50"})]})})}),h.jsx(jf,{className:"ui:w-auto ui:p-0",align:"start",children:h.jsx(nx,{mode:"single",selected:d.value?new Date(d.value):void 0,onSelect:f=>{f&&d.onChange(f)},disabled:n,initialFocus:!0})})]}),h.jsx(In,{children:h.jsx(Vt,{condition:!!i,children:h.jsx(xr,{children:i})})}),h.jsx(Ln,{showErrorPlaceholder:l})]})})},SQ=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},EQ=e=>e.type.startsWith("image/"),IQ=({uploadedFile:e,onRemove:t})=>h.jsx("div",{className:"ui:p-3 ui:bg-muted/50 ui:border ui:border-border ui:rounded-lg",children:h.jsxs("div",{className:"ui:flex ui:items-center ui:justify-between ui:gap-3",children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-3 ui:min-w-0",children:[EQ(e.file)?h.jsx("img",{src:e.url,alt:e.file.name,className:"ui:shrink-0 ui:w-10 ui:h-10 ui:object-cover ui:rounded-md"}):h.jsx("div",{className:"ui:shrink-0 ui:p-2 ui:bg-primary/10 ui:rounded-md",children:h.jsx(Oe.FileText,{size:20,className:"ui:text-primary"})}),h.jsxs("div",{className:"ui:min-w-0",children:[h.jsx("p",{className:"ui:text-sm ui:font-medium ui:text-foreground ui:truncate",children:e.file.name}),h.jsx("p",{className:"ui:text-xs ui:text-muted-foreground",children:SQ(e.file.size)})]})]}),h.jsx(Do,{variant:"ghost",size:"sm",isIconOnly:!0,onClick:t,icon:h.jsx(Oe.X,{size:16}),className:L("ui:shrink-0 ui:text-muted-foreground","ui:hover:text-destructive ui:hover:bg-destructive/10")})]})}),a2=({name:e,control:t,label:n,uploadButtonLabel:r="Upload File",uploadingLabel:o="Uploading...",uploadFailedMessage:i="Upload failed",description:s,accept:a="*",disabled:l=!1,multiple:u=!1,containerClassName:c,tooltipContent:d,hasRequiredIndicator:f=!1,onUpload:p})=>{const g=Mn.useFormContext(),m=t??g?.control;if(!m)throw new Error("FormFileUpload must be used within a FormProvider or receive a control prop");const v=O.useRef(null),[y,x]=O.useState(!1),w=async(S,R,I)=>{const T=S.target.files;if(T?.length){x(!0);try{if(u){const M=Array.from(T),V=[];for(const P of M){const N=p?await p(P):URL.createObjectURL(P);V.push({file:P,url:N})}const A=Array.isArray(I)?I:[];R([...A,...V])}else{const M=T[0],V=p?await p(M):URL.createObjectURL(M);R({file:M,url:V})}}catch(M){const V=M instanceof Error?M.message:i;ey.toast.error(V)}finally{x(!1),v.current&&(v.current.value="")}}},C=(S,R,I)=>{if(u&&Array.isArray(R)&&I){const T=R.filter(M=>M!==I);S(T.length>0?T:null)}else S(null);v.current&&(v.current.value="")};return h.jsx(Fn,{control:m,name:e,render:({field:S})=>{const R=S.value,I=u?Array.isArray(R)?R:[]:R&&"file"in R?[R]:[];return h.jsxs(An,{className:L("ui:w-full",c),children:[n&&h.jsxs(mr,{className:L({"ui:flex ui:items-center ui:gap-2":!!d}),children:[n,f&&h.jsx("span",{children:"*"}),d&&h.jsx(ys,{content:d,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:text-muted-foreground ui:cursor-pointer"})})]}),h.jsx(qn,{children:h.jsxs("div",{className:"ui:space-y-3",children:[h.jsxs("div",{className:"ui:relative ui:inline-block",children:[h.jsx("input",{ref:v,type:"file",accept:a,multiple:u,onChange:T=>w(T,S.onChange,R),disabled:l||y,className:L("ui:absolute ui:inset-0 ui:w-full ui:h-full ui:opacity-0 ui:cursor-pointer","ui:disabled:cursor-not-allowed")}),h.jsx(Do,{variant:"outline",label:y?o:r,icon:y?h.jsx(Oe.Loader2,{size:16,className:"ui:animate-spin"}):h.jsx(Oe.Upload,{size:16}),disabled:l||y})]}),I.length>0&&h.jsx("div",{className:"ui:space-y-2",children:I.map((T,M)=>h.jsx(IQ,{uploadedFile:T,onRemove:()=>C(S.onChange,R,T)},`${T.file.name}-${T.file.size}-${M}`))})]})}),h.jsx(Ln,{}),s&&h.jsx(xr,{children:s})]})}})};a2.displayName="FormFileUpload";const Bf=O.forwardRef(({name:e,label:t,labelVariant:n,type:r="text",value:o,onChange:i,description:s="",placeholder:a,className:l,inputClassName:u,isReadOnly:c=!1,readOnly:d,hasRequiredIndicator:f=!1,...p},g)=>h.jsxs("article",{className:l,children:[t&&h.jsxs(yr,{variant:n,className:"ui:mb-2",children:[t,f&&h.jsx("span",{className:"ui:text-destructive",children:"*"})]}),h.jsx(xa,{ref:g,"data-test-id":e,name:e,placeholder:a,value:o,type:r,onChange:i,readOnly:c||d,className:L({"ui:pointer-events-none ui:opacity-30":c||d},u),...p}),s&&h.jsx(Af,{description:s})]}));Bf.displayName="InputField";const RQ=({label:e,containerClassName:t,inputClassName:n,name:r,description:o,placeholder:i="",tooltipContent:s,hasRequiredIndicator:a=!1,control:l,type:u="text",...c})=>{const d=Mn.useFormContext(),f=l??d?.control;if(!f)throw new Error("FormInput must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:f,name:r,render:({field:p})=>h.jsxs(An,{className:L("ui:w-full",t),children:[h.jsxs(mr,{className:s?"ui:flex ui:items-center ui:gap-2":void 0,children:[e,a&&h.jsx("span",{className:"ui:text-destructive",children:"*"}),s&&h.jsx(ys,{content:s,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(qn,{children:h.jsx(Bf,{...p,...c,type:u,placeholder:i,inputClassName:L(n)})}),o&&h.jsx(xr,{children:o}),h.jsx(Ln,{})]})})},AQ=({label:e,name:t,containerClassName:n,description:r,placeholder:o,tooltipContent:i,control:s,hasRequiredIndicator:a=!1,...l})=>{const u=Mn.useFormContext(),c=s??u?.control;if(!c)throw new Error("FormPassword must be used within a FormProvider or receive a control prop");const[d,f]=O.useState(!1),p=()=>{f(g=>!g)};return h.jsx(Fn,{control:c,name:t,render:({field:g})=>h.jsxs(An,{className:L("ui:w-full",n),children:[e&&h.jsxs(mr,{className:L({"ui:flex ui:items-center ui:gap-2":!!i}),children:[e,a&&h.jsx("span",{children:"*"}),i&&h.jsx(ys,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(qn,{children:h.jsxs("div",{className:"ui:relative",children:[h.jsx(Bf,{...g,...l,type:d?"text":"password",placeholder:o,hasRequiredIndicator:a,inputClassName:"pr-8"}),h.jsx("button",{type:"button",onClick:p,className:"ui:absolute ui:right-3 ui:top-1/2 ui:-translate-y-1/2 ui:text-muted-foreground ui:hover:text-foreground ui:transition-colors",tabIndex:-1,children:d?h.jsx(Oe.EyeOff,{size:16,className:"ui:cursor-pointer"}):h.jsx(Oe.Eye,{size:16,className:"ui:cursor-pointer"})})]})}),r&&h.jsx(xr,{children:r}),h.jsx(Ln,{})]})})};function l2({className:e,...t}){return h.jsx(wG,{"data-slot":"radio-group",className:L("ui:grid ui:gap-3",e),...t})}function u2({className:e,...t}){return h.jsx(CG,{"data-slot":"radio-group-item",className:L("ui:p-0! ui:aspect-square ui:h-4 ui:w-4 ui:rounded-full ui:border ui:border-solid ui:border-primary ui:text-primary ui:bg-transparent ui:hover:bg-transparent ui:ring-offset-background ui:focus:outline-none ui:focus-visible:ring-2 ui:focus-visible:ring-ring ui:focus-visible:ring-offset-2 ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:transition-none",e),...t,children:h.jsx(SG,{"data-slot":"radio-group-indicator",className:"ui:relative ui:flex ui:items-center ui:justify-center",children:h.jsx(Oe.CircleIcon,{className:"ui:fill-primary ui:absolute ui:top-1/2 ui:left-1/2 ui:size-2 ui:-translate-x-1/2 ui:-translate-y-1/2"})})})}const TQ=({name:e,label:t,items:n,control:r,containerClassName:o,itemClassName:i,itemLabelClassName:s,selectedClassName:a,description:l})=>{const u=Mn.useFormContext(),c=r??u?.control;if(!c)throw new Error("FormRadio must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:c,name:e,render:({field:d})=>h.jsxs(An,{className:L("ui:space-y-3",o),children:[t&&h.jsx(mr,{children:t}),h.jsx(qn,{children:h.jsx(l2,{onValueChange:d.onChange,defaultValue:d.value,className:"ui:flex ui:flex-col ui:space-y-1",children:n.map(f=>h.jsxs(An,{className:L("ui:flex ui:items-center ui:space-y-0",i,d.value===f.value&&a),children:[h.jsx(qn,{children:h.jsx(u2,{value:f.value})}),h.jsx(mr,{className:L("ui:font-normal",s),children:f.label})]},f.value))})}),h.jsx(Ln,{}),l&&h.jsx(xr,{children:l})]})})};function c2({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const s=b.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return h.jsxs(DH,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:L("ui:relative ui:flex ui:w-full ui:touch-none ui:items-center ui:select-none ui:data-[disabled]:opacity-50 ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:min-h-44 ui:data-[orientation=vertical]:w-auto ui:data-[orientation=vertical]:flex-col",e),...i,children:[h.jsx(kH,{"data-slot":"slider-track",className:L("ui:bg-muted ui:relative ui:grow ui:overflow-hidden ui:rounded-full ui:data-[orientation=horizontal]:h-1.5 ui:data-[orientation=horizontal]:w-full ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:w-1.5"),children:h.jsx(jH,{"data-slot":"slider-range",className:L("ui:bg-primary ui:absolute ui:data-[orientation=horizontal]:h-full ui:data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(a,l)=>h.jsx(FH,{"data-slot":"slider-thumb",className:"ui:border-primary ui:ring-ring/50 ui:block ui:size-4 ui:shrink-0 ui:rounded-full ui:border ui:bg-white ui:shadow-sm ui:transition-[color,box-shadow] ui:hover:ring-4 ui:focus-visible:ring-4 ui:focus-visible:outline-hidden ui:disabled:pointer-events-none ui:disabled:opacity-50"},l))]})}const NQ=({name:e,control:t,label:n,description:r,min:o=0,max:i=100,step:s=1,leftLabel:a,rightLabel:l,showLabels:u=!0,complementaryField:c,onValueChange:d,containerClassName:f,labelClassName:p,showErrorPlaceholder:g=!1,tooltipContent:m,...v})=>{const y=Mn.useFormContext(),x=t??y?.control;if(!x)throw new Error("FormSlider must be used within a FormProvider or receive a control prop");const w=O.useRef(!1),C=Mn.useWatch({control:x,name:e});return h.jsx(Fn,{control:x,name:e,render:({field:S})=>{const R=T=>{if(w.current)return;const M=T[0];w.current=!0,S.onChange(String(M)),c&&y?.setValue&&y.setValue(c,String(i-M),{shouldValidate:!0}),d&&d(M),setTimeout(()=>{w.current=!1},0)},I=Number(C)||o+(i-o)/2;return h.jsxs(An,{className:L("ui:w-full",f),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!n,children:h.jsxs(mr,{className:L(p,{"ui:flex ui:items-center ui:gap-2":!!m}),children:[n,m&&h.jsx(ys,{content:m,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,color:"#737373",className:"ui:cursor-pointer"})})]})})}),h.jsx(qn,{children:h.jsxs("div",{className:"ui:space-y-2",children:[h.jsx(c2,{value:[I],onValueChange:R,min:o,max:i,step:s,className:"ui:w-full",...v}),u&&h.jsxs("div",{className:"ui:flex ui:justify-between ui:text-sm ui:text-gray-600",children:[a&&h.jsxs("span",{children:[a,": ",I,i===100?"%":""]}),l&&h.jsxs("span",{children:[l,": ",c?i-I:I,i===100?"%":""]})]})]})}),h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(xr,{className:"ui:text-xs",children:r})})}),h.jsx(Ln,{showErrorPlaceholder:g})]})}})};function d2({className:e,...t}){return h.jsx(GH,{"data-slot":"switch",className:L("ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:p-0",e),...t,children:h.jsx(HH,{"data-slot":"switch-thumb",className:L("ui:bg-background ui:dark:data-[state=unchecked]:bg-foreground ui:dark:data-[state=checked]:bg-primary-foreground ui:pointer-events-none ui:block ui:size-4 ui:rounded-full ui:ring-0 ui:transition-transform ui:data-[state=checked]:translate-x-[calc(100%-2px)] ui:data-[state=unchecked]:translate-x-0")})})}const f2=({label:e="",name:t,...n})=>h.jsxs("article",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(d2,{id:t,...n}),e&&h.jsx(yr,{htmlFor:t,children:e})]}),OQ=({name:e,label:t,description:n,control:r,className:o,...i})=>{const s=Mn.useFormContext(),a=r??s?.control;if(!a)throw new Error("FormSwitch must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:a,name:e,render:({field:l})=>h.jsxs(An,{className:o,children:[h.jsx(qn,{children:h.jsx(f2,{...l,...i,label:t,checked:!!l.value,onCheckedChange:l.onChange})}),h.jsx(Ln,{}),n&&h.jsx(xr,{children:n})]})})},p2=({textAreaClassName:e,value:t,onChange:n,label:r,...o})=>h.jsxs("article",{children:[r&&h.jsx(yr,{className:"ui:mb-2 ui:block",children:r}),h.jsx(Ok,{className:L("ui:w-full",e),value:t,onChange:n,...o})]}),PQ=({label:e,name:t,description:n,placeholder:r,containerClassName:o,control:i,...s})=>{const a=Mn.useFormContext(),l=i??a?.control;if(!l)throw new Error("FormTextarea must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:l,name:t,render:({field:u})=>h.jsxs(An,{className:L("ui:w-full",o),children:[h.jsx(mr,{children:e}),h.jsx(qn,{children:h.jsx(p2,{placeholder:r,...u,...s})}),n&&h.jsx(xr,{children:n}),h.jsx(Ln,{})]})})};function _Q({...e}){return h.jsx(J3,{"data-slot":"hover-card",...e})}function MQ({...e}){return h.jsx(K3,{"data-slot":"hover-card-trigger",...e})}function DQ({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(Q3,{"data-slot":"hover-card-portal",children:h.jsx(eG,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:L("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-64 ui:origin-(--radix-hover-card-content-transform-origin) ui:rounded-md ui:border ui:p-4 ui:shadow-md ui:outline-hidden",e),...r})})}function kQ({name:e,className:t,...n}){return h.jsx("i",{className:L(`icon-${e}`,t),...n,children:h.jsxs("span",{className:"ui:for-screenreader-only",children:[e," icon"]})})}var jQ=Object.defineProperty,FQ=Object.defineProperties,LQ=Object.getOwnPropertyDescriptors,vd=Object.getOwnPropertySymbols,h2=Object.prototype.hasOwnProperty,g2=Object.prototype.propertyIsEnumerable,dI=(e,t,n)=>t in e?jQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BQ=(e,t)=>{for(var n in t||(t={}))h2.call(t,n)&&dI(e,n,t[n]);if(vd)for(var n of vd(t))g2.call(t,n)&&dI(e,n,t[n]);return e},VQ=(e,t)=>FQ(e,LQ(t)),$Q=(e,t)=>{var n={};for(var r in e)h2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vd)for(var r of vd(e))t.indexOf(r)<0&&g2.call(e,r)&&(n[r]=e[r]);return n};function GQ(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function HQ(e){let t=b.useRef();return b.useEffect(()=>{t.current=e}),t.current}var WQ=18,m2=40,zQ=`${m2}px`,qQ=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function UQ({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[o,i]=b.useState(!1),[s,a]=b.useState(!1),[l,u]=b.useState(!1),c=b.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&o&&s,[o,s,n]),d=b.useCallback(()=>{let f=e.current,p=t.current;if(!f||!p||l||n==="none")return;let g=f,m=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,y=m-WQ,x=v;document.querySelectorAll(qQ).length===0&&document.elementFromPoint(y,x)===f||(i(!0),u(!0))},[e,t,l,n]);return b.useEffect(()=>{let f=e.current;if(!f||n==="none")return;function p(){let m=window.innerWidth-f.getBoundingClientRect().right;a(m>=m2)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,n]),b.useEffect(()=>{let f=r||document.activeElement===t.current;if(n==="none"||!f)return;let p=setTimeout(d,0),g=setTimeout(d,2e3),m=setTimeout(d,5e3),v=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(m),clearTimeout(v)}},[t,r,n,d]),{hasPWMBadge:o,willPushPWMBadge:c,PWM_BADGE_SPACE_WIDTH:zQ}}var YQ=b.createContext({}),b2=b.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,maxLength:i,textAlign:s="left",pattern:a,placeholder:l,inputMode:u="numeric",onComplete:c,pushPasswordManagerStrategy:d="increase-width",pasteTransformer:f,containerClassName:p,noScriptCSSFallback:g=XQ,render:m,children:v}=n,y=$Q(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),x,w,C,S,R;let[I,T]=b.useState(typeof y.defaultValue=="string"?y.defaultValue:""),M=r??I,V=HQ(M),A=b.useCallback(k=>{o?.(k),T(k)},[o]),P=b.useMemo(()=>a?typeof a=="string"?new RegExp(a):a:null,[a]),N=b.useRef(null),B=b.useRef(null),j=b.useRef({value:M,onChange:A,isIOS:typeof window<"u"&&((w=(x=window?.CSS)==null?void 0:x.supports)==null?void 0:w.call(x,"-webkit-touch-callout","none"))}),D=b.useRef({prev:[(C=N.current)==null?void 0:C.selectionStart,(S=N.current)==null?void 0:S.selectionEnd,(R=N.current)==null?void 0:R.selectionDirection]});b.useImperativeHandle(t,()=>N.current,[]),b.useEffect(()=>{let k=N.current,ie=B.current;if(!k||!ie)return;j.current.value!==k.value&&j.current.onChange(k.value),D.current.prev=[k.selectionStart,k.selectionEnd,k.selectionDirection];function Y(){if(document.activeElement!==k){W(null),K(null);return}let re=k.selectionStart,fe=k.selectionEnd,de=k.selectionDirection,ve=k.maxLength,we=k.value,Se=D.current.prev,Ye=-1,at=-1,Xe;if(we.length!==0&&re!==null&&fe!==null){let gt=re===fe,ct=re===we.length&&we.length<ve;if(gt&&!ct){let ot=re;if(ot===0)Ye=0,at=1,Xe="forward";else if(ot===ve)Ye=ot-1,at=ot,Xe="backward";else if(ve>1&&we.length>1){let mt=0;if(Se[0]!==null&&Se[1]!==null){Xe=ot<Se[1]?"backward":"forward";let Ot=Se[0]===Se[1]&&Se[0]<ve;Xe==="backward"&&!Ot&&(mt=-1)}Ye=mt+ot,at=mt+ot+1}}Ye!==-1&&at!==-1&&Ye!==at&&N.current.setSelectionRange(Ye,at,Xe)}let Ue=Ye!==-1?Ye:re,rt=at!==-1?at:fe,et=Xe??de;W(Ue),K(rt),D.current.prev=[Ue,rt,et]}if(document.addEventListener("selectionchange",Y,{capture:!0}),Y(),document.activeElement===k&&H(!0),!document.getElementById("input-otp-style")){let re=document.createElement("style");if(re.id="input-otp-style",document.head.appendChild(re),re.sheet){let fe="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";za(re.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),za(re.sheet,`[data-input-otp]:autofill { ${fe} }`),za(re.sheet,`[data-input-otp]:-webkit-autofill { ${fe} }`),za(re.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),za(re.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let le=()=>{ie&&ie.style.setProperty("--root-height",`${k.clientHeight}px`)};le();let pe=new ResizeObserver(le);return pe.observe(k),()=>{document.removeEventListener("selectionchange",Y,{capture:!0}),pe.disconnect()}},[]);let[$,G]=b.useState(!1),[z,H]=b.useState(!1),[ne,W]=b.useState(null),[J,K]=b.useState(null);b.useEffect(()=>{GQ(()=>{var k,ie,Y,le;(k=N.current)==null||k.dispatchEvent(new Event("input"));let pe=(ie=N.current)==null?void 0:ie.selectionStart,re=(Y=N.current)==null?void 0:Y.selectionEnd,fe=(le=N.current)==null?void 0:le.selectionDirection;pe!==null&&re!==null&&(W(pe),K(re),D.current.prev=[pe,re,fe])})},[M,z]),b.useEffect(()=>{V!==void 0&&M!==V&&V.length<i&&M.length===i&&c?.(M)},[i,c,V,M]);let U=UQ({containerRef:B,inputRef:N,pushPasswordManagerStrategy:d,isFocused:z}),oe=b.useCallback(k=>{let ie=k.currentTarget.value.slice(0,i);if(ie.length>0&&P&&!P.test(ie)){k.preventDefault();return}typeof V=="string"&&ie.length<V.length&&document.dispatchEvent(new Event("selectionchange")),A(ie)},[i,A,V,P]),X=b.useCallback(()=>{var k;if(N.current){let ie=Math.min(N.current.value.length,i-1),Y=N.current.value.length;(k=N.current)==null||k.setSelectionRange(ie,Y),W(ie),K(Y)}H(!0)},[i]),te=b.useCallback(k=>{var ie,Y;let le=N.current;if(!f&&(!j.current.isIOS||!k.clipboardData||!le))return;let pe=k.clipboardData.getData("text/plain"),re=f?f(pe):pe;k.preventDefault();let fe=(ie=N.current)==null?void 0:ie.selectionStart,de=(Y=N.current)==null?void 0:Y.selectionEnd,ve=(fe!==de?M.slice(0,fe)+re+M.slice(de):M.slice(0,fe)+re+M.slice(fe)).slice(0,i);if(ve.length>0&&P&&!P.test(ve))return;le.value=ve,A(ve);let we=Math.min(ve.length,i-1),Se=ve.length;le.setSelectionRange(we,Se),W(we),K(Se)},[i,A,P,M]),Q=b.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),se=b.useMemo(()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:s,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,s]),ae=b.useMemo(()=>b.createElement("input",VQ(BQ({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":M.length===0||void 0,"data-input-otp-mss":ne,"data-input-otp-mse":J,inputMode:u,pattern:P?.source,"aria-placeholder":l,style:se,maxLength:i,value:M,ref:N,onPaste:k=>{var ie;te(k),(ie=y.onPaste)==null||ie.call(y,k)},onChange:oe,onMouseOver:k=>{var ie;G(!0),(ie=y.onMouseOver)==null||ie.call(y,k)},onMouseLeave:k=>{var ie;G(!1),(ie=y.onMouseLeave)==null||ie.call(y,k)},onFocus:k=>{var ie;X(),(ie=y.onFocus)==null||ie.call(y,k)},onBlur:k=>{var ie;H(!1),(ie=y.onBlur)==null||ie.call(y,k)}})),[oe,X,te,u,se,i,J,ne,y,P?.source,M]),F=b.useMemo(()=>({slots:Array.from({length:i}).map((k,ie)=>{var Y;let le=z&&ne!==null&&J!==null&&(ne===J&&ie===ne||ie>=ne&&ie<J),pe=M[ie]!==void 0?M[ie]:null,re=M[0]!==void 0?null:(Y=l?.[ie])!=null?Y:null;return{char:pe,placeholderChar:re,isActive:le,hasFakeCaret:le&&pe===null}}),isFocused:z,isHovering:!y.disabled&&$}),[z,$,i,J,ne,y.disabled,M]),Z=b.useMemo(()=>m?m(F):b.createElement(YQ.Provider,{value:F},v),[v,F,m]);return b.createElement(b.Fragment,null,g!==null&&b.createElement("noscript",null,b.createElement("style",null,g)),b.createElement("div",{ref:B,"data-input-otp-container":!0,style:Q,className:p},Z,b.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ae)))});b2.displayName="Input";function za(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var XQ=`
|
|
88
|
+
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function bK(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function vK(){return i0(/^Mac/)}function yK(){return i0(/^iPhone/)}function aI(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function xK(){return i0(/^iPad/)||vK()&&navigator.maxTouchPoints>1}function Fk(){return yK()||xK()}function i0(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const wK=24,CK=typeof window<"u"?O.useLayoutEffect:O.useEffect;function lI(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Bm=typeof document<"u"&&window.visualViewport;function uI(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Lk(e){for(uI(e)&&(e=e.parentElement);e&&!uI(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const SK=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let ac=0,Vm;function EK(e={}){let{isDisabled:t}=e;CK(()=>{if(!t)return ac++,ac===1&&Fk()&&(Vm=IK()),()=>{ac--,ac===0&&Vm?.()}},[t])}function IK(){let e,t=0,n=d=>{e=Lk(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&f>t||p>=g&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;xv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;xv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",Bm&&(Bm.height<window.innerHeight?requestAnimationFrame(()=>{cI(f)}):Bm.addEventListener("resize",()=>cI(f),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,u=lI(RK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let c=lI(Ha(document,"touchstart",n,{passive:!1,capture:!0}),Ha(document,"touchmove",r,{passive:!1,capture:!0}),Ha(document,"touchend",o,{passive:!1,capture:!0}),Ha(document,"focus",i,!0),Ha(window,"scroll",s));return()=>{u(),c(),window.scrollTo(a,l)}}function RK(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ha(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function cI(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Lk(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+wK;i>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function xv(e){return e instanceof HTMLInputElement&&!SK.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function AK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function TK(...e){return t=>e.forEach(n=>AK(n,t))}function Bk(...e){return b.useCallback(TK(...e),e)}const Vk=new WeakMap;function nn(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Vk.set(e,r)}function NK(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Vk.get(e);n&&(e.style[t]=n[t])}const Xt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function lc(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Xt(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Xt(t)?5:4]):null)}function OK(e){return 8*(Math.log(e+1)-2)}function $m(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function PK(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const kt={DURATION:.5,EASE:[.32,.72,0,1]},$k=.4,_K=.25,MK=100,Gk=8,Gi=16,wv=26,Gm="vaul-dragging";function Hk(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function DK({defaultProp:e,onChange:t}){const n=O.useState(e),[r]=n,o=O.useRef(r),i=Hk(t);return O.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Wk({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=DK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Hk(n),l=O.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function kK({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:s,direction:a="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=Wk({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=O.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);O.useEffect(()=>{function I(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const g=O.useMemo(()=>c===n?.[n.length-1]||null,[n,c]),m=O.useMemo(()=>{var I;return(I=n?.findIndex(T=>T===c))!=null?I:null},[n,c]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,y=O.useMemo(()=>{const I=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n?.map(M=>{const V=typeof M=="string";let A=0;if(V&&(A=parseInt(M,10)),Xt(a)){const N=V?A:f?M*I.height:0;return f?a==="bottom"?I.height-N:-I.height+N:N}const P=V?A:f?M*I.width:0;return f?a==="right"?I.width-P:-I.width+P:P}))!=null?T:[]},[n,f,l]),x=O.useMemo(()=>m!==null?y?.[m]:null,[y,m]),w=O.useCallback(I=>{var T;const M=(T=y?.findIndex(V=>V===I))!=null?T:null;s(M),nn(r.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Xt(a)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`}),y&&M!==y.length-1&&i!==void 0&&M!==i&&M<i?nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"0"}):nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(M,0)])},[r.current,n,y,i,o,d]);O.useEffect(()=>{if(c||e){var I;const T=(I=n?.findIndex(M=>M===e||M===c))!=null?I:-1;y&&T!==-1&&typeof y[T]=="number"&&w(y[T])}},[c,e,n,y,w]);function C({draggedDistance:I,closeDrawer:T,velocity:M,dismissible:V}){if(i===void 0)return;const A=a==="bottom"||a==="right"?(x??0)-I:(x??0)+I,P=m===i-1,N=m===0,B=I>0;if(P&&nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),!u&&M>2&&!B){V?T():w(y[0]);return}if(!u&&M>2&&B&&y&&n){w(y[n.length-1]);return}const j=y?.reduce(($,G)=>typeof $!="number"||typeof G!="number"?$:Math.abs(G-A)<Math.abs($-A)?G:$),D=Xt(a)?window.innerHeight:window.innerWidth;if(M>$k&&Math.abs(I)<D*.4){const $=B?1:-1;if($>0&&g&&n){w(y[n.length-1]);return}if(N&&$<0&&V&&T(),m===null)return;w(y[m+$]);return}w(j)}function S({draggedDistance:I}){if(x===null)return;const T=a==="bottom"||a==="right"?x-I:x+I;(a==="bottom"||a==="right")&&T<y[y.length-1]||(a==="top"||a==="left")&&T>y[y.length-1]||nn(r.current,{transform:Xt(a)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function R(I,T){if(!n||typeof m!="number"||!y||i===void 0)return null;const M=m===i-1;if(m>=i&&T)return 0;if(M&&!T)return 1;if(!v&&!M)return null;const A=M?m+1:m-1,P=M?y[A]-y[A-1]:y[A+1]-y[A],N=I/Math.abs(P);return M?1-N:N}return{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:R,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:C,onDrag:S,snapPointsOffset:y}}const jK=()=>()=>{};function FK(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=xu(),i=O.useRef(null),s=O.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-wv)/window.innerWidth}O.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;PK(r&&!o?$m(document.body,{background:"black"}):jK,$m(l,{transformOrigin:Xt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`}));const u=$m(l,{borderRadius:`${Gk}px`,overflow:"hidden",...Xt(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},kt.DURATION*1e3)}}},[t,n,s])}let Wa=null;function LK({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[s,a]=O.useState(()=>typeof window<"u"?window.location.href:""),l=O.useRef(0),u=O.useCallback(()=>{if(aI()&&Wa===null&&e&&!i){Wa={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&l.current>=f&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),c=O.useCallback(()=>{if(aI()&&Wa!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Wa),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),Wa=null}},[s]);return O.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),O.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),O.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,r,s,t,n,u,c]),{restorePositionSetting:c}}function BK({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=_K,scrollLockTimeout:u=MK,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:x,noBodyStyles:w=!1,direction:C="bottom",defaultOpen:S=!1,disablePreventScroll:R=!0,snapToSequentialPoint:I=!1,preventScrollRestoration:T=!1,repositionInputs:M=!0,onAnimationEnd:V,container:A,autoFocus:P=!1}){var N,B;const[j=!1,D]=Wk({defaultProp:S,prop:e,onChange:ee=>{t?.(ee),!ee&&!x&&Xe(),setTimeout(()=>{V?.(ee)},kt.DURATION*1e3),ee&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[$,G]=O.useState(!1),[z,H]=O.useState(!1),[ne,W]=O.useState(!1),J=O.useRef(null),K=O.useRef(null),U=O.useRef(null),oe=O.useRef(null),X=O.useRef(null),te=O.useRef(!1),Q=O.useRef(null),se=O.useRef(0),ae=O.useRef(!1),F=O.useRef(!S),Z=O.useRef(0),k=O.useRef(null),ie=O.useRef(((N=k.current)==null?void 0:N.getBoundingClientRect().height)||0),Y=O.useRef(((B=k.current)==null?void 0:B.getBoundingClientRect().width)||0),le=O.useRef(0),pe=O.useCallback(ee=>{i&&ee===we.length-1&&(K.current=new Date)},[]),{activeSnapPoint:re,activeSnapPointIndex:fe,setActiveSnapPoint:de,onRelease:ve,snapPointsOffset:we,onDrag:Se,shouldFade:Ye,getPercentageDragged:at}=kK({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:k,fadeFromIndex:f,overlayRef:J,onSnapPointChange:pe,direction:C,container:A,snapToSequentialPoint:I});EK({isDisabled:!j||z||!v||ne||!$||!M||!R});const{restorePositionSetting:Xe}=LK({isOpen:j,modal:v,nested:x??!1,hasBeenOpened:$,preventScrollRestoration:T,noBodyStyles:w});function Ue(){return(window.innerWidth-wv)/window.innerWidth}function rt(ee){var ye,ge;!c&&!i||k.current&&!k.current.contains(ee.target)||(ie.current=((ye=k.current)==null?void 0:ye.getBoundingClientRect().height)||0,Y.current=((ge=k.current)==null?void 0:ge.getBoundingClientRect().width)||0,H(!0),U.current=new Date,Fk()&&window.addEventListener("touchend",()=>te.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),se.current=Xt(C)?ee.pageY:ee.pageX)}function et(ee,ye){var ge;let xe=ee;const Ae=(ge=window.getSelection())==null?void 0:ge.toString(),Ie=k.current?lc(k.current,C):null,qe=new Date;if(xe.tagName==="SELECT"||xe.hasAttribute("data-vaul-no-drag")||xe.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(K.current&&qe.getTime()-K.current.getTime()<500)return!1;if(Ie!==null&&(C==="bottom"?Ie>0:Ie<0))return!0;if(Ae&&Ae.length>0)return!1;if(X.current&&qe.getTime()-X.current.getTime()<u&&Ie===0||ye)return X.current=qe,!1;for(;xe;){if(xe.scrollHeight>xe.clientHeight){if(xe.scrollTop!==0)return X.current=new Date,!1;if(xe.getAttribute("role")==="dialog")return!0}xe=xe.parentNode}return!0}function gt(ee){if(k.current&&z){const ye=C==="bottom"||C==="right"?1:-1,ge=(se.current-(Xt(C)?ee.pageY:ee.pageX))*ye,xe=ge>0,Ae=i&&!c&&!xe;if(Ae&&fe===0)return;const Ie=Math.abs(ge),qe=document.querySelector("[data-vaul-drawer-wrapper]"),Pt=C==="bottom"||C==="top"?ie.current:Y.current;let lt=Ie/Pt;const it=at(Ie,xe);if(it!==null&&(lt=it),Ae&<>=1||!te.current&&!et(ee.target,xe))return;if(k.current.classList.add(Gm),te.current=!0,nn(k.current,{transition:"none"}),nn(J.current,{transition:"none"}),i&&Se({draggedDistance:ge}),xe&&!i){const Et=OK(ge),sn=Math.min(Et*-1,0)*ye;nn(k.current,{transform:Xt(C)?`translate3d(0, ${sn}px, 0)`:`translate3d(${sn}px, 0, 0)`});return}const _t=1-lt;if((Ye||f&&fe===f-1)&&(r?.(ee,lt),nn(J.current,{opacity:`${_t}`,transition:"none"},!0)),qe&&J.current&&s){const Et=Math.min(Ue()+lt*(1-Ue()),1),sn=8-lt*8,wr=Math.max(0,14-lt*14);nn(qe,{borderRadius:`${sn}px`,transform:Xt(C)?`scale(${Et}) translate3d(0, ${wr}px, 0)`:`scale(${Et}) translate3d(${wr}px, 0, 0)`,transition:"none"},!0)}if(!i){const Et=Ie*ye;nn(k.current,{transform:Xt(C)?`translate3d(0, ${Et}px, 0)`:`translate3d(${Et}px, 0, 0)`})}}}O.useEffect(()=>{window.requestAnimationFrame(()=>{F.current=!0})},[]),O.useEffect(()=>{var ee;function ye(){if(!k.current||!M)return;const ge=document.activeElement;if(xv(ge)||ae.current){var xe;const Ae=((xe=window.visualViewport)==null?void 0:xe.height)||0,Ie=window.innerHeight;let qe=Ie-Ae;const Pt=k.current.getBoundingClientRect().height||0,lt=Pt>Ie*.8;le.current||(le.current=Pt);const it=k.current.getBoundingClientRect().top;if(Math.abs(Z.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&we&&fe){const _t=we[fe]||0;qe+=_t}if(Z.current=qe,Pt>Ae||ae.current){const _t=k.current.getBoundingClientRect().height;let Et=_t;_t>Ae&&(Et=Ae-(lt?it:wv)),m?k.current.style.height=`${_t-Math.max(qe,0)}px`:k.current.style.height=`${Math.max(Et,Ae-it)}px`}else bK()||(k.current.style.height=`${le.current}px`);i&&i.length>0&&!ae.current?k.current.style.bottom="0px":k.current.style.bottom=`${Math.max(qe,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",ye),()=>{var ge;return(ge=window.visualViewport)==null?void 0:ge.removeEventListener("resize",ye)}},[fe,i,we]);function ct(ee){mt(),y?.(),ee||D(!1),setTimeout(()=>{i&&de(i[0])},kt.DURATION*1e3)}function ot(){if(!k.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),ye=lc(k.current,C);nn(k.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),nn(J.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),s&&ye&&ye>0&&j&&nn(ee,{borderRadius:`${Gk}px`,overflow:"hidden",...Xt(C)?{transform:`scale(${Ue()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ue()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`},!0)}function mt(){!z||!k.current||(k.current.classList.remove(Gm),te.current=!1,H(!1),oe.current=new Date)}function Ot(ee){if(!z||!k.current)return;k.current.classList.remove(Gm),te.current=!1,H(!1),oe.current=new Date;const ye=lc(k.current,C);if(!ee||!et(ee.target,!1)||!ye||Number.isNaN(ye)||U.current===null)return;const ge=oe.current.getTime()-U.current.getTime(),xe=se.current-(Xt(C)?ee.pageY:ee.pageX),Ae=Math.abs(xe)/ge;if(Ae>.05&&(W(!0),setTimeout(()=>{W(!1)},200)),i){ve({draggedDistance:xe*(C==="bottom"||C==="right"?1:-1),closeDrawer:ct,velocity:Ae,dismissible:c}),o?.(ee,!0);return}if(C==="bottom"||C==="right"?xe>0:xe<0){ot(),o?.(ee,!0);return}if(Ae>$k){ct(),o?.(ee,!1);return}var Ie;const qe=Math.min((Ie=k.current.getBoundingClientRect().height)!=null?Ie:0,window.innerHeight);var Pt;const lt=Math.min((Pt=k.current.getBoundingClientRect().width)!=null?Pt:0,window.innerWidth),it=C==="left"||C==="right";if(Math.abs(ye)>=(it?lt:qe)*l){ct(),o?.(ee,!1);return}o?.(ee,!0),ot()}O.useEffect(()=>(j&&(nn(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{NK(document.documentElement,"scrollBehavior")}),[j]);function Bt(ee){const ye=ee?(window.innerWidth-Gi)/window.innerWidth:1,ge=ee?-Gi:0;Q.current&&window.clearTimeout(Q.current),nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Xt(C)?`scale(${ye}) translate3d(0, ${ge}px, 0)`:`scale(${ye}) translate3d(${ge}px, 0, 0)`}),!ee&&k.current&&(Q.current=setTimeout(()=>{const xe=lc(k.current,C);nn(k.current,{transition:"none",transform:Xt(C)?`translate3d(0, ${xe}px, 0)`:`translate3d(${xe}px, 0, 0)`})},500))}function tt(ee,ye){if(ye<0)return;const ge=(window.innerWidth-Gi)/window.innerWidth,xe=ge+ye*(1-ge),Ae=-Gi+ye*Gi;nn(k.current,{transform:Xt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`,transition:"none"})}function Ze(ee,ye){const ge=Xt(C)?window.innerHeight:window.innerWidth,xe=ye?(ge-Gi)/ge:1,Ae=ye?-Gi:0;ye&&nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Xt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`})}return O.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),O.createElement(Jl,{defaultOpen:S,onOpenChange:ee=>{!c&&!ee||(ee?G(!0):ct(!0),D(ee))},open:j},O.createElement(jk.Provider,{value:{activeSnapPoint:re,snapPoints:i,setActiveSnapPoint:de,drawerRef:k,overlayRef:J,onOpenChange:t,onPress:rt,onRelease:Ot,onDrag:gt,dismissible:c,shouldAnimate:F,handleOnly:d,isOpen:j,isDragging:z,shouldFade:Ye,closeDrawer:ct,onNestedDrag:tt,onNestedOpenChange:Bt,onNestedRelease:Ze,keyboardIsOpen:ae,modal:v,snapPointsOffset:we,activeSnapPointIndex:fe,direction:C,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:w,container:A,autoFocus:P}},n))}const zk=O.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:s,modal:a,shouldAnimate:l}=xu(),u=Bk(t,n),c=r&&r.length>0;if(!a)return null;const d=O.useCallback(f=>o(f),[o]);return O.createElement(Ql,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&c?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});zk.displayName="Drawer.Overlay";const qk=O.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:s,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:x,autoFocus:w}=xu(),[C,S]=O.useState(!1),R=Bk(o,i),I=O.useRef(null),T=O.useRef(null),M=O.useRef(!1),V=m&&m.length>0;FK();const A=(N,B,j=0)=>{if(M.current)return!0;const D=Math.abs(N.y),$=Math.abs(N.x),G=$>D,z=["bottom","right"].includes(B)?1:-1;if(B==="left"||B==="right"){if(!(N.x*z<0)&&$>=0&&$<=j)return G}else if(!(N.y*z<0)&&D>=0&&D<=j)return!G;return M.current=!0,!0};O.useEffect(()=>{V&&window.requestAnimationFrame(()=>{S(!0)})},[]);function P(N){I.current=null,M.current=!1,a(N)}return O.createElement(eu,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":p&&V?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[d??0]}px`,...t}:t,onPointerDown:N=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,N),I.current={x:N.pageX,y:N.pageY},s(N))},onOpenAutoFocus:N=>{n?.(N),w||N.preventDefault()},onPointerDownOutside:N=>{if(e?.(N),!f||N.defaultPrevented){N.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:N=>{if(!f){N.preventDefault();return}},onPointerMove:N=>{if(T.current=N,y||(r.onPointerMove==null||r.onPointerMove.call(r,N),!I.current))return;const B=N.pageY-I.current.y,j=N.pageX-I.current.x,D=N.pointerType==="touch"?10:2;A({x:j,y:B},g,D)?l(N):(Math.abs(j)>D||Math.abs(B)>D)&&(I.current=null)},onPointerUp:N=>{r.onPointerUp==null||r.onPointerUp.call(r,N),I.current=null,M.current=!1,a(N)},onPointerOut:N=>{r.onPointerOut==null||r.onPointerOut.call(r,N),P(T.current)},onContextMenu:N=>{r.onContextMenu==null||r.onContextMenu.call(r,N),T.current&&P(T.current)}})});qk.displayName="Drawer.Content";const VK=250,$K=120,GK=O.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:f,onDrag:p}=xu(),g=O.useRef(null),m=O.useRef(!1);function v(){if(m.current){w();return}window.setTimeout(()=>{y()},$K)}function y(){if(i||e||m.current){w();return}if(w(),!s||s.length===0){u||o();return}if(a===s[s.length-1]&&u){o();return}const S=s.findIndex(I=>I===a);if(S===-1)return;const R=s[S+1];l(R)}function x(){g.current=window.setTimeout(()=>{m.current=!0},VK)}function w(){g.current&&window.clearTimeout(g.current),m.current=!1}return O.createElement("div",{onClick:v,onPointerCancel:w,onPointerDown:C=>{c&&f(C),x()},onPointerMove:C=>{c&&p(C)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},O.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});GK.displayName="Drawer.Handle";function HK(e){const t=xu(),{container:n=t.container,...r}=e;return O.createElement(Kl,{container:n,...r})}const Ri={Root:BK,Content:qk,Overlay:zk,Trigger:Ld,Portal:HK,Close:fs,Title:Bd,Description:Vd};function WK({...e}){return h.jsx(Ri.Root,{"data-slot":"drawer",...e})}function zK({...e}){return h.jsx(Ri.Trigger,{"data-slot":"drawer-trigger",...e})}function Uk({...e}){return h.jsx(Ri.Portal,{"data-slot":"drawer-portal",...e})}function qK({...e}){return h.jsx(Ri.Close,{"data-slot":"drawer-close",...e})}function Yk({className:e,...t}){return h.jsx(Ri.Overlay,{"data-slot":"drawer-overlay",className:L("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function UK({className:e,children:t,...n}){return h.jsxs(Uk,{"data-slot":"drawer-portal",children:[h.jsx(Yk,{}),h.jsxs(Ri.Content,{"data-slot":"drawer-content",className:L("ui:group/drawer-content ui:bg-background ui:fixed ui:flex ui:h-auto ui:flex-col ui:rounded-t-[10px] ui:z-100 ui:mt-24","ui:data-[vaul-drawer-direction=top]:inset-x-0 ui:data-[vaul-drawer-direction=top]:top-0 ui:data-[vaul-drawer-direction=top]:mb-24 ui:data-[vaul-drawer-direction=top]:max-h-[80vh] ui:data-[vaul-drawer-direction=top]:rounded-b-lg ui:data-[vaul-drawer-direction=top]:border-b","ui:data-[vaul-drawer-direction=bottom]:inset-x-0 ui:data-[vaul-drawer-direction=bottom]:bottom-0 ui:data-[vaul-drawer-direction=bottom]:mt-24 ui:data-[vaul-drawer-direction=bottom]:max-h-[80vh] ui:data-[vaul-drawer-direction=bottom]:rounded-t-lg ui:data-[vaul-drawer-direction=bottom]:border-t","ui:data-[vaul-drawer-direction=right]:inset-y-0 ui:data-[vaul-drawer-direction=right]:right-0 ui:data-[vaul-drawer-direction=right]:w-3/4 ui:data-[vaul-drawer-direction=right]:border-l ui:data-[vaul-drawer-direction=right]:sm:max-w-sm","ui:data-[vaul-drawer-direction=left]:inset-y-0 ui:data-[vaul-drawer-direction=left]:left-0 ui:data-[vaul-drawer-direction=left]:w-3/4 ui:data-[vaul-drawer-direction=left]:border-r ui:data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[h.jsx("div",{className:"ui:bg-muted ui:mx-auto ui:mt-4 ui:hidden ui:h-2 ui:w-[100px] ui:shrink-0 ui:rounded-full ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function YK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-header",className:L("ui:flex ui:flex-col ui:gap-0.5 ui:p-4 ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center ui:group-data-[vaul-drawer-direction=top]/drawer-content:text-center ui:md:gap-1.5 ui:md:text-left",e),...t})}function XK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-footer",className:L("ui:mt-auto ui:flex ui:flex-col ui:gap-2 ui:p-4",e),...t})}function ZK({className:e,...t}){return h.jsx(Ri.Title,{"data-slot":"drawer-title",className:L("ui:text-foreground ui:font-semibold",e),...t})}function JK({className:e,...t}){return h.jsx(Ri.Description,{"data-slot":"drawer-description",className:L("ui:text-muted-foreground ui:text-sm",e),...t})}function s0({...e}){return h.jsx(P3,{"data-slot":"dropdown-menu",...e})}function KK({...e}){return h.jsx(sO,{"data-slot":"dropdown-menu-portal",...e})}function a0({...e}){return h.jsx(_3,{"data-slot":"dropdown-menu-trigger",...e})}function l0({className:e,sideOffset:t=4,...n}){return h.jsx(sO,{children:h.jsx(M3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:L("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:max-h-(--radix-dropdown-menu-content-available-height) ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-x-hidden ui:overflow-y-auto ui:rounded-md ui:border ui:p-1 ui:shadow-md",e),...n})})}function QK({...e}){return h.jsx(D3,{"data-slot":"dropdown-menu-group",...e})}function Xk({className:e,inset:t,variant:n="default",...r}){return h.jsx(j3,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[variant=destructive]:text-destructive ui:data-[variant=destructive]:focus:bg-destructive/10 ui:dark:data-[variant=destructive]:focus:bg-destructive/20 ui:data-[variant=destructive]:focus:text-destructive ui:data-[variant=destructive]:*:[svg]:!text-destructive ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r})}function Cv({className:e,children:t,checked:n,...r}){return h.jsxs(F3,{"data-slot":"dropdown-menu-checkbox-item",className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(aO,{children:h.jsx(Oe.CheckIcon,{className:"ui:size-4"})})}),t]})}function eQ({...e}){return h.jsx(L3,{"data-slot":"dropdown-menu-radio-group",...e})}function tQ({className:e,children:t,...n}){return h.jsxs(B3,{"data-slot":"dropdown-menu-radio-item",className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(aO,{children:h.jsx(Oe.CircleIcon,{className:"ui:size-2 ui:fill-current"})})}),t]})}function nQ({className:e,inset:t,...n}){return h.jsx(k3,{"data-slot":"dropdown-menu-label","data-inset":t,className:L("ui:px-2 ui:py-1.5 ui:text-sm ui:font-medium ui:data-[inset]:pl-8",e),...n})}function rQ({className:e,...t}){return h.jsx(V3,{"data-slot":"dropdown-menu-separator",className:L("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function oQ({className:e,...t}){return h.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:L("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}function iQ({...e}){return h.jsx($3,{"data-slot":"dropdown-menu-sub",...e})}function sQ({className:e,inset:t,children:n,...r}){return h.jsxs(G3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[state=open]:bg-accent ui:data-[state=open]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(Oe.ChevronRightIcon,{className:"ui:ml-auto ui:size-4"})]})}function aQ({className:e,...t}){return h.jsx(H3,{"data-slot":"dropdown-menu-sub-content",className:L("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-hidden ui:rounded-md ui:border ui:p-1 ui:shadow-lg",e),...t})}function lQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:L("ui:flex ui:min-w-0 ui:flex-1 ui:flex-col ui:items-center ui:justify-center ui:gap-6 ui:rounded-lg ui:border-dashed ui:p-6 ui:text-center ui:text-balance ui:md:p-12",e),...t})}function uQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:L("ui:flex ui:max-w-sm ui:flex-col ui:items-center ui:gap-2 ui:text-center",e),...t})}const cQ=Si("ui:flex ui:shrink-0 ui:items-center ui:justify-center ui:mb-2 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0",{variants:{variant:{default:"ui:bg-transparent",icon:"ui:bg-muted ui:text-foreground ui:flex ui:size-10 ui:shrink-0 ui:items-center ui:justify-center ui:rounded-lg ui:[&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function dQ({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:L(cQ({variant:t,className:e})),...n})}function fQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:L("ui:text-lg ui:font-medium ui:tracking-tight",e),...t})}function pQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:L("ui:text-muted-foreground ui:[&>a:hover]:text-primary ui:text-sm/relaxed ui:[&>a]:underline ui:[&>a]:underline-offset-4",e),...t})}function hQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-content",className:L("ui:flex ui:w-full ui:max-w-sm ui:min-w-0 ui:flex-col ui:items-center ui:gap-4 ui:text-sm ui:text-balance",e),...t})}function Zk({message:e,className:t}){return h.jsx("p",{className:L("ui:text-red-500 ui:text-xs ui:mt-2 ui:has-error",t),children:e})}const Jk=b.createContext(null),Kk=b.createContext(null),Ff=()=>{const e=b.useContext(Jk),t=b.useContext(Kk);if(!e)throw new Error("useFormField must be used within <FormField>");if(!t)throw new Error("useFormField must be used within <FormItem>");const{id:n}=t,{name:r,error:o}=e;return{name:r,error:o,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`}},Fn=e=>h.jsx(Mn.Controller,{...e,render:t=>h.jsx(Jk.Provider,{value:{name:e.name,error:t.fieldState.error},children:e.render?.(t)})});function An({className:e,...t}){const n=b.useId();return h.jsx(Kk.Provider,{value:{id:n},children:h.jsx("div",{"data-slot":"form-item",className:L("ui:grid ui:gap-2",e),...t})})}function mr({className:e,required:t=!1,...n}){const{error:r,formItemId:o}=Ff();return h.jsxs(yr,{"data-slot":"form-label","data-error":!!r,htmlFor:o,className:L("ui:text-sm",r?"ui:text-destructive":"ui:text-black-950",e),...n,children:[n.children,t&&h.jsx("span",{className:"ui:text-destructive ml-1",children:"*"})]})}function qn(e){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=Ff();return h.jsx(Bo,{"data-slot":"form-control",id:n,"aria-invalid":!!t,"aria-describedby":t?`${r} ${o}`:r,...e})}function xr({className:e,...t}){const{formDescriptionId:n}=Ff();return h.jsx("p",{"data-slot":"form-description",id:n,className:L("ui:text-muted-foreground ui:text-sm",e),...t})}function Ln({className:e,showErrorPlaceholder:t,...n}){const{error:r,formMessageId:o}=Ff(),i=r?String(r.message??""):n.children;return i?h.jsx("p",{"data-slot":"form-message",id:o,className:L("ui:text-destructive ui:text-sm",e),...n,children:i}):t?h.jsx("p",{className:"ui:h-4"}):null}const Oc=({name:e,control:t,containerClassName:n,...r})=>{const o=Mn.useFormContext(),i=t??o?.control;if(!i)throw new Error("FormCheckbox must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:i,name:e,render:({field:s})=>h.jsxs(An,{className:n,children:[h.jsx(qn,{children:h.jsx(aD,{...s,checked:!!s.value,onCheckedChange:s.onChange,...r})}),h.jsx(Ln,{})]})})};function u0({delayDuration:e=0,...t}){return h.jsx(d9,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function c0({...e}){return h.jsx(u0,{children:h.jsx(f9,{"data-slot":"tooltip",...e})})}function d0({...e}){return h.jsx(p9,{"data-slot":"tooltip-trigger",...e})}function Lf({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(f_,{children:h.jsxs(p_,{"data-slot":"tooltip-content",sideOffset:t,className:L("ui:bg-foreground ui:text-background ui:animate-in ui:fade-in-0 ui:zoom-in-95 ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=closed]:zoom-out-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-fit ui:origin-(--radix-tooltip-content-transform-origin) ui:rounded-md ui:px-3 ui:py-1.5 ui:text-xs ui:text-balance",e),...r,children:[n,h.jsx(h9,{className:"ui:bg-foreground ui:fill-foreground ui:z-50 ui:size-2.5 ui:translate-y-[calc(-50%-2px)] ui:rotate-45 ui:rounded-[2px]"})]})})}const Qk=b.forwardRef(({children:e,...t},n)=>h.jsx(f_,{children:h.jsx(Lf,{ref:n,...t,children:e})}));Qk.displayName=p_.displayName;const ys=({trigger:e,content:t,asChild:n=!0,wrapTrigger:r=!0,triggerClassName:o="",contentClassName:i="ui:max-w-sm",disableContent:s=!1,isPortal:a=!1})=>s?e:h.jsxs(c0,{children:[h.jsx(d0,{asChild:n,children:r?h.jsx("div",{className:L("ui:truncate",o),children:e}):e}),a?h.jsx(Qk,{className:i,children:t}):h.jsx(Lf,{className:i,children:t})]}),gQ=({name:e,label:t,placeholder:n,items:r=[],description:o,multiple:i=!1,emptyMessage:s="No results found",containerClassName:a,hasClearButton:l=!1,hasAllOption:u=!1,allOptionLabel:c="All",disabled:d=!1,tooltipContent:f,control:p,inputMode:g="input"})=>{const m=Mn.useFormContext(),v=p??m?.control;if(!v)throw new Error("FormCombobox must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:v,name:e,render:({field:y})=>h.jsxs(An,{className:L("ui:flex ui:flex-col",a),children:[t&&h.jsxs(mr,{className:L({"ui:flex ui:items-center ui:gap-2":!!f}),children:[t,f&&h.jsx(ys,{triggerClassName:"ui:order-last",content:f,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(r0,{items:r,multiple:i,value:y.value,onValueChange:y.onChange,placeholder:n,emptyMessage:s,disabled:d,hasClearButton:l,hasAllOption:u,allOptionLabel:c,inputMode:g}),o&&h.jsx(xr,{children:o}),h.jsx(Ln,{})]})})};function e2({...e}){return h.jsx(oH,{"data-slot":"select",...e})}function mQ({...e}){return h.jsx(dH,{"data-slot":"select-group",...e})}function t2({...e}){return h.jsx(sH,{"data-slot":"select-value",...e})}function n2({className:e,size:t="default",children:n,...r}){return h.jsxs(iH,{"data-slot":"select-trigger","data-size":t,className:L("ui:flex ui:h-10 ui:w-full ui:items-center ui:justify-between ui:rounded-md ui:border-solid ui:border ui:border-input ui:bg-background ui:px-3 ui:py-2 ui:text-sm ui:placeholder:text-muted-foreground ui:hover:bg-background ui:focus:outline-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:[&>span]:line-clamp-1",e),...r,children:[n,h.jsx(aH,{asChild:!0,children:h.jsx(Oe.ChevronDownIcon,{className:"ui:size-4 ui:opacity-50"})})]})}function r2({className:e,children:t,position:n="item-aligned",isPortal:r=!1,align:o="center",style:i,...s}){const{layer:a}=Nk(),l=a!=null?parseInt(getComputedStyle(a).zIndex,10):NaN,u=Number.isFinite(l)?l+1:void 0,c=h.jsxs(uH,{"data-slot":"select-content",className:L("ui:relative ui:z-50 ui:max-h-96 ui:min-w-32 ui:overflow-hidden ui:rounded-md ui:border ui:bg-popover ui:text-popover-foreground ui:shadow-md ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"ui:data-[side=bottom]:translate-y-1 ui:data-[side=left]:-translate-x-1 ui:data-[side=right]:translate-x-1 ui:data-[side=top]:-translate-y-1",e),position:n,align:o,style:u!=null?{zIndex:u,...i}:i,...s,children:[h.jsx(i2,{}),h.jsx(cH,{className:L("ui:p-1",n==="popper"&&"ui:h-(--radix-select-trigger-height) ui:w-full ui:min-w-(--radix-select-trigger-width) ui:scroll-my-1"),children:t}),h.jsx(s2,{})]});return r?h.jsx(lH,{children:c}):c}function bQ({className:e,...t}){return h.jsx(fH,{"data-slot":"select-label",className:L("ui:text-muted-foreground ui:px-2 ui:py-1.5 ui:text-xs",e),...t})}function o2({className:e,children:t,...n}){return h.jsxs(pH,{"data-slot":"select-item",className:L("ui:focus:bg-accent ui:focus:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4 ui:*:[span]:last:flex ui:*:[span]:last:items-center ui:*:[span]:last:gap-2",e),...n,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"ui:absolute ui:right-2 ui:flex ui:size-3.5 ui:items-center ui:justify-center",children:h.jsx(gH,{children:h.jsx(Oe.CheckIcon,{className:"ui:size-4"})})}),h.jsx(hH,{children:t})]})}function vQ({className:e,...t}){return h.jsx(vH,{"data-slot":"select-separator",className:L("ui:bg-border ui:pointer-events-none ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function i2({className:e,...t}){return h.jsx(mH,{"data-slot":"select-scroll-up-button",className:L("ui:flex ui:cursor-default ui:items-center ui:justify-center ui:py-1",e),...t,children:h.jsx(Oe.ChevronUpIcon,{className:"ui:size-4"})})}function s2({className:e,...t}){return h.jsx(bH,{"data-slot":"select-scroll-down-button",className:L("ui:flex ui:cursor-default ui:items-center ui:justify-center ui:py-1",e),...t,children:h.jsx(Oe.ChevronDownIcon,{className:"ui:size-4"})})}const yQ=({hasFormControlWrapper:e=!1,children:t})=>e?h.jsx(qn,{children:t}):t,f0=({options:e,placeholder:t,hasFormControlWrapper:n=!1,selectContentClassName:r,onChange:o,value:i,label:s,triggerClassName:a,labelClassName:l,containerClassName:u,isPortal:c=!1,...d})=>h.jsxs("article",{className:u,children:[s&&h.jsx(yr,{className:L("ui:mb-2 ui:block",l),children:s}),h.jsxs(e2,{onValueChange:o,value:i,...d,children:[h.jsx(yQ,{hasFormControlWrapper:n,children:h.jsx(n2,{className:L("ui:h-10",a),children:h.jsx(t2,{placeholder:t})})}),h.jsx(r2,{className:r,isPortal:c,children:e.map(f=>h.jsx(o2,{value:f.value,children:f.label},f.value))})]})]}),xQ=({name:e,label:t,options:n,placeholder:r,description:o,tooltipContent:i,hasRequiredIndicator:s=!1,containerClassName:a,control:l,...u})=>{const c=Mn.useFormContext(),d=l??c?.control;if(!d)throw new Error("FormSelect must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:d,name:e,render:({field:f})=>h.jsxs(An,{className:L("ui:w-full",a),children:[h.jsxs(mr,{className:i?"ui:flex ui:items-center ui:gap-2":void 0,children:[t,s&&h.jsx("span",{className:"ui:text-destructive",children:"*"}),i&&h.jsx(ys,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(f0,{...u,options:n,placeholder:r,hasFormControlWrapper:!0,value:f.value??"",onChange:p=>{f.onChange(p),f.onBlur()}}),o&&h.jsx(xr,{children:o}),h.jsx(Ln,{})]})})},wQ=({name:e,label:t,description:n,containerClassName:r,showErrorPlaceholder:o,step:i=60})=>{const{control:s}=Mn.useFormContext();return h.jsx(Fn,{control:s,name:e,render:({field:a})=>h.jsxs(An,{className:L("ui:flex ui:flex-col ui:gap-2 ui:w-full ui:space-y-0",r),children:[t&&h.jsx(mr,{children:t}),h.jsx(qn,{children:h.jsx(xa,{type:"time",step:i,className:"ui:bg-background ui:appearance-none [&::-webkit-calendar-picker-indicator]:ui:hidden [&::-webkit-calendar-picker-indicator]:ui:appearance-none",...a})}),n&&h.jsx(xr,{children:n}),h.jsx(Ln,{showErrorPlaceholder:o})]})})},CQ=({name:e,control:t,disabledCondition:n=!1,label:r,placeholder:o,description:i,containerClassName:s,triggerClassName:a,showErrorPlaceholder:l})=>{const u=Mn.useFormContext(),c=t??u?.control;if(!c)throw new Error("FormDatePicker must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:c,name:e,render:({field:d})=>h.jsxs(An,{className:L("ui:flex ui:flex-col",s),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(mr,{children:r})})}),h.jsxs(o0,{children:[h.jsx(qn,{children:h.jsx(kf,{asChild:!0,children:h.jsxs(Ut,{variant:"outline",className:L("ui:w-[240px] ui:pl-3 ui:text-left ui:font-normal",!d.value&&"ui:text-muted-foreground",a),children:[d.value?ti(new Date(d.value),"dd/MM/yyyy"):h.jsx("span",{children:o}),h.jsx(Oe.CalendarIcon,{className:"ui:ml-auto ui:h-4 ui:w-4 ui:opacity-50"})]})})}),h.jsx(jf,{className:"ui:w-auto ui:p-0",align:"start",children:h.jsx(nx,{mode:"single",selected:d.value?new Date(d.value):void 0,onSelect:f=>{f&&d.onChange(f)},disabled:n,initialFocus:!0})})]}),h.jsx(In,{children:h.jsx(Vt,{condition:!!i,children:h.jsx(xr,{children:i})})}),h.jsx(Ln,{showErrorPlaceholder:l})]})})},SQ=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},EQ=e=>e.type.startsWith("image/"),IQ=({uploadedFile:e,onRemove:t})=>h.jsx("div",{className:"ui:p-3 ui:bg-muted/50 ui:border ui:border-border ui:rounded-lg",children:h.jsxs("div",{className:"ui:flex ui:items-center ui:justify-between ui:gap-3",children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-3 ui:min-w-0",children:[EQ(e.file)?h.jsx("img",{src:e.url,alt:e.file.name,className:"ui:shrink-0 ui:w-10 ui:h-10 ui:object-cover ui:rounded-md"}):h.jsx("div",{className:"ui:shrink-0 ui:p-2 ui:bg-primary/10 ui:rounded-md",children:h.jsx(Oe.FileText,{size:20,className:"ui:text-primary"})}),h.jsxs("div",{className:"ui:min-w-0",children:[h.jsx("p",{className:"ui:text-sm ui:font-medium ui:text-foreground ui:truncate",children:e.file.name}),h.jsx("p",{className:"ui:text-xs ui:text-muted-foreground",children:SQ(e.file.size)})]})]}),h.jsx(Do,{variant:"ghost",size:"sm",isIconOnly:!0,onClick:t,icon:h.jsx(Oe.X,{size:16}),className:L("ui:shrink-0 ui:text-muted-foreground","ui:hover:text-destructive ui:hover:bg-destructive/10")})]})}),a2=({name:e,control:t,label:n,uploadButtonLabel:r="Upload File",uploadingLabel:o="Uploading...",uploadFailedMessage:i="Upload failed",description:s,accept:a="*",disabled:l=!1,multiple:u=!1,containerClassName:c,tooltipContent:d,hasRequiredIndicator:f=!1,onUpload:p})=>{const g=Mn.useFormContext(),m=t??g?.control;if(!m)throw new Error("FormFileUpload must be used within a FormProvider or receive a control prop");const v=O.useRef(null),[y,x]=O.useState(!1),w=async(S,R,I)=>{const T=S.target.files;if(T?.length){x(!0);try{if(u){const M=Array.from(T),V=[];for(const P of M){const N=p?await p(P):URL.createObjectURL(P);V.push({file:P,url:N})}const A=Array.isArray(I)?I:[];R([...A,...V])}else{const M=T[0],V=p?await p(M):URL.createObjectURL(M);R({file:M,url:V})}}catch(M){const V=M instanceof Error?M.message:i;ey.toast.error(V)}finally{x(!1),v.current&&(v.current.value="")}}},C=(S,R,I)=>{if(u&&Array.isArray(R)&&I){const T=R.filter(M=>M!==I);S(T.length>0?T:null)}else S(null);v.current&&(v.current.value="")};return h.jsx(Fn,{control:m,name:e,render:({field:S})=>{const R=S.value,I=u?Array.isArray(R)?R:[]:R&&"file"in R?[R]:[];return h.jsxs(An,{className:L("ui:w-full",c),children:[n&&h.jsxs(mr,{className:L({"ui:flex ui:items-center ui:gap-2":!!d}),children:[n,f&&h.jsx("span",{children:"*"}),d&&h.jsx(ys,{content:d,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:text-muted-foreground ui:cursor-pointer"})})]}),h.jsx(qn,{children:h.jsxs("div",{className:"ui:space-y-3",children:[h.jsxs("div",{className:"ui:relative ui:inline-block",children:[h.jsx("input",{ref:v,type:"file",accept:a,multiple:u,onChange:T=>w(T,S.onChange,R),disabled:l||y,className:L("ui:absolute ui:inset-0 ui:w-full ui:h-full ui:opacity-0 ui:cursor-pointer","ui:disabled:cursor-not-allowed")}),h.jsx(Do,{variant:"outline",label:y?o:r,icon:y?h.jsx(Oe.Loader2,{size:16,className:"ui:animate-spin"}):h.jsx(Oe.Upload,{size:16}),disabled:l||y})]}),I.length>0&&h.jsx("div",{className:"ui:space-y-2",children:I.map((T,M)=>h.jsx(IQ,{uploadedFile:T,onRemove:()=>C(S.onChange,R,T)},`${T.file.name}-${T.file.size}-${M}`))})]})}),h.jsx(Ln,{}),s&&h.jsx(xr,{children:s})]})}})};a2.displayName="FormFileUpload";const Bf=O.forwardRef(({name:e,label:t,labelVariant:n,type:r="text",value:o,onChange:i,description:s="",placeholder:a,className:l,inputClassName:u,isReadOnly:c=!1,readOnly:d,hasRequiredIndicator:f=!1,...p},g)=>h.jsxs("article",{className:l,children:[t&&h.jsxs(yr,{variant:n,className:"ui:mb-2",children:[t,f&&h.jsx("span",{className:"ui:text-destructive",children:"*"})]}),h.jsx(xa,{ref:g,"data-test-id":e,name:e,placeholder:a,value:o,type:r,onChange:i,readOnly:c||d,className:L({"ui:pointer-events-none ui:opacity-30":c||d},u),...p}),s&&h.jsx(Af,{description:s})]}));Bf.displayName="InputField";const RQ=({label:e,containerClassName:t,inputClassName:n,name:r,description:o,placeholder:i="",tooltipContent:s,hasRequiredIndicator:a=!1,control:l,type:u="text",...c})=>{const d=Mn.useFormContext(),f=l??d?.control;if(!f)throw new Error("FormInput must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:f,name:r,render:({field:p})=>h.jsxs(An,{className:L("ui:w-full",t),children:[h.jsxs(mr,{className:s?"ui:flex ui:items-center ui:gap-2":void 0,children:[e,a&&h.jsx("span",{className:"ui:text-destructive",children:"*"}),s&&h.jsx(ys,{content:s,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(qn,{children:h.jsx(Bf,{...p,...c,type:u,placeholder:i,inputClassName:L(n)})}),o&&h.jsx(xr,{children:o}),h.jsx(Ln,{})]})})},AQ=({label:e,name:t,containerClassName:n,description:r,placeholder:o,tooltipContent:i,control:s,hasRequiredIndicator:a=!1,...l})=>{const u=Mn.useFormContext(),c=s??u?.control;if(!c)throw new Error("FormPassword must be used within a FormProvider or receive a control prop");const[d,f]=O.useState(!1),p=()=>{f(g=>!g)};return h.jsx(Fn,{control:c,name:t,render:({field:g})=>h.jsxs(An,{className:L("ui:w-full",n),children:[e&&h.jsxs(mr,{className:L({"ui:flex ui:items-center ui:gap-2":!!i}),children:[e,a&&h.jsx("span",{children:"*"}),i&&h.jsx(ys,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(qn,{children:h.jsxs("div",{className:"ui:relative",children:[h.jsx(Bf,{...g,...l,type:d?"text":"password",placeholder:o,hasRequiredIndicator:a,inputClassName:"pr-8"}),h.jsx("button",{type:"button",onClick:p,className:"ui:absolute ui:right-3 ui:top-1/2 ui:-translate-y-1/2 ui:text-muted-foreground ui:hover:text-foreground ui:transition-colors",tabIndex:-1,children:d?h.jsx(Oe.EyeOff,{size:16,className:"ui:cursor-pointer"}):h.jsx(Oe.Eye,{size:16,className:"ui:cursor-pointer"})})]})}),r&&h.jsx(xr,{children:r}),h.jsx(Ln,{})]})})};function l2({className:e,...t}){return h.jsx(wG,{"data-slot":"radio-group",className:L("ui:grid ui:gap-3",e),...t})}function u2({className:e,...t}){return h.jsx(CG,{"data-slot":"radio-group-item",className:L("ui:p-0! ui:aspect-square ui:h-4 ui:w-4 ui:rounded-full ui:border ui:border-solid ui:border-primary ui:text-primary ui:bg-transparent ui:hover:bg-transparent ui:ring-offset-background ui:focus:outline-none ui:focus-visible:ring-2 ui:focus-visible:ring-ring ui:focus-visible:ring-offset-2 ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:transition-none",e),...t,children:h.jsx(SG,{"data-slot":"radio-group-indicator",className:"ui:relative ui:flex ui:items-center ui:justify-center",children:h.jsx(Oe.CircleIcon,{className:"ui:fill-primary ui:absolute ui:top-1/2 ui:left-1/2 ui:size-2 ui:-translate-x-1/2 ui:-translate-y-1/2"})})})}const TQ=({name:e,label:t,items:n,control:r,containerClassName:o,itemClassName:i,itemLabelClassName:s,selectedClassName:a,description:l})=>{const u=Mn.useFormContext(),c=r??u?.control;if(!c)throw new Error("FormRadio must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:c,name:e,render:({field:d})=>h.jsxs(An,{className:L("ui:space-y-3",o),children:[t&&h.jsx(mr,{children:t}),h.jsx(qn,{children:h.jsx(l2,{onValueChange:d.onChange,defaultValue:d.value,className:"ui:flex ui:flex-col ui:space-y-1",children:n.map(f=>h.jsxs(An,{className:L("ui:flex ui:items-center ui:space-y-0",i,d.value===f.value&&a),children:[h.jsx(qn,{children:h.jsx(u2,{value:f.value})}),h.jsx(mr,{className:L("ui:font-normal",s),children:f.label})]},f.value))})}),h.jsx(Ln,{}),l&&h.jsx(xr,{children:l})]})})};function c2({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const s=b.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return h.jsxs(DH,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:L("ui:relative ui:flex ui:w-full ui:touch-none ui:items-center ui:select-none ui:data-[disabled]:opacity-50 ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:min-h-44 ui:data-[orientation=vertical]:w-auto ui:data-[orientation=vertical]:flex-col",e),...i,children:[h.jsx(kH,{"data-slot":"slider-track",className:L("ui:bg-muted ui:relative ui:grow ui:overflow-hidden ui:rounded-full ui:data-[orientation=horizontal]:h-1.5 ui:data-[orientation=horizontal]:w-full ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:w-1.5"),children:h.jsx(jH,{"data-slot":"slider-range",className:L("ui:bg-primary ui:absolute ui:data-[orientation=horizontal]:h-full ui:data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(a,l)=>h.jsx(FH,{"data-slot":"slider-thumb",className:"ui:border-primary ui:ring-ring/50 ui:block ui:size-4 ui:shrink-0 ui:rounded-full ui:border ui:bg-white ui:shadow-sm ui:transition-[color,box-shadow] ui:hover:ring-4 ui:focus-visible:ring-4 ui:focus-visible:outline-hidden ui:disabled:pointer-events-none ui:disabled:opacity-50"},l))]})}const NQ=({name:e,control:t,label:n,description:r,min:o=0,max:i=100,step:s=1,leftLabel:a,rightLabel:l,showLabels:u=!0,complementaryField:c,onValueChange:d,containerClassName:f,labelClassName:p,showErrorPlaceholder:g=!1,tooltipContent:m,...v})=>{const y=Mn.useFormContext(),x=t??y?.control;if(!x)throw new Error("FormSlider must be used within a FormProvider or receive a control prop");const w=O.useRef(!1),C=Mn.useWatch({control:x,name:e});return h.jsx(Fn,{control:x,name:e,render:({field:S})=>{const R=T=>{if(w.current)return;const M=T[0];w.current=!0,S.onChange(String(M)),c&&y?.setValue&&y.setValue(c,String(i-M),{shouldValidate:!0}),d&&d(M),setTimeout(()=>{w.current=!1},0)},I=Number(C)||o+(i-o)/2;return h.jsxs(An,{className:L("ui:w-full",f),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!n,children:h.jsxs(mr,{className:L(p,{"ui:flex ui:items-center ui:gap-2":!!m}),children:[n,m&&h.jsx(ys,{content:m,contentClassName:"ui:max-w-96",trigger:h.jsx(Oe.Info,{size:16,color:"#737373",className:"ui:cursor-pointer"})})]})})}),h.jsx(qn,{children:h.jsxs("div",{className:"ui:space-y-2",children:[h.jsx(c2,{value:[I],onValueChange:R,min:o,max:i,step:s,className:"ui:w-full",...v}),u&&h.jsxs("div",{className:"ui:flex ui:justify-between ui:text-sm ui:text-gray-600",children:[a&&h.jsxs("span",{children:[a,": ",I,i===100?"%":""]}),l&&h.jsxs("span",{children:[l,": ",c?i-I:I,i===100?"%":""]})]})]})}),h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(xr,{className:"ui:text-xs",children:r})})}),h.jsx(Ln,{showErrorPlaceholder:g})]})}})};function d2({className:e,...t}){return h.jsx(GH,{"data-slot":"switch",className:L("ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:p-0",e),...t,children:h.jsx(HH,{"data-slot":"switch-thumb",className:L("ui:bg-background ui:dark:data-[state=unchecked]:bg-foreground ui:dark:data-[state=checked]:bg-primary-foreground ui:pointer-events-none ui:block ui:size-4 ui:rounded-full ui:ring-0 ui:transition-transform ui:data-[state=checked]:translate-x-[calc(100%-2px)] ui:data-[state=unchecked]:translate-x-0")})})}const f2=({label:e="",name:t,...n})=>h.jsxs("article",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(d2,{id:t,...n}),e&&h.jsx(yr,{htmlFor:t,children:e})]}),OQ=({name:e,label:t,description:n,control:r,className:o,...i})=>{const s=Mn.useFormContext(),a=r??s?.control;if(!a)throw new Error("FormSwitch must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:a,name:e,render:({field:l})=>h.jsxs(An,{className:o,children:[h.jsx(qn,{children:h.jsx(f2,{...l,...i,label:t,checked:!!l.value,onCheckedChange:l.onChange})}),h.jsx(Ln,{}),n&&h.jsx(xr,{children:n})]})})},p2=({textAreaClassName:e,value:t,onChange:n,label:r,...o})=>h.jsxs("article",{children:[r&&h.jsx(yr,{className:"ui:mb-2 ui:block",children:r}),h.jsx(Ok,{className:L("ui:w-full",e),value:t,onChange:n,...o})]}),PQ=({label:e,name:t,description:n,placeholder:r,containerClassName:o,control:i,...s})=>{const a=Mn.useFormContext(),l=i??a?.control;if(!l)throw new Error("FormTextarea must be used within a FormProvider or receive a control prop");return h.jsx(Fn,{control:l,name:t,render:({field:u})=>h.jsxs(An,{className:L("ui:w-full",o),children:[h.jsx(mr,{children:e}),h.jsx(qn,{children:h.jsx(p2,{placeholder:r,...u,...s})}),n&&h.jsx(xr,{children:n}),h.jsx(Ln,{})]})})};function _Q({...e}){return h.jsx(J3,{"data-slot":"hover-card",...e})}function MQ({...e}){return h.jsx(K3,{"data-slot":"hover-card-trigger",...e})}function DQ({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(Q3,{"data-slot":"hover-card-portal",children:h.jsx(eG,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:L("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-64 ui:origin-(--radix-hover-card-content-transform-origin) ui:rounded-md ui:border ui:p-4 ui:shadow-md ui:outline-hidden",e),...r})})}function kQ({name:e,className:t,...n}){return h.jsx("i",{className:L(`icon-${e}`,t),...n,children:h.jsxs("span",{className:"ui:for-screenreader-only",children:[e," icon"]})})}var jQ=Object.defineProperty,FQ=Object.defineProperties,LQ=Object.getOwnPropertyDescriptors,vd=Object.getOwnPropertySymbols,h2=Object.prototype.hasOwnProperty,g2=Object.prototype.propertyIsEnumerable,dI=(e,t,n)=>t in e?jQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BQ=(e,t)=>{for(var n in t||(t={}))h2.call(t,n)&&dI(e,n,t[n]);if(vd)for(var n of vd(t))g2.call(t,n)&&dI(e,n,t[n]);return e},VQ=(e,t)=>FQ(e,LQ(t)),$Q=(e,t)=>{var n={};for(var r in e)h2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vd)for(var r of vd(e))t.indexOf(r)<0&&g2.call(e,r)&&(n[r]=e[r]);return n};function GQ(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function HQ(e){let t=b.useRef();return b.useEffect(()=>{t.current=e}),t.current}var WQ=18,m2=40,zQ=`${m2}px`,qQ=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function UQ({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[o,i]=b.useState(!1),[s,a]=b.useState(!1),[l,u]=b.useState(!1),c=b.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&o&&s,[o,s,n]),d=b.useCallback(()=>{let f=e.current,p=t.current;if(!f||!p||l||n==="none")return;let g=f,m=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,y=m-WQ,x=v;document.querySelectorAll(qQ).length===0&&document.elementFromPoint(y,x)===f||(i(!0),u(!0))},[e,t,l,n]);return b.useEffect(()=>{let f=e.current;if(!f||n==="none")return;function p(){let m=window.innerWidth-f.getBoundingClientRect().right;a(m>=m2)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,n]),b.useEffect(()=>{let f=r||document.activeElement===t.current;if(n==="none"||!f)return;let p=setTimeout(d,0),g=setTimeout(d,2e3),m=setTimeout(d,5e3),v=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(m),clearTimeout(v)}},[t,r,n,d]),{hasPWMBadge:o,willPushPWMBadge:c,PWM_BADGE_SPACE_WIDTH:zQ}}var YQ=b.createContext({}),b2=b.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,maxLength:i,textAlign:s="left",pattern:a,placeholder:l,inputMode:u="numeric",onComplete:c,pushPasswordManagerStrategy:d="increase-width",pasteTransformer:f,containerClassName:p,noScriptCSSFallback:g=XQ,render:m,children:v}=n,y=$Q(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),x,w,C,S,R;let[I,T]=b.useState(typeof y.defaultValue=="string"?y.defaultValue:""),M=r??I,V=HQ(M),A=b.useCallback(k=>{o?.(k),T(k)},[o]),P=b.useMemo(()=>a?typeof a=="string"?new RegExp(a):a:null,[a]),N=b.useRef(null),B=b.useRef(null),j=b.useRef({value:M,onChange:A,isIOS:typeof window<"u"&&((w=(x=window?.CSS)==null?void 0:x.supports)==null?void 0:w.call(x,"-webkit-touch-callout","none"))}),D=b.useRef({prev:[(C=N.current)==null?void 0:C.selectionStart,(S=N.current)==null?void 0:S.selectionEnd,(R=N.current)==null?void 0:R.selectionDirection]});b.useImperativeHandle(t,()=>N.current,[]),b.useEffect(()=>{let k=N.current,ie=B.current;if(!k||!ie)return;j.current.value!==k.value&&j.current.onChange(k.value),D.current.prev=[k.selectionStart,k.selectionEnd,k.selectionDirection];function Y(){if(document.activeElement!==k){W(null),K(null);return}let re=k.selectionStart,fe=k.selectionEnd,de=k.selectionDirection,ve=k.maxLength,we=k.value,Se=D.current.prev,Ye=-1,at=-1,Xe;if(we.length!==0&&re!==null&&fe!==null){let gt=re===fe,ct=re===we.length&&we.length<ve;if(gt&&!ct){let ot=re;if(ot===0)Ye=0,at=1,Xe="forward";else if(ot===ve)Ye=ot-1,at=ot,Xe="backward";else if(ve>1&&we.length>1){let mt=0;if(Se[0]!==null&&Se[1]!==null){Xe=ot<Se[1]?"backward":"forward";let Ot=Se[0]===Se[1]&&Se[0]<ve;Xe==="backward"&&!Ot&&(mt=-1)}Ye=mt+ot,at=mt+ot+1}}Ye!==-1&&at!==-1&&Ye!==at&&N.current.setSelectionRange(Ye,at,Xe)}let Ue=Ye!==-1?Ye:re,rt=at!==-1?at:fe,et=Xe??de;W(Ue),K(rt),D.current.prev=[Ue,rt,et]}if(document.addEventListener("selectionchange",Y,{capture:!0}),Y(),document.activeElement===k&&H(!0),!document.getElementById("input-otp-style")){let re=document.createElement("style");if(re.id="input-otp-style",document.head.appendChild(re),re.sheet){let fe="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";za(re.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),za(re.sheet,`[data-input-otp]:autofill { ${fe} }`),za(re.sheet,`[data-input-otp]:-webkit-autofill { ${fe} }`),za(re.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),za(re.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let le=()=>{ie&&ie.style.setProperty("--root-height",`${k.clientHeight}px`)};le();let pe=new ResizeObserver(le);return pe.observe(k),()=>{document.removeEventListener("selectionchange",Y,{capture:!0}),pe.disconnect()}},[]);let[$,G]=b.useState(!1),[z,H]=b.useState(!1),[ne,W]=b.useState(null),[J,K]=b.useState(null);b.useEffect(()=>{GQ(()=>{var k,ie,Y,le;(k=N.current)==null||k.dispatchEvent(new Event("input"));let pe=(ie=N.current)==null?void 0:ie.selectionStart,re=(Y=N.current)==null?void 0:Y.selectionEnd,fe=(le=N.current)==null?void 0:le.selectionDirection;pe!==null&&re!==null&&(W(pe),K(re),D.current.prev=[pe,re,fe])})},[M,z]),b.useEffect(()=>{V!==void 0&&M!==V&&V.length<i&&M.length===i&&c?.(M)},[i,c,V,M]);let U=UQ({containerRef:B,inputRef:N,pushPasswordManagerStrategy:d,isFocused:z}),oe=b.useCallback(k=>{let ie=k.currentTarget.value.slice(0,i);if(ie.length>0&&P&&!P.test(ie)){k.preventDefault();return}typeof V=="string"&&ie.length<V.length&&document.dispatchEvent(new Event("selectionchange")),A(ie)},[i,A,V,P]),X=b.useCallback(()=>{var k;if(N.current){let ie=Math.min(N.current.value.length,i-1),Y=N.current.value.length;(k=N.current)==null||k.setSelectionRange(ie,Y),W(ie),K(Y)}H(!0)},[i]),te=b.useCallback(k=>{var ie,Y;let le=N.current;if(!f&&(!j.current.isIOS||!k.clipboardData||!le))return;let pe=k.clipboardData.getData("text/plain"),re=f?f(pe):pe;k.preventDefault();let fe=(ie=N.current)==null?void 0:ie.selectionStart,de=(Y=N.current)==null?void 0:Y.selectionEnd,ve=(fe!==de?M.slice(0,fe)+re+M.slice(de):M.slice(0,fe)+re+M.slice(fe)).slice(0,i);if(ve.length>0&&P&&!P.test(ve))return;le.value=ve,A(ve);let we=Math.min(ve.length,i-1),Se=ve.length;le.setSelectionRange(we,Se),W(we),K(Se)},[i,A,P,M]),Q=b.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),se=b.useMemo(()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:s,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,s]),ae=b.useMemo(()=>b.createElement("input",VQ(BQ({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":M.length===0||void 0,"data-input-otp-mss":ne,"data-input-otp-mse":J,inputMode:u,pattern:P?.source,"aria-placeholder":l,style:se,maxLength:i,value:M,ref:N,onPaste:k=>{var ie;te(k),(ie=y.onPaste)==null||ie.call(y,k)},onChange:oe,onMouseOver:k=>{var ie;G(!0),(ie=y.onMouseOver)==null||ie.call(y,k)},onMouseLeave:k=>{var ie;G(!1),(ie=y.onMouseLeave)==null||ie.call(y,k)},onFocus:k=>{var ie;X(),(ie=y.onFocus)==null||ie.call(y,k)},onBlur:k=>{var ie;H(!1),(ie=y.onBlur)==null||ie.call(y,k)}})),[oe,X,te,u,se,i,J,ne,y,P?.source,M]),F=b.useMemo(()=>({slots:Array.from({length:i}).map((k,ie)=>{var Y;let le=z&&ne!==null&&J!==null&&(ne===J&&ie===ne||ie>=ne&&ie<J),pe=M[ie]!==void 0?M[ie]:null,re=M[0]!==void 0?null:(Y=l?.[ie])!=null?Y:null;return{char:pe,placeholderChar:re,isActive:le,hasFakeCaret:le&&pe===null}}),isFocused:z,isHovering:!y.disabled&&$}),[z,$,i,J,ne,y.disabled,M]),Z=b.useMemo(()=>m?m(F):b.createElement(YQ.Provider,{value:F},v),[v,F,m]);return b.createElement(b.Fragment,null,g!==null&&b.createElement("noscript",null,b.createElement("style",null,g)),b.createElement("div",{ref:B,"data-input-otp-container":!0,style:Q,className:p},Z,b.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ae)))});b2.displayName="Input";function za(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var XQ=`
|
|
89
89
|
[data-input-otp] {
|
|
90
90
|
--nojs-bg: white !important;
|
|
91
91
|
--nojs-fg: black !important;
|