@g4rcez/components 0.0.65 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -174,7 +174,7 @@
174
174
  */var Oh;function lA(){return Oh||(Oh=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=ov();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,f,h,p){var m=s(null),g;m.current===null?(g={hasValue:!1,value:null},m.current=g):g=m.current;var v=a(function(){var T=!1,E,R,I=function(M){if(!T){T=!0,E=M;var j=h(M);if(p!==void 0&&g.hasValue){var P=g.value;if(p(P,j))return R=P,P}return R=j,j}var O=E,F=R;if(r(O,M))return F;var V=h(M);return p!==void 0&&p(F,V)?F:(E=M,R=V,V)},k=f===void 0?null:f,A=function(){return I(d())},N=k===null?void 0:function(){return I(k())};return[A,N]},[d,f,h,p]),b=v[0],y=v[1],S=o(u,b,y);return i(function(){g.hasValue=!0,g.value=S},[S]),l(S),S}Ah.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ah}process.env.NODE_ENV==="production"?aA():lA();const Ir=e=>{const t=w.useRef(e??{});return w.useEffect(()=>void(t.current=e),[e]),t},cA=e=>{const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current},uA=e=>Object.entries(e),sv=e=>e instanceof Promise,iv=(e,t,n,r)=>t===e?n.reduce((o,s)=>s(o,t,r),e):e.constructor.name===Object.name?n.reduce((o,s)=>s(o,t,r),{...t,...e}):n.reduce((o,s)=>s(o,t,r),e),dA=(e,t,n,r,o,s)=>(...i)=>{const a=performance.now(),l=t(...i),c=(u,d)=>n(f=>iv(u,f,s,d));return sv(l)?l.then(u=>{o.current={method:e,props:r(),time:performance.now()-a},c(u,o.current)}):(o.current={method:e,props:r(),time:performance.now()-a},void c(l,o.current))},fA=(e,t,n,r,o,s)=>(...i)=>{o.current={method:e,time:0,props:r()};const a=t(...i),l=c=>n(u=>iv(c,u,s,o.current));return sv(a)?a.then(c=>l(c)):l(a)},Au=(e,t,n)=>{const[r,o]=w.useState(()=>e),s=Ir(r),i=Ir((n==null?void 0:n.props)??{}),a=Ir(t),l=Ir((n==null?void 0:n.postMiddleware)??[]),c=Ir((n==null?void 0:n.interceptor)??[]),u=w.useRef(e),d=cA(r),f=Ir(d),h=w.useRef(null);w.useEffect(()=>{if(h.current===null)return;const m=h.current;l.current.forEach(g=>{g(r,d,m)})},[r,l,d]);const[p]=w.useState(()=>{const m=()=>i.current,g=a.current({props:m,state:()=>s.current,initialState:u.current,previousState:()=>f.current});return uA(g).reduce((v,[b,y])=>({...v,[b]:n!=null&&n.debug?dA(b,y,o,m,h,c.current):fA(b,y,o,m,h,c.current)}),{})});return[r,p,i.current]},hA=(e,t=0)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e(...o),t)}};function pA(e,t){return w.useRef(hA(e,t)).current}const sa={cssVariable:(e,t,n)=>`var(--${n})`,rgba:e=>`rgba(${e})`,rgb:e=>`rgb(${e})`,hsl:e=>`hsl(${e})`,hsla:e=>`hsla(${e})`,hex:e=>e,raw:e=>e,formatWithVar:e=>(t,n,r)=>`${e}(var(--${r}), <alpha-value>)`},Nr=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return o.concat(t(i,l,a))}return o.concat(Nr(i,t,n,a))},[]),av=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return{...o,[l]:t(i,s,a)}}return{...o,[s]:av(i,t,n,a)}},{}),Dh={default:e=>`:root { ${e} }`,dark:e=>`html.dark {${e}}`},ac=(e,t)=>{const n=t.value||((o,s)=>s),r=e.map(o=>`${o.key}: ${n(o.key,o.value)}`).join(";");return t.result(r)},mA={default:e=>ac(e,{result:Dh.default}),dark:e=>ac(e,{result:Dh.dark})},gA=(e,t)=>{const n=(a,l,c)=>({key:`--${c}`,value:`${a}`}),r=Nr(e.colors,n),o=Nr(e.spacing,n),s=Nr(e.rounded,n),i=e.custom?Nr(e.custom,n):[];return ac(r.concat(o,s,i),{result:a=>`html${t?`.${t}`:""} {${a}}`,value:(a,l)=>l.replace("hsla(","").replace(")","")})},lv={button:"0.4rem",pill:"2rem",card:"0.75rem",full:"9999px"},cv={base:"1rem",lg:"1.5rem",sm:"0.75rem","input-height":"2.5rem","input-x":"0.5rem","input-y":"0.25rem","input-inline":"0.25rem","input-gap":"0.3rem"},yA={name:"dark",rounded:lv,spacing:cv,shadow:{floating:"rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px"},colors:{foreground:"hsla(210, 50%, 98%)",background:"hsla(0, 0%, 9%)",disabled:"hsla(240, 4%, 33%)",emphasis:{foreground:"hsla(251, 91%, 95%)",DEFAULT:"hsla(255, 92%, 76%)",subtle:"hsla(252, 95%, 85%)",hover:"hsla(262, 83%, 58%)"},primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(200,98%,39%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{DEFAULT:"hsla(210, 32%, 70%)",background:"hsla(210, 30%, 81%)",subtle:"hsla(210, 27%, 88%)",hover:"hsla(210, 10%, 58%)",foreground:"hsla(210, 20%, 30%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 93%, 77%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(219, 91%, 59%)"},warn:{DEFAULT:"hsla(27, 96%, 61%)",subtle:"hsla(45, 95%, 66%)",hover:"hsla(21, 90%, 48%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(32, 65%, 75%)"},danger:{DEFAULT:"hsla(358, 65%, 57%)",subtle:"hsla(0, 94%, 81%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(358, 40%, 23%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 75%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 50%)",notification:"hsla(161,62%,17%)"},input:{border:"hsla(240, 4%, 25%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 9%)",switch:"hsla(0, 0%, 100%)"},card:{background:"hsla(0, 0%, 15%)",border:"hsla(240, 7%, 27%)"},floating:{background:"hsla(0, 0%, 14%)",border:"hsla(240, 7%, 27%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(210, 40%, 98%)",background:"hsla(0, 0%, 8%)",border:"hsla(0, 0%, 19%)"},table:{header:"hsla(0, 0%, 12%)",background:"hsla(0, 0%, 15%)",border:"hsla(240, 4%, 33%)"},button:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,90%)",bg:"hsla(5,62%,23%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,79%)",bg:"hsla(5,62%,23%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},alert:{primary:{text:"hsla(210,100%,72%)",border:"hsla(212,69%,16%)",bg:"hsla(215,42%,9%)"},warn:{bg:"hsla(28,33%,9%)",border:"hsla(29,65%,12%)",text:"hsla(27,100%,78%)"},info:{text:"hsla(253,100%,83%)",bg:"hsla(263,28%,11%)",border:"hsla(252,34%,51%)"},success:{text:"hsla(144,79%,79%)",bg:"hsla(153,20%,9%)",border:"hsla(144,70%,14%)"},danger:{text:"hsla(350,100%,91%)",bg:"hsla(355,25%,15%)",border:"hsla(355,25%,10%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(220,9%,94%)",bg:"hsla(220,6%,10%)",border:"hsla(214,7%,19%)"}}}},vA={name:"light",rounded:lv,spacing:cv,shadow:{floating:"rgba(50, 50, 50, 0.1) 0px 0px 0px 1px, rgba(50, 50, 50, 0.1) 0px 3px 6px, rgba(50, 50, 50, 0.1) 0px 2px 3px"},colors:{foreground:"hsla(217, 15%, 30%)",background:"hsla(210, 34%, 96%)",disabled:"hsla(240, 10%, 78%)",emphasis:{foreground:"hsla(251,91%,95%)",DEFAULT:"hsla(255,92%,76%)",subtle:"hsla(252,95%,85%)",hover:"hsla(262,83%,58%)"},primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(199, 89%, 54%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{background:"hsla(210, 25%, 35%)",DEFAULT:"hsla(210, 25%, 35%)",subtle:"hsla(207, 29%, 39%)",hover:"hsla(210, 21%, 67%)",foreground:"hsla(210, 40%, 98%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 70%, 90%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(219, 91%, 59%)"},danger:{DEFAULT:"hsla(0, 82%, 63%)",subtle:"hsla(0, 96%, 95%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(0, 100%, 87%)"},warn:{DEFAULT:"hsla(27, 100%, 70%)",subtle:"hsla(45, 95%, 80%)",hover:"hsla(29, 85%, 50%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(27, 85%, 92%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 90%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 17%)",notification:"hsla(160, 75%, 80%)"},input:{border:"hsla(218, 22%, 85%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 45%)",switch:"hsla(0, 0%, 100%)"},card:{background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)"},floating:{background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(217, 15%, 20%)",background:"hsla(210, 25%, 98%)",border:"hsla(200, 1%, 80%)"},table:{header:"hsla(221, 10%, 90%)",background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)"},button:{primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,96%,48%)"},warn:{bg:"hsla(26,90%,60%)",text:"hsla(0, 0%, 100%)"},info:{text:"hsla(0, 0%, 100%)",bg:"hsla(210,60%,60%)"},success:{text:"hsla(0, 0%, 100%)",bg:"hsla(152,56%,39%)"},danger:{text:"hsla(0, 0%, 100%)",bg:"hsla(10,78%,54%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,70%,55%)"},warn:{bg:"hsla(30,100%,82%)",text:"hsla(23,100%,40%)"},info:{text:"hsla(196,100%,20%)",bg:"hsla(197,65%,80%)"},success:{text:"hsla(154,52%,19%)",bg:"hsla(152,56%,80%)"},danger:{text:"hsla(10,82%,45%)",bg:"hsla(359,94%,92%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},alert:{primary:{text:"hsla(206,70%,50%)",border:"hsla(206,90%,89%)",bg:"hsla(205,92%,95%)"},warn:{bg:"hsla(23,100%,96%)",text:"hsla(23,93%,53%)",border:"hsla(33,100%,85%)"},info:{text:"hsla(252,56%,57%)",bg:"hsla(256,100%,95%)",border:"hsla(252,76%,84%)"},success:{text:"hsla(152,56%,39%)",bg:"hsla(139,47%,93%)",border:"hsla(152,58%,78%)"},danger:{text:"hsla(358,69%,55%)",bg:"hsla(357,90%,96%)",border:"hsla(359,100%,90%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(216,10%,10%)",bg:"hsla(214,7%,92%)",border:"hsla(216,22%,78%)"}}}},bA=yA,xA=vA,Ou={emptyDataMessage:"No data",inputCaretDown:"Click to see all options",inputCloseValue:"Click to clear the value",datePickerCalendarButtonLabel:"Click to open a date picker",inputOptionalLabel:"Optional",autocompleteEmpty:"Nothing here...",tableGroupLabel:"Group",tableGroupLabelWithCount:"Group",tableSortAsc:"Ascending",tableSortOrderByLabel:"Order by",tableSortOrderInputPlaceholder:"Order by",tableSortOrderInputTitle:"Order by",tableSortTypeInputPlaceholder:"Ascending",tableSortTypeInputTitle:"Sort type",tableSortAddButton:"Add sort",tableSortDropdownTitle:"Order by",tableSortDesc:"Descending",tableColumnResizer:"Resize column",tableFilterTypeContains:"Contains",tableFilterTypeIs:"Is",tableFilterTypeIsNot:"Is not",tableFilterTypeNotContains:"Not contains",tableFilterTypeLessThan:"Less than",tableFilterTypeGreaterThan:"Greater than",tableFilterTypeStartsWith:"Starts with",tableFilterTypeEndsWith:"Ends with",tableFilterNewFilter:"New filter",tableFilterColumnTitle:"Filter by",tableFilterColumnPlaceholder:"Filter by",tableFilterOperatorTitle:"Operation",tableFilterOperatorPlaceholder:"Equals to...",tableFilterValueTitle:"Value",tableFilterValuePlaceholder:"Something...",tableFilterLabel:"Filters",tableFilterDropdownTitle:"Filters",tableFilterDropdownTitleUnique:"Filter by",tablePaginationPrevious:"Previous",tablePaginationNext:"Next",tablePaginationSelectLabel:"Select the size of page",tablePaginationFooter:e=>x.jsxs(w.Fragment,{children:[e.current," to ",e.pages," of ",e.totalItems," items.",Array.isArray(e.sizes)?e.select:null," per page."]}),calendarFromDate:"From",calendarToDate:"To",calendarToday:"Today"},ia=w.createContext({colorTokenParser:sa.hsla,translations:Ou,locale:void 0}),wA=e=>{const t=w.useMemo(()=>({locale:e.locale,translations:{...Ou,...e.map},colorTokenParser:e.parser||sa.hsla}),[e]);return x.jsx(ia.Provider,{value:t,children:e.children})},uv=()=>{const e=w.useContext(ia);if(e)return e.locale},Ct=()=>{const e=w.useContext(ia);return e?e.translations:Ou},TA=()=>{const e=w.useContext(ia);return e?e.colorTokenParser:sa.hsla},Bt=(e,t=2)=>e.toString(16).padStart(t,"0"),Ps=()=>{const e=Date.now(),t=e/1e3&4095|28672,n=e%1e3,r=new Uint8Array(10);for(let o=0;o<r.length;o++)r[o]=Math.floor(Math.random()*256);return r[0]=r[0]&63|128,`${Bt(t,4)+Bt(n,3)}-${Bt(r[0])+Bt(r[1])}-${Bt(r[2])+Bt(r[3])}-${Bt(r[4])+Bt(r[5])}-${Bt(r[6])+Bt(r[7])+Bt(r[8])+Bt(r[9])}`},Mh=(e,t,n)=>e.split(t).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,n),kh={basic:/[,[\]]+?/,extend:/[,[\].]+?/},Du=(e,t)=>{const n=Mh(t,kh.basic,e)||Mh(t,kh.extend,e);return n===void 0||n===e?void 0:n},Ri=()=>typeof window>"u",lc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),dv=(e,t)=>{const n=[];for(let r=0;r<t;r++){const o=r*t,s=e.slice(o,o+t);s.length>0&&n.push(s)}return n},SA={type:"spring",bounce:.3,duration:.6},Fh=e=>(t=1)=>({x:`${100*e*t}%`,opacity:.25}),fv={middle:{x:"0%",opacity:1},enter:Fh(1),exit:Fh(-1)},jh={exit:{visibility:"hidden"}},EA=e=>{const t=fn(By(e));return $y({start:t,end:bo(t,41)})},hv=(e,t)=>e.toLocaleDateString(t,{month:"long"}),CA=(e,t,n)=>Array.from({length:12}).map((r,o)=>{const s=By(new Date(1970,o,1).setMonth(o)),i=hv(s,n);return x.jsx("option",{value:i,"data-index":o,children:i},`${e}-${i}`)}),tl={ArrowLeft:(e,t)=>t==="days"?VI(e,1):Zy(e,1),ArrowRight:(e,t)=>t==="days"?bo(e,1):oa(e,1),ArrowUp:(e,t)=>t==="days"?$I(e,1):BI(e,1),ArrowDown:(e,t)=>t==="days"?Ly(e,1):_y(e,1)},Nh=(e,t,n,r=0)=>{const o=n.toISOString(),s=()=>{var i;if(e!=null&&e.dataset.focustrap){const a=(i=t.current)==null?void 0:i.querySelector(`button[data-focustrap="${e==null?void 0:e.dataset.focustrap}"]`);return setTimeout(()=>a==null?void 0:a.focus({preventScroll:!1}),r)}if(t.current){const a=t.current.querySelector(`button[data-date="${o}"]`);if(a)return a.focus({preventScroll:!1})}};r===0&&s(),setTimeout(s,r)},er=e=>e.getFullYear().toString().padStart(4,"0"),PA=(e,t,n)=>e===void 0||n===void 0?!1:$R(t,e)&&BR(t,n),RA=e=>{var n;const t=Ct();return x.jsx(dt.tbody,{layout:!0,variants:fv,custom:e.direction,onKeyDown:e.onKeyDown,className:ke((n=e.styles)==null?void 0:n.week),children:e.zip.map((r,o)=>{var s;return x.jsx("tr",{className:(s=e.styles)==null?void 0:s.week,children:r.map(i=>{var h,p,m,g,v,b,y,S,T,E,R,I,k,A;const a=i.toISOString(),l=e.rangeMode?a===((p=(h=e.range)==null?void 0:h.to)==null?void 0:p.toISOString())||a===((g=(m=e.range)==null?void 0:m.from)==null?void 0:g.toISOString()):a===((v=e.date)==null?void 0:v.toISOString()),c=_I(i)&&e.markToday,u=((b=e.disabledDate)==null?void 0:b.call(e,i))||!1,d=!LI(i,e.stateDate)||u,f=e.rangeMode?PA((y=e.range)==null?void 0:y.from,i,(S=e.range)==null?void 0:S.to):!1;return x.jsxs("td",{align:"center",className:ke("relative",(T=e.styles)==null?void 0:T.dayFrame),children:[x.jsxs("button",{type:"button","data-date":a,disabled:u,"data-range":e.rangeMode,onClick:e.dispatch.onSelectDate,"data-view":e.stateDate.getMonth().toString(),className:ke(`flex size-10 items-center justify-center rounded-full proportional-nums disabled:cursor-not-allowed ${c?"text-emphasis":""} ${d?"text-disabled":""} ${l?"bg-primary text-primary-foreground":""}`,(E=e.styles)==null?void 0:E.day,f&&e.markRange?"size-10 border border-dashed border-card-border":""),children:[i.getDate(),l&&((R=e.stateRange.from)==null?void 0:R.toISOString())===a?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:((I=e.labelRange)==null?void 0:I.from)??t.calendarFromDate})}):null,l&&((k=e.stateRange.to)==null?void 0:k.toISOString())===a?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:((A=e.labelRange)==null?void 0:A.to)??t.calendarToDate})}):null]}),e.RenderOnDay?x.jsx(e.RenderOnDay,{date:i}):null]},a)})},`week-${r.length}-${o}`)})})},pv=({RenderOnDay:e,changeOnlyOnClick:t=!1,labelRange:n,disabledDate:r,locale:o,markToday:s=!0,onChangeMonth:i,onChangeYear:a,rangeMode:l=!1,onChange:c,styles:u,markRange:d=!0,...f})=>{const h=w.useRef(Ps()),p=Ct(),m=w.useRef(null),{date:g,range:v}=f,b=g||new Date,y=w.useRef(null),[S,T]=Au({date:b,isAnimating:!1,year:er(b),direction:void 0,range:{from:v==null?void 0:v.from,to:v==null?void 0:v.to},months:CA(h.current,b,o),selectMode:l?"from":void 0,week:$y({start:fn(b),end:UP(b)})},N=>({onChangeYear:M=>({year:M}),setToday:()=>({date:eo(new Date)}),onExitComplete:()=>(Nh(y.current||null,m,N.state().date,200),y.current=null,{isAnimating:!1}),date:M=>{const j=M(N.state().date);return{date:j,year:er(j)}},nextMonth:M=>{y.current=M.currentTarget;const j=N.state();if(j.isAnimating)return j;const P=oa(j.date,1);return{date:P,isAnimating:!0,direction:1,year:er(P)}},previousMonth:M=>{y.current=M.currentTarget;const j=N.state();if(j.isAnimating)return j;const P=Zy(j.date,1);return{date:P,isAnimating:!0,direction:-1,year:er(P)}},onSelectDate:M=>{const j=N.state(),P=M.currentTarget.dataset.range==="true",O=M.currentTarget.dataset.date||"",F=new Date(O);return{date:F,year:er(F),selectMode:j.selectMode===void 0?void 0:j.selectMode==="from"?"to":"from",range:P?{from:j.selectMode==="from"?F:j.range.from,to:j.selectMode==="to"?F:j.range.to}:j.range}},onChangeMonth:M=>{const j=M.target.value,O=Array.from(M.target.options).find(V=>V.value===j),F=N.state();if(O){const V=O.dataset.index||"",H=new Date(N.state().date);return H.setMonth(+V),{...F,date:H,year:er(H)}}return F},onKeyDown:M=>{const j=M.key,P=N.state();if(j in tl){(j==="ArrowUp"||j==="ArrowDown")&&M.preventDefault();const O=N.state().date,F=bn.keyof(tl,j)?tl[j](O,M.shiftKey?"month":"days"):null;if(F!==null)return Nh(M.target,m,F),{...P,date:F,year:er(F)}}return N.state()}}),{props:{onChangeMonth:i,onChangeYear:a},postMiddleware:[(N,M,j)=>{var O,F;return(j.method==="onChangeMonth"||j.method==="previousMonth"||j.method==="nextMonth")&&((F=(O=j.props).onChangeMonth)==null||F.call(O,N.date)),N},(N,M,j)=>{var O,F;return j.method==="onChangeYear"&&((F=(O=j.props).onChangeYear)==null||F.call(O,N.date)),N},(N,M,j)=>{const P=j.method==="onSelectDate"||j.method==="setToday"||j.method==="onKeyDown";return l&&P&&t?(c==null||c(N.range),N):(P&&t&&(c==null||c(N.date)),N)}]}),E=dv(EA(S.date),7),R=S.date.toISOString(),I=hv(S.date,o);w.useEffect(()=>{t||c==null||c(S.date)},[R]);const k=pA(N=>{T.date(M=>{const j=new Date(M);return j.setFullYear(+N),j})},1200),A=N=>{const M=N.currentTarget.value;T.onChangeYear(M),a==null||a(new Date(M)),k(M)};return x.jsx(AC,{transition:SA,children:x.jsxs("div",{"data-component":"calendar",ref:m,className:ke("relative overflow-hidden",u==null?void 0:u.calendar),children:[x.jsx("div",{className:"flex flex-col justify-center rounded text-center",children:x.jsx(vo,{initial:!1,mode:"popLayout",custom:S.direction,onExitComplete:T.onExitComplete,children:x.jsxs(dt.div,{initial:"enter",animate:"middle",exit:"exit",children:[x.jsxs("header",{className:"relative flex justify-between",children:[x.jsx(dt.button,{layout:!0,"data-focustrap":"prev",variants:jh,onClick:T.previousMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary",children:x.jsx(TP,{className:"h-4 w-4"})}),x.jsx(dt.span,{layout:!0,variants:fv,custom:S.direction,className:"absolute inset-0 isolate z-normal flex items-center justify-center font-semibold",children:x.jsxs("span",{className:"flex w-fit items-center justify-center gap-0.5 py-1",children:[x.jsx("select",{style:{width:`${I.length}ch`},value:I,onChange:T.onChangeMonth,className:"w-fit cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary",children:S.months}),x.jsx(rv,{mask:"int",value:S.year,maxLength:4,placeholder:"YYYY",onChange:A,style:{width:`${S.year.length}ch`},className:"w-16 cursor-pointer appearance-none bg-transparent hover:text-primary"})]})}),x.jsx(dt.button,{layout:!0,"data-focustrap":"next",variants:jh,className:"z-calendar rounded-full p-1.5 hover:bg-primary",onClick:T.nextMonth,children:x.jsx(Su,{className:"h-4 w-4"})}),x.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)"}})]}),x.jsxs(dt.table,{className:"mt-2 table min-w-full table-auto border-0",children:[x.jsx("thead",{children:x.jsx("tr",{children:S.week.map(N=>x.jsx("th",{className:ke("py-2 text-sm font-medium capitalize",u==null?void 0:u.weekDay),children:N.toLocaleDateString(o,{weekday:"short"})},N.toString()))})}),x.jsx(RA,{stateRange:S.range,stateDate:S.date,disabledDate:r,markRange:d,zip:E,range:v,styles:u,dispatch:T,date:g||null,markToday:s,rangeMode:l,labelRange:n,RenderOnDay:e,direction:S.direction,onKeyDown:T.onKeyDown})]})]},I)})}),x.jsx("footer",{className:"mt-2 text-center text-primary",children:x.jsx("button",{className:"transition-transform duration-300 hover:scale-105",type:"button",onClick:T.setToday,children:p.calendarToday})})]})})},mv=({children:e,title:t,titleClassName:n="",as:r="div",container:o="",header:s=null,className:i="",...a})=>x.jsxs(mo,{...a,as:r,"data-componen":"card",className:ke("flex flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-8 shadow",o),children:[t?x.jsx("header",{className:ke("mb-2 w-full border-b border-card-border px-8 pb-4 text-xl font-medium",n),children:t}):s,x.jsx("div",{className:ke("min-w-full px-8",i),children:e})]}),gv=e=>{const t=e.Icon??My,n=Ct();return x.jsxs("div",{className:"flex w-full flex-col items-center justify-center gap-4 px-8 py-12",children:[x.jsx(t,{size:64,className:"text-disabled"}),x.jsx("p",{className:"text-disabled",children:n.emptyDataMessage})]})};function kt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function IA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function yv(...e){return t=>e.forEach(n=>IA(n,t))}function gr(...e){return C.useCallback(yv(...e),e)}function vv(e,t=[]){let n=[];function r(s,i){const a=C.createContext(i),l=n.length;n=[...n,i];function c(d){const{scope:f,children:h,...p}=d,m=(f==null?void 0:f[e][l])||a,g=C.useMemo(()=>p,Object.values(p));return x.jsx(m.Provider,{value:g,children:h})}function u(d,f){const h=(f==null?void 0:f[e][l])||a,p=C.useContext(h);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const o=()=>{const s=n.map(i=>C.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,AA(o,...t)]}function AA(...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(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var to=C.forwardRef((e,t)=>{const{children:n,...r}=e,o=C.Children.toArray(n),s=o.find(DA);if(s){const i=s.props.children,a=o.map(l=>l===s?C.Children.count(i)>1?C.Children.only(null):C.isValidElement(i)?i.props.children:null:l);return x.jsx(cc,{...r,ref:t,children:C.isValidElement(i)?C.cloneElement(i,void 0,a):null})}return x.jsx(cc,{...r,ref:t,children:n})});to.displayName="Slot";var cc=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const o=kA(n);return C.cloneElement(n,{...MA(r,n.props),ref:t?yv(t,o):o})}return C.Children.count(n)>1?C.Children.only(null):null});cc.displayName="SlotClone";var OA=({children:e})=>x.jsx(x.Fragment,{children:e});function DA(e){return C.isValidElement(e)&&e.type===OA}function MA(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function kA(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function FA(e){const t=e+"CollectionProvider",[n,r]=vv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:p,children:m}=h,g=w.useRef(null),v=w.useRef(new Map).current;return x.jsx(o,{scope:p,itemMap:v,collectionRef:g,children:m})};i.displayName=t;const a=e+"CollectionSlot",l=w.forwardRef((h,p)=>{const{scope:m,children:g}=h,v=s(a,m),b=gr(p,v.collectionRef);return x.jsx(to,{ref:b,children:g})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=w.forwardRef((h,p)=>{const{scope:m,children:g,...v}=h,b=w.useRef(null),y=gr(p,b),S=s(c,m);return w.useEffect(()=>(S.itemMap.set(b,{ref:b,...v}),()=>void S.itemMap.delete(b))),x.jsx(to,{[u]:"",ref:y,children:g})});d.displayName=c;function f(h){const p=s(e+"CollectionConsumer",h);return w.useCallback(()=>{const g=p.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,T)=>v.indexOf(S.ref.current)-v.indexOf(T.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:i,Slot:l,ItemSlot:d},f,r]}var jA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],mn=jA.reduce((e,t)=>{const n=C.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?to:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function bv(e,t){e&&vs.flushSync(()=>e.dispatchEvent(t))}function Tn(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function NA(e,t=globalThis==null?void 0:globalThis.document){const n=Tn(e);C.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 LA="DismissableLayer",uc="dismissableLayer.update",_A="dismissableLayer.pointerDownOutside",VA="dismissableLayer.focusOutside",Lh,xv=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wv=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=C.useContext(xv),[u,d]=C.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=C.useState({}),p=gr(t,R=>d(R)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),b=u?m.indexOf(u):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,S=b>=v,T=BA(R=>{const I=R.target,k=[...c.branches].some(A=>A.contains(I));!S||k||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},f),E=HA(R=>{const I=R.target;[...c.branches].some(A=>A.contains(I))||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},f);return NA(R=>{b===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},f),C.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Lh=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),_h(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Lh)}},[u,f,n,c]),C.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),_h())},[u,c]),C.useEffect(()=>{const R=()=>h({});return document.addEventListener(uc,R),()=>document.removeEventListener(uc,R)},[]),x.jsx(mn.div,{...l,ref:p,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:kt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:kt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:kt(e.onPointerDownCapture,T.onPointerDownCapture)})});wv.displayName=LA;var $A="DismissableLayerBranch",Tv=C.forwardRef((e,t)=>{const n=C.useContext(xv),r=C.useRef(null),o=gr(t,r);return C.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(mn.div,{...e,ref:o})});Tv.displayName=$A;function BA(e,t=globalThis==null?void 0:globalThis.document){const n=Tn(e),r=C.useRef(!1),o=C.useRef(()=>{});return C.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Sv(_A,n,c,{discrete:!0})};const c={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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function HA(e,t=globalThis==null?void 0:globalThis.document){const n=Tn(e),r=C.useRef(!1);return C.useEffect(()=>{const o=s=>{s.target&&!r.current&&Sv(VA,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _h(){const e=new CustomEvent(uc);document.dispatchEvent(e)}function Sv(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?bv(o,s):o.dispatchEvent(s)}var WA=wv,zA=Tv,Ii=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},UA="Portal",Ev=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=C.useState(!1);Ii(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Vc.createPortal(x.jsx(mn.div,{...r,ref:t}),i):null});Ev.displayName=UA;function GA(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Cv=e=>{const{present:t,children:n}=e,r=YA(t),o=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=gr(r.ref,KA(o));return typeof n=="function"||r.isPresent?C.cloneElement(o,{ref:s}):null};Cv.displayName="Presence";function YA(e){const[t,n]=C.useState(),r=C.useRef({}),o=C.useRef(e),s=C.useRef("none"),i=e?"mounted":"unmounted",[a,l]=GA(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const c=Gs(r.current);s.current=a==="mounted"?c:"none"},[a]),Ii(()=>{const c=r.current,u=o.current;if(u!==e){const f=s.current,h=Gs(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ii(()=>{if(t){const c=d=>{const h=Gs(r.current).includes(d.animationName);d.target===t&&h&&vs.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=Gs(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Gs(e){return(e==null?void 0:e.animationName)||"none"}function KA(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function qA({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=XA({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Tn(n),l=C.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[s,e,o,a]);return[i,l]}function XA({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,o=C.useRef(r),s=Tn(t);return C.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var QA="VisuallyHidden",Mu=C.forwardRef((e,t)=>x.jsx(mn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Mu.displayName=QA;var ku="ToastProvider",[Fu,ZA,JA]=FA("Toast"),[Pv,LL]=vv("Toast",[JA]),[eO,aa]=Pv(ku),Rv=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,l]=C.useState(null),[c,u]=C.useState(0),d=C.useRef(!1),f=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ku}\`. Expected non-empty \`string\`.`),x.jsx(Fu.Provider,{scope:t,children:x.jsx(eO,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:C.useCallback(()=>u(h=>h+1),[]),onToastRemove:C.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};Rv.displayName=ku;var Iv="ToastViewport",tO=["F8"],dc="toast.viewportPause",fc="toast.viewportResume",Av=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=tO,label:o="Notifications ({hotkey})",...s}=e,i=aa(Iv,n),a=ZA(n),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),f=gr(t,d,i.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=i.toastCount>0;C.useEffect(()=>{const g=v=>{var y;r.every(S=>v[S]||v.code===S)&&((y=d.current)==null||y.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),C.useEffect(()=>{const g=l.current,v=d.current;if(p&&g&&v){const b=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(dc);v.dispatchEvent(E),i.isClosePausedRef.current=!0}},y=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(fc);v.dispatchEvent(E),i.isClosePausedRef.current=!1}},S=E=>{!g.contains(E.relatedTarget)&&y()},T=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",b),g.addEventListener("focusout",S),g.addEventListener("pointermove",b),g.addEventListener("pointerleave",T),window.addEventListener("blur",b),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",b),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",b),g.removeEventListener("pointerleave",T),window.removeEventListener("blur",b),window.removeEventListener("focus",y)}}},[p,i.isClosePausedRef]);const m=C.useCallback(({tabbingDirection:g})=>{const b=a().map(y=>{const S=y.ref.current,T=[S,...mO(S)];return g==="forwards"?T:T.reverse()});return(g==="forwards"?b.reverse():b).flat()},[a]);return C.useEffect(()=>{const g=d.current;if(g){const v=b=>{var T,E,R;const y=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!y){const I=document.activeElement,k=b.shiftKey;if(b.target===g&&k){(T=c.current)==null||T.focus();return}const M=m({tabbingDirection:k?"backwards":"forwards"}),j=M.findIndex(P=>P===I);nl(M.slice(j+1))?b.preventDefault():k?(E=c.current)==null||E.focus():(R=u.current)==null||R.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[a,m]),x.jsxs(zA,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&x.jsx(hc,{ref:c,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});nl(g)}}),x.jsx(Fu.Slot,{scope:n,children:x.jsx(mn.ol,{tabIndex:-1,...s,ref:f})}),p&&x.jsx(hc,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});nl(g)}})]})});Av.displayName=Iv;var Ov="ToastFocusProxy",hc=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=aa(Ov,n);return x.jsx(Mu,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});hc.displayName=Ov;var la="Toast",nO="toast.swipeStart",rO="toast.swipeMove",oO="toast.swipeCancel",sO="toast.swipeEnd",Dv=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,l]=qA({prop:r,defaultProp:o,onChange:s});return x.jsx(Cv,{present:n||a,children:x.jsx(lO,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:Tn(e.onPause),onResume:Tn(e.onResume),onSwipeStart:kt(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:kt(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:kt(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:kt(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Dv.displayName=la;var[iO,aO]=Pv(la,{onClose(){}}),lO=C.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...p}=e,m=aa(la,n),[g,v]=C.useState(null),b=gr(t,P=>v(P)),y=C.useRef(null),S=C.useRef(null),T=o||m.duration,E=C.useRef(0),R=C.useRef(T),I=C.useRef(0),{onToastAdd:k,onToastRemove:A}=m,N=Tn(()=>{var O;(g==null?void 0:g.contains(document.activeElement))&&((O=m.viewport)==null||O.focus()),i()}),M=C.useCallback(P=>{!P||P===1/0||(window.clearTimeout(I.current),E.current=new Date().getTime(),I.current=window.setTimeout(N,P))},[N]);C.useEffect(()=>{const P=m.viewport;if(P){const O=()=>{M(R.current),c==null||c()},F=()=>{const V=new Date().getTime()-E.current;R.current=R.current-V,window.clearTimeout(I.current),l==null||l()};return P.addEventListener(dc,F),P.addEventListener(fc,O),()=>{P.removeEventListener(dc,F),P.removeEventListener(fc,O)}}},[m.viewport,T,l,c,M]),C.useEffect(()=>{s&&!m.isClosePausedRef.current&&M(T)},[s,T,m.isClosePausedRef,M]),C.useEffect(()=>(k(),()=>A()),[k,A]);const j=C.useMemo(()=>g?Lv(g):null,[g]);return m.viewport?x.jsxs(x.Fragment,{children:[j&&x.jsx(cO,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:j}),x.jsx(iO,{scope:n,onClose:N,children:vs.createPortal(x.jsx(Fu.ItemSlot,{scope:n,children:x.jsx(WA,{asChild:!0,onEscapeKeyDown:kt(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||N(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(mn.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...p,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:kt(e.onKeyDown,P=>{P.key==="Escape"&&(a==null||a(P.nativeEvent),P.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:kt(e.onPointerDown,P=>{P.button===0&&(y.current={x:P.clientX,y:P.clientY})}),onPointerMove:kt(e.onPointerMove,P=>{if(!y.current)return;const O=P.clientX-y.current.x,F=P.clientY-y.current.y,V=!!S.current,H=["left","right"].includes(m.swipeDirection),z=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,D=H?z(0,O):0,$=H?0:z(0,F),K=P.pointerType==="touch"?10:2,J={x:D,y:$},X={originalEvent:P,delta:J};V?(S.current=J,Ys(rO,d,X,{discrete:!1})):Vh(J,m.swipeDirection,K)?(S.current=J,Ys(nO,u,X,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(O)>K||Math.abs(F)>K)&&(y.current=null)}),onPointerUp:kt(e.onPointerUp,P=>{const O=S.current,F=P.target;if(F.hasPointerCapture(P.pointerId)&&F.releasePointerCapture(P.pointerId),S.current=null,y.current=null,O){const V=P.currentTarget,H={originalEvent:P,delta:O};Vh(O,m.swipeDirection,m.swipeThreshold)?Ys(sO,h,H,{discrete:!0}):Ys(oO,f,H,{discrete:!0}),V.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),cO=e=>{const{__scopeToast:t,children:n,...r}=e,o=aa(la,t),[s,i]=C.useState(!1),[a,l]=C.useState(!1);return hO(()=>i(!0)),C.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:x.jsx(Ev,{asChild:!0,children:x.jsx(Mu,{...r,children:s&&x.jsxs(x.Fragment,{children:[o.label," ",n]})})})},uO="ToastTitle",Mv=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(mn.div,{...r,ref:t})});Mv.displayName=uO;var dO="ToastDescription",kv=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(mn.div,{...r,ref:t})});kv.displayName=dO;var Fv="ToastAction",fO=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?x.jsx(Nv,{altText:n,asChild:!0,children:x.jsx(ju,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Fv}\`. Expected non-empty \`string\`.`),null)});fO.displayName=Fv;var jv="ToastClose",ju=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=aO(jv,n);return x.jsx(Nv,{asChild:!0,children:x.jsx(mn.button,{type:"button",...r,ref:t,onClick:kt(e.onClick,o.onClose)})})});ju.displayName=jv;var Nv=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return x.jsx(mn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Lv(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),pO(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Lv(r))}}),t}function Ys(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?bv(o,s):o.dispatchEvent(s)}var Vh=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function hO(e=()=>{}){const t=Tn(e);Ii(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function pO(e){return e.nodeType===e.ELEMENT_NODE}function mO(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 nl(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var gO=Rv,yO=Av,vO=Dv,bO=Mv,xO=kv,wO=ju;const TO=e=>{const[t,n]=w.useState(!1),r=()=>n(!0),o=()=>n(!1);return w.useEffect(()=>{const s=e.current;if(s)return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",o),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",o)}},[]),t},SO=uo("relative isolate z-tooltip flex justify-between overflow-hidden whitespace-nowrap rounded-lg border text-sm shadow-sm supports-[backdrop-filter]:backdrop-blur-xl",{variants:{theme:{warn:"bg-warn-notification/90 text-warn-hover border-warn/50",info:"bg-info-notification supports-[backdrop-filter]:bg-info-notification/50 supports-[backdrop-filter]:bg-info/20 text-info border-info/50",danger:"bg-danger-notification supports-[backdrop-filter]:bg-danger-notification/60 text-danger border-danger/50",success:"bg-success-notification supports-[backdrop-filter]:bg-success-notification/50 text-success border-success/50",default:"border-card-border bg-card-background text-foreground"}},defaultVariants:{theme:"default"}}),_v=w.createContext(()=>{throw new Error("Not implemented")}),EO=()=>w.useContext(_v),$h={0:{opacity:1,y:[10,15],scale:[1,.98]},1:{opacity:1,y:[15,20],scale:[1,.97]},2:{opacity:1,y:[20,25],scale:[1,.96]},default:{opacity:1,y:[25,30],scale:[1,.95]}},CO=w.forwardRef(function(t,n){const r=t.closable??!0,o=t.duration,s=t.hover?"hover":t.isLast?"isLast":"other",i=SO({theme:t.theme||"default"});return x.jsx(vO,{ref:n,asChild:!0,forceMount:!0,onOpenChange:t.onClose,duration:o,children:x.jsx(dt.li,{layout:!0,layoutScroll:!0,animate:s,"data-index":t.index,initial:{y:-100,zIndex:-1},className:"text-select pointer-events-auto absolute right-0 top-0 w-80",variants:{isLast:{y:10,scale:1,animationDuration:"300ms",opacity:1},hover:{y:0,position:"static",scale:1,opacity:1},other:$h[t.reversedIndex]||$h.default},transition:{type:"spring",mass:1.2,damping:30,stiffness:200},exit:{opacity:[.9,0],transition:{opacity:{bounce:.25,duration:.3}}},children:x.jsxs("div",{className:i,children:[x.jsxs("div",{className:"flex flex-col p-4",children:[t.title?x.jsx(bO,{className:"select-text truncate text-lg font-medium leading-relaxed",children:"Title"}):null,x.jsx(xO,{className:"select-text truncate",children:t.text})]}),r?x.jsx(wO,{className:"absolute right-2 top-2 rounded-full p-1 text-foreground transition hover:bg-danger/10 hover:text-danger-hover",children:x.jsx(ra,{className:"h-5 w-5"})}):null]})})})});function PO({children:e,max:t=5,duration:n=5e3}){const r=w.useRef(null),o=TO(r),[s,i]=w.useState([]),a=w.useCallback(()=>i([]),[]);w.useEffect(()=>()=>a(),[a]);const l=w.useCallback((c,u)=>{const d=window.crypto.randomUUID();return i(h=>{const p=[...h,{...u,id:d,text:c}];return p.length>t?p.slice(p.length-t,p.length+1):p}),{clear:a,close:()=>i(h=>h.filter(p=>p.id!==d))}},[t]);return x.jsxs(gO,{duration:n,swipeThreshold:150,children:[x.jsx(_v.Provider,{value:l,children:e}),x.jsx(vo,{presenceAffectsLayout:!0,mode:"popLayout",children:s.map((c,u,d)=>{const f=()=>i(h=>h.filter(p=>p.id!==c.id));return w.createElement(CO,{...c,key:c.id,hover:o,index:u,onClose:f,isLast:d.length-1===u,reversedIndex:d.length-(u+1)})})}),x.jsx(yO,{ref:r,"data-items":s.length,style:{justifyContent:"start",height:`${(o?s.length:Math.min(1,s.length))*7}rem`},className:"fixed right-4 top-10 flex w-80 list-none flex-col-reverse items-end gap-4 overflow-y-clip overflow-x-visible data-[items=true]:pb-8 max-sm:top-20"})]})}const RO=e=>x.jsxs("div",{className:"divide-y divide-card-border bg-card-background shadow border border-card-border rounded-card",children:[x.jsxs("header",{className:"p-6 items-start flex gap-4",children:[x.jsx("div",{className:ke("size-10 p-8 rounded-card flex items-center justify-center aspect-square bg-primary",e.iconContainer),children:x.jsx("div",{children:x.jsx(e.Icon,{className:"size-10 aspect-square text-primary-foreground"})})}),x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("header",{children:x.jsx("h3",{className:"text-base leading-none",children:e.title})}),x.jsx("p",{className:"text-4xl font-semibold",children:e.children})]})]}),e.footer?x.jsx("footer",{className:"px-6 py-2",children:e.footer}):null]}),Vv=(e,t)=>{const[n,r]=w.useState(()=>t||e);return w.useEffect(()=>{r(e)},[e]),[n,r]},$v=w.createContext(""),IO=e=>{const[t,n]=Vv(e.active),r=mr(0),o=mr(0),s=w.useRef(null),i=e.useHash?"a":"button";w.useLayoutEffect(()=>{const u=s.current;if(u===null)return;const d=m=>{if(!m)return;const g=m.getBoundingClientRect();o.set(g.width),r.set(m.offsetLeft)},f=()=>{const m=u.querySelector("li[data-active=true]");return void d(m)};window.addEventListener("resize",f);let h=u.querySelector("li[data-active=true]");const p=window.location.hash.replace(/^#/,"");if(e.active===""&&p!==""&&(h=u.querySelector(`li[data-id="${p}"]`),n(p)),h===null){h=u.querySelector("li[data-id]");const m=h.getAttribute("data-id")||"";n(m)}return d(h),()=>window.removeEventListener("resize",f)},[]);const a=Bm(e.onChange);w.useEffect(()=>{a.current&&a.current(t)},[a,t]);const l=w.Children.toArray(e.children),c=u=>{const d=u.currentTarget,f=d.getBoundingClientRect();o.set(f.width),r.set(d.offsetLeft),n(d.dataset.id||"")};return x.jsx($v.Provider,{value:t,children:x.jsx(mv,{className:e.className,container:"pt-0 max-w-full w-full min-w-0",header:x.jsx("header",{ref:s,className:"relative mb-2 overflow-x-auto border-b border-card-border",children:x.jsx("nav",{className:"min-w-0",children:x.jsx("ul",{className:"flex w-0 min-w-full flex-1 justify-start overflow-x-auto",children:l.map(u=>{const d=u.props;return x.jsx("li",{"data-id":d.id,"data-active":t===d.id,className:"w-full border-b-2 border-card-border data-[active=true]:border-primary data-[active=true]:font-bold data-[active=true]:text-primary",children:x.jsx(i,{"data-id":d.id,onClick:c,"aria-current":"page",href:e.useHash?`#${d.id}`:void 0,className:"block w-full whitespace-nowrap px-10 py-4",children:d.title})},`tab-header-${d.id}`)})})})}),children:e.children})})},AO=()=>w.useContext($v),OO=e=>{const t=AO();return x.jsx(w.Fragment,{children:e.id===t?e.children:null})};function Gn(e){return Bv(e)?(e.nodeName||"").toLowerCase():"#document"}function Rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function En(e){var t;return(t=(Bv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bv(e){return e instanceof Node||e instanceof Rt(e).Node}function Fe(e){return e instanceof Element||e instanceof Rt(e).Element}function et(e){return e instanceof HTMLElement||e instanceof Rt(e).HTMLElement}function pc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rt(e).ShadowRoot}function Rs(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function DO(e){return["table","td","th"].includes(Gn(e))}function ca(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Nu(e){const t=Lu(),n=Fe(e)?Vt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MO(e){let t=Sn(e);for(;et(t)&&!Vn(t);){if(Nu(t))return t;if(ca(t))return null;t=Sn(t)}return null}function Lu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vn(e){return["html","body","#document"].includes(Gn(e))}function Vt(e){return Rt(e).getComputedStyle(e)}function ua(e){return Fe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sn(e){if(Gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pc(e)&&e.host||En(e);return pc(t)?t.host:t}function Hv(e){const t=Sn(e);return Vn(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&Rs(t)?t:Hv(t)}function jn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Hv(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Rt(o);if(s){const a=mc(i);return t.concat(i,i.visualViewport||[],Rs(o)?o:[],a&&n?jn(a):[])}return t.concat(o,jn(o,[],n))}function mc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ye(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&pc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _u(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Wv(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function zv(e){return e.mozInputSource===0&&e.isTrusted?!0:gc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Vu(e){return kO()?!1:!gc()&&e.width===0&&e.height===0||gc()&&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 $u(){return/apple/i.test(navigator.vendor)}function gc(){const e=/android/i;return e.test(_u())||e.test(Wv())}function Uv(){return _u().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function kO(){return Wv().includes("jsdom/")}function no(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function FO(e){return"nativeEvent"in e}function jO(e){return e.matches("html,body")}function ut(e){return(e==null?void 0:e.ownerDocument)||document}function rl(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 rn(e){return"composedPath"in e?e.composedPath()[0]:e.target}const NO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Bu(e){return et(e)&&e.matches(NO)}function mt(e){e.preventDefault(),e.stopPropagation()}function Gv(e){return e?e.getAttribute("role")==="combobox"&&Bu(e):!1}const on=Math.min,Mt=Math.max,Ai=Math.round,Lr=Math.floor,$n=e=>({x:e,y:e}),LO={left:"right",right:"left",bottom:"top",top:"bottom"},_O={start:"end",end:"start"};function yc(e,t,n){return Mt(e,on(t,n))}function xo(e,t){return typeof e=="function"?e(t):e}function Bn(e){return e.split("-")[0]}function wo(e){return e.split("-")[1]}function Yv(e){return e==="x"?"y":"x"}function Hu(e){return e==="y"?"height":"width"}function yr(e){return["top","bottom"].includes(Bn(e))?"y":"x"}function Wu(e){return Yv(yr(e))}function VO(e,t,n){n===void 0&&(n=!1);const r=wo(e),o=Wu(e),s=Hu(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Oi(i)),[i,Oi(i)]}function $O(e){const t=Oi(e);return[vc(e),t,vc(t)]}function vc(e){return e.replace(/start|end/g,t=>_O[t])}function BO(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function HO(e,t,n,r){const o=wo(e);let s=BO(Bn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(vc)))),s}function Oi(e){return e.replace(/left|right|bottom|top/g,t=>LO[t])}function WO(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kv(e){return typeof e!="number"?WO(e):{top:e,right:e,bottom:e,left:e}}function Di(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
175
175
  * tabbable 6.2.0
176
176
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
177
- */var zO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Mi=zO.join(","),qv=typeof Element>"u",ro=qv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ki=!qv&&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==null?void 0:e.ownerDocument},Fi=function e(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"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},UO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},GO=function(t,n,r){if(Fi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Mi));return n&&ro.call(t,Mi)&&o.unshift(t),o=o.filter(r),o},YO=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Fi(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=ro.call(i,Mi);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Fi(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&f){var h=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},Xv=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Qv=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||UO(t))&&!Xv(t)?0:t.tabIndex},KO=function(t,n){var r=Qv(t);return r<0&&n&&!Xv(t)?0:r},qO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Zv=function(t){return t.tagName==="INPUT"},XO=function(t){return Zv(t)&&t.type==="hidden"},QO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ZO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},JO=function(t){if(!t.name)return!0;var n=t.form||ki(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(i){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",i.message),!1}var s=ZO(o,t.form);return!s||s===t},eD=function(t){return Zv(t)&&t.type==="radio"},tD=function(t){return eD(t)&&!JO(t)},nD=function(t){var n,r=t&&ki(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=ki(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},Bh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},rD=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=ro.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(ro.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=ki(t);if(l&&!l.shadowRoot&&o(l)===!0)return Bh(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(nD(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Bh(t);return!1},oD=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 ro.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},sD=function(t,n){return!(n.disabled||Fi(n)||XO(n)||rD(n,t)||QO(n)||oD(n))},bc=function(t,n){return!(tD(n)||Qv(n)<0||!sD(t,n))},iD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},aD=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=KO(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(qO).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},cs=function(t,n){n=n||{};var r;return n.getShadowRoot?r=YO([t],n.includeContainer,{filter:bc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:iD}):r=GO(t,n.includeContainer,bc.bind(null,n)),aD(r)},lD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ro.call(t,Mi)===!1?!1:bc(n,t)};function Hh(e,t,n){let{reference:r,floating:o}=e;const s=yr(t),i=Wu(t),a=Hu(i),l=Bn(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(wo(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1);break}return h}const cD=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Hh(c,r,l),f=r,h={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:v}=a[m],{x:b,y,data:S,reset:T}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=b??u,d=y??d,h={...h,[g]:{...h[g],...S}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(f=T.placement),T.rects&&(c=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:d}=Hh(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function zu(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=xo(t,e),p=Kv(h),g=a[f?d==="floating"?"reference":"floating":d],v=Di(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},T=Di(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:l}):b);return{top:(v.top-T.top+p.top)/S.y,bottom:(T.bottom-v.bottom+p.bottom)/S.y,left:(v.left-T.left+p.left)/S.x,right:(T.right-v.right+p.right)/S.x}}const uD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=xo(e,t)||{};if(c==null)return{};const d=Kv(u),f={x:n,y:r},h=Wu(o),p=Hu(h),m=await i.getDimensions(c),g=h==="y",v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-f[h]-s.floating[p],T=f[h]-s.reference[h],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let R=E?E[y]:0;(!R||!await(i.isElement==null?void 0:i.isElement(E)))&&(R=a.floating[y]||s.floating[p]);const I=S/2-T/2,k=R/2-m[p]/2-1,A=on(d[v],k),N=on(d[b],k),M=A,j=R-m[p]-N,P=R/2-m[p]/2+I,O=yc(M,P,j),F=!l.arrow&&wo(o)!=null&&P!==O&&s.reference[p]/2-(P<M?A:N)-m[p]/2<0,V=F?P<M?P-M:P-j:0;return{[h]:f[h]+V,data:{[h]:O,centerOffset:P-O-V,...F&&{alignmentOffset:V}},reset:F}}}),dD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=xo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Bn(o),b=yr(a),y=Bn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=f||(y||!m?[Oi(a)]:$O(a)),E=p!=="none";!f&&E&&T.push(...HO(a,m,p,S));const R=[a,...T],I=await zu(t,g),k=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&k.push(I[v]),d){const P=VO(o,i,S);k.push(I[P[0]],I[P[1]])}if(A=[...A,{placement:o,overflows:k}],!k.every(P=>P<=0)){var N,M;const P=(((N=s.flip)==null?void 0:N.index)||0)+1,O=R[P];if(O)return{data:{index:P,overflows:A},reset:{placement:O}};let F=(M=A.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:M.placement;if(!F)switch(h){case"bestFit":{var j;const V=(j=A.filter(H=>{if(E){const z=yr(H.placement);return z===b||z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(z=>z>0).reduce((z,D)=>z+D,0)]).sort((H,z)=>H[1]-z[1])[0])==null?void 0:j[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};async function fD(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Bn(n),a=wo(n),l=yr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=xo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const hD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await fD(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},pD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:g=>{let{x:v,y:b}=g;return{x:v,y:b}}},...l}=xo(e,t),c={x:n,y:r},u=await zu(t,l),d=yr(Bn(o)),f=Yv(d);let h=c[f],p=c[d];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+u[g],y=h-u[v];h=yc(b,h,y)}if(i){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=p+u[g],y=p-u[v];p=yc(b,p,y)}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},mD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=xo(e,t),l=await zu(t,a),c=Bn(n),u=wo(n),d=yr(n)==="y",{width:f,height:h}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,b=on(h-l[p],g),y=on(f-l[m],v),S=!t.middlewareData.shift;let T=b,E=y;if(d?E=u||S?on(y,v):v:T=u||S?on(b,g):g,S&&!u){const I=Mt(l.left,0),k=Mt(l.right,0),A=Mt(l.top,0),N=Mt(l.bottom,0);d?E=f-2*(I!==0||k!==0?I+k:Mt(l.left,l.right)):T=h-2*(A!==0||N!==0?A+N:Mt(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:T});const R=await o.getDimensions(s.floating);return f!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}};function Jv(e){const t=Vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ai(n)!==s||Ai(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Uu(e){return Fe(e)?e:e.contextElement}function $r(e){const t=Uu(e);if(!et(t))return $n(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Jv(t);let i=(s?Ai(n.width):n.width)/r,a=(s?Ai(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const gD=$n(0);function eb(e){const t=Rt(e);return!Lu()||!t.visualViewport?gD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rt(e)?!1:t}function vr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Uu(e);let i=$n(1);t&&(r?Fe(r)&&(i=$r(r)):i=$r(e));const a=yD(s,n,r)?eb(s):$n(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Rt(s),h=r&&Fe(r)?Rt(r):r;let p=f,m=mc(p);for(;m&&r&&h!==p;){const g=$r(m),v=m.getBoundingClientRect(),b=Vt(m),y=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*g.x,S=v.top+(m.clientTop+parseFloat(b.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=y,c+=S,p=Rt(m),m=mc(p)}}return Di({width:u,height:d,x:l,y:c})}function vD(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=En(r),a=t?ca(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=$n(1);const u=$n(0),d=et(r);if((d||!d&&!s)&&((Gn(r)!=="body"||Rs(i))&&(l=ua(r)),et(r))){const f=vr(r);c=$r(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function bD(e){return Array.from(e.getClientRects())}function tb(e){return vr(En(e)).left+ua(e).scrollLeft}function xD(e){const t=En(e),n=ua(e),r=e.ownerDocument.body,o=Mt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Mt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+tb(e);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(i+=Mt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function wD(e,t){const n=Rt(e),r=En(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Lu();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function TD(e,t){const n=vr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=et(e)?$r(e):$n(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Wh(e,t,n){let r;if(t==="viewport")r=wD(e,n);else if(t==="document")r=xD(En(e));else if(Fe(t))r=TD(t,n);else{const o=eb(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Di(r)}function nb(e,t){const n=Sn(e);return n===t||!Fe(n)||Vn(n)?!1:Vt(n).position==="fixed"||nb(n,t)}function SD(e,t){const n=t.get(e);if(n)return n;let r=jn(e,[],!1).filter(a=>Fe(a)&&Gn(a)!=="body"),o=null;const s=Vt(e).position==="fixed";let i=s?Sn(e):e;for(;Fe(i)&&!Vn(i);){const a=Vt(i),l=Nu(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Rs(i)&&!l&&nb(e,i))?r=r.filter(u=>u!==i):o=a,i=Sn(i)}return t.set(e,r),r}function ED(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ca(t)?[]:SD(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Wh(t,u,o);return c.top=Mt(d.top,c.top),c.right=on(d.right,c.right),c.bottom=on(d.bottom,c.bottom),c.left=Mt(d.left,c.left),c},Wh(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function CD(e){const{width:t,height:n}=Jv(e);return{width:t,height:n}}function PD(e,t,n){const r=et(t),o=En(t),s=n==="fixed",i=vr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=$n(0);if(r||!r&&!s)if((Gn(t)!=="body"||Rs(o))&&(a=ua(t)),r){const d=vr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=tb(o));const c=i.left+a.scrollLeft-l.x,u=i.top+a.scrollTop-l.y;return{x:c,y:u,width:i.width,height:i.height}}function ol(e){return Vt(e).position==="static"}function zh(e,t){return!et(e)||Vt(e).position==="fixed"?null:t?t(e):e.offsetParent}function rb(e,t){const n=Rt(e);if(ca(e))return n;if(!et(e)){let o=Sn(e);for(;o&&!Vn(o);){if(Fe(o)&&!ol(o))return o;o=Sn(o)}return n}let r=zh(e,t);for(;r&&DO(r)&&ol(r);)r=zh(r,t);return r&&Vn(r)&&ol(r)&&!Nu(r)?n:r||MO(e)||n}const RD=async function(e){const t=this.getOffsetParent||rb,n=this.getDimensions,r=await n(e.floating);return{reference:PD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ID(e){return Vt(e).direction==="rtl"}const AD={convertOffsetParentRelativeRectToViewportRelativeRect:vD,getDocumentElement:En,getClippingRect:ED,getOffsetParent:rb,getElementRects:RD,getClientRects:bD,getDimensions:CD,getScale:$r,isElement:Fe,isRTL:ID};function OD(e,t){let n=null,r;const o=En(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Lr(u),p=Lr(o.clientWidth-(c+d)),m=Lr(o.clientHeight-(u+f)),g=Lr(c),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Mt(0,on(1,l))||1};let y=!0;function S(T){const E=T[0].intersectionRatio;if(E!==l){if(!y)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(S,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(e)}return i(!0),s}function da(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Uu(e),u=o||s?[...c?jn(c):[],...jn(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?OD(c,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,m=l?vr(e):null;l&&g();function g(){const v=vr(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(g)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const DD=hD,MD=pD,kD=dD,FD=mD,Uh=uD,jD=(e,t,n)=>{const r=new Map,o={platform:AD,...n},s={...o.platform,_c:r};return cD(e,t,{...o,platform:s})};var ai=typeof document<"u"?w.useLayoutEffect:w.useEffect;function ji(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ji(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!ji(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ob(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gh(e,t){const n=ob(e);return Math.round(t*n)/n}function Yh(e){const t=C.useRef(e);return ai(()=>{t.current=e}),t}function ND(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=C.useState(r);ji(f,r)||h(r);const[p,m]=C.useState(null),[g,v]=C.useState(null),b=C.useCallback(V=>{V!==E.current&&(E.current=V,m(V))},[]),y=C.useCallback(V=>{V!==R.current&&(R.current=V,v(V))},[]),S=s||p,T=i||g,E=C.useRef(null),R=C.useRef(null),I=C.useRef(u),k=l!=null,A=Yh(l),N=Yh(o),M=C.useCallback(()=>{if(!E.current||!R.current)return;const V={placement:t,strategy:n,middleware:f};N.current&&(V.platform=N.current),jD(E.current,R.current,V).then(H=>{const z={...H,isPositioned:!0};j.current&&!ji(I.current,z)&&(I.current=z,vs.flushSync(()=>{d(z)}))})},[f,t,n,N]);ai(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const j=C.useRef(!1);ai(()=>(j.current=!0,()=>{j.current=!1}),[]),ai(()=>{if(S&&(E.current=S),T&&(R.current=T),S&&T){if(A.current)return A.current(S,T,M);M()}},[S,T,M,A,k]);const P=C.useMemo(()=>({reference:E,floating:R,setReference:b,setFloating:y}),[b,y]),O=C.useMemo(()=>({reference:S,floating:T}),[S,T]),F=C.useMemo(()=>{const V={position:n,left:0,top:0};if(!O.floating)return V;const H=Gh(O.floating,u.x),z=Gh(O.floating,u.y);return a?{...V,transform:"translate("+H+"px, "+z+"px)",...ob(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:z}},[n,a,O.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:M,refs:P,elements:O,floatingStyles:F}),[u,M,P,O,F])}const LD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Uh({element:r.current,padding:o}).fn(n):{}:r?Uh({element:r,padding:o}).fn(n):{}}}},fa=(e,t)=>({...DD(e),options:[e,t]}),Gu=(e,t)=>({...MD(e),options:[e,t]}),Yu=(e,t)=>({...kD(e),options:[e,t]}),_D=(e,t)=>({...FD(e),options:[e,t]}),sb=(e,t)=>({...LD(e),options:[e,t]});function xc(e){return C.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const ib={...C},VD=ib.useInsertionEffect,$D=VD||(e=>e());function at(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return $D(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Ku="ArrowUp",Is="ArrowDown",oo="ArrowLeft",To="ArrowRight";function Ks(e,t,n){return Math.floor(e/t)!==n}function Zo(e,t){return t<0||t>=e.current.length}function sl(e,t){return xt(e,{disabledIndices:t})}function Kh(e,t){return xt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function xt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t;const i=e.current;let a=n;do a+=r?-s:s;while(a>=0&&a<=i.length-1&&li(i,a,o));return a}function BD(e,t){let{event:n,orientation:r,loop:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===Ku){if(u&&mt(n),c===-1)d=l;else if(d=xt(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),o&&(c-s<a||d<0)){const f=c%s,h=l%s,p=l-(h-f);h===f?d=l:d=h>f?p:p-s}Zo(e,d)&&(d=c)}if(n.key===Is&&(u&&mt(n),c===-1?d=a:(d=xt(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=xt(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),Zo(e,d)&&(d=c)),r==="both"){const f=Lr(c/s);n.key===To&&(u&&mt(n),c%s!==s-1?(d=xt(e,{startingIndex:c,disabledIndices:i}),o&&Ks(d,s,f)&&(d=xt(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=xt(e,{startingIndex:c-c%s-1,disabledIndices:i})),Ks(d,s,f)&&(d=c)),n.key===oo&&(u&&mt(n),c%s!==0?(d=xt(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&Ks(d,s,f)&&(d=xt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=xt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),Ks(d,s,f)&&(d=c));const h=Lr(l/s)===f;Zo(e,d)&&(o&&h?d=n.key===oo?l:xt(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function HD(e,t,n){const r=[];let o=0;return e.forEach((s,i)=>{let{width:a,height:l}=s;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const u=[];for(let d=0;d<a;d++)for(let f=0;f<l;f++)u.push(o+d+f*t);o%t+a<=t&&u.every(d=>r[d]==null)?(u.forEach(d=>{r[d]=i}),c=!0):o++}}),[...r]}function WD(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e)}}function zD(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function li(e,t,n){if(n)return n.includes(t);const r=e[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}let qh=0;function Dn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(qh);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():qh=requestAnimationFrame(s)}var Te=typeof document<"u"?w.useLayoutEffect:w.useEffect;function UD(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}function GD(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}const ab=C.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function YD(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,s]=C.useState(()=>new Map),i=C.useCallback(l=>{s(c=>new Map(c).set(l,null))},[]),a=C.useCallback(l=>{s(c=>{const u=new Map(c);return u.delete(l),u})},[]);return Te(()=>{const l=new Map(o);Array.from(l.keys()).sort(UD).forEach((u,d)=>{l.set(u,d)}),GD(o,l)||s(l)},[o]),C.createElement(ab.Provider,{value:C.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function lb(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=C.useContext(ab),[a,l]=C.useState(null),c=C.useRef(null),u=C.useCallback(d=>{if(c.current=d,a!==null&&(s.current[a]=d,i)){var f;const h=t!==void 0;i.current[a]=h?t:(f=d==null?void 0:d.textContent)!=null?f:null}},[a,s,i,t]);return Te(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),Te(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),C.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},so.apply(this,arguments)}let Xh=!1,KD=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+KD++;function qD(){const[e,t]=C.useState(()=>Xh?Qh():void 0);return Te(()=>{e==null&&t(Qh())},[]),C.useEffect(()=>{Xh=!0},[]),e}const XD=ib.useId,So=XD||qD;let us;process.env.NODE_ENV!=="production"&&(us=new Set);function ci(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=us)!=null&&e.has(o))){var s;(s=us)==null||s.add(o),console.warn(o)}}function QD(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=us)!=null&&e.has(o))){var s;(s=us)==null||s.add(o),console.error(o)}}const cb=C.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:f,style:{transform:h,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||ci("The `ref` prop is required for `FloatingArrow`."));const g=So(),[v,b]=C.useState(!1);if(Te(()=>{if(!o)return;Vt(o).direction==="rtl"&&b(!0)},[o]),!o)return null;const y=c*2,S=y/2,T=i/2*(l/-8+1),E=a/2*l/4,[R,I]=r.split("-"),k=!!f,A=R==="top"||R==="bottom",N=u&&I==="end"?"bottom":"top";let M=u&&I==="end"?"right":"left";u&&v&&(M=I==="end"?"left":"right");const j=(s==null?void 0:s.x)!=null?u||s.x:"",P=(s==null?void 0:s.y)!=null?u||s.y:"",O=f||"M0,0"+(" H"+i)+(" L"+(i-T)+","+(a-E))+(" Q"+i/2+","+a+" "+T+","+(a-E))+" Z",F={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[R];return C.createElement("svg",so({},m,{"aria-hidden":!0,ref:n,width:k?i:i+y,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[M]:j,[N]:P,[R]:A||k?"100%":"calc(100% - "+y/2+"px)",transform:""+F+(h??""),...p}}),y>0&&C.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:y+(f?0:1),d:O}),C.createElement("path",{stroke:y&&!f?m.fill:"none",d:O}),C.createElement("clipPath",{id:g},C.createElement("rect",{x:-S,y:S*(k?-1:1),width:i+y,height:i})))});function ub(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const db=C.createContext(null),fb=C.createContext(null),Yn=()=>{var e;return((e=C.useContext(db))==null?void 0:e.id)||null},Kn=()=>C.useContext(fb);function ZD(e){const t=So(),n=Kn(),o=Yn();return Te(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function JD(e){const{children:t,id:n}=e,r=Yn();return C.createElement(db.Provider,{value:C.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function eM(e){const{children:t}=e,n=C.useRef([]),r=C.useCallback(i=>{n.current=[...n.current,i]},[]),o=C.useCallback(i=>{n.current=n.current.filter(a=>a!==i)},[]),s=C.useState(()=>ub())[0];return C.createElement(fb.Provider,{value:C.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function Hn(e){return"data-floating-ui-"+e}function gt(e){const t=w.useRef(e);return Te(()=>{t.current=e}),t}const Zh=Hn("safe-polygon");function il(e,t,n){return n&&!no(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function hb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,h=Kn(),p=Yn(),m=gt(c),g=gt(l),v=gt(n),b=C.useRef(),y=C.useRef(-1),S=C.useRef(),T=C.useRef(-1),E=C.useRef(!0),R=C.useRef(!1),I=C.useRef(()=>{}),k=C.useCallback(()=>{var O;const F=(O=o.current.openEvent)==null?void 0:O.type;return(F==null?void 0:F.includes("mouse"))&&F!=="mousedown"},[o]);C.useEffect(()=>{if(!a)return;function O(F){let{open:V}=F;V||(clearTimeout(y.current),clearTimeout(T.current),E.current=!0)}return s.on("openchange",O),()=>{s.off("openchange",O)}},[a,s]),C.useEffect(()=>{if(!a||!m.current||!n)return;function O(V){k()&&r(!1,V,"hover")}const F=ut(i.floating).documentElement;return F.addEventListener("mouseleave",O),()=>{F.removeEventListener("mouseleave",O)}},[i.floating,n,r,a,m,k]);const A=C.useCallback(function(O,F,V){F===void 0&&(F=!0),V===void 0&&(V="hover");const H=il(g.current,"close",b.current);H&&!S.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,O,V),H)):F&&(clearTimeout(y.current),r(!1,O,V))},[g,r]),N=at(()=>{I.current(),S.current=void 0}),M=at(()=>{if(R.current){const O=ut(i.floating).body;O.style.pointerEvents="",O.removeAttribute(Zh),R.current=!1}});C.useEffect(()=>{if(!a)return;function O(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function F(D){if(clearTimeout(y.current),E.current=!1,u&&!no(b.current)||d>0&&!il(g.current,"open"))return;const $=il(g.current,"open",b.current);$?y.current=window.setTimeout(()=>{v.current||r(!0,D,"hover")},$):r(!0,D,"hover")}function V(D){if(O())return;I.current();const $=ut(i.floating);if(clearTimeout(T.current),m.current&&o.current.floatingContext){n||clearTimeout(y.current),S.current=m.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){M(),N(),A(D,!0,"safe-polygon")}});const J=S.current;$.addEventListener("mousemove",J),I.current=()=>{$.removeEventListener("mousemove",J)};return}(b.current==="touch"?!Ye(i.floating,D.relatedTarget):!0)&&A(D)}function H(D){O()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){M(),N(),A(D)}})(D))}if(Fe(i.domReference)){var z;const D=i.domReference;return n&&D.addEventListener("mouseleave",H),(z=i.floating)==null||z.addEventListener("mouseleave",H),f&&D.addEventListener("mousemove",F,{once:!0}),D.addEventListener("mouseenter",F),D.addEventListener("mouseleave",V),()=>{var $;n&&D.removeEventListener("mouseleave",H),($=i.floating)==null||$.removeEventListener("mouseleave",H),f&&D.removeEventListener("mousemove",F),D.removeEventListener("mouseenter",F),D.removeEventListener("mouseleave",V)}}},[i,a,e,u,d,f,A,N,M,r,n,v,h,g,m,o]),Te(()=>{var O;if(a&&n&&(O=m.current)!=null&&O.__options.blockPointerEvents&&k()){const V=ut(i.floating).body;V.setAttribute(Zh,""),V.style.pointerEvents="none",R.current=!0;const H=i.floating;if(Fe(i.domReference)&&H){var F;const z=i.domReference,D=h==null||(F=h.nodesRef.current.find($=>$.id===p))==null||(F=F.context)==null?void 0:F.elements.floating;return D&&(D.style.pointerEvents=""),z.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{z.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,i,h,m,k]),Te(()=>{n||(b.current=void 0,N(),M())},[n,N,M]),C.useEffect(()=>()=>{N(),clearTimeout(y.current),clearTimeout(T.current),M()},[a,i.domReference,N,M]);const j=C.useMemo(()=>{function O(F){b.current=F.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(F){const{nativeEvent:V}=F;function H(){!E.current&&!v.current&&r(!0,V,"hover")}u&&!no(b.current)||n||d===0||(clearTimeout(T.current),b.current==="touch"?H():T.current=window.setTimeout(H,d))}}},[u,r,n,v,d]),P=C.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(O){A(O.nativeEvent,!1)}}),[A]);return C.useMemo(()=>a?{reference:j,floating:P}:{},[a,j,P])}function tM(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function pr(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function nM(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),pr(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let Ar=new WeakMap,qs=new WeakSet,Xs={},al=0;const rM=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,pb=e=>e&&(e.host||pb(e.parentNode)),oM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=pb(n);return e.contains(r)?r:null}).filter(n=>n!=null);function sM(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=oM(t,e),a=new Set,l=new Set(i),c=[];Xs[o]||(Xs[o]=new WeakMap);const u=Xs[o];i.forEach(d),f(t),a.clear();function d(h){!h||a.has(h)||(a.add(h),h.parentNode&&d(h.parentNode))}function f(h){!h||l.has(h)||[].forEach.call(h.children,p=>{if(Gn(p)!=="script")if(a.has(p))f(p);else{const m=s?p.getAttribute(s):null,g=m!==null&&m!=="false",v=(Ar.get(p)||0)+1,b=(u.get(p)||0)+1;Ar.set(p,v),u.set(p,b),c.push(p),v===1&&g&&qs.add(p),b===1&&p.setAttribute(o,""),!g&&s&&p.setAttribute(s,"true")}})}return al++,()=>{c.forEach(h=>{const p=(Ar.get(h)||0)-1,m=(u.get(h)||0)-1;Ar.set(h,p),u.set(h,m),p||(!qs.has(h)&&s&&h.removeAttribute(s),qs.delete(h)),m||h.removeAttribute(o)}),al--,al||(Ar=new WeakMap,Ar=new WeakMap,qs=new WeakSet,Xs={})}}function Jh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ut(e[0]).body;return sM(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const io=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function mb(e,t){const n=cs(e,io());t==="prev"&&n.reverse();const r=n.indexOf(zt(ut(e)));return n.slice(r+1)[0]}function gb(){return mb(document.body,"next")}function yb(){return mb(document.body,"prev")}function Jo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ye(n,r)}function iM(e){cs(e,io()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function aM(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 lM(e,t,n){const r=e.indexOf(t);function o(i){const a=Hn("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||Ye(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const qu={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let cM;function ep(e){e.key==="Tab"&&(e.target,clearTimeout(cM))}const Ni=C.forwardRef(function(t,n){const[r,o]=C.useState();Te(()=>($u()&&o("button"),document.addEventListener("keydown",ep),()=>{document.removeEventListener("keydown",ep)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Hn("focus-guard")]:"",style:qu};return C.createElement("span",so({},t,s))}),vb=C.createContext(null),tp=Hn("portal");function uM(e){e===void 0&&(e={});const{id:t,root:n}=e,r=So(),o=bb(),[s,i]=C.useState(null),a=C.useRef(null);return Te(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Te(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(tp,""),l.appendChild(c),a.current=c,i(c)},[t,r]),Te(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Fe(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(tp,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function Eo(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=uM({id:n,root:r}),[i,a]=C.useState(null),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),f=!!i&&!i.modal&&i.open&&o&&!!(r||s);return C.useEffect(()=>{if(!s||!o||i!=null&&i.modal)return;function h(p){s&&Jo(p)&&(p.type==="focusin"?aM:iM)(s)}return s.addEventListener("focusin",h,!0),s.addEventListener("focusout",h,!0),()=>{s.removeEventListener("focusin",h,!0),s.removeEventListener("focusout",h,!0)}},[s,o,i==null?void 0:i.modal]),C.createElement(vb.Provider,{value:C.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},f&&s&&C.createElement(Ni,{"data-type":"outside",ref:l,onFocus:h=>{if(Jo(h,s)){var p;(p=u.current)==null||p.focus()}else{const m=yb()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus()}}}),f&&s&&C.createElement("span",{"aria-owns":s.id,style:qu}),s&&vs.createPortal(t,s),f&&s&&C.createElement(Ni,{"data-type":"outside",ref:c,onFocus:h=>{if(Jo(h,s)){var p;(p=d.current)==null||p.focus()}else{const m=gb()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,h.nativeEvent))}}}))}const bb=()=>C.useContext(vb),np=20;let sr=[];function ll(e){sr=sr.filter(n=>n.isConnected);let t=e;if(!(!t||Gn(t)==="body")){if(!lD(t,io())){const n=cs(t,io())[0];n&&(t=n)}sr.push(t),sr.length>np&&(sr=sr.slice(-np))}}function rp(){return sr.slice().reverse().find(e=>e.isConnected)}const dM=C.forwardRef(function(t,n){return C.createElement("button",so({},t,{type:"button",ref:n,tabIndex:-1,style:qu}))});function As(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:p,onOpenChange:m,events:g,dataRef:v,floatingId:b,elements:{domReference:y,floating:S}}=t,T=typeof i=="number"&&i<0,E=Gv(y)&&T,R=rM()?s:!0,I=gt(o),k=gt(i),A=gt(a),N=Kn(),M=bb(),j=C.useRef(null),P=C.useRef(null),O=C.useRef(!1),F=C.useRef(!1),V=C.useRef(-1),H=M!=null,z=S==null?void 0:S.firstElementChild,D=(z==null?void 0:z.id)===b?z:S,$=at(function(G){return G===void 0&&(G=D),G?cs(G,io()):[]}),K=at(G=>{const L=$(G);return I.current.map(B=>y&&B==="reference"?y:D&&B==="floating"?D:L).filter(Boolean).flat()});C.useEffect(()=>{if(r||!c)return;function G(B){if(B.key==="Tab"){Ye(D,zt(ut(D)))&&$().length===0&&!E&&mt(B);const W=K(),U=rn(B);I.current[0]==="reference"&&U===y&&(mt(B),B.shiftKey?Dn(W[W.length-1]):Dn(W[1])),I.current[1]==="floating"&&U===D&&B.shiftKey&&(mt(B),Dn(W[0]))}}const L=ut(D);return L.addEventListener("keydown",G),()=>{L.removeEventListener("keydown",G)}},[r,y,D,c,I,E,$,K]),C.useEffect(()=>{if(r||!S)return;function G(L){const B=rn(L),U=$().indexOf(B);U!==-1&&(V.current=U)}return S.addEventListener("focusin",G),()=>{S.removeEventListener("focusin",G)}},[r,S,$]),C.useEffect(()=>{if(r||!d)return;function G(){F.current=!0,setTimeout(()=>{F.current=!1})}function L(B){const W=B.relatedTarget;queueMicrotask(()=>{const U=!(Ye(y,W)||Ye(S,W)||Ye(W,S)||Ye(M==null?void 0:M.portalNode,W)||W!=null&&W.hasAttribute(Hn("focus-guard"))||N&&(pr(N.nodesRef.current,p).find(q=>{var te,_;return Ye((te=q.context)==null?void 0:te.elements.floating,W)||Ye((_=q.context)==null?void 0:_.elements.domReference,W)})||tM(N.nodesRef.current,p).find(q=>{var te,_;return((te=q.context)==null?void 0:te.elements.floating)===W||((_=q.context)==null?void 0:_.elements.domReference)===W})));if(l&&U&&zt(ut(D))===ut(D).body){et(D)&&(D==null||D.focus());const q=V.current,te=$(),_=te[q]||te[te.length-1]||D;et(_)&&_.focus()}(E||!c)&&W&&U&&!F.current&&W!==rp()&&(O.current=!0,m(!1,B))})}if(S&&et(y))return y.addEventListener("focusout",L),y.addEventListener("pointerdown",G),S.addEventListener("focusout",L),()=>{y.removeEventListener("focusout",L),y.removeEventListener("pointerdown",G),S.removeEventListener("focusout",L)}},[r,y,S,D,c,p,N,M,m,d,l,$,E]),C.useEffect(()=>{var G;if(r)return;const L=Array.from((M==null||(G=M.portalNode)==null?void 0:G.querySelectorAll("["+Hn("portal")+"]"))||[]);if(S){const B=[S,...L,j.current,P.current,I.current.includes("reference")||E?y:null].filter(U=>U!=null),W=c||E?Jh(B,R,!R):Jh(B);return()=>{W()}}},[r,y,S,c,I,M,E,R]),Te(()=>{if(r||!et(D))return;const G=ut(D),L=zt(G);queueMicrotask(()=>{const B=K(D),W=k.current,U=(typeof W=="number"?B[W]:W.current)||D,q=Ye(D,L);!T&&!q&&f&&Dn(U,{preventScroll:U===D})})},[r,f,D,T,K,k]),Te(()=>{if(r||!D)return;let G=!1;const L=ut(D),B=zt(L);let U=v.current.openEvent;const q=h.domReference.current;ll(B);function te(_){let{open:ae,reason:he,event:ve,nested:We}=_;ae&&(U=ve),he==="escape-key"&&h.domReference.current&&ll(h.domReference.current),he==="hover"&&ve.type==="mouseleave"&&(O.current=!0),he==="outside-press"&&(We?(O.current=!1,G=!0):O.current=!(zv(ve)||Vu(ve)))}return g.on("openchange",te),()=>{g.off("openchange",te);const _=zt(L),ae=Ye(S,_)||N&&pr(N.nodesRef.current,p).some(oe=>{var ye;return Ye((ye=oe.context)==null?void 0:ye.elements.floating,_)});(ae||U&&["click","mousedown"].includes(U.type))&&h.domReference.current&&ll(h.domReference.current);const ve=q||B,We=cs(ut(ve).body,io());queueMicrotask(()=>{let oe=rp();!oe&&et(ve)&&S&&(oe=lM(We,ve,S)),A.current&&!O.current&&et(oe)&&(!(oe!==_&&_!==L.body)||ae)&&oe.focus({preventScroll:G})})}},[r,S,D,A,v,h,g,N,p]),Te(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{M.setFocusManagerState(null)}},[r,M,c,f,m,h,d]),Te(()=>{if(r||!D||typeof MutationObserver!="function"||T)return;const G=()=>{const B=D.getAttribute("tabindex"),W=$(),U=zt(ut(S)),q=W.indexOf(U);q!==-1&&(V.current=q),I.current.includes("floating")||U!==h.domReference.current&&W.length===0?B!=="0"&&D.setAttribute("tabindex","0"):B!=="-1"&&D.setAttribute("tabindex","-1")};G();const L=new MutationObserver(G);return L.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{L.disconnect()}},[r,S,D,h,I,$,T]);function J(G){return r||!u||!c?null:C.createElement(dM,{ref:G==="start"?j:P,onClick:L=>m(!1,L.nativeEvent)},typeof u=="string"?u:"Dismiss")}const X=!r&&R&&(c?!E:!0)&&(H||c);return C.createElement(C.Fragment,null,X&&C.createElement(Ni,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:G=>{if(c){const B=K();Dn(o[0]==="reference"?B[0]:B[B.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(O.current=!1,Jo(G,M.portalNode)){const B=gb()||y;B==null||B.focus()}else{var L;(L=M.beforeOutsideRef.current)==null||L.focus()}}}),!E&&J("start"),n,J("end"),X&&C.createElement(Ni,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:G=>{if(c)Dn(K()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(d&&(O.current=!0),Jo(G,M.portalNode)){const B=yb()||y;B==null||B.focus()}else{var L;(L=M.afterOutsideRef.current)==null||L.focus()}}}))}const cl=new Set,fM=C.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=So();return Te(()=>{if(!r)return;cl.add(s);const i=/iP(hone|ad|od)|iOS/.test(_u()),a=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,d=a.left?parseFloat(a.left):window.scrollX,f=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[c]=u+"px"),i){var h,p;const m=((h=window.visualViewport)==null?void 0:h.offsetLeft)||0,g=((p=window.visualViewport)==null?void 0:p.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(f-Math.floor(g))+"px",left:-(d-Math.floor(m))+"px",right:"0"})}return()=>{cl.delete(s),cl.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,f)))}},[s,r]),C.createElement("div",so({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function op(e){return et(e.target)&&e.target.tagName==="BUTTON"}function sp(e){return Bu(e)}function Os(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=C.useRef(),f=C.useRef(!1),h=C.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(no(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}no(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||op(p))&&(p.key===" "&&!sp(s)&&(p.preventDefault(),f.current=!0),p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||op(p)||sp(s)||p.key===" "&&f.current&&(f.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,s,a,c,u,r,n,l]);return C.useMemo(()=>i?{reference:h}:{},[i,h])}function hM(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var s;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(((s=t.dataRef.current.openEvent)==null?void 0:s.type)||"")&&t.pointerType!=="touch";let u=i.width,d=i.height,f=i.x,h=i.y;return n==null&&t.x&&a&&(n=i.x-t.x),r==null&&t.y&&l&&(r=i.y-t.y),f-=n||0,h-=r||0,u=0,d=0,!o||c?(u=t.axis==="y"?i.width:0,d=t.axis==="x"?i.height:0,f=a&&t.x!=null?t.x:f,h=l&&t.y!=null?t.y:h):o&&!c&&(d=t.axis==="x"?i.height:d,u=t.axis==="y"?i.width:u),o=!0,{width:u,height:d,x:f,y:h,top:h,right:f+u,bottom:h+d,left:f}}}}function ip(e){return e!=null&&e.clientX!=null}function pM(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:s},refs:i}=e,{enabled:a=!0,axis:l="both",x:c=null,y:u=null}=t,d=C.useRef(!1),f=C.useRef(null),[h,p]=C.useState(),[m,g]=C.useState([]),v=at((E,R)=>{d.current||r.current.openEvent&&!ip(r.current.openEvent)||i.setPositionReference(hM(s,{x:E,y:R,axis:l,dataRef:r,pointerType:h}))}),b=at(E=>{c!=null||u!=null||(n?f.current||g([]):v(E.clientX,E.clientY))}),y=no(h)?o:n,S=C.useCallback(()=>{if(!y||!a||c!=null||u!=null)return;const E=Rt(o);function R(I){const k=rn(I);Ye(o,k)?(E.removeEventListener("mousemove",R),f.current=null):v(I.clientX,I.clientY)}if(!r.current.openEvent||ip(r.current.openEvent)){E.addEventListener("mousemove",R);const I=()=>{E.removeEventListener("mousemove",R),f.current=null};return f.current=I,I}i.setPositionReference(s)},[y,a,c,u,o,r,i,s,v]);C.useEffect(()=>S(),[S,m]),C.useEffect(()=>{a&&!o&&(d.current=!1)},[a,o]),C.useEffect(()=>{!a&&n&&(d.current=!0)},[a,n]),Te(()=>{a&&(c!=null||u!=null)&&(d.current=!1,v(c,u))},[a,c,u,v]);const T=C.useMemo(()=>{function E(R){let{pointerType:I}=R;p(I)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:b,onMouseEnter:b}},[b]);return C.useMemo(()=>a?{reference:T}:{},[a,T])}const mM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},gM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ap=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Co(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:p}=t,m=Kn(),g=at(typeof l=="function"?l:()=>!1),v=typeof l=="function"?g:l,b=C.useRef(!1),y=C.useRef(!1),{escapeKey:S,outsidePress:T}=ap(h),{escapeKey:E,outsidePress:R}=ap(p),I=at(P=>{var O;if(!n||!i||!a||P.key!=="Escape")return;const F=(O=s.current.floatingContext)==null?void 0:O.nodeId,V=m?pr(m.nodesRef.current,F):[];if(!S&&(P.stopPropagation(),V.length>0)){let H=!0;if(V.forEach(z=>{var D;if((D=z.context)!=null&&D.open&&!z.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,FO(P)?P.nativeEvent:P,"escape-key")}),k=at(P=>{var O;const F=()=>{var V;I(P),(V=rn(P))==null||V.removeEventListener("keydown",F)};(O=rn(P))==null||O.addEventListener("keydown",F)}),A=at(P=>{var O;const F=b.current;b.current=!1;const V=y.current;if(y.current=!1,c==="click"&&V||F||typeof v=="function"&&!v(P))return;const H=rn(P),z="["+Hn("inert")+"]",D=ut(o.floating).querySelectorAll(z);let $=Fe(H)?H:null;for(;$&&!Vn($);){const G=Sn($);if(Vn(G)||!Fe(G))break;$=G}if(D.length&&Fe(H)&&!jO(H)&&!Ye(H,o.floating)&&Array.from(D).every(G=>!Ye($,G)))return;if(et(H)&&j){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,L=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let B=L&&P.offsetX>H.clientWidth;if(L&&Vt(H).direction==="rtl"&&(B=P.offsetX<=H.offsetWidth-H.clientWidth),B||G&&P.offsetY>H.clientHeight)return}const K=(O=s.current.floatingContext)==null?void 0:O.nodeId,J=m&&pr(m.nodesRef.current,K).some(G=>{var L;return rl(P,(L=G.context)==null?void 0:L.elements.floating)});if(rl(P,o.floating)||rl(P,o.domReference)||J)return;const X=m?pr(m.nodesRef.current,K):[];if(X.length>0){let G=!0;if(X.forEach(L=>{var B;if((B=L.context)!=null&&B.open&&!L.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,P,"outside-press")}),N=at(P=>{var O;const F=()=>{var V;A(P),(V=rn(P))==null||V.removeEventListener(c,F)};(O=rn(P))==null||O.addEventListener(c,F)});C.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=T;function P(V){r(!1,V,"ancestor-scroll")}const O=ut(o.floating);a&&O.addEventListener("keydown",E?k:I,E),v&&O.addEventListener(c,R?N:A,R);let F=[];return f&&(Fe(o.domReference)&&(F=jn(o.domReference)),Fe(o.floating)&&(F=F.concat(jn(o.floating))),!Fe(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(jn(o.reference.contextElement)))),F=F.filter(V=>{var H;return V!==((H=O.defaultView)==null?void 0:H.visualViewport)}),F.forEach(V=>{V.addEventListener("scroll",P,{passive:!0})}),()=>{a&&O.removeEventListener("keydown",E?k:I,E),v&&O.removeEventListener(c,R?N:A,R),F.forEach(V=>{V.removeEventListener("scroll",P)})}},[s,o,a,v,c,n,r,f,i,S,T,I,E,k,A,R,N]),C.useEffect(()=>{b.current=!1},[v,c]);const M=C.useMemo(()=>({onKeyDown:I,[mM[d]]:P=>{u&&r(!1,P.nativeEvent,"reference-press")}}),[I,r,u,d]),j=C.useMemo(()=>({onKeyDown:I,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[gM[c]]:()=>{b.current=!0}}),[I,c]);return C.useMemo(()=>i?{reference:M,floating:j}:{},[i,M,j])}function yM(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=So(),s=C.useRef({}),[i]=C.useState(()=>ub()),a=Yn()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Fe(h)&&QD("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=C.useState(r.reference),u=at((h,p,m)=>{s.current.openEvent=h?p:void 0,i.emit("openchange",{open:h,event:p,reason:m,nested:a}),n==null||n(h,p,m)}),d=C.useMemo(()=>({setPositionReference:c}),[]),f=C.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return C.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:f,events:i,floatingId:o,refs:d}),[t,u,f,i,o,d])}function Po(e){e===void 0&&(e={});const{nodeId:t}=e,n=yM({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=C.useState(null),[a,l]=C.useState(null),u=(o==null?void 0:o.reference)||s,d=C.useRef(null),f=Kn();Te(()=>{u&&(d.current=u)},[u]);const h=ND({...e,elements:{...o,...a&&{reference:a}}}),p=C.useCallback(y=>{const S=Fe(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(S),h.refs.setReference(S)},[h.refs]),m=C.useCallback(y=>{(Fe(y)||y===null)&&(d.current=y,i(y)),(Fe(h.refs.reference.current)||h.refs.reference.current===null||y!==null&&!Fe(y))&&h.refs.setReference(y)},[h.refs]),g=C.useMemo(()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d}),[h.refs,m,p]),v=C.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),b=C.useMemo(()=>({...h,...r,refs:g,elements:v,nodeId:t}),[h,g,v,t,r]);return Te(()=>{r.dataRef.current.floatingContext=b;const y=f==null?void 0:f.nodesRef.current.find(S=>S.id===t);y&&(y.context=b)}),C.useMemo(()=>({...h,context:b,refs:g,elements:v}),[h,g,v,b])}function vM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=C.useRef(!1),u=C.useRef(),d=C.useRef(!0);C.useEffect(()=>{if(!a)return;const h=Rt(i.domReference);function p(){!n&&et(i.domReference)&&i.domReference===zt(ut(i.domReference))&&(c.current=!0)}function m(){d.current=!0}return h.addEventListener("blur",p),h.addEventListener("keydown",m,!0),()=>{h.removeEventListener("blur",p),h.removeEventListener("keydown",m,!0)}},[i.domReference,n,a]),C.useEffect(()=>{if(!a)return;function h(p){let{reason:m}=p;(m==="reference-press"||m==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),C.useEffect(()=>()=>{clearTimeout(u.current)},[]);const f=C.useMemo(()=>({onPointerDown(h){Vu(h.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const p=rn(h.nativeEvent);if(l&&Fe(p))try{if($u()&&Uv())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!d.current&&!Bu(p))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const p=h.relatedTarget,m=h.nativeEvent,g=Fe(p)&&p.hasAttribute(Hn("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const b=zt(i.domReference?i.domReference.ownerDocument:document);!p&&b===i.domReference||Ye((v=s.current.floatingContext)==null?void 0:v.refs.floating.current,b)||Ye(i.domReference,b)||g||r(!1,m,"focus")})}}),[s,i.domReference,r,l]);return C.useMemo(()=>a?{reference:f}:{},[a,f])}const lp="active",cp="selected";function ul(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[lp]:i,[cp]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[lp,cp].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var f,h=arguments.length,p=new Array(h),m=0;m<h;m++)p[m]=arguments[m];return(f=r.get(c))==null?void 0:f.map(g=>g(...p)).find(g=>g!==void 0)}}}else i[c]=u}),i),{})}}function Ro(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=C.useCallback(a=>ul(a,e,"reference"),t),s=C.useCallback(a=>ul(a,e,"floating"),n),i=C.useCallback(a=>ul(a,e,"item"),r);return C.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let up=!1;function ha(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function dp(e,t){return ha(t,e===Ku||e===Is,e===oo||e===To)}function dl(e,t,n){return ha(t,e===Is,n?e===oo:e===To)||e==="Enter"||e===" "||e===""}function bM(e,t,n){return ha(t,n?e===oo:e===To,e===Is)}function fp(e,t,n){return ha(t,n?e===To:e===oo,e===Ku)}function xb(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:f=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:b=void 0,orientation:y="vertical",cols:S=1,scrollItemIntoView:T=!0,virtualItemRef:E,itemSizes:R,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||ci("`useListNavigation` looping must be enabled to allow escaping."),p||ci("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&S>1&&ci("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const k=Yn(),A=Kn(),N=at(a),M=C.useRef(m),j=C.useRef(c??-1),P=C.useRef(null),O=C.useRef(!0),F=C.useRef(N),V=C.useRef(!!o.floating),H=C.useRef(n),z=C.useRef(!1),D=C.useRef(!1),$=gt(b),K=gt(n),J=gt(T),X=gt(o.floating),G=gt(c),[L,B]=C.useState(),[W,U]=C.useState(),q=at(function(oe,ye,se){se===void 0&&(se=!1);function xe(we){p?(B(we.id),A==null||A.events.emit("virtualfocus",we),E&&(E.current=we)):Dn(we,{preventScroll:!0,sync:Uv()&&$u()?up||z.current:!1})}const Qe=oe.current[ye.current];Qe&&xe(Qe),requestAnimationFrame(()=>{const we=oe.current[ye.current]||Qe;if(!we)return;Qe||xe(we);const ot=J.current;ot&&_&&(se||!O.current)&&(we.scrollIntoView==null||we.scrollIntoView(typeof ot=="boolean"?{block:"nearest",inline:"nearest"}:ot))})});Te(()=>{document.createElement("div").focus({get preventScroll(){return up=!0,!1}})},[]),Te(()=>{l&&(n&&o.floating?M.current&&c!=null&&(D.current=!0,j.current=c,N(c)):V.current&&(j.current=-1,F.current(null)))},[l,n,o.floating,c,N]),Te(()=>{if(l&&n&&o.floating)if(i==null){if(z.current=!1,G.current!=null)return;if(V.current&&(j.current=-1,q(s,j)),(!H.current||!V.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let oe=0;const ye=()=>{s.current[0]==null?(oe<2&&(oe?requestAnimationFrame:queueMicrotask)(ye),oe++):(j.current=P.current==null||dl(P.current,y,h)||f?sl(s,$.current):Kh(s,$.current),P.current=null,N(j.current))};ye()}}else Zo(s,i)||(j.current=i,q(s,j,D.current),D.current=!1)},[l,n,o.floating,i,G,f,s,y,h,N,q,$]),Te(()=>{var oe;if(!l||o.floating||!A||p||!V.current)return;const ye=A.nodesRef.current,se=(oe=ye.find(we=>we.id===k))==null||(oe=oe.context)==null?void 0:oe.elements.floating,xe=zt(ut(o.floating)),Qe=ye.some(we=>we.context&&Ye(we.context.elements.floating,xe));se&&!Qe&&O.current&&se.focus({preventScroll:!0})},[l,o.floating,A,k,p]),Te(()=>{if(!l||!A||!p||k)return;function oe(ye){U(ye.id),E&&(E.current=ye)}return A.events.on("virtualfocus",oe),()=>{A.events.off("virtualfocus",oe)}},[l,A,p,k,E]),Te(()=>{F.current=N,V.current=!!o.floating}),Te(()=>{n||(P.current=null)},[n]),Te(()=>{H.current=n},[n]);const te=i!=null,_=C.useMemo(()=>{function oe(se){if(!n)return;const xe=s.current.indexOf(se);xe!==-1&&N(xe)}return{onFocus(se){let{currentTarget:xe}=se;oe(xe)},onClick:se=>{let{currentTarget:xe}=se;return xe.focus({preventScroll:!0})},...g&&{onMouseMove(se){let{currentTarget:xe}=se;oe(xe)},onPointerLeave(se){let{pointerType:xe}=se;!O.current||xe==="touch"||(j.current=-1,q(s,j),N(null),p||Dn(X.current,{preventScroll:!0}))}}}},[n,X,q,g,s,N,p]),ae=at(oe=>{if(O.current=!1,z.current=!0,!K.current&&oe.currentTarget===X.current)return;if(f&&fp(oe.key,y,h)){mt(oe),r(!1,oe.nativeEvent,"list-navigation"),et(o.domReference)&&!p&&o.domReference.focus();return}const ye=j.current,se=sl(s,b),xe=Kh(s,b);if(oe.key==="Home"&&(mt(oe),j.current=se,N(j.current)),oe.key==="End"&&(mt(oe),j.current=xe,N(j.current)),S>1){const Qe=R||Array.from({length:s.current.length},()=>({width:1,height:1})),we=HD(Qe,S,I),ot=we.findIndex(re=>re!=null&&!li(s.current,re,b)),Z=we.reduce((re,Se,Le)=>Se!=null&&!li(s.current,Se,b)?Le:re,-1);if(j.current=we[BD({current:we.map(re=>re!=null?s.current[re]:null)},{event:oe,orientation:y,loop:d,cols:S,disabledIndices:zD([...b||s.current.map((re,Se)=>li(s.current,Se)?Se:void 0),void 0],we),minIndex:ot,maxIndex:Z,prevIndex:WD(j.current>xe?se:j.current,Qe,we,S,oe.key===Is?"bl":oe.key===To?"tr":"tl"),stopEvent:!0})],N(j.current),y==="both")return}if(dp(oe.key,y)){if(mt(oe),n&&!p&&zt(oe.currentTarget.ownerDocument)===oe.currentTarget){j.current=dl(oe.key,y,h)?se:xe,N(j.current);return}dl(oe.key,y,h)?d?j.current=ye>=xe?u&&ye!==s.current.length?-1:se:xt(s,{startingIndex:ye,disabledIndices:b}):j.current=Math.min(xe,xt(s,{startingIndex:ye,disabledIndices:b})):d?j.current=ye<=se?u&&ye!==-1?s.current.length:xe:xt(s,{startingIndex:ye,decrement:!0,disabledIndices:b}):j.current=Math.max(se,xt(s,{startingIndex:ye,decrement:!0,disabledIndices:b})),Zo(s,j.current)?N(null):N(j.current)}}),he=C.useMemo(()=>p&&n&&te&&{"aria-activedescendant":W||L},[p,n,te,W,L]),ve=C.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!Gv(o.domReference)&&he,onKeyDown:ae,onPointerMove(){O.current=!0}}),[he,ae,o.domReference,y]),We=C.useMemo(()=>{function oe(se){m==="auto"&&zv(se.nativeEvent)&&(M.current=!0)}function ye(se){M.current=m,m==="auto"&&Vu(se.nativeEvent)&&(M.current=!0)}return{...he,onKeyDown(se){O.current=!1;const xe=se.key.indexOf("Arrow")===0,Qe=bM(se.key,y,h),we=fp(se.key,y,h),ot=dp(se.key,y),Z=(f?Qe:ot)||se.key==="Enter"||se.key.trim()==="";if(p&&n){const ht=A==null?void 0:A.nodesRef.current.find(Pt=>Pt.parentId==null),vt=A&&ht?nM(A.nodesRef.current,ht.id):null;if(xe&&vt&&E){const Pt=new KeyboardEvent("keydown",{key:se.key,bubbles:!0});if(Qe||we){var re,Se;const Zn=((re=vt.context)==null?void 0:re.elements.domReference)===se.currentTarget,Sr=we&&!Zn?(Se=vt.context)==null?void 0:Se.elements.domReference:Qe?s.current.find(Er=>(Er==null?void 0:Er.id)===L):null;Sr&&(mt(se),Sr.dispatchEvent(Pt),U(void 0))}if(ot&&vt.context&&vt.context.open&&vt.parentId&&se.currentTarget!==vt.context.elements.domReference){var Le;mt(se),(Le=vt.context.elements.domReference)==null||Le.dispatchEvent(Pt);return}}return ae(se)}if(!(!n&&!v&&xe)){if(Z&&(P.current=f&&ot?null:se.key),f){Qe&&(mt(se),n?(j.current=sl(s,$.current),N(j.current)):r(!0,se.nativeEvent,"list-navigation"));return}ot&&(c!=null&&(j.current=c),mt(se),!n&&v?r(!0,se.nativeEvent,"list-navigation"):ae(se),n&&N(j.current))}},onFocus(){n&&!p&&N(null)},onPointerDown:ye,onMouseDown:oe,onClick:oe}},[L,he,ae,$,m,s,f,N,r,n,v,y,h,c,A,p,E]);return C.useMemo(()=>l?{reference:We,floating:ve,item:_}:{},[l,We,ve,_])}const xM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Io(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=xM.get(i))!=null?n:i,l=So(),u=Yn()!=null,d=C.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&u&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,l,i]),f=C.useMemo(()=>{const p={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?p:{...p,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),h=C.useCallback(p=>{let{active:m,selected:g}=p;const v={role:"option",...m&&{id:o+"-option"}};switch(i){case"select":return{...v,"aria-selected":m&&g};case"combobox":return{...v,...m&&{"aria-selected":!0}}}return{}},[o,i]);return C.useMemo(()=>s?{reference:d,floating:f,item:h}:{},[s,d,f,h])}const hp=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Or(e,t){return typeof e=="function"?e(t):e}function wM(e,t){const[n,r]=C.useState(e);return e&&!n&&r(!0),C.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function TM(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[a,l]=C.useState("unmounted"),c=wM(n,i);return!c&&a==="close"&&l("unmounted"),Te(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function SM(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=C.useMemo(()=>({side:l,placement:a}),[l,a]),u=typeof i=="number",d=(u?i:i.open)||0,f=(u?i:i.close)||0,[h,p]=C.useState(()=>({...Or(s,c),...Or(n,c)})),{isMounted:m,status:g}=TM(e,{duration:i}),v=gt(n),b=gt(r),y=gt(o),S=gt(s);return Te(()=>{const T=Or(v.current,c),E=Or(y.current,c),R=Or(S.current,c),I=Or(b.current,c)||Object.keys(T).reduce((k,A)=>(k[A]="",k),{});if(g==="initial"&&p(k=>({transitionProperty:k.transitionProperty,...R,...T})),g==="open"&&p({transitionProperty:Object.keys(I).map(hp).join(","),transitionDuration:d+"ms",...R,...I}),g==="close"){const k=E||T;p({transitionProperty:Object.keys(k).map(hp).join(","),transitionDuration:f+"ms",...R,...k})}},[f,y,v,b,S,d,g,c]),{isMounted:m,styles:h}}function EM(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:h=null}=t,p=C.useRef(),m=C.useRef(""),g=C.useRef((n=h??i)!=null?n:-1),v=C.useRef(null),b=at(a),y=at(l),S=gt(u),T=gt(f);Te(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),Te(()=>{if(r&&m.current===""){var A;g.current=(A=h??i)!=null?A:-1}},[r,h,i]);const E=at(A=>{A?o.current.typing||(o.current.typing=A,y(A)):o.current.typing&&(o.current.typing=A,y(A))}),R=at(A=>{function N(F,V,H){const z=S.current?S.current(V,H):V.find(D=>(D==null?void 0:D.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return z?F.indexOf(z):-1}const M=s.current;if(m.current.length>0&&m.current[0]!==" "&&(N(M,M,m.current)===-1?E(!1):A.key===" "&&mt(A)),M==null||T.current.includes(A.key)||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;r&&A.key!==" "&&(mt(A),E(!0)),M.every(F=>{var V,H;return F?((V=F[0])==null?void 0:V.toLocaleLowerCase())!==((H=F[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===A.key&&(m.current="",g.current=v.current),m.current+=A.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=v.current,E(!1)},d);const P=g.current,O=N(M,[...M.slice((P||0)+1),...M.slice(0,(P||0)+1)],m.current);O!==-1?(b(O),v.current=O):A.key!==" "&&(m.current="",E(!1))}),I=C.useMemo(()=>({onKeyDown:R}),[R]),k=C.useMemo(()=>({onKeyDown:R,onKeyUp(A){A.key===" "&&E(!1)}}),[R,E]);return C.useMemo(()=>c?{reference:I,floating:k}:{},[c,I,k])}function pp(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[l,c]=t[i]||[0,0],[u,d]=t[a]||[0,0];c>=r!=d>=r&&n<=(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}function CM(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function wb(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();function c(d,f){const h=performance.now(),p=h-l;if(i===null||a===null||p===0)return i=d,a=f,l=h,null;const m=d-i,g=f-a,b=Math.sqrt(m*m+g*g)/p;return i=d,a=f,l=h,b}const u=d=>{let{x:f,y:h,placement:p,elements:m,onClose:g,nodeId:v,tree:b}=d;return function(S){function T(){clearTimeout(o),g()}if(clearTimeout(o),!m.domReference||!m.floating||p==null||f==null||h==null)return;const{clientX:E,clientY:R}=S,I=[E,R],k=rn(S),A=S.type==="mouseleave",N=Ye(m.floating,k),M=Ye(m.domReference,k),j=m.domReference.getBoundingClientRect(),P=m.floating.getBoundingClientRect(),O=p.split("-")[0],F=f>P.right-P.width/2,V=h>P.bottom-P.height/2,H=CM(I,j),z=P.width>j.width,D=P.height>j.height,$=(z?j:P).left,K=(z?j:P).right,J=(D?j:P).top,X=(D?j:P).bottom;if(N&&(s=!0,!A))return;if(M&&(s=!1),M&&!A){s=!0;return}if(A&&Fe(S.relatedTarget)&&Ye(m.floating,S.relatedTarget)||b&&pr(b.nodesRef.current,v).some(B=>{let{context:W}=B;return W==null?void 0:W.open}))return;if(O==="top"&&h>=j.bottom-1||O==="bottom"&&h<=j.top+1||O==="left"&&f>=j.right-1||O==="right"&&f<=j.left+1)return T();let G=[];switch(O){case"top":G=[[$,j.top+1],[$,P.bottom-1],[K,P.bottom-1],[K,j.top+1]];break;case"bottom":G=[[$,P.top+1],[$,j.bottom-1],[K,j.bottom-1],[K,P.top+1]];break;case"left":G=[[P.right-1,X],[P.right-1,J],[j.left+1,J],[j.left+1,X]];break;case"right":G=[[j.right-1,X],[j.right-1,J],[P.left+1,J],[P.left+1,X]];break}function L(B){let[W,U]=B;switch(O){case"top":{const q=[z?W+t/2:F?W+t*4:W-t*4,U+t+1],te=[z?W-t/2:F?W+t*4:W-t*4,U+t+1],_=[[P.left,F||z?P.bottom-t:P.top],[P.right,F?z?P.bottom-t:P.top:P.bottom-t]];return[q,te,..._]}case"bottom":{const q=[z?W+t/2:F?W+t*4:W-t*4,U-t],te=[z?W-t/2:F?W+t*4:W-t*4,U-t],_=[[P.left,F||z?P.top+t:P.bottom],[P.right,F?z?P.top+t:P.bottom:P.top+t]];return[q,te,..._]}case"left":{const q=[W+t+1,D?U+t/2:V?U+t*4:U-t*4],te=[W+t+1,D?U-t/2:V?U+t*4:U-t*4];return[...[[V||D?P.right-t:P.left,P.top],[V?D?P.right-t:P.left:P.right-t,P.bottom]],q,te]}case"right":{const q=[W-t,D?U+t/2:V?U+t*4:U-t*4],te=[W-t,D?U-t/2:V?U+t*4:U-t*4],_=[[V||D?P.left+t:P.right,P.top],[V?D?P.left+t:P.right:P.left+t,P.bottom]];return[q,te,..._]}}}if(!pp([E,R],G)){if(s&&!H)return T();if(!A&&r){const B=c(S.clientX,S.clientY);if(B!==null&&B<.1)return T()}pp([E,R],L([f,h]))?!s&&r&&(o=window.setTimeout(T,40)):T()}}};return u.__options={blockPointerEvents:n},u}const Ao=e=>{const t=w.useId(),[n,r]=w.useState(e.open),o=w.useRef(null),s=w.useMemo(()=>[fa(10),Yu({fallbackAxisSideDirection:"end"}),Gu(),sb({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=Po({open:n,middleware:s,transform:!0,whileElementsMounted:da,onOpenChange:(p,m)=>{var v;const g=m==null?void 0:m.relatedTarget;g&&g.dataset.floating==="true"&&!p||(r(p),(v=e.onChange)==null||v.call(e,p))}}),c=Os(l),u=Co(l),d=Io(l),{getReferenceProps:f,getFloatingProps:h}=Ro([c,u,d]);return x.jsxs(w.Fragment,{children:[x.jsx("button",{ref:i.setReference,...f(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(Eo,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(As,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:x.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:i.setFloating,style:a,"aria-labelledby":t,...h(),children:[x.jsx(cb,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),x.jsx("header",{className:"mb-2",children:x.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},PM=e=>{const t=w.useRef(null),n=w.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=w.useState(!1),{context:a,refs:l}=Po({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=Os(a),u=Io(a),d=Co(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:f,getReferenceProps:h}=Ro([c,u,d]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(Gr,{...h(e),as:dt.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>i(!0),children:x.jsx(dt.span,{layoutId:o,children:e.trigger})}),x.jsx(vo,{children:s?x.jsx(Eo,{root:t,children:x.jsx(As,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:x.jsx(dt.div,{...f(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},Tb=300,RM=500,Sb=(e="")=>ke("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary data-[open]:bg-primary focus:bg-primary aria-expanded:opacity-80","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed","data-[open]:bg-primary-foreground focus:bg-primary-foreground",e),wc=w.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),mp=w.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const l=Yn(),c=l!==null,[u,d]=w.useState(!1),[f,h]=w.useState(!1),[p,m]=w.useState(null),g=w.useRef([]),v=w.useRef([]),b=w.useContext(wc),y=Kn(),S=ZD(),T=lb(),{floatingStyles:E,refs:R,context:I}=Po({nodeId:S,open:u,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:da,placement:c?"right":"bottom-start",middleware:[fa({mainAxis:c?0:4,alignmentAxis:c?-4:0}),Yu(),Gu()]}),k=Io(I,{role:"menu",enabled:!0}),A=Co(I,{bubbles:!0}),N=hb(I,{enabled:n,delay:{open:Tb},handleClose:wb({blockPointerEvents:!0})}),M=Os(I,{event:"mousedown",toggle:!c,ignoreMouse:c,keyboardHandlers:!0}),j=xb(I,{loop:!0,activeIndex:p,virtual:!0,nested:c,allowEscape:!0,listRef:g,scrollItemIntoView:!0,onNavigate:m}),P=EM(I,{activeIndex:p,listRef:v,resetMs:RM,onMatch:u?m:void 0}),{getReferenceProps:O,getFloatingProps:F,getItemProps:V}=Ro([N,M,k,A,j,P]);w.useEffect(()=>{if(!y)return;const z=()=>d(!1),D=$=>{$.nodeId!==S&&$.parentId===l&&d(!1)};return y.events.on("click",z),y.events.on("menuopen",D),()=>{y.events.off("click",z),y.events.off("menuopen",D)}},[y,S,l]),w.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:l,nodeId:S})},[y,u,S,l]);const H=r?i.className:ke(Sb(i.className));return x.jsxs(JD,{id:S,children:[x.jsx(w.Fragment,{children:i.asChild?x.jsx(to,{children:s,ref:xc([R.setReference,T.ref,a]),tabIndex:c?b.activeIndex===T.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":f?"":void 0,className:H,...O(b.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),h(!1),b.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",ref:xc([R.setReference,T.ref,a]),tabIndex:c?b.activeIndex===T.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":f?"":void 0,className:H,...O(b.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),h(!1),b.setHasFocusInside(!0)}})),children:[s,c&&x.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[x.jsx("span",{className:"sr-only",children:"Next menu"}),x.jsx(Su,{size:14})]})]})}),x.jsx(wc.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:V,setHasFocusInside:h,isOpen:u},children:x.jsx(YD,{elementsRef:g,labelsRef:v,children:u&&x.jsx(Eo,{preserveTabOrder:!0,children:x.jsx(As,{context:I,modal:!1,initialFocus:c?-1:0,returnFocus:!c,children:x.jsx(t,{...F(),ref:R.setFloating,style:{...i.style,...E},className:ke("isolate z-tooltip flex flex-col items-start rounded-lg border border-floating-border bg-floating-background text-left shadow-xl outline-none",o),children:e})})})})})]})}),IM=w.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=w.useContext(wc),a=lb({label:r?null:typeof e=="string"?e:t}),l=Kn(),c=a.index===i.activeIndex;return x.jsxs("button",{...o,ref:xc([a.ref,s]),"data-active":c,"data-open":i.isOpen,type:"button",role:"menuitem",disabled:r,tabIndex:c?0:-1,className:Sb(o.className),...i.getItemProps({onClick(u){var d;(d=o.onClick)==null||d.call(o,u),l==null||l.events.emit("click")},onFocus(u){var d;(d=o.onFocus)==null||d.call(o,u),i.setHasFocusInside(!0)}}),children:[e,n?x.jsx(n,{size:16}):null]})}),AM=w.forwardRef((e,t)=>Yn()!==null?x.jsx(mp,{...e,isParent:!1,ref:t}):x.jsx(eM,{children:x.jsx(mp,{...e,isParent:!0,ref:t})})),OM=(e,t)=>Ri()?t:window.matchMedia(e).matches,DM=(e,t=!0)=>{const[n,r]=w.useState(t);return w.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(OM(e,t));return s(),o.addListener?(o.addListener(s),()=>o.removeListener?o.removeListener(s):void 0):(o.addEventListener("change",s),()=>o.removeEventListener("change",s))},[e]),n},Ut="600ms",MM={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:Ut},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:Ut},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:Ut}},kM={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:Ut},exit:{translateX:["0%","30%"],opacity:0,animationDuration:Ut}},fl={drawer:e=>e==="left"?MM:kM,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:Ut,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:Ut,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:Ut,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:Ut},enter:{opacity:1,scale:[1.05,1],animationDuration:Ut},exit:{opacity:0,scale:.97,animationDuration:Ut}}},FM=uo("isolate z-floating border border-card-border ring-0 outline-0 appearance-none flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background",{variants:{type:{drawer:"max-h-screen max-w-[90%] absolute w-fit h-screen min-h-0",dialog:"max-h-[calc(100lvh-10%)] relative container h-min rounded-lg py-4",sheet:"w-screen absolute bottom-0 h-[85vh] max-h-[85vh] max-h-[85svh] pt-6 pb-4 rounded-t-lg"},position:{none:"",right:"py-4 absolute right-0 top-0 rounded-l-lg",left:"py-4 absolute left-0 top-0 rounded-r-lg"}},defaultVariants:{position:"right",type:"dialog"}}),jM={top:0,left:0,right:0,bottom:-1},NM=e=>e*.62,LM=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const c=e.parent.current,u=e.value.get()||c.getBoundingClientRect().width,d=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+d))}const s=e.parent.current.getBoundingClientRect(),i=e.value.get()||s.height,a=Math.abs(i-r.delta.y),l=NM(window.outerHeight);return a<l?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return x.jsx(dt.div,{draggable:!0,dragMomentum:!0,dragListener:!0,dragPropagation:!0,onDrag:t,animate:!1,initial:!1,dragElastic:0,dragDirectionLock:!0,dragSnapToOrigin:!0,drag:e.sheet?"y":"x",dragConstraints:jM,whileDrag:{cursor:"grabbing"},className:ke("absolute rounded-lg",e.sheet?"cursor-row-resize":"cursor-col-resize bg-floating-border",e.sheet?"top-1 flex h-3 w-full justify-center py-2":e.position==="left"?"right-5 top-1/2 h-10 w-2":"left-2 top-1/2 h-10 w-2"),children:e.sheet?x.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},hl={drawer:"right",sheet:"none",dialog:"none"},_M=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...s})=>{const i=w.useId(),a=w.useId(),l=DM("(min-width: 64rem)"),c=e!=="dialog",u=l?e==="drawer"?s.position:hl[e]:r?hl[e]:hl.sheet,d=l||r?fl[e]:fl.sheet,f=typeof d=="function"?d(u):d,h=l||r?e:"sheet",{refs:p,context:m}=Po({open:s.open,onOpenChange:s.onChange}),g=Os(m),v=Io(m),b=Co(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:S}=Ro([g,v,b]),T=s.trigger,E=mr(void 0),R=()=>s.onChange(!1);return x.jsxs(w.Fragment,{children:[s.trigger?x.jsx(w.Fragment,{children:s.asChild?x.jsx(to,{ref:p.setReference,...y({layoutId:s.layoutId}),children:T}):x.jsx(dt.button,{ref:p.setReference,...y(),layoutId:s.layoutId,type:"button",children:T})}):null,x.jsx(Eo,{children:x.jsx(vo,{presenceAffectsLayout:!0,children:s.open?x.jsx(fM,{lockScroll:!0,className:`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${h==="drawer"?"":"flex items-start justify-center p-10"}`,children:x.jsx(As,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:m,children:x.jsxs(dt.div,{exit:"exit",animate:"enter",initial:"initial",variants:f,ref:p.setFloating,"aria-modal":s.open,layoutId:s.layoutId,"aria-labelledby":i,"aria-describedby":a,className:FM({position:u,type:h}),style:h==="drawer"?{width:E}:{height:E},...S(),children:[s.title?x.jsx("header",{className:"relative w-full",children:s.title?x.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:s.title}):null}):null,x.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:s.children}),s.footer?x.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:s.footer}):null,o?x.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:x.jsx("button",{type:"button",onClick:R,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(ra,{})})}):null,c&&t?x.jsx(LM,{onChange:s.onChange,parent:p.floating,position:u,sheet:h==="sheet",value:E}):null]})})}):null})})]})},VM=e=>x.jsx(dt.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),Eb=({as:e,title:t,children:n,placement:r,focus:o=!0,hover:s=!0,enabled:i=!0,popover:a=!0,followCursor:l=!1,...c})=>{const[u,d]=w.useState(!1),f=w.useRef(null),h=e||"span",{refs:p,floatingStyles:m,context:g}=Po({open:u,placement:r,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:da,middleware:[Gu(),fa(5),Yu({fallbackAxisSideDirection:"start"}),sb({padding:5,element:f})]}),v=hb(g,{move:!0,delay:{open:Tb},enabled:i?s:!1,handleClose:a?wb():null}),b=vM(g,{enabled:i?o:!1}),y=Os(g,{enabled:i?a:!1}),S=Co(g,{enabled:i}),T=Io(g,{role:"tooltip",enabled:i}),E=pM(g,{enabled:!!i&&!!l}),{getReferenceProps:R,getFloatingProps:I}=Ro([T,S,E,o?b:void 0,s?v:void 0,a?y:void 0]);return x.jsxs(w.Fragment,{children:[x.jsx(h,{ref:p.setReference,...R(c),children:t}),x.jsx(Eo,{preserveTabOrder:!0,children:u&&x.jsxs(mo,{...I(),ref:p.setFloating,style:m,className:"z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[x.jsx(cb,{ref:f,context:g,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),n]})})]})};class Li{static getDescendantProperty(t,n,r=[]){let o,s,i,a,l,c;if(n){if(i=n.indexOf("."),i===-1?o=n:(o=n.slice(0,i),s=n.slice(i+1)),a=t[o],a!==null&&typeof a<"u")if(!s&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(l=0,c=a.length;l<c;l++)Li.getDescendantProperty(a[l],s,r);else s&&Li.getDescendantProperty(a,s,r)}else r.push(t);return r}}class _r{constructor(t=[],n=[],r={}){Array.isArray(n)||(r=n,n=[]),this.haystack=t,this.keys=n,this.options=Object.assign({caseSensitive:!1,sort:!1},r)}search(t=""){if(t==="")return this.haystack;const n=[];for(let r=0;r<this.haystack.length;r++){const o=this.haystack[r];if(this.keys.length===0){const s=_r.isMatch(o,t,this.options.caseSensitive);s&&n.push({item:o,score:s})}else for(let s=0;s<this.keys.length;s++){const i=Li.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=_r.isMatch(i[l],t,this.options.caseSensitive);if(c){a=!0,n.push({item:o,score:c});break}}if(a)break}}return this.options.sort&&n.sort((r,o)=>r.score-o.score),n.map(r=>r.item)}static isMatch(t,n,r){t=String(t),n=String(n),r||(t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase());const o=_r.nearestIndexesFor(t,n);return o?t===n?1:o.length>1?2+(o[o.length-1]-o[0]):2+o[0]:!1}static nearestIndexesFor(t,n){const r=n.split("");let o=[];return _r.indexesOfFirstLetter(t,n).forEach((i,a)=>{let l=i+1;o[a]=[i];for(let c=1;c<r.length;c++){const u=r[c];if(l=t.indexOf(u,l),l===-1){o[a]=!1;break}o[a].push(l),l++}}),o=o.filter(i=>i!==!1),o.length?o.sort((i,a)=>i.length===1?i[0]-a[0]:(i=i[i.length-1]-i[0],a=a[a.length-1]-a[0],i-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,s)=>o!==r?!1:s).filter(o=>o!==!1)}}const Cb=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>x.jsxs("div",{className:ke("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:x.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-disabled:text-disabled group-error:text-danger",children:[s,e||r?x.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?x.jsx(Eb,{as:"button",type:"button",title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(ky,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:x.jsx("div",{className:"w-full max-w-48 whitespace-break-spaces break-words",children:r})}):null,e?x.jsxs(w.Fragment,{children:[x.jsx(Dy,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0}),x.jsx(SP,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}):null]}):null]}),o]}),pa=w.forwardRef(({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:s,right:i,info:a,children:l,error:c,form:u,id:d,labelClassName:f="",name:h,title:p,componentName:m,placeholder:g,hideLeft:v=!1,required:b,disabled:y},S)=>{const T=d??h,E=Ct(),R=e??E.inputOptionalLabel;return x.jsxs("fieldset",{ref:S,form:u,disabled:y,"data-error":!!c,"aria-disabled":y,"data-component":m,"data-interactive":!!s,className:ke("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[x.jsxs("label",{form:u,htmlFor:T,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger",children:[x.jsx(Cb,{info:a,hideLeft:v,reportStatus:!0,title:p,placeholder:g,children:R||n?x.jsxs(w.Fragment,{children:[b?null:x.jsx("span",{"aria-disabled":y,className:"text-opacity-70 aria-disabled:text-disabled",children:R}),n?x.jsx(w.Fragment,{children:n}):null]}):null}),x.jsxs("div",{className:`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${f}`,children:[t?x.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap pl-2",children:t}):null,l,i?x.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap pr-2",children:i}):null]})]}),x.jsx("p",{className:"mt-input-gap hidden flex-shrink-0 flex-grow-0 whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:inline-block group-error:inline-block group-error:text-danger",children:c}),x.jsx("p",{className:"mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden",children:o})]})}),$M=e=>x.jsx(w.Fragment,{children:e.children}),Pb=w.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},s)=>{const i=r.Render??$M,a=r.label??r.value;return r.hidden?null:x.jsx("li",{...o,ref:s,role:"option","aria-selected":t,className:"w-full min-w-0 container border-b border-tooltip-border last:border-b-0",children:x.jsxs("button",{type:"button","aria-checked":t,"aria-current":t,"aria-selected":t,onClick:n,"data-value":r.value,"aria-busy":r.disabled,className:`flex w-full cursor-pointer justify-between p-2 text-left ${t?"bg-primary-hover text-primary-foreground":""} ${e?"bg-primary text-primary-foreground":""}`,children:[x.jsx(i,{...o,label:r.label,value:r.value,children:a}),t?x.jsx("span",{children:x.jsx(wP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})}),BM={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},HM={caseSensitive:!1,sort:!1},WM=[],zM=w.forwardRef(({left:e,error:t,right:n,options:r,container:o,rightLabel:s,interactive:i,emptyMessage:a,optionalText:l,labelClassName:c,feedback:u=null,hideLeft:d=!1,required:f=!1,dynamicOption:h=!1,...p},m)=>{const g=Ct(),v=p.value??p.defaultValue??"",[b,y]=w.useState(!1),[S,T]=w.useState(""),[E,R]=w.useState(v),[I,k]=w.useState(()=>{var _;return((_=r.find(ae=>ae.value===v))==null?void 0:_.label)??v}),[A,N]=w.useState(null),M=w.useRef(WM),j=w.useRef(null),P=h&&S!==""?[{value:S,label:S,"data-dynamic":"true"},...r]:r,O=new _r(P,["value","label"],HM).search(S),F=h?void 0:`^(${r.map(_=>`${lc(_.value)}${_.label?"|"+lc(_.label):""}`).join("|")})$`;w.useEffect(()=>{if(p.value){const _=r.find(ae=>ae.value===p.value);R((_==null?void 0:_.label)??p.value)}},[p.value]);const{x:V,y:H,strategy:z,refs:D,context:$}=Po({open:b,transform:!0,strategy:"absolute",onOpenChange:y,whileElementsMounted:da,middleware:[fa(4),_D({padding:10,elementContext:"reference",apply(_){var oe;const he=_.elements.reference.parentElement,ve=(oe=j.current)==null?void 0:oe.getBoundingClientRect().width,We=(he==null?void 0:he.getBoundingClientRect().width)||0;Object.assign(_.elements.floating.style,{width:`${We}px`,overflowY:"auto",maxWidth:`${ve}px`,minWidth:`${ve}px`,maxHeight:`${Math.min(250,_.availableHeight)}px`})}})]}),K=SM($,BM),{getReferenceProps:J,getFloatingProps:X,getItemProps:G}=Ro([Io($,{role:"listbox"}),Co($),xb($,{cols:0,listRef:M,loop:!0,virtual:!0,allowEscape:!0,activeIndex:A,selectedIndex:A,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:_=>N(ae=>_??ae)})]);w.useEffect(()=>{const _=D.reference.current;if(_)return Gi(_)},[]);const L=(_,ae)=>{R(_.value);const he=D.reference.current;if(!he)return;he==null||he.setAttribute("data-value",_.value),he.value=_.value;const ve=new Event("change",{bubbles:!1,cancelable:!0});he.dispatchEvent(ve),p.onChange&&p.onChange(ve),k(_.label??""),y(!1),T(""),N(ae)},B=_=>{var he;const ae=_.target.value;return T(ae),!b&&ae===""?y(!0):(_.target.name=p.name||"",ae?y(!0):(he=p.onChange)==null?void 0:he.call(p,_))},W=()=>{y(!0),T("")},U=()=>{var _;y(!0),(_=D.reference.current)==null||_.focus()},q=_=>{var ae;_.stopPropagation(),(ae=D.reference.current)==null||ae.setAttribute("data-value",""),$m(D.reference.current),T(""),R(""),k(""),y(!1)},te=p.id||p.name;return x.jsxs(pa,{...p,left:e,error:t,ref:j,form:p.form,name:p.name,feedback:u,hideLeft:d,required:f,title:p.title,container:o,rightLabel:s,disabled:p.disabled,interactive:i,id:p.name||p.id,optionalText:l,componentName:"autocomplete",labelClassName:c,placeholder:p.placeholder,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{disabled:p.disabled,onClick:U,type:"button",className:"transition-colors disabled:link:text-disabled link:text-primary disabled:text-disabled",children:[x.jsx(Oy,{size:20}),x.jsx("span",{className:"sr-only",children:g.inputCaretDown})]}),E?x.jsxs("button",{type:"button",onClick:q,className:"isolate relative transition-colors link:text-danger",children:[x.jsx(ra,{size:15}),x.jsx("span",{className:"sr-only",children:g.inputCloseValue})]}):null]}),children:[x.jsx("input",{...J({...p,onChange:B,onFocus:W,pattern:F,ref:D.setReference,name:`${te}-shadow`,id:`${te}-shadow`,onClick:_=>_.currentTarget.focus(),onKeyDown(_){if(_.key==="Escape")return _.currentTarget.blur(),y(!1);if(_.key==="Enter"){if(A!==null&&O[A])return _.preventDefault(),L(O[A],A);if(O.length===1)return _.preventDefault(),L(O[0],0)}}}),"data-value":E,"data-error":!!t,"data-name":te,"data-target":te,required:f,value:b?S:I||E,"aria-autocomplete":"list",autoComplete:"off",className:ke("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary line-clamp-1",p.className)}),x.jsx("input",{id:te,name:te,type:"hidden","data-origin":te,ref:m,required:f,defaultValue:p.value||E||void 0}),x.jsx(Eo,{preserveTabOrder:!0,children:b?x.jsx(As,{disabled:p.disabled,guards:!0,returnFocus:!1,context:$,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("ul",{...X({ref:D.setFloating,style:{position:z,left:(V??0)+(E?26:18),top:H??0,...K.styles}}),"data-floating":"true",className:"container z-floating m-0 origin-[top_center] list-none overflow-auto overflow-y-auto overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:[O.map((_,ae)=>{const he=E===_.value||E===_.label;return x.jsx(Pb,{...G({onClick:()=>L(_,ae),ref:ve=>void(M.current[ae]=ve),selected:A===ae}),option:_,active:he,selected:A===ae},`${_.value}-option`)}),O.length===0?x.jsx("li",{role:"option",className:"w-full border-b border-tooltip-border last:border-b-0",children:x.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:a||g.autocompleteEmpty})}):null]})}):null})]})}),Rb=w.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:s,container:i,...a},l)=>x.jsxs("label",{"data-task":t,"data-component":"checkbox","data-disabled":a.disabled,"aria-disabled":a.disabled,className:ke("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",i),children:[x.jsx("input",{...a,ref:l,type:"checkbox","data-task":t,className:ke("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",o)}),e,x.jsx("span",{"data-name":"checkbox-label",className:ke("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),Ib=(e,t,n,r)=>w.forwardRef(({type:s="text",feedback:i=null,info:a,labelClassName:l,next:c,interactive:u,rightLabel:d,optionalText:f,container:h,hideLeft:p=!1,right:m,left:g,error:v,...b},y)=>{const S=e,T=b.id??b.name,E=w.useRef(null);return w.useEffect(()=>{if(E.current===null)return;const R=E.current,I=Gi(E.current),k=r==null?void 0:r(R),A=N=>{const M=N;if(M.key==="Enter"&&R.enterKeyHint==="next"){const j=R.getAttribute("data-next");if(j){const P=document.getElementById(j);if(P)return P.focus(),void M.preventDefault()}}};return R.addEventListener("keydown",A),()=>{k==null||k(),I(),R.removeEventListener("keydown",A)}},[]),x.jsx(pa,{...n,componentName:t,info:a,container:h,error:v,feedback:i,hideLeft:p,left:g,optionalText:f,right:m,rightLabel:d,interactive:u,form:b.form,id:b.name||b.id,name:b.name,labelClassName:l,title:b.title,placeholder:b.placeholder,required:b.required,disabled:b.disabled,children:x.jsx(S,{...n,...b,id:T,name:T,type:s,"data-next":c,"aria-busy":b.disabled,"aria-disabled":b.disabled,"aria-readonly":b.readOnly,ref:Yc(y,E),className:ke("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","resize-y group-focus-within:border-primary group-hover:border-primary","disabled:cursor-not-allowed disabled:text-disabled",b.className)})})}),Ds=Ib(rv,"input",{type:"text"}),gp=new Date(1970,11,31),pl={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},yp={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},UM={literal:(e,t)=>t,year:e=>e.getFullYear(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},ml=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},GM=w.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=t||uv(),l=w.useId(),c=Ct(),u=w.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[d,f]=w.useState(e||void 0),[h,p]=w.useState(!1),m=ml(u,gp).flatMap(R=>bn.keyof(pl,R.type)?pl[R.type](R.value):[]),g=ml(u,gp).reduce((R,I)=>R+(bn.keyof(yp,I.type)?yp[I.type](I.value):""),""),[v,b]=w.useState(d?ml(u,d).reduce((R,I)=>R+(bn.keyof(pl,I.type)?UM[I.type](d,I.value):""),""):""),y=R=>{const I=R.target.value;if(b(I),m.length===I.length&&m.every((A,N)=>{const M=I.charAt(N);return typeof A=="string"?M===A:A.test(M)})){const A=eo(jI(I,g,new Date));return f(A),r==null?void 0:r(A)}return f(void 0),r==null?void 0:r(void 0)},S=R=>(f(R),r==null||r(R),b(R?NR(R,g):"")),T=Vy(d),E=T?d.toISOString():void 0;return x.jsx(Ds,{...s,mask:m,value:v,id:void 0,name:void 0,className:"uppercase","data-value":E,formNoValidate:!h,"data-target":s.name,"data-component":"date-picker",onChange:y,required:s.required??!0,error:h?void 0:s.error,placeholder:s.placeholder??g,right:x.jsxs(w.Fragment,{children:[x.jsx("input",{"data-origin":s.name,defaultValue:E,form:s.form,hidden:!0,id:s.name,name:s.name,ref:i,type:"date"}),x.jsx(Ao,{open:h,onChange:p,trigger:x.jsxs("span",{"aria-labelledby":l,children:[x.jsx("span",{id:l,className:"sr-only",children:c.datePickerCalendarButtonLabel}),x.jsx(xP,{})]}),buttonProps:{"aria-describedby":l},children:x.jsx(pv,{...s,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:S,disabledDate:n,date:T?d:void 0})})]})})}),YM=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],KM=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],qM=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],XM=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],vp=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function bp(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const n=t.bits?t.binary?XM:qM:t.binary?KM:YM,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,s=o?"-":t.signed?"+":"";o&&(e=-e);let i;if(t.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:t.maximumFractionDigits,...i}),e<1){const u=vp(e,t.locale,i);return s+u+r+n[0]}const a=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**a,i||(e=e.toPrecision(3));const l=vp(Number(e),t.locale,i),c=n[a];return s+l+r+c}var Tc={exports:{}},Qs={exports:{}},Ie={};/** @license React v16.13.1
177
+ */var zO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Mi=zO.join(","),qv=typeof Element>"u",ro=qv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ki=!qv&&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==null?void 0:e.ownerDocument},Fi=function e(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"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},UO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},GO=function(t,n,r){if(Fi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Mi));return n&&ro.call(t,Mi)&&o.unshift(t),o=o.filter(r),o},YO=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Fi(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=ro.call(i,Mi);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Fi(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&f){var h=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},Xv=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Qv=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||UO(t))&&!Xv(t)?0:t.tabIndex},KO=function(t,n){var r=Qv(t);return r<0&&n&&!Xv(t)?0:r},qO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Zv=function(t){return t.tagName==="INPUT"},XO=function(t){return Zv(t)&&t.type==="hidden"},QO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ZO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},JO=function(t){if(!t.name)return!0;var n=t.form||ki(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(i){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",i.message),!1}var s=ZO(o,t.form);return!s||s===t},eD=function(t){return Zv(t)&&t.type==="radio"},tD=function(t){return eD(t)&&!JO(t)},nD=function(t){var n,r=t&&ki(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=ki(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},Bh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},rD=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=ro.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(ro.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=ki(t);if(l&&!l.shadowRoot&&o(l)===!0)return Bh(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(nD(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Bh(t);return!1},oD=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 ro.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},sD=function(t,n){return!(n.disabled||Fi(n)||XO(n)||rD(n,t)||QO(n)||oD(n))},bc=function(t,n){return!(tD(n)||Qv(n)<0||!sD(t,n))},iD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},aD=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=KO(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(qO).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},cs=function(t,n){n=n||{};var r;return n.getShadowRoot?r=YO([t],n.includeContainer,{filter:bc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:iD}):r=GO(t,n.includeContainer,bc.bind(null,n)),aD(r)},lD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ro.call(t,Mi)===!1?!1:bc(n,t)};function Hh(e,t,n){let{reference:r,floating:o}=e;const s=yr(t),i=Wu(t),a=Hu(i),l=Bn(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(wo(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1);break}return h}const cD=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Hh(c,r,l),f=r,h={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:v}=a[m],{x:b,y,data:S,reset:T}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=b??u,d=y??d,h={...h,[g]:{...h[g],...S}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(f=T.placement),T.rects&&(c=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:d}=Hh(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function zu(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=xo(t,e),p=Kv(h),g=a[f?d==="floating"?"reference":"floating":d],v=Di(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},T=Di(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:l}):b);return{top:(v.top-T.top+p.top)/S.y,bottom:(T.bottom-v.bottom+p.bottom)/S.y,left:(v.left-T.left+p.left)/S.x,right:(T.right-v.right+p.right)/S.x}}const uD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=xo(e,t)||{};if(c==null)return{};const d=Kv(u),f={x:n,y:r},h=Wu(o),p=Hu(h),m=await i.getDimensions(c),g=h==="y",v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-f[h]-s.floating[p],T=f[h]-s.reference[h],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let R=E?E[y]:0;(!R||!await(i.isElement==null?void 0:i.isElement(E)))&&(R=a.floating[y]||s.floating[p]);const I=S/2-T/2,k=R/2-m[p]/2-1,A=on(d[v],k),N=on(d[b],k),M=A,j=R-m[p]-N,P=R/2-m[p]/2+I,O=yc(M,P,j),F=!l.arrow&&wo(o)!=null&&P!==O&&s.reference[p]/2-(P<M?A:N)-m[p]/2<0,V=F?P<M?P-M:P-j:0;return{[h]:f[h]+V,data:{[h]:O,centerOffset:P-O-V,...F&&{alignmentOffset:V}},reset:F}}}),dD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=xo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Bn(o),b=yr(a),y=Bn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=f||(y||!m?[Oi(a)]:$O(a)),E=p!=="none";!f&&E&&T.push(...HO(a,m,p,S));const R=[a,...T],I=await zu(t,g),k=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&k.push(I[v]),d){const P=VO(o,i,S);k.push(I[P[0]],I[P[1]])}if(A=[...A,{placement:o,overflows:k}],!k.every(P=>P<=0)){var N,M;const P=(((N=s.flip)==null?void 0:N.index)||0)+1,O=R[P];if(O)return{data:{index:P,overflows:A},reset:{placement:O}};let F=(M=A.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:M.placement;if(!F)switch(h){case"bestFit":{var j;const V=(j=A.filter(H=>{if(E){const z=yr(H.placement);return z===b||z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(z=>z>0).reduce((z,D)=>z+D,0)]).sort((H,z)=>H[1]-z[1])[0])==null?void 0:j[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};async function fD(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Bn(n),a=wo(n),l=yr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=xo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const hD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await fD(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},pD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:g=>{let{x:v,y:b}=g;return{x:v,y:b}}},...l}=xo(e,t),c={x:n,y:r},u=await zu(t,l),d=yr(Bn(o)),f=Yv(d);let h=c[f],p=c[d];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+u[g],y=h-u[v];h=yc(b,h,y)}if(i){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=p+u[g],y=p-u[v];p=yc(b,p,y)}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},mD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=xo(e,t),l=await zu(t,a),c=Bn(n),u=wo(n),d=yr(n)==="y",{width:f,height:h}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,b=on(h-l[p],g),y=on(f-l[m],v),S=!t.middlewareData.shift;let T=b,E=y;if(d?E=u||S?on(y,v):v:T=u||S?on(b,g):g,S&&!u){const I=Mt(l.left,0),k=Mt(l.right,0),A=Mt(l.top,0),N=Mt(l.bottom,0);d?E=f-2*(I!==0||k!==0?I+k:Mt(l.left,l.right)):T=h-2*(A!==0||N!==0?A+N:Mt(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:T});const R=await o.getDimensions(s.floating);return f!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}};function Jv(e){const t=Vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ai(n)!==s||Ai(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Uu(e){return Fe(e)?e:e.contextElement}function $r(e){const t=Uu(e);if(!et(t))return $n(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Jv(t);let i=(s?Ai(n.width):n.width)/r,a=(s?Ai(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const gD=$n(0);function eb(e){const t=Rt(e);return!Lu()||!t.visualViewport?gD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rt(e)?!1:t}function vr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Uu(e);let i=$n(1);t&&(r?Fe(r)&&(i=$r(r)):i=$r(e));const a=yD(s,n,r)?eb(s):$n(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Rt(s),h=r&&Fe(r)?Rt(r):r;let p=f,m=mc(p);for(;m&&r&&h!==p;){const g=$r(m),v=m.getBoundingClientRect(),b=Vt(m),y=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*g.x,S=v.top+(m.clientTop+parseFloat(b.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=y,c+=S,p=Rt(m),m=mc(p)}}return Di({width:u,height:d,x:l,y:c})}function vD(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=En(r),a=t?ca(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=$n(1);const u=$n(0),d=et(r);if((d||!d&&!s)&&((Gn(r)!=="body"||Rs(i))&&(l=ua(r)),et(r))){const f=vr(r);c=$r(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function bD(e){return Array.from(e.getClientRects())}function tb(e){return vr(En(e)).left+ua(e).scrollLeft}function xD(e){const t=En(e),n=ua(e),r=e.ownerDocument.body,o=Mt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Mt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+tb(e);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(i+=Mt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function wD(e,t){const n=Rt(e),r=En(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Lu();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function TD(e,t){const n=vr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=et(e)?$r(e):$n(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Wh(e,t,n){let r;if(t==="viewport")r=wD(e,n);else if(t==="document")r=xD(En(e));else if(Fe(t))r=TD(t,n);else{const o=eb(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Di(r)}function nb(e,t){const n=Sn(e);return n===t||!Fe(n)||Vn(n)?!1:Vt(n).position==="fixed"||nb(n,t)}function SD(e,t){const n=t.get(e);if(n)return n;let r=jn(e,[],!1).filter(a=>Fe(a)&&Gn(a)!=="body"),o=null;const s=Vt(e).position==="fixed";let i=s?Sn(e):e;for(;Fe(i)&&!Vn(i);){const a=Vt(i),l=Nu(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Rs(i)&&!l&&nb(e,i))?r=r.filter(u=>u!==i):o=a,i=Sn(i)}return t.set(e,r),r}function ED(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ca(t)?[]:SD(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Wh(t,u,o);return c.top=Mt(d.top,c.top),c.right=on(d.right,c.right),c.bottom=on(d.bottom,c.bottom),c.left=Mt(d.left,c.left),c},Wh(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function CD(e){const{width:t,height:n}=Jv(e);return{width:t,height:n}}function PD(e,t,n){const r=et(t),o=En(t),s=n==="fixed",i=vr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=$n(0);if(r||!r&&!s)if((Gn(t)!=="body"||Rs(o))&&(a=ua(t)),r){const d=vr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=tb(o));const c=i.left+a.scrollLeft-l.x,u=i.top+a.scrollTop-l.y;return{x:c,y:u,width:i.width,height:i.height}}function ol(e){return Vt(e).position==="static"}function zh(e,t){return!et(e)||Vt(e).position==="fixed"?null:t?t(e):e.offsetParent}function rb(e,t){const n=Rt(e);if(ca(e))return n;if(!et(e)){let o=Sn(e);for(;o&&!Vn(o);){if(Fe(o)&&!ol(o))return o;o=Sn(o)}return n}let r=zh(e,t);for(;r&&DO(r)&&ol(r);)r=zh(r,t);return r&&Vn(r)&&ol(r)&&!Nu(r)?n:r||MO(e)||n}const RD=async function(e){const t=this.getOffsetParent||rb,n=this.getDimensions,r=await n(e.floating);return{reference:PD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ID(e){return Vt(e).direction==="rtl"}const AD={convertOffsetParentRelativeRectToViewportRelativeRect:vD,getDocumentElement:En,getClippingRect:ED,getOffsetParent:rb,getElementRects:RD,getClientRects:bD,getDimensions:CD,getScale:$r,isElement:Fe,isRTL:ID};function OD(e,t){let n=null,r;const o=En(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Lr(u),p=Lr(o.clientWidth-(c+d)),m=Lr(o.clientHeight-(u+f)),g=Lr(c),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Mt(0,on(1,l))||1};let y=!0;function S(T){const E=T[0].intersectionRatio;if(E!==l){if(!y)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(S,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(e)}return i(!0),s}function da(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Uu(e),u=o||s?[...c?jn(c):[],...jn(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?OD(c,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,m=l?vr(e):null;l&&g();function g(){const v=vr(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(g)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const DD=hD,MD=pD,kD=dD,FD=mD,Uh=uD,jD=(e,t,n)=>{const r=new Map,o={platform:AD,...n},s={...o.platform,_c:r};return cD(e,t,{...o,platform:s})};var ai=typeof document<"u"?w.useLayoutEffect:w.useEffect;function ji(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ji(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!ji(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ob(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gh(e,t){const n=ob(e);return Math.round(t*n)/n}function Yh(e){const t=C.useRef(e);return ai(()=>{t.current=e}),t}function ND(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=C.useState(r);ji(f,r)||h(r);const[p,m]=C.useState(null),[g,v]=C.useState(null),b=C.useCallback(V=>{V!==E.current&&(E.current=V,m(V))},[]),y=C.useCallback(V=>{V!==R.current&&(R.current=V,v(V))},[]),S=s||p,T=i||g,E=C.useRef(null),R=C.useRef(null),I=C.useRef(u),k=l!=null,A=Yh(l),N=Yh(o),M=C.useCallback(()=>{if(!E.current||!R.current)return;const V={placement:t,strategy:n,middleware:f};N.current&&(V.platform=N.current),jD(E.current,R.current,V).then(H=>{const z={...H,isPositioned:!0};j.current&&!ji(I.current,z)&&(I.current=z,vs.flushSync(()=>{d(z)}))})},[f,t,n,N]);ai(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const j=C.useRef(!1);ai(()=>(j.current=!0,()=>{j.current=!1}),[]),ai(()=>{if(S&&(E.current=S),T&&(R.current=T),S&&T){if(A.current)return A.current(S,T,M);M()}},[S,T,M,A,k]);const P=C.useMemo(()=>({reference:E,floating:R,setReference:b,setFloating:y}),[b,y]),O=C.useMemo(()=>({reference:S,floating:T}),[S,T]),F=C.useMemo(()=>{const V={position:n,left:0,top:0};if(!O.floating)return V;const H=Gh(O.floating,u.x),z=Gh(O.floating,u.y);return a?{...V,transform:"translate("+H+"px, "+z+"px)",...ob(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:z}},[n,a,O.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:M,refs:P,elements:O,floatingStyles:F}),[u,M,P,O,F])}const LD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Uh({element:r.current,padding:o}).fn(n):{}:r?Uh({element:r,padding:o}).fn(n):{}}}},fa=(e,t)=>({...DD(e),options:[e,t]}),Gu=(e,t)=>({...MD(e),options:[e,t]}),Yu=(e,t)=>({...kD(e),options:[e,t]}),_D=(e,t)=>({...FD(e),options:[e,t]}),sb=(e,t)=>({...LD(e),options:[e,t]});function xc(e){return C.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const ib={...C},VD=ib.useInsertionEffect,$D=VD||(e=>e());function at(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return $D(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Ku="ArrowUp",Is="ArrowDown",oo="ArrowLeft",To="ArrowRight";function Ks(e,t,n){return Math.floor(e/t)!==n}function Zo(e,t){return t<0||t>=e.current.length}function sl(e,t){return xt(e,{disabledIndices:t})}function Kh(e,t){return xt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function xt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t;const i=e.current;let a=n;do a+=r?-s:s;while(a>=0&&a<=i.length-1&&li(i,a,o));return a}function BD(e,t){let{event:n,orientation:r,loop:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===Ku){if(u&&mt(n),c===-1)d=l;else if(d=xt(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),o&&(c-s<a||d<0)){const f=c%s,h=l%s,p=l-(h-f);h===f?d=l:d=h>f?p:p-s}Zo(e,d)&&(d=c)}if(n.key===Is&&(u&&mt(n),c===-1?d=a:(d=xt(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=xt(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),Zo(e,d)&&(d=c)),r==="both"){const f=Lr(c/s);n.key===To&&(u&&mt(n),c%s!==s-1?(d=xt(e,{startingIndex:c,disabledIndices:i}),o&&Ks(d,s,f)&&(d=xt(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=xt(e,{startingIndex:c-c%s-1,disabledIndices:i})),Ks(d,s,f)&&(d=c)),n.key===oo&&(u&&mt(n),c%s!==0?(d=xt(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&Ks(d,s,f)&&(d=xt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=xt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),Ks(d,s,f)&&(d=c));const h=Lr(l/s)===f;Zo(e,d)&&(o&&h?d=n.key===oo?l:xt(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function HD(e,t,n){const r=[];let o=0;return e.forEach((s,i)=>{let{width:a,height:l}=s;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const u=[];for(let d=0;d<a;d++)for(let f=0;f<l;f++)u.push(o+d+f*t);o%t+a<=t&&u.every(d=>r[d]==null)?(u.forEach(d=>{r[d]=i}),c=!0):o++}}),[...r]}function WD(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e)}}function zD(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function li(e,t,n){if(n)return n.includes(t);const r=e[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}let qh=0;function Dn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(qh);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():qh=requestAnimationFrame(s)}var Te=typeof document<"u"?w.useLayoutEffect:w.useEffect;function UD(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}function GD(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}const ab=C.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function YD(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,s]=C.useState(()=>new Map),i=C.useCallback(l=>{s(c=>new Map(c).set(l,null))},[]),a=C.useCallback(l=>{s(c=>{const u=new Map(c);return u.delete(l),u})},[]);return Te(()=>{const l=new Map(o);Array.from(l.keys()).sort(UD).forEach((u,d)=>{l.set(u,d)}),GD(o,l)||s(l)},[o]),C.createElement(ab.Provider,{value:C.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function lb(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=C.useContext(ab),[a,l]=C.useState(null),c=C.useRef(null),u=C.useCallback(d=>{if(c.current=d,a!==null&&(s.current[a]=d,i)){var f;const h=t!==void 0;i.current[a]=h?t:(f=d==null?void 0:d.textContent)!=null?f:null}},[a,s,i,t]);return Te(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),Te(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),C.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},so.apply(this,arguments)}let Xh=!1,KD=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+KD++;function qD(){const[e,t]=C.useState(()=>Xh?Qh():void 0);return Te(()=>{e==null&&t(Qh())},[]),C.useEffect(()=>{Xh=!0},[]),e}const XD=ib.useId,So=XD||qD;let us;process.env.NODE_ENV!=="production"&&(us=new Set);function ci(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=us)!=null&&e.has(o))){var s;(s=us)==null||s.add(o),console.warn(o)}}function QD(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=us)!=null&&e.has(o))){var s;(s=us)==null||s.add(o),console.error(o)}}const cb=C.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:f,style:{transform:h,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||ci("The `ref` prop is required for `FloatingArrow`."));const g=So(),[v,b]=C.useState(!1);if(Te(()=>{if(!o)return;Vt(o).direction==="rtl"&&b(!0)},[o]),!o)return null;const y=c*2,S=y/2,T=i/2*(l/-8+1),E=a/2*l/4,[R,I]=r.split("-"),k=!!f,A=R==="top"||R==="bottom",N=u&&I==="end"?"bottom":"top";let M=u&&I==="end"?"right":"left";u&&v&&(M=I==="end"?"left":"right");const j=(s==null?void 0:s.x)!=null?u||s.x:"",P=(s==null?void 0:s.y)!=null?u||s.y:"",O=f||"M0,0"+(" H"+i)+(" L"+(i-T)+","+(a-E))+(" Q"+i/2+","+a+" "+T+","+(a-E))+" Z",F={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[R];return C.createElement("svg",so({},m,{"aria-hidden":!0,ref:n,width:k?i:i+y,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[M]:j,[N]:P,[R]:A||k?"100%":"calc(100% - "+y/2+"px)",transform:""+F+(h??""),...p}}),y>0&&C.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:y+(f?0:1),d:O}),C.createElement("path",{stroke:y&&!f?m.fill:"none",d:O}),C.createElement("clipPath",{id:g},C.createElement("rect",{x:-S,y:S*(k?-1:1),width:i+y,height:i})))});function ub(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const db=C.createContext(null),fb=C.createContext(null),Yn=()=>{var e;return((e=C.useContext(db))==null?void 0:e.id)||null},Kn=()=>C.useContext(fb);function ZD(e){const t=So(),n=Kn(),o=Yn();return Te(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function JD(e){const{children:t,id:n}=e,r=Yn();return C.createElement(db.Provider,{value:C.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function eM(e){const{children:t}=e,n=C.useRef([]),r=C.useCallback(i=>{n.current=[...n.current,i]},[]),o=C.useCallback(i=>{n.current=n.current.filter(a=>a!==i)},[]),s=C.useState(()=>ub())[0];return C.createElement(fb.Provider,{value:C.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function Hn(e){return"data-floating-ui-"+e}function gt(e){const t=w.useRef(e);return Te(()=>{t.current=e}),t}const Zh=Hn("safe-polygon");function il(e,t,n){return n&&!no(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function hb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,h=Kn(),p=Yn(),m=gt(c),g=gt(l),v=gt(n),b=C.useRef(),y=C.useRef(-1),S=C.useRef(),T=C.useRef(-1),E=C.useRef(!0),R=C.useRef(!1),I=C.useRef(()=>{}),k=C.useCallback(()=>{var O;const F=(O=o.current.openEvent)==null?void 0:O.type;return(F==null?void 0:F.includes("mouse"))&&F!=="mousedown"},[o]);C.useEffect(()=>{if(!a)return;function O(F){let{open:V}=F;V||(clearTimeout(y.current),clearTimeout(T.current),E.current=!0)}return s.on("openchange",O),()=>{s.off("openchange",O)}},[a,s]),C.useEffect(()=>{if(!a||!m.current||!n)return;function O(V){k()&&r(!1,V,"hover")}const F=ut(i.floating).documentElement;return F.addEventListener("mouseleave",O),()=>{F.removeEventListener("mouseleave",O)}},[i.floating,n,r,a,m,k]);const A=C.useCallback(function(O,F,V){F===void 0&&(F=!0),V===void 0&&(V="hover");const H=il(g.current,"close",b.current);H&&!S.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,O,V),H)):F&&(clearTimeout(y.current),r(!1,O,V))},[g,r]),N=at(()=>{I.current(),S.current=void 0}),M=at(()=>{if(R.current){const O=ut(i.floating).body;O.style.pointerEvents="",O.removeAttribute(Zh),R.current=!1}});C.useEffect(()=>{if(!a)return;function O(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function F(D){if(clearTimeout(y.current),E.current=!1,u&&!no(b.current)||d>0&&!il(g.current,"open"))return;const $=il(g.current,"open",b.current);$?y.current=window.setTimeout(()=>{v.current||r(!0,D,"hover")},$):r(!0,D,"hover")}function V(D){if(O())return;I.current();const $=ut(i.floating);if(clearTimeout(T.current),m.current&&o.current.floatingContext){n||clearTimeout(y.current),S.current=m.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){M(),N(),A(D,!0,"safe-polygon")}});const J=S.current;$.addEventListener("mousemove",J),I.current=()=>{$.removeEventListener("mousemove",J)};return}(b.current==="touch"?!Ye(i.floating,D.relatedTarget):!0)&&A(D)}function H(D){O()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){M(),N(),A(D)}})(D))}if(Fe(i.domReference)){var z;const D=i.domReference;return n&&D.addEventListener("mouseleave",H),(z=i.floating)==null||z.addEventListener("mouseleave",H),f&&D.addEventListener("mousemove",F,{once:!0}),D.addEventListener("mouseenter",F),D.addEventListener("mouseleave",V),()=>{var $;n&&D.removeEventListener("mouseleave",H),($=i.floating)==null||$.removeEventListener("mouseleave",H),f&&D.removeEventListener("mousemove",F),D.removeEventListener("mouseenter",F),D.removeEventListener("mouseleave",V)}}},[i,a,e,u,d,f,A,N,M,r,n,v,h,g,m,o]),Te(()=>{var O;if(a&&n&&(O=m.current)!=null&&O.__options.blockPointerEvents&&k()){const V=ut(i.floating).body;V.setAttribute(Zh,""),V.style.pointerEvents="none",R.current=!0;const H=i.floating;if(Fe(i.domReference)&&H){var F;const z=i.domReference,D=h==null||(F=h.nodesRef.current.find($=>$.id===p))==null||(F=F.context)==null?void 0:F.elements.floating;return D&&(D.style.pointerEvents=""),z.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{z.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,i,h,m,k]),Te(()=>{n||(b.current=void 0,N(),M())},[n,N,M]),C.useEffect(()=>()=>{N(),clearTimeout(y.current),clearTimeout(T.current),M()},[a,i.domReference,N,M]);const j=C.useMemo(()=>{function O(F){b.current=F.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(F){const{nativeEvent:V}=F;function H(){!E.current&&!v.current&&r(!0,V,"hover")}u&&!no(b.current)||n||d===0||(clearTimeout(T.current),b.current==="touch"?H():T.current=window.setTimeout(H,d))}}},[u,r,n,v,d]),P=C.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(O){A(O.nativeEvent,!1)}}),[A]);return C.useMemo(()=>a?{reference:j,floating:P}:{},[a,j,P])}function tM(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function pr(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function nM(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),pr(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let Ar=new WeakMap,qs=new WeakSet,Xs={},al=0;const rM=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,pb=e=>e&&(e.host||pb(e.parentNode)),oM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=pb(n);return e.contains(r)?r:null}).filter(n=>n!=null);function sM(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=oM(t,e),a=new Set,l=new Set(i),c=[];Xs[o]||(Xs[o]=new WeakMap);const u=Xs[o];i.forEach(d),f(t),a.clear();function d(h){!h||a.has(h)||(a.add(h),h.parentNode&&d(h.parentNode))}function f(h){!h||l.has(h)||[].forEach.call(h.children,p=>{if(Gn(p)!=="script")if(a.has(p))f(p);else{const m=s?p.getAttribute(s):null,g=m!==null&&m!=="false",v=(Ar.get(p)||0)+1,b=(u.get(p)||0)+1;Ar.set(p,v),u.set(p,b),c.push(p),v===1&&g&&qs.add(p),b===1&&p.setAttribute(o,""),!g&&s&&p.setAttribute(s,"true")}})}return al++,()=>{c.forEach(h=>{const p=(Ar.get(h)||0)-1,m=(u.get(h)||0)-1;Ar.set(h,p),u.set(h,m),p||(!qs.has(h)&&s&&h.removeAttribute(s),qs.delete(h)),m||h.removeAttribute(o)}),al--,al||(Ar=new WeakMap,Ar=new WeakMap,qs=new WeakSet,Xs={})}}function Jh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ut(e[0]).body;return sM(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const io=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function mb(e,t){const n=cs(e,io());t==="prev"&&n.reverse();const r=n.indexOf(zt(ut(e)));return n.slice(r+1)[0]}function gb(){return mb(document.body,"next")}function yb(){return mb(document.body,"prev")}function Jo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ye(n,r)}function iM(e){cs(e,io()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function aM(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 lM(e,t,n){const r=e.indexOf(t);function o(i){const a=Hn("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||Ye(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const qu={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let cM;function ep(e){e.key==="Tab"&&(e.target,clearTimeout(cM))}const Ni=C.forwardRef(function(t,n){const[r,o]=C.useState();Te(()=>($u()&&o("button"),document.addEventListener("keydown",ep),()=>{document.removeEventListener("keydown",ep)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Hn("focus-guard")]:"",style:qu};return C.createElement("span",so({},t,s))}),vb=C.createContext(null),tp=Hn("portal");function uM(e){e===void 0&&(e={});const{id:t,root:n}=e,r=So(),o=bb(),[s,i]=C.useState(null),a=C.useRef(null);return Te(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Te(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(tp,""),l.appendChild(c),a.current=c,i(c)},[t,r]),Te(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Fe(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(tp,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function Eo(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=uM({id:n,root:r}),[i,a]=C.useState(null),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),f=!!i&&!i.modal&&i.open&&o&&!!(r||s);return C.useEffect(()=>{if(!s||!o||i!=null&&i.modal)return;function h(p){s&&Jo(p)&&(p.type==="focusin"?aM:iM)(s)}return s.addEventListener("focusin",h,!0),s.addEventListener("focusout",h,!0),()=>{s.removeEventListener("focusin",h,!0),s.removeEventListener("focusout",h,!0)}},[s,o,i==null?void 0:i.modal]),C.createElement(vb.Provider,{value:C.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},f&&s&&C.createElement(Ni,{"data-type":"outside",ref:l,onFocus:h=>{if(Jo(h,s)){var p;(p=u.current)==null||p.focus()}else{const m=yb()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus()}}}),f&&s&&C.createElement("span",{"aria-owns":s.id,style:qu}),s&&vs.createPortal(t,s),f&&s&&C.createElement(Ni,{"data-type":"outside",ref:c,onFocus:h=>{if(Jo(h,s)){var p;(p=d.current)==null||p.focus()}else{const m=gb()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,h.nativeEvent))}}}))}const bb=()=>C.useContext(vb),np=20;let sr=[];function ll(e){sr=sr.filter(n=>n.isConnected);let t=e;if(!(!t||Gn(t)==="body")){if(!lD(t,io())){const n=cs(t,io())[0];n&&(t=n)}sr.push(t),sr.length>np&&(sr=sr.slice(-np))}}function rp(){return sr.slice().reverse().find(e=>e.isConnected)}const dM=C.forwardRef(function(t,n){return C.createElement("button",so({},t,{type:"button",ref:n,tabIndex:-1,style:qu}))});function As(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:p,onOpenChange:m,events:g,dataRef:v,floatingId:b,elements:{domReference:y,floating:S}}=t,T=typeof i=="number"&&i<0,E=Gv(y)&&T,R=rM()?s:!0,I=gt(o),k=gt(i),A=gt(a),N=Kn(),M=bb(),j=C.useRef(null),P=C.useRef(null),O=C.useRef(!1),F=C.useRef(!1),V=C.useRef(-1),H=M!=null,z=S==null?void 0:S.firstElementChild,D=(z==null?void 0:z.id)===b?z:S,$=at(function(G){return G===void 0&&(G=D),G?cs(G,io()):[]}),K=at(G=>{const L=$(G);return I.current.map(B=>y&&B==="reference"?y:D&&B==="floating"?D:L).filter(Boolean).flat()});C.useEffect(()=>{if(r||!c)return;function G(B){if(B.key==="Tab"){Ye(D,zt(ut(D)))&&$().length===0&&!E&&mt(B);const W=K(),U=rn(B);I.current[0]==="reference"&&U===y&&(mt(B),B.shiftKey?Dn(W[W.length-1]):Dn(W[1])),I.current[1]==="floating"&&U===D&&B.shiftKey&&(mt(B),Dn(W[0]))}}const L=ut(D);return L.addEventListener("keydown",G),()=>{L.removeEventListener("keydown",G)}},[r,y,D,c,I,E,$,K]),C.useEffect(()=>{if(r||!S)return;function G(L){const B=rn(L),U=$().indexOf(B);U!==-1&&(V.current=U)}return S.addEventListener("focusin",G),()=>{S.removeEventListener("focusin",G)}},[r,S,$]),C.useEffect(()=>{if(r||!d)return;function G(){F.current=!0,setTimeout(()=>{F.current=!1})}function L(B){const W=B.relatedTarget;queueMicrotask(()=>{const U=!(Ye(y,W)||Ye(S,W)||Ye(W,S)||Ye(M==null?void 0:M.portalNode,W)||W!=null&&W.hasAttribute(Hn("focus-guard"))||N&&(pr(N.nodesRef.current,p).find(q=>{var te,_;return Ye((te=q.context)==null?void 0:te.elements.floating,W)||Ye((_=q.context)==null?void 0:_.elements.domReference,W)})||tM(N.nodesRef.current,p).find(q=>{var te,_;return((te=q.context)==null?void 0:te.elements.floating)===W||((_=q.context)==null?void 0:_.elements.domReference)===W})));if(l&&U&&zt(ut(D))===ut(D).body){et(D)&&(D==null||D.focus());const q=V.current,te=$(),_=te[q]||te[te.length-1]||D;et(_)&&_.focus()}(E||!c)&&W&&U&&!F.current&&W!==rp()&&(O.current=!0,m(!1,B))})}if(S&&et(y))return y.addEventListener("focusout",L),y.addEventListener("pointerdown",G),S.addEventListener("focusout",L),()=>{y.removeEventListener("focusout",L),y.removeEventListener("pointerdown",G),S.removeEventListener("focusout",L)}},[r,y,S,D,c,p,N,M,m,d,l,$,E]),C.useEffect(()=>{var G;if(r)return;const L=Array.from((M==null||(G=M.portalNode)==null?void 0:G.querySelectorAll("["+Hn("portal")+"]"))||[]);if(S){const B=[S,...L,j.current,P.current,I.current.includes("reference")||E?y:null].filter(U=>U!=null),W=c||E?Jh(B,R,!R):Jh(B);return()=>{W()}}},[r,y,S,c,I,M,E,R]),Te(()=>{if(r||!et(D))return;const G=ut(D),L=zt(G);queueMicrotask(()=>{const B=K(D),W=k.current,U=(typeof W=="number"?B[W]:W.current)||D,q=Ye(D,L);!T&&!q&&f&&Dn(U,{preventScroll:U===D})})},[r,f,D,T,K,k]),Te(()=>{if(r||!D)return;let G=!1;const L=ut(D),B=zt(L);let U=v.current.openEvent;const q=h.domReference.current;ll(B);function te(_){let{open:ae,reason:he,event:ve,nested:We}=_;ae&&(U=ve),he==="escape-key"&&h.domReference.current&&ll(h.domReference.current),he==="hover"&&ve.type==="mouseleave"&&(O.current=!0),he==="outside-press"&&(We?(O.current=!1,G=!0):O.current=!(zv(ve)||Vu(ve)))}return g.on("openchange",te),()=>{g.off("openchange",te);const _=zt(L),ae=Ye(S,_)||N&&pr(N.nodesRef.current,p).some(oe=>{var ye;return Ye((ye=oe.context)==null?void 0:ye.elements.floating,_)});(ae||U&&["click","mousedown"].includes(U.type))&&h.domReference.current&&ll(h.domReference.current);const ve=q||B,We=cs(ut(ve).body,io());queueMicrotask(()=>{let oe=rp();!oe&&et(ve)&&S&&(oe=lM(We,ve,S)),A.current&&!O.current&&et(oe)&&(!(oe!==_&&_!==L.body)||ae)&&oe.focus({preventScroll:G})})}},[r,S,D,A,v,h,g,N,p]),Te(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{M.setFocusManagerState(null)}},[r,M,c,f,m,h,d]),Te(()=>{if(r||!D||typeof MutationObserver!="function"||T)return;const G=()=>{const B=D.getAttribute("tabindex"),W=$(),U=zt(ut(S)),q=W.indexOf(U);q!==-1&&(V.current=q),I.current.includes("floating")||U!==h.domReference.current&&W.length===0?B!=="0"&&D.setAttribute("tabindex","0"):B!=="-1"&&D.setAttribute("tabindex","-1")};G();const L=new MutationObserver(G);return L.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{L.disconnect()}},[r,S,D,h,I,$,T]);function J(G){return r||!u||!c?null:C.createElement(dM,{ref:G==="start"?j:P,onClick:L=>m(!1,L.nativeEvent)},typeof u=="string"?u:"Dismiss")}const X=!r&&R&&(c?!E:!0)&&(H||c);return C.createElement(C.Fragment,null,X&&C.createElement(Ni,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:G=>{if(c){const B=K();Dn(o[0]==="reference"?B[0]:B[B.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(O.current=!1,Jo(G,M.portalNode)){const B=gb()||y;B==null||B.focus()}else{var L;(L=M.beforeOutsideRef.current)==null||L.focus()}}}),!E&&J("start"),n,J("end"),X&&C.createElement(Ni,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:G=>{if(c)Dn(K()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(d&&(O.current=!0),Jo(G,M.portalNode)){const B=yb()||y;B==null||B.focus()}else{var L;(L=M.afterOutsideRef.current)==null||L.focus()}}}))}const cl=new Set,fM=C.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=So();return Te(()=>{if(!r)return;cl.add(s);const i=/iP(hone|ad|od)|iOS/.test(_u()),a=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,d=a.left?parseFloat(a.left):window.scrollX,f=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[c]=u+"px"),i){var h,p;const m=((h=window.visualViewport)==null?void 0:h.offsetLeft)||0,g=((p=window.visualViewport)==null?void 0:p.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(f-Math.floor(g))+"px",left:-(d-Math.floor(m))+"px",right:"0"})}return()=>{cl.delete(s),cl.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,f)))}},[s,r]),C.createElement("div",so({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function op(e){return et(e.target)&&e.target.tagName==="BUTTON"}function sp(e){return Bu(e)}function Os(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=C.useRef(),f=C.useRef(!1),h=C.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(no(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}no(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||op(p))&&(p.key===" "&&!sp(s)&&(p.preventDefault(),f.current=!0),p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||op(p)||sp(s)||p.key===" "&&f.current&&(f.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,s,a,c,u,r,n,l]);return C.useMemo(()=>i?{reference:h}:{},[i,h])}function hM(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var s;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(((s=t.dataRef.current.openEvent)==null?void 0:s.type)||"")&&t.pointerType!=="touch";let u=i.width,d=i.height,f=i.x,h=i.y;return n==null&&t.x&&a&&(n=i.x-t.x),r==null&&t.y&&l&&(r=i.y-t.y),f-=n||0,h-=r||0,u=0,d=0,!o||c?(u=t.axis==="y"?i.width:0,d=t.axis==="x"?i.height:0,f=a&&t.x!=null?t.x:f,h=l&&t.y!=null?t.y:h):o&&!c&&(d=t.axis==="x"?i.height:d,u=t.axis==="y"?i.width:u),o=!0,{width:u,height:d,x:f,y:h,top:h,right:f+u,bottom:h+d,left:f}}}}function ip(e){return e!=null&&e.clientX!=null}function pM(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:s},refs:i}=e,{enabled:a=!0,axis:l="both",x:c=null,y:u=null}=t,d=C.useRef(!1),f=C.useRef(null),[h,p]=C.useState(),[m,g]=C.useState([]),v=at((E,R)=>{d.current||r.current.openEvent&&!ip(r.current.openEvent)||i.setPositionReference(hM(s,{x:E,y:R,axis:l,dataRef:r,pointerType:h}))}),b=at(E=>{c!=null||u!=null||(n?f.current||g([]):v(E.clientX,E.clientY))}),y=no(h)?o:n,S=C.useCallback(()=>{if(!y||!a||c!=null||u!=null)return;const E=Rt(o);function R(I){const k=rn(I);Ye(o,k)?(E.removeEventListener("mousemove",R),f.current=null):v(I.clientX,I.clientY)}if(!r.current.openEvent||ip(r.current.openEvent)){E.addEventListener("mousemove",R);const I=()=>{E.removeEventListener("mousemove",R),f.current=null};return f.current=I,I}i.setPositionReference(s)},[y,a,c,u,o,r,i,s,v]);C.useEffect(()=>S(),[S,m]),C.useEffect(()=>{a&&!o&&(d.current=!1)},[a,o]),C.useEffect(()=>{!a&&n&&(d.current=!0)},[a,n]),Te(()=>{a&&(c!=null||u!=null)&&(d.current=!1,v(c,u))},[a,c,u,v]);const T=C.useMemo(()=>{function E(R){let{pointerType:I}=R;p(I)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:b,onMouseEnter:b}},[b]);return C.useMemo(()=>a?{reference:T}:{},[a,T])}const mM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},gM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ap=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Co(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:p}=t,m=Kn(),g=at(typeof l=="function"?l:()=>!1),v=typeof l=="function"?g:l,b=C.useRef(!1),y=C.useRef(!1),{escapeKey:S,outsidePress:T}=ap(h),{escapeKey:E,outsidePress:R}=ap(p),I=at(P=>{var O;if(!n||!i||!a||P.key!=="Escape")return;const F=(O=s.current.floatingContext)==null?void 0:O.nodeId,V=m?pr(m.nodesRef.current,F):[];if(!S&&(P.stopPropagation(),V.length>0)){let H=!0;if(V.forEach(z=>{var D;if((D=z.context)!=null&&D.open&&!z.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,FO(P)?P.nativeEvent:P,"escape-key")}),k=at(P=>{var O;const F=()=>{var V;I(P),(V=rn(P))==null||V.removeEventListener("keydown",F)};(O=rn(P))==null||O.addEventListener("keydown",F)}),A=at(P=>{var O;const F=b.current;b.current=!1;const V=y.current;if(y.current=!1,c==="click"&&V||F||typeof v=="function"&&!v(P))return;const H=rn(P),z="["+Hn("inert")+"]",D=ut(o.floating).querySelectorAll(z);let $=Fe(H)?H:null;for(;$&&!Vn($);){const G=Sn($);if(Vn(G)||!Fe(G))break;$=G}if(D.length&&Fe(H)&&!jO(H)&&!Ye(H,o.floating)&&Array.from(D).every(G=>!Ye($,G)))return;if(et(H)&&j){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,L=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let B=L&&P.offsetX>H.clientWidth;if(L&&Vt(H).direction==="rtl"&&(B=P.offsetX<=H.offsetWidth-H.clientWidth),B||G&&P.offsetY>H.clientHeight)return}const K=(O=s.current.floatingContext)==null?void 0:O.nodeId,J=m&&pr(m.nodesRef.current,K).some(G=>{var L;return rl(P,(L=G.context)==null?void 0:L.elements.floating)});if(rl(P,o.floating)||rl(P,o.domReference)||J)return;const X=m?pr(m.nodesRef.current,K):[];if(X.length>0){let G=!0;if(X.forEach(L=>{var B;if((B=L.context)!=null&&B.open&&!L.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,P,"outside-press")}),N=at(P=>{var O;const F=()=>{var V;A(P),(V=rn(P))==null||V.removeEventListener(c,F)};(O=rn(P))==null||O.addEventListener(c,F)});C.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=T;function P(V){r(!1,V,"ancestor-scroll")}const O=ut(o.floating);a&&O.addEventListener("keydown",E?k:I,E),v&&O.addEventListener(c,R?N:A,R);let F=[];return f&&(Fe(o.domReference)&&(F=jn(o.domReference)),Fe(o.floating)&&(F=F.concat(jn(o.floating))),!Fe(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(jn(o.reference.contextElement)))),F=F.filter(V=>{var H;return V!==((H=O.defaultView)==null?void 0:H.visualViewport)}),F.forEach(V=>{V.addEventListener("scroll",P,{passive:!0})}),()=>{a&&O.removeEventListener("keydown",E?k:I,E),v&&O.removeEventListener(c,R?N:A,R),F.forEach(V=>{V.removeEventListener("scroll",P)})}},[s,o,a,v,c,n,r,f,i,S,T,I,E,k,A,R,N]),C.useEffect(()=>{b.current=!1},[v,c]);const M=C.useMemo(()=>({onKeyDown:I,[mM[d]]:P=>{u&&r(!1,P.nativeEvent,"reference-press")}}),[I,r,u,d]),j=C.useMemo(()=>({onKeyDown:I,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[gM[c]]:()=>{b.current=!0}}),[I,c]);return C.useMemo(()=>i?{reference:M,floating:j}:{},[i,M,j])}function yM(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=So(),s=C.useRef({}),[i]=C.useState(()=>ub()),a=Yn()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Fe(h)&&QD("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=C.useState(r.reference),u=at((h,p,m)=>{s.current.openEvent=h?p:void 0,i.emit("openchange",{open:h,event:p,reason:m,nested:a}),n==null||n(h,p,m)}),d=C.useMemo(()=>({setPositionReference:c}),[]),f=C.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return C.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:f,events:i,floatingId:o,refs:d}),[t,u,f,i,o,d])}function Po(e){e===void 0&&(e={});const{nodeId:t}=e,n=yM({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=C.useState(null),[a,l]=C.useState(null),u=(o==null?void 0:o.reference)||s,d=C.useRef(null),f=Kn();Te(()=>{u&&(d.current=u)},[u]);const h=ND({...e,elements:{...o,...a&&{reference:a}}}),p=C.useCallback(y=>{const S=Fe(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(S),h.refs.setReference(S)},[h.refs]),m=C.useCallback(y=>{(Fe(y)||y===null)&&(d.current=y,i(y)),(Fe(h.refs.reference.current)||h.refs.reference.current===null||y!==null&&!Fe(y))&&h.refs.setReference(y)},[h.refs]),g=C.useMemo(()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d}),[h.refs,m,p]),v=C.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),b=C.useMemo(()=>({...h,...r,refs:g,elements:v,nodeId:t}),[h,g,v,t,r]);return Te(()=>{r.dataRef.current.floatingContext=b;const y=f==null?void 0:f.nodesRef.current.find(S=>S.id===t);y&&(y.context=b)}),C.useMemo(()=>({...h,context:b,refs:g,elements:v}),[h,g,v,b])}function vM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=C.useRef(!1),u=C.useRef(),d=C.useRef(!0);C.useEffect(()=>{if(!a)return;const h=Rt(i.domReference);function p(){!n&&et(i.domReference)&&i.domReference===zt(ut(i.domReference))&&(c.current=!0)}function m(){d.current=!0}return h.addEventListener("blur",p),h.addEventListener("keydown",m,!0),()=>{h.removeEventListener("blur",p),h.removeEventListener("keydown",m,!0)}},[i.domReference,n,a]),C.useEffect(()=>{if(!a)return;function h(p){let{reason:m}=p;(m==="reference-press"||m==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),C.useEffect(()=>()=>{clearTimeout(u.current)},[]);const f=C.useMemo(()=>({onPointerDown(h){Vu(h.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const p=rn(h.nativeEvent);if(l&&Fe(p))try{if($u()&&Uv())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!d.current&&!Bu(p))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const p=h.relatedTarget,m=h.nativeEvent,g=Fe(p)&&p.hasAttribute(Hn("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const b=zt(i.domReference?i.domReference.ownerDocument:document);!p&&b===i.domReference||Ye((v=s.current.floatingContext)==null?void 0:v.refs.floating.current,b)||Ye(i.domReference,b)||g||r(!1,m,"focus")})}}),[s,i.domReference,r,l]);return C.useMemo(()=>a?{reference:f}:{},[a,f])}const lp="active",cp="selected";function ul(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[lp]:i,[cp]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[lp,cp].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var f,h=arguments.length,p=new Array(h),m=0;m<h;m++)p[m]=arguments[m];return(f=r.get(c))==null?void 0:f.map(g=>g(...p)).find(g=>g!==void 0)}}}else i[c]=u}),i),{})}}function Ro(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=C.useCallback(a=>ul(a,e,"reference"),t),s=C.useCallback(a=>ul(a,e,"floating"),n),i=C.useCallback(a=>ul(a,e,"item"),r);return C.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let up=!1;function ha(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function dp(e,t){return ha(t,e===Ku||e===Is,e===oo||e===To)}function dl(e,t,n){return ha(t,e===Is,n?e===oo:e===To)||e==="Enter"||e===" "||e===""}function bM(e,t,n){return ha(t,n?e===oo:e===To,e===Is)}function fp(e,t,n){return ha(t,n?e===To:e===oo,e===Ku)}function xb(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:f=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:b=void 0,orientation:y="vertical",cols:S=1,scrollItemIntoView:T=!0,virtualItemRef:E,itemSizes:R,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||ci("`useListNavigation` looping must be enabled to allow escaping."),p||ci("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&S>1&&ci("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const k=Yn(),A=Kn(),N=at(a),M=C.useRef(m),j=C.useRef(c??-1),P=C.useRef(null),O=C.useRef(!0),F=C.useRef(N),V=C.useRef(!!o.floating),H=C.useRef(n),z=C.useRef(!1),D=C.useRef(!1),$=gt(b),K=gt(n),J=gt(T),X=gt(o.floating),G=gt(c),[L,B]=C.useState(),[W,U]=C.useState(),q=at(function(oe,ye,se){se===void 0&&(se=!1);function xe(we){p?(B(we.id),A==null||A.events.emit("virtualfocus",we),E&&(E.current=we)):Dn(we,{preventScroll:!0,sync:Uv()&&$u()?up||z.current:!1})}const Qe=oe.current[ye.current];Qe&&xe(Qe),requestAnimationFrame(()=>{const we=oe.current[ye.current]||Qe;if(!we)return;Qe||xe(we);const ot=J.current;ot&&_&&(se||!O.current)&&(we.scrollIntoView==null||we.scrollIntoView(typeof ot=="boolean"?{block:"nearest",inline:"nearest"}:ot))})});Te(()=>{document.createElement("div").focus({get preventScroll(){return up=!0,!1}})},[]),Te(()=>{l&&(n&&o.floating?M.current&&c!=null&&(D.current=!0,j.current=c,N(c)):V.current&&(j.current=-1,F.current(null)))},[l,n,o.floating,c,N]),Te(()=>{if(l&&n&&o.floating)if(i==null){if(z.current=!1,G.current!=null)return;if(V.current&&(j.current=-1,q(s,j)),(!H.current||!V.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let oe=0;const ye=()=>{s.current[0]==null?(oe<2&&(oe?requestAnimationFrame:queueMicrotask)(ye),oe++):(j.current=P.current==null||dl(P.current,y,h)||f?sl(s,$.current):Kh(s,$.current),P.current=null,N(j.current))};ye()}}else Zo(s,i)||(j.current=i,q(s,j,D.current),D.current=!1)},[l,n,o.floating,i,G,f,s,y,h,N,q,$]),Te(()=>{var oe;if(!l||o.floating||!A||p||!V.current)return;const ye=A.nodesRef.current,se=(oe=ye.find(we=>we.id===k))==null||(oe=oe.context)==null?void 0:oe.elements.floating,xe=zt(ut(o.floating)),Qe=ye.some(we=>we.context&&Ye(we.context.elements.floating,xe));se&&!Qe&&O.current&&se.focus({preventScroll:!0})},[l,o.floating,A,k,p]),Te(()=>{if(!l||!A||!p||k)return;function oe(ye){U(ye.id),E&&(E.current=ye)}return A.events.on("virtualfocus",oe),()=>{A.events.off("virtualfocus",oe)}},[l,A,p,k,E]),Te(()=>{F.current=N,V.current=!!o.floating}),Te(()=>{n||(P.current=null)},[n]),Te(()=>{H.current=n},[n]);const te=i!=null,_=C.useMemo(()=>{function oe(se){if(!n)return;const xe=s.current.indexOf(se);xe!==-1&&N(xe)}return{onFocus(se){let{currentTarget:xe}=se;oe(xe)},onClick:se=>{let{currentTarget:xe}=se;return xe.focus({preventScroll:!0})},...g&&{onMouseMove(se){let{currentTarget:xe}=se;oe(xe)},onPointerLeave(se){let{pointerType:xe}=se;!O.current||xe==="touch"||(j.current=-1,q(s,j),N(null),p||Dn(X.current,{preventScroll:!0}))}}}},[n,X,q,g,s,N,p]),ae=at(oe=>{if(O.current=!1,z.current=!0,!K.current&&oe.currentTarget===X.current)return;if(f&&fp(oe.key,y,h)){mt(oe),r(!1,oe.nativeEvent,"list-navigation"),et(o.domReference)&&!p&&o.domReference.focus();return}const ye=j.current,se=sl(s,b),xe=Kh(s,b);if(oe.key==="Home"&&(mt(oe),j.current=se,N(j.current)),oe.key==="End"&&(mt(oe),j.current=xe,N(j.current)),S>1){const Qe=R||Array.from({length:s.current.length},()=>({width:1,height:1})),we=HD(Qe,S,I),ot=we.findIndex(re=>re!=null&&!li(s.current,re,b)),Z=we.reduce((re,Se,Le)=>Se!=null&&!li(s.current,Se,b)?Le:re,-1);if(j.current=we[BD({current:we.map(re=>re!=null?s.current[re]:null)},{event:oe,orientation:y,loop:d,cols:S,disabledIndices:zD([...b||s.current.map((re,Se)=>li(s.current,Se)?Se:void 0),void 0],we),minIndex:ot,maxIndex:Z,prevIndex:WD(j.current>xe?se:j.current,Qe,we,S,oe.key===Is?"bl":oe.key===To?"tr":"tl"),stopEvent:!0})],N(j.current),y==="both")return}if(dp(oe.key,y)){if(mt(oe),n&&!p&&zt(oe.currentTarget.ownerDocument)===oe.currentTarget){j.current=dl(oe.key,y,h)?se:xe,N(j.current);return}dl(oe.key,y,h)?d?j.current=ye>=xe?u&&ye!==s.current.length?-1:se:xt(s,{startingIndex:ye,disabledIndices:b}):j.current=Math.min(xe,xt(s,{startingIndex:ye,disabledIndices:b})):d?j.current=ye<=se?u&&ye!==-1?s.current.length:xe:xt(s,{startingIndex:ye,decrement:!0,disabledIndices:b}):j.current=Math.max(se,xt(s,{startingIndex:ye,decrement:!0,disabledIndices:b})),Zo(s,j.current)?N(null):N(j.current)}}),he=C.useMemo(()=>p&&n&&te&&{"aria-activedescendant":W||L},[p,n,te,W,L]),ve=C.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!Gv(o.domReference)&&he,onKeyDown:ae,onPointerMove(){O.current=!0}}),[he,ae,o.domReference,y]),We=C.useMemo(()=>{function oe(se){m==="auto"&&zv(se.nativeEvent)&&(M.current=!0)}function ye(se){M.current=m,m==="auto"&&Vu(se.nativeEvent)&&(M.current=!0)}return{...he,onKeyDown(se){O.current=!1;const xe=se.key.indexOf("Arrow")===0,Qe=bM(se.key,y,h),we=fp(se.key,y,h),ot=dp(se.key,y),Z=(f?Qe:ot)||se.key==="Enter"||se.key.trim()==="";if(p&&n){const ht=A==null?void 0:A.nodesRef.current.find(Pt=>Pt.parentId==null),vt=A&&ht?nM(A.nodesRef.current,ht.id):null;if(xe&&vt&&E){const Pt=new KeyboardEvent("keydown",{key:se.key,bubbles:!0});if(Qe||we){var re,Se;const Zn=((re=vt.context)==null?void 0:re.elements.domReference)===se.currentTarget,Sr=we&&!Zn?(Se=vt.context)==null?void 0:Se.elements.domReference:Qe?s.current.find(Er=>(Er==null?void 0:Er.id)===L):null;Sr&&(mt(se),Sr.dispatchEvent(Pt),U(void 0))}if(ot&&vt.context&&vt.context.open&&vt.parentId&&se.currentTarget!==vt.context.elements.domReference){var Le;mt(se),(Le=vt.context.elements.domReference)==null||Le.dispatchEvent(Pt);return}}return ae(se)}if(!(!n&&!v&&xe)){if(Z&&(P.current=f&&ot?null:se.key),f){Qe&&(mt(se),n?(j.current=sl(s,$.current),N(j.current)):r(!0,se.nativeEvent,"list-navigation"));return}ot&&(c!=null&&(j.current=c),mt(se),!n&&v?r(!0,se.nativeEvent,"list-navigation"):ae(se),n&&N(j.current))}},onFocus(){n&&!p&&N(null)},onPointerDown:ye,onMouseDown:oe,onClick:oe}},[L,he,ae,$,m,s,f,N,r,n,v,y,h,c,A,p,E]);return C.useMemo(()=>l?{reference:We,floating:ve,item:_}:{},[l,We,ve,_])}const xM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Io(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=xM.get(i))!=null?n:i,l=So(),u=Yn()!=null,d=C.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&u&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,l,i]),f=C.useMemo(()=>{const p={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?p:{...p,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),h=C.useCallback(p=>{let{active:m,selected:g}=p;const v={role:"option",...m&&{id:o+"-option"}};switch(i){case"select":return{...v,"aria-selected":m&&g};case"combobox":return{...v,...m&&{"aria-selected":!0}}}return{}},[o,i]);return C.useMemo(()=>s?{reference:d,floating:f,item:h}:{},[s,d,f,h])}const hp=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Or(e,t){return typeof e=="function"?e(t):e}function wM(e,t){const[n,r]=C.useState(e);return e&&!n&&r(!0),C.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function TM(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[a,l]=C.useState("unmounted"),c=wM(n,i);return!c&&a==="close"&&l("unmounted"),Te(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function SM(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=C.useMemo(()=>({side:l,placement:a}),[l,a]),u=typeof i=="number",d=(u?i:i.open)||0,f=(u?i:i.close)||0,[h,p]=C.useState(()=>({...Or(s,c),...Or(n,c)})),{isMounted:m,status:g}=TM(e,{duration:i}),v=gt(n),b=gt(r),y=gt(o),S=gt(s);return Te(()=>{const T=Or(v.current,c),E=Or(y.current,c),R=Or(S.current,c),I=Or(b.current,c)||Object.keys(T).reduce((k,A)=>(k[A]="",k),{});if(g==="initial"&&p(k=>({transitionProperty:k.transitionProperty,...R,...T})),g==="open"&&p({transitionProperty:Object.keys(I).map(hp).join(","),transitionDuration:d+"ms",...R,...I}),g==="close"){const k=E||T;p({transitionProperty:Object.keys(k).map(hp).join(","),transitionDuration:f+"ms",...R,...k})}},[f,y,v,b,S,d,g,c]),{isMounted:m,styles:h}}function EM(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:h=null}=t,p=C.useRef(),m=C.useRef(""),g=C.useRef((n=h??i)!=null?n:-1),v=C.useRef(null),b=at(a),y=at(l),S=gt(u),T=gt(f);Te(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),Te(()=>{if(r&&m.current===""){var A;g.current=(A=h??i)!=null?A:-1}},[r,h,i]);const E=at(A=>{A?o.current.typing||(o.current.typing=A,y(A)):o.current.typing&&(o.current.typing=A,y(A))}),R=at(A=>{function N(F,V,H){const z=S.current?S.current(V,H):V.find(D=>(D==null?void 0:D.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return z?F.indexOf(z):-1}const M=s.current;if(m.current.length>0&&m.current[0]!==" "&&(N(M,M,m.current)===-1?E(!1):A.key===" "&&mt(A)),M==null||T.current.includes(A.key)||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;r&&A.key!==" "&&(mt(A),E(!0)),M.every(F=>{var V,H;return F?((V=F[0])==null?void 0:V.toLocaleLowerCase())!==((H=F[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===A.key&&(m.current="",g.current=v.current),m.current+=A.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=v.current,E(!1)},d);const P=g.current,O=N(M,[...M.slice((P||0)+1),...M.slice(0,(P||0)+1)],m.current);O!==-1?(b(O),v.current=O):A.key!==" "&&(m.current="",E(!1))}),I=C.useMemo(()=>({onKeyDown:R}),[R]),k=C.useMemo(()=>({onKeyDown:R,onKeyUp(A){A.key===" "&&E(!1)}}),[R,E]);return C.useMemo(()=>c?{reference:I,floating:k}:{},[c,I,k])}function pp(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[l,c]=t[i]||[0,0],[u,d]=t[a]||[0,0];c>=r!=d>=r&&n<=(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}function CM(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function wb(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();function c(d,f){const h=performance.now(),p=h-l;if(i===null||a===null||p===0)return i=d,a=f,l=h,null;const m=d-i,g=f-a,b=Math.sqrt(m*m+g*g)/p;return i=d,a=f,l=h,b}const u=d=>{let{x:f,y:h,placement:p,elements:m,onClose:g,nodeId:v,tree:b}=d;return function(S){function T(){clearTimeout(o),g()}if(clearTimeout(o),!m.domReference||!m.floating||p==null||f==null||h==null)return;const{clientX:E,clientY:R}=S,I=[E,R],k=rn(S),A=S.type==="mouseleave",N=Ye(m.floating,k),M=Ye(m.domReference,k),j=m.domReference.getBoundingClientRect(),P=m.floating.getBoundingClientRect(),O=p.split("-")[0],F=f>P.right-P.width/2,V=h>P.bottom-P.height/2,H=CM(I,j),z=P.width>j.width,D=P.height>j.height,$=(z?j:P).left,K=(z?j:P).right,J=(D?j:P).top,X=(D?j:P).bottom;if(N&&(s=!0,!A))return;if(M&&(s=!1),M&&!A){s=!0;return}if(A&&Fe(S.relatedTarget)&&Ye(m.floating,S.relatedTarget)||b&&pr(b.nodesRef.current,v).some(B=>{let{context:W}=B;return W==null?void 0:W.open}))return;if(O==="top"&&h>=j.bottom-1||O==="bottom"&&h<=j.top+1||O==="left"&&f>=j.right-1||O==="right"&&f<=j.left+1)return T();let G=[];switch(O){case"top":G=[[$,j.top+1],[$,P.bottom-1],[K,P.bottom-1],[K,j.top+1]];break;case"bottom":G=[[$,P.top+1],[$,j.bottom-1],[K,j.bottom-1],[K,P.top+1]];break;case"left":G=[[P.right-1,X],[P.right-1,J],[j.left+1,J],[j.left+1,X]];break;case"right":G=[[j.right-1,X],[j.right-1,J],[P.left+1,J],[P.left+1,X]];break}function L(B){let[W,U]=B;switch(O){case"top":{const q=[z?W+t/2:F?W+t*4:W-t*4,U+t+1],te=[z?W-t/2:F?W+t*4:W-t*4,U+t+1],_=[[P.left,F||z?P.bottom-t:P.top],[P.right,F?z?P.bottom-t:P.top:P.bottom-t]];return[q,te,..._]}case"bottom":{const q=[z?W+t/2:F?W+t*4:W-t*4,U-t],te=[z?W-t/2:F?W+t*4:W-t*4,U-t],_=[[P.left,F||z?P.top+t:P.bottom],[P.right,F?z?P.top+t:P.bottom:P.top+t]];return[q,te,..._]}case"left":{const q=[W+t+1,D?U+t/2:V?U+t*4:U-t*4],te=[W+t+1,D?U-t/2:V?U+t*4:U-t*4];return[...[[V||D?P.right-t:P.left,P.top],[V?D?P.right-t:P.left:P.right-t,P.bottom]],q,te]}case"right":{const q=[W-t,D?U+t/2:V?U+t*4:U-t*4],te=[W-t,D?U-t/2:V?U+t*4:U-t*4],_=[[V||D?P.left+t:P.right,P.top],[V?D?P.left+t:P.right:P.left+t,P.bottom]];return[q,te,..._]}}}if(!pp([E,R],G)){if(s&&!H)return T();if(!A&&r){const B=c(S.clientX,S.clientY);if(B!==null&&B<.1)return T()}pp([E,R],L([f,h]))?!s&&r&&(o=window.setTimeout(T,40)):T()}}};return u.__options={blockPointerEvents:n},u}const Ao=e=>{const t=w.useId(),[n,r]=w.useState(e.open),o=w.useRef(null),s=w.useMemo(()=>[fa(10),Yu({fallbackAxisSideDirection:"end"}),Gu(),sb({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=Po({open:n,middleware:s,transform:!0,whileElementsMounted:da,onOpenChange:(p,m)=>{var v;const g=m==null?void 0:m.relatedTarget;g&&g.dataset.floating==="true"&&!p||(r(p),(v=e.onChange)==null||v.call(e,p))}}),c=Os(l),u=Co(l),d=Io(l),{getReferenceProps:f,getFloatingProps:h}=Ro([c,u,d]);return x.jsxs(w.Fragment,{children:[x.jsx("button",{ref:i.setReference,...f(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(Eo,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(As,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:x.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:i.setFloating,style:a,"aria-labelledby":t,...h(),children:[x.jsx(cb,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),x.jsx("header",{className:"mb-2",children:x.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},PM=e=>{const t=w.useRef(null),n=w.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=w.useState(!1),{context:a,refs:l}=Po({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=Os(a),u=Io(a),d=Co(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:f,getReferenceProps:h}=Ro([c,u,d]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(Gr,{...h(e),as:dt.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>i(!0),children:x.jsx(dt.span,{layoutId:o,children:e.trigger})}),x.jsx(vo,{children:s?x.jsx(Eo,{root:t,children:x.jsx(As,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:x.jsx(dt.div,{...f(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},Tb=300,RM=500,Sb=(e="")=>ke("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary data-[open]:bg-primary focus:bg-primary aria-expanded:opacity-80","data-[active=true]:text-primary-foreground focus:text-primary-foreground","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),wc=w.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),mp=w.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const l=Yn(),c=l!==null,[u,d]=w.useState(!1),[f,h]=w.useState(!1),[p,m]=w.useState(null),g=w.useRef([]),v=w.useRef([]),b=w.useContext(wc),y=Kn(),S=ZD(),T=lb(),{floatingStyles:E,refs:R,context:I}=Po({nodeId:S,open:u,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:da,placement:c?"right":"bottom-start",middleware:[fa({mainAxis:c?0:4,alignmentAxis:c?-4:0}),Yu(),Gu()]}),k=Io(I,{role:"menu",enabled:!0}),A=Co(I,{bubbles:!0}),N=hb(I,{enabled:n,delay:{open:Tb},handleClose:wb({blockPointerEvents:!0})}),M=Os(I,{event:"mousedown",toggle:!c,ignoreMouse:c,keyboardHandlers:!0}),j=xb(I,{loop:!0,activeIndex:p,virtual:!0,nested:c,allowEscape:!0,listRef:g,scrollItemIntoView:!0,onNavigate:m}),P=EM(I,{activeIndex:p,listRef:v,resetMs:RM,onMatch:u?m:void 0}),{getReferenceProps:O,getFloatingProps:F,getItemProps:V}=Ro([N,M,k,A,j,P]);w.useEffect(()=>{if(!y)return;const z=()=>d(!1),D=$=>{$.nodeId!==S&&$.parentId===l&&d(!1)};return y.events.on("click",z),y.events.on("menuopen",D),()=>{y.events.off("click",z),y.events.off("menuopen",D)}},[y,S,l]),w.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:l,nodeId:S})},[y,u,S,l]);const H=r?i.className:ke(Sb(i.className));return x.jsxs(JD,{id:S,children:[x.jsx(w.Fragment,{children:i.asChild?x.jsx(to,{children:s,ref:xc([R.setReference,T.ref,a]),tabIndex:c?b.activeIndex===T.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":f?"":void 0,className:H,...O(b.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),h(!1),b.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",ref:xc([R.setReference,T.ref,a]),tabIndex:c?b.activeIndex===T.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":f?"":void 0,className:H,...O(b.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),h(!1),b.setHasFocusInside(!0)}})),children:[s,c&&x.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[x.jsx("span",{className:"sr-only",children:"Next menu"}),x.jsx(Su,{size:14})]})]})}),x.jsx(wc.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:V,setHasFocusInside:h,isOpen:u},children:x.jsx(YD,{elementsRef:g,labelsRef:v,children:u&&x.jsx(Eo,{preserveTabOrder:!0,children:x.jsx(As,{context:I,modal:!1,initialFocus:c?-1:0,returnFocus:!c,children:x.jsx(t,{...F(),ref:R.setFloating,style:{...i.style,...E},className:ke("isolate z-tooltip flex flex-col items-start rounded-lg border border-floating-border bg-floating-background text-left shadow-xl outline-none",o),children:e})})})})})]})}),IM=w.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=w.useContext(wc),a=lb({label:r?null:typeof e=="string"?e:t}),l=Kn(),c=a.index===i.activeIndex;return x.jsxs("button",{...o,ref:xc([a.ref,s]),"data-active":c,"data-open":i.isOpen,type:"button",role:"menuitem",disabled:r,tabIndex:c?0:-1,className:Sb(o.className),...i.getItemProps({onClick(u){var d;(d=o.onClick)==null||d.call(o,u),l==null||l.events.emit("click")},onFocus(u){var d;(d=o.onFocus)==null||d.call(o,u),i.setHasFocusInside(!0)}}),children:[e,n?x.jsx(n,{size:16}):null]})}),AM=w.forwardRef((e,t)=>Yn()!==null?x.jsx(mp,{...e,isParent:!1,ref:t}):x.jsx(eM,{children:x.jsx(mp,{...e,isParent:!0,ref:t})})),OM=(e,t)=>Ri()?t:window.matchMedia(e).matches,DM=(e,t=!0)=>{const[n,r]=w.useState(t);return w.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(OM(e,t));return s(),o.addListener?(o.addListener(s),()=>o.removeListener?o.removeListener(s):void 0):(o.addEventListener("change",s),()=>o.removeEventListener("change",s))},[e]),n},Ut="600ms",MM={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:Ut},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:Ut},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:Ut}},kM={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:Ut},exit:{translateX:["0%","30%"],opacity:0,animationDuration:Ut}},fl={drawer:e=>e==="left"?MM:kM,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:Ut,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:Ut,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:Ut,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:Ut},enter:{opacity:1,scale:[1.05,1],animationDuration:Ut},exit:{opacity:0,scale:.97,animationDuration:Ut}}},FM=uo("isolate z-floating border border-card-border ring-0 outline-0 appearance-none flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background",{variants:{type:{drawer:"max-h-screen max-w-[90%] absolute w-fit h-screen min-h-0",dialog:"max-h-[calc(100lvh-10%)] relative container h-min rounded-lg py-4",sheet:"w-screen absolute bottom-0 h-[85vh] max-h-[85vh] max-h-[85svh] pt-6 pb-4 rounded-t-lg"},position:{none:"",right:"py-4 absolute right-0 top-0 rounded-l-lg",left:"py-4 absolute left-0 top-0 rounded-r-lg"}},defaultVariants:{position:"right",type:"dialog"}}),jM={top:0,left:0,right:0,bottom:-1},NM=e=>e*.62,LM=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const c=e.parent.current,u=e.value.get()||c.getBoundingClientRect().width,d=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+d))}const s=e.parent.current.getBoundingClientRect(),i=e.value.get()||s.height,a=Math.abs(i-r.delta.y),l=NM(window.outerHeight);return a<l?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return x.jsx(dt.div,{draggable:!0,dragMomentum:!0,dragListener:!0,dragPropagation:!0,onDrag:t,animate:!1,initial:!1,dragElastic:0,dragDirectionLock:!0,dragSnapToOrigin:!0,drag:e.sheet?"y":"x",dragConstraints:jM,whileDrag:{cursor:"grabbing"},className:ke("absolute rounded-lg",e.sheet?"cursor-row-resize":"cursor-col-resize bg-floating-border",e.sheet?"top-1 flex h-3 w-full justify-center py-2":e.position==="left"?"right-5 top-1/2 h-10 w-2":"left-2 top-1/2 h-10 w-2"),children:e.sheet?x.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},hl={drawer:"right",sheet:"none",dialog:"none"},_M=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...s})=>{const i=w.useId(),a=w.useId(),l=DM("(min-width: 64rem)"),c=e!=="dialog",u=l?e==="drawer"?s.position:hl[e]:r?hl[e]:hl.sheet,d=l||r?fl[e]:fl.sheet,f=typeof d=="function"?d(u):d,h=l||r?e:"sheet",{refs:p,context:m}=Po({open:s.open,onOpenChange:s.onChange}),g=Os(m),v=Io(m),b=Co(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:S}=Ro([g,v,b]),T=s.trigger,E=mr(void 0),R=()=>s.onChange(!1);return x.jsxs(w.Fragment,{children:[s.trigger?x.jsx(w.Fragment,{children:s.asChild?x.jsx(to,{ref:p.setReference,...y({layoutId:s.layoutId}),children:T}):x.jsx(dt.button,{ref:p.setReference,...y(),layoutId:s.layoutId,type:"button",children:T})}):null,x.jsx(Eo,{children:x.jsx(vo,{presenceAffectsLayout:!0,children:s.open?x.jsx(fM,{lockScroll:!0,className:`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${h==="drawer"?"":"flex items-start justify-center p-10"}`,children:x.jsx(As,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:m,children:x.jsxs(dt.div,{exit:"exit",animate:"enter",initial:"initial",variants:f,ref:p.setFloating,"aria-modal":s.open,layoutId:s.layoutId,"aria-labelledby":i,"aria-describedby":a,className:FM({position:u,type:h}),style:h==="drawer"?{width:E}:{height:E},...S(),children:[s.title?x.jsx("header",{className:"relative w-full",children:s.title?x.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:s.title}):null}):null,x.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:s.children}),s.footer?x.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:s.footer}):null,o?x.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:x.jsx("button",{type:"button",onClick:R,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(ra,{})})}):null,c&&t?x.jsx(LM,{onChange:s.onChange,parent:p.floating,position:u,sheet:h==="sheet",value:E}):null]})})}):null})})]})},VM=e=>x.jsx(dt.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),Eb=({as:e,title:t,children:n,placement:r,focus:o=!0,hover:s=!0,enabled:i=!0,popover:a=!0,followCursor:l=!1,...c})=>{const[u,d]=w.useState(!1),f=w.useRef(null),h=e||"span",{refs:p,floatingStyles:m,context:g}=Po({open:u,placement:r,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:da,middleware:[Gu(),fa(5),Yu({fallbackAxisSideDirection:"start"}),sb({padding:5,element:f})]}),v=hb(g,{move:!0,delay:{open:Tb},enabled:i?s:!1,handleClose:a?wb():null}),b=vM(g,{enabled:i?o:!1}),y=Os(g,{enabled:i?a:!1}),S=Co(g,{enabled:i}),T=Io(g,{role:"tooltip",enabled:i}),E=pM(g,{enabled:!!i&&!!l}),{getReferenceProps:R,getFloatingProps:I}=Ro([T,S,E,o?b:void 0,s?v:void 0,a?y:void 0]);return x.jsxs(w.Fragment,{children:[x.jsx(h,{ref:p.setReference,...R(c),children:t}),x.jsx(Eo,{preserveTabOrder:!0,children:u&&x.jsxs(mo,{...I(),ref:p.setFloating,style:m,className:"z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[x.jsx(cb,{ref:f,context:g,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),n]})})]})};class Li{static getDescendantProperty(t,n,r=[]){let o,s,i,a,l,c;if(n){if(i=n.indexOf("."),i===-1?o=n:(o=n.slice(0,i),s=n.slice(i+1)),a=t[o],a!==null&&typeof a<"u")if(!s&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(l=0,c=a.length;l<c;l++)Li.getDescendantProperty(a[l],s,r);else s&&Li.getDescendantProperty(a,s,r)}else r.push(t);return r}}class _r{constructor(t=[],n=[],r={}){Array.isArray(n)||(r=n,n=[]),this.haystack=t,this.keys=n,this.options=Object.assign({caseSensitive:!1,sort:!1},r)}search(t=""){if(t==="")return this.haystack;const n=[];for(let r=0;r<this.haystack.length;r++){const o=this.haystack[r];if(this.keys.length===0){const s=_r.isMatch(o,t,this.options.caseSensitive);s&&n.push({item:o,score:s})}else for(let s=0;s<this.keys.length;s++){const i=Li.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=_r.isMatch(i[l],t,this.options.caseSensitive);if(c){a=!0,n.push({item:o,score:c});break}}if(a)break}}return this.options.sort&&n.sort((r,o)=>r.score-o.score),n.map(r=>r.item)}static isMatch(t,n,r){t=String(t),n=String(n),r||(t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase());const o=_r.nearestIndexesFor(t,n);return o?t===n?1:o.length>1?2+(o[o.length-1]-o[0]):2+o[0]:!1}static nearestIndexesFor(t,n){const r=n.split("");let o=[];return _r.indexesOfFirstLetter(t,n).forEach((i,a)=>{let l=i+1;o[a]=[i];for(let c=1;c<r.length;c++){const u=r[c];if(l=t.indexOf(u,l),l===-1){o[a]=!1;break}o[a].push(l),l++}}),o=o.filter(i=>i!==!1),o.length?o.sort((i,a)=>i.length===1?i[0]-a[0]:(i=i[i.length-1]-i[0],a=a[a.length-1]-a[0],i-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,s)=>o!==r?!1:s).filter(o=>o!==!1)}}const Cb=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>x.jsxs("div",{className:ke("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:x.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-disabled:text-disabled group-error:text-danger",children:[s,e||r?x.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?x.jsx(Eb,{as:"button",type:"button",title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(ky,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:x.jsx("div",{className:"w-full max-w-48 whitespace-break-spaces break-words",children:r})}):null,e?x.jsxs(w.Fragment,{children:[x.jsx(Dy,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0}),x.jsx(SP,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}):null]}):null]}),o]}),pa=w.forwardRef(({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:s,right:i,info:a,children:l,error:c,form:u,id:d,labelClassName:f="",name:h,title:p,componentName:m,placeholder:g,hideLeft:v=!1,required:b,disabled:y},S)=>{const T=d??h,E=Ct(),R=e??E.inputOptionalLabel;return x.jsxs("fieldset",{ref:S,form:u,disabled:y,"data-error":!!c,"aria-disabled":y,"data-component":m,"data-interactive":!!s,className:ke("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[x.jsxs("label",{form:u,htmlFor:T,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger",children:[x.jsx(Cb,{info:a,hideLeft:v,reportStatus:!0,title:p,placeholder:g,children:R||n?x.jsxs(w.Fragment,{children:[b?null:x.jsx("span",{"aria-disabled":y,className:"text-opacity-70 aria-disabled:text-disabled",children:R}),n?x.jsx(w.Fragment,{children:n}):null]}):null}),x.jsxs("div",{className:`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${f}`,children:[t?x.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap pl-2",children:t}):null,l,i?x.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap pr-2",children:i}):null]})]}),x.jsx("p",{className:"mt-input-gap hidden flex-shrink-0 flex-grow-0 whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:inline-block group-error:inline-block group-error:text-danger",children:c}),x.jsx("p",{className:"mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden",children:o})]})}),$M=e=>x.jsx(w.Fragment,{children:e.children}),Pb=w.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},s)=>{const i=r.Render??$M,a=r.label??r.value;return r.hidden?null:x.jsx("li",{...o,ref:s,role:"option","aria-selected":t,className:"w-full min-w-0 container border-b border-tooltip-border last:border-b-0",children:x.jsxs("button",{type:"button","aria-checked":t,"aria-current":t,"aria-selected":t,onClick:n,"data-value":r.value,"aria-busy":r.disabled,className:`flex w-full cursor-pointer justify-between p-2 text-left ${t?"bg-primary-hover text-primary-foreground":""} ${e?"bg-primary text-primary-foreground":""}`,children:[x.jsx(i,{...o,label:r.label,value:r.value,children:a}),t?x.jsx("span",{children:x.jsx(wP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})}),BM={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},HM={caseSensitive:!1,sort:!1},WM=[],zM=w.forwardRef(({left:e,error:t,right:n,options:r,container:o,rightLabel:s,interactive:i,emptyMessage:a,optionalText:l,labelClassName:c,feedback:u=null,hideLeft:d=!1,required:f=!1,dynamicOption:h=!1,...p},m)=>{const g=Ct(),v=p.value??p.defaultValue??"",[b,y]=w.useState(!1),[S,T]=w.useState(""),[E,R]=w.useState(v),[I,k]=w.useState(()=>{var _;return((_=r.find(ae=>ae.value===v))==null?void 0:_.label)??v}),[A,N]=w.useState(null),M=w.useRef(WM),j=w.useRef(null),P=h&&S!==""?[{value:S,label:S,"data-dynamic":"true"},...r]:r,O=new _r(P,["value","label"],HM).search(S),F=h?void 0:`^(${r.map(_=>`${lc(_.value)}${_.label?"|"+lc(_.label):""}`).join("|")})$`;w.useEffect(()=>{if(p.value){const _=r.find(ae=>ae.value===p.value);R((_==null?void 0:_.label)??p.value)}},[p.value]);const{x:V,y:H,strategy:z,refs:D,context:$}=Po({open:b,transform:!0,strategy:"absolute",onOpenChange:y,whileElementsMounted:da,middleware:[fa(4),_D({padding:10,elementContext:"reference",apply(_){var oe;const he=_.elements.reference.parentElement,ve=(oe=j.current)==null?void 0:oe.getBoundingClientRect().width,We=(he==null?void 0:he.getBoundingClientRect().width)||0;Object.assign(_.elements.floating.style,{width:`${We}px`,overflowY:"auto",maxWidth:`${ve}px`,minWidth:`${ve}px`,maxHeight:`${Math.min(250,_.availableHeight)}px`})}})]}),K=SM($,BM),{getReferenceProps:J,getFloatingProps:X,getItemProps:G}=Ro([Io($,{role:"listbox"}),Co($),xb($,{cols:0,listRef:M,loop:!0,virtual:!0,allowEscape:!0,activeIndex:A,selectedIndex:A,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:_=>N(ae=>_??ae)})]);w.useEffect(()=>{const _=D.reference.current;if(_)return Gi(_)},[]);const L=(_,ae)=>{R(_.value);const he=D.reference.current;if(!he)return;he==null||he.setAttribute("data-value",_.value),he.value=_.value;const ve=new Event("change",{bubbles:!1,cancelable:!0});he.dispatchEvent(ve),p.onChange&&p.onChange(ve),k(_.label??""),y(!1),T(""),N(ae)},B=_=>{var he;const ae=_.target.value;return T(ae),!b&&ae===""?y(!0):(_.target.name=p.name||"",ae?y(!0):(he=p.onChange)==null?void 0:he.call(p,_))},W=()=>{y(!0),T("")},U=()=>{var _;y(!0),(_=D.reference.current)==null||_.focus()},q=_=>{var ae;_.stopPropagation(),(ae=D.reference.current)==null||ae.setAttribute("data-value",""),$m(D.reference.current),T(""),R(""),k(""),y(!1)},te=p.id||p.name;return x.jsxs(pa,{...p,left:e,error:t,ref:j,form:p.form,name:p.name,feedback:u,hideLeft:d,required:f,title:p.title,container:o,rightLabel:s,disabled:p.disabled,interactive:i,id:p.name||p.id,optionalText:l,componentName:"autocomplete",labelClassName:c,placeholder:p.placeholder,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{disabled:p.disabled,onClick:U,type:"button",className:"transition-colors disabled:link:text-disabled link:text-primary disabled:text-disabled",children:[x.jsx(Oy,{size:20}),x.jsx("span",{className:"sr-only",children:g.inputCaretDown})]}),E?x.jsxs("button",{type:"button",onClick:q,className:"isolate relative transition-colors link:text-danger",children:[x.jsx(ra,{size:15}),x.jsx("span",{className:"sr-only",children:g.inputCloseValue})]}):null]}),children:[x.jsx("input",{...J({...p,onChange:B,onFocus:W,pattern:F,ref:D.setReference,name:`${te}-shadow`,id:`${te}-shadow`,onClick:_=>_.currentTarget.focus(),onKeyDown(_){if(_.key==="Escape")return _.currentTarget.blur(),y(!1);if(_.key==="Enter"){if(A!==null&&O[A])return _.preventDefault(),L(O[A],A);if(O.length===1)return _.preventDefault(),L(O[0],0)}}}),"data-value":E,"data-error":!!t,"data-name":te,"data-target":te,required:f,value:b?S:I||E,"aria-autocomplete":"list",autoComplete:"off",className:ke("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary line-clamp-1",p.className)}),x.jsx("input",{id:te,name:te,type:"hidden","data-origin":te,ref:m,required:f,defaultValue:p.value||E||void 0}),x.jsx(Eo,{preserveTabOrder:!0,children:b?x.jsx(As,{disabled:p.disabled,guards:!0,returnFocus:!1,context:$,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("ul",{...X({ref:D.setFloating,style:{position:z,left:(V??0)+(E?26:18),top:H??0,...K.styles}}),"data-floating":"true",className:"container z-floating m-0 origin-[top_center] list-none overflow-auto overflow-y-auto overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:[O.map((_,ae)=>{const he=E===_.value||E===_.label;return x.jsx(Pb,{...G({onClick:()=>L(_,ae),ref:ve=>void(M.current[ae]=ve),selected:A===ae}),option:_,active:he,selected:A===ae},`${_.value}-option`)}),O.length===0?x.jsx("li",{role:"option",className:"w-full border-b border-tooltip-border last:border-b-0",children:x.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:a||g.autocompleteEmpty})}):null]})}):null})]})}),Rb=w.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:s,container:i,...a},l)=>x.jsxs("label",{"data-task":t,"data-component":"checkbox","data-disabled":a.disabled,"aria-disabled":a.disabled,className:ke("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",i),children:[x.jsx("input",{...a,ref:l,type:"checkbox","data-task":t,className:ke("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",o)}),e,x.jsx("span",{"data-name":"checkbox-label",className:ke("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),Ib=(e,t,n,r)=>w.forwardRef(({type:s="text",feedback:i=null,info:a,labelClassName:l,next:c,interactive:u,rightLabel:d,optionalText:f,container:h,hideLeft:p=!1,right:m,left:g,error:v,...b},y)=>{const S=e,T=b.id??b.name,E=w.useRef(null);return w.useEffect(()=>{if(E.current===null)return;const R=E.current,I=Gi(E.current),k=r==null?void 0:r(R),A=N=>{const M=N;if(M.key==="Enter"&&R.enterKeyHint==="next"){const j=R.getAttribute("data-next");if(j){const P=document.getElementById(j);if(P)return P.focus(),void M.preventDefault()}}};return R.addEventListener("keydown",A),()=>{k==null||k(),I(),R.removeEventListener("keydown",A)}},[]),x.jsx(pa,{...n,componentName:t,info:a,container:h,error:v,feedback:i,hideLeft:p,left:g,optionalText:f,right:m,rightLabel:d,interactive:u,form:b.form,id:b.name||b.id,name:b.name,labelClassName:l,title:b.title,placeholder:b.placeholder,required:b.required,disabled:b.disabled,children:x.jsx(S,{...n,...b,id:T,name:T,type:s,"data-next":c,"aria-busy":b.disabled,"aria-disabled":b.disabled,"aria-readonly":b.readOnly,ref:Yc(y,E),className:ke("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","resize-y group-focus-within:border-primary group-hover:border-primary","disabled:cursor-not-allowed disabled:text-disabled",b.className)})})}),Ds=Ib(rv,"input",{type:"text"}),gp=new Date(1970,11,31),pl={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},yp={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},UM={literal:(e,t)=>t,year:e=>e.getFullYear(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},ml=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},GM=w.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=t||uv(),l=w.useId(),c=Ct(),u=w.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[d,f]=w.useState(e||void 0),[h,p]=w.useState(!1),m=ml(u,gp).flatMap(R=>bn.keyof(pl,R.type)?pl[R.type](R.value):[]),g=ml(u,gp).reduce((R,I)=>R+(bn.keyof(yp,I.type)?yp[I.type](I.value):""),""),[v,b]=w.useState(d?ml(u,d).reduce((R,I)=>R+(bn.keyof(pl,I.type)?UM[I.type](d,I.value):""),""):""),y=R=>{const I=R.target.value;if(b(I),m.length===I.length&&m.every((A,N)=>{const M=I.charAt(N);return typeof A=="string"?M===A:A.test(M)})){const A=eo(jI(I,g,new Date));return f(A),r==null?void 0:r(A)}return f(void 0),r==null?void 0:r(void 0)},S=R=>(f(R),r==null||r(R),b(R?NR(R,g):"")),T=Vy(d),E=T?d.toISOString():void 0;return x.jsx(Ds,{...s,mask:m,value:v,id:void 0,name:void 0,className:"uppercase","data-value":E,formNoValidate:!h,"data-target":s.name,"data-component":"date-picker",onChange:y,required:s.required??!0,error:h?void 0:s.error,placeholder:s.placeholder??g,right:x.jsxs(w.Fragment,{children:[x.jsx("input",{"data-origin":s.name,defaultValue:E,form:s.form,hidden:!0,id:s.name,name:s.name,ref:i,type:"date"}),x.jsx(Ao,{open:h,onChange:p,trigger:x.jsxs("span",{"aria-labelledby":l,children:[x.jsx("span",{id:l,className:"sr-only",children:c.datePickerCalendarButtonLabel}),x.jsx(xP,{})]}),buttonProps:{"aria-describedby":l},children:x.jsx(pv,{...s,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:S,disabledDate:n,date:T?d:void 0})})]})})}),YM=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],KM=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],qM=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],XM=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],vp=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function bp(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const n=t.bits?t.binary?XM:qM:t.binary?KM:YM,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,s=o?"-":t.signed?"+":"";o&&(e=-e);let i;if(t.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:t.maximumFractionDigits,...i}),e<1){const u=vp(e,t.locale,i);return s+u+r+n[0]}const a=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**a,i||(e=e.toPrecision(3));const l=vp(Number(e),t.locale,i),c=n[a];return s+l+r+c}var Tc={exports:{}},Qs={exports:{}},Ie={};/** @license React v16.13.1
178
178
  * react-is.production.min.js
179
179
  *
180
180
  * Copyright (c) Facebook, Inc. and its affiliates.