@g4rcez/components 0.0.66 → 0.0.67

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.umd.js CHANGED
@@ -174,7 +174,7 @@
174
174
  */var bg;function ZA(){return bg||(bg=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=b,t=gg();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,I,A=function(k){if(!T){T=!0,E=k;var L=h(k);if(p!==void 0&&g.hasValue){var P=g.value;if(p(P,L))return I=P,P}return I=L,L}var D=E,N=I;if(r(D,k))return N;var B=h(k);return p!==void 0&&p(N,B)?N:(E=k,I=B,B)},F=f===void 0?null:f,O=function(){return A(d())},_=F===null?void 0:function(){return A(F())};return[O,_]},[d,f,h,p]),w=v[0],y=v[1],S=o(u,w,y);return i(function(){g.hasValue=!0,g.value=S},[S]),l(S),S}vg.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),vg}process.env.NODE_ENV==="production"?QA():ZA();const Jr=e=>{const t=b.useRef(e??{});return b.useEffect(()=>void(t.current=e),[e]),t},JA=e=>{const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current},eO=e=>Object.entries(e),wg=e=>e instanceof Promise,xg=(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),tO=(e,t,n,r,o,s)=>(...i)=>{const a=performance.now(),l=t(...i),c=(u,d)=>n(f=>xg(u,f,s,d));return wg(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))},nO=(e,t,n,r,o,s)=>(...i)=>{o.current={method:e,time:0,props:r()};const a=t(...i),l=c=>n(u=>xg(c,u,s,o.current));return wg(a)?a.then(c=>l(c)):l(a)},gc=(e,t,n)=>{const[r,o]=b.useState(()=>e),s=Jr(r),i=Jr((n==null?void 0:n.props)??{}),a=Jr(t),l=Jr((n==null?void 0:n.postMiddleware)??[]),c=Jr((n==null?void 0:n.interceptor)??[]),u=b.useRef(e),d=JA(r),f=Jr(d),h=b.useRef(null);b.useEffect(()=>{if(h.current===null)return;const m=h.current;l.current.forEach(g=>{g(r,d,m)})},[r,l,d]);const[p]=b.useState(()=>{const m=()=>i.current,g=a.current({props:m,state:()=>s.current,initialState:u.current,previousState:()=>f.current});return eO(g).reduce((v,[w,y])=>({...v,[w]:n!=null&&n.debug?tO(w,y,o,m,h,c.current):nO(w,y,o,m,h,c.current)}),{})});return[r,p,i.current]},rO=(e,t=0)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e(...o),t)}};function oO(e,t){return b.useRef(rO(e,t)).current}const Ei={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>)`},eo=(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(eo(i,t,n,a))},[]),Tg=(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]:Tg(i,t,n,a)}},{}),Sg={default:e=>`:root { ${e} }`,dark:e=>`html.dark {${e}}`},yc=(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)},sO={default:e=>yc(e,{result:Sg.default}),dark:e=>yc(e,{result:Sg.dark})},iO=(e,t)=>{const n=(a,l,c)=>({key:`--${c}`,value:`${a}`}),r=eo(e.colors,n),o=eo(e.spacing,n),s=eo(e.rounded,n),i=e.custom?eo(e.custom,n):[];return yc(r.concat(o,s,i),{result:a=>`html${t?`.${t}`:""} {${a}}`,value:(a,l)=>l.replace("hsla(","").replace(")","")})},Eg={button:"0.4rem",pill:"2rem",card:"0.75rem",full:"9999px"},Cg={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"},aO={name:"dark",rounded:Eg,spacing:Cg,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%)"}}}},lO={name:"light",rounded:Eg,spacing:Cg,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%)"}}}},cO=aO,uO=lO,vc={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(b.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"},Ci=b.createContext({colorTokenParser:Ei.hsla,translations:vc,locale:void 0}),dO=e=>{const t=b.useMemo(()=>({locale:e.locale,translations:{...vc,...e.map},colorTokenParser:e.parser||Ei.hsla}),[e]);return x.jsx(Ci.Provider,{value:t,children:e.children})},Pg=()=>{const e=b.useContext(Ci);if(e)return e.locale},Tt=()=>{const e=b.useContext(Ci);return e?e.translations:vc},fO=()=>{const e=b.useContext(Ci);return e?e.colorTokenParser:Ei.hsla},Wt=(e,t=2)=>e.toString(16).padStart(t,"0"),ds=()=>{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,`${Wt(t,4)+Wt(n,3)}-${Wt(r[0])+Wt(r[1])}-${Wt(r[2])+Wt(r[3])}-${Wt(r[4])+Wt(r[5])}-${Wt(r[6])+Wt(r[7])+Wt(r[8])+Wt(r[9])}`},Ig=(e,t,n)=>e.split(t).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,n),Ag={basic:/[,[\]]+?/,extend:/[,[\].]+?/},bc=(e,t)=>{const n=Ig(t,Ag.basic,e)||Ig(t,Ag.extend,e);return n===void 0||n===e?void 0:n},Pi=()=>typeof window>"u",wc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Og=(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},hO={type:"spring",bounce:.3,duration:.6},Dg=e=>(t=1)=>({x:`${100*e*t}%`,opacity:.25}),Mg={middle:{x:"0%",opacity:1},enter:Dg(1),exit:Dg(-1)},kg={exit:{visibility:"hidden"}},pO=e=>{const t=rn($m(e));return Vm({start:t,end:qr(t,41)})},Fg=(e,t)=>e.toLocaleDateString(t,{month:"long"}),mO=(e,t,n)=>Array.from({length:12}).map((r,o)=>{const s=$m(new Date(1970,o,1).setMonth(o)),i=Fg(s,n);return x.jsx("option",{value:i,"data-index":o,children:i},`${e}-${i}`)}),xc={ArrowLeft:(e,t)=>t==="days"?OA(e,1):Jm(e,1),ArrowRight:(e,t)=>t==="days"?qr(e,1):gi(e,1),ArrowUp:(e,t)=>t==="days"?DA(e,1):MA(e,1),ArrowDown:(e,t)=>t==="days"?Nm(e,1):Lm(e,1)},Ng=(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)},dr=e=>e.getFullYear().toString().padStart(4,"0"),gO=(e,t,n)=>e===void 0||n===void 0?!1:DI(t,e)&&MI(t,n),yO=e=>{var n;const t=Tt();return x.jsx(dt.tbody,{layout:!0,variants:Mg,custom:e.direction,onKeyDown:e.onKeyDown,className:Me((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,w,y,S,T,E,I,A,F,O;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=AA(i)&&e.markToday,u=((w=e.disabledDate)==null?void 0:w.call(e,i))||!1,d=!IA(i,e.stateDate)||u,f=e.rangeMode?gO((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:Me("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:Me(`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&&((I=e.stateRange.from)==null?void 0:I.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.from)??t.calendarFromDate})}):null,l&&((F=e.stateRange.to)==null?void 0:F.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:((O=e.labelRange)==null?void 0:O.to)??t.calendarToDate})}):null]}),e.RenderOnDay?x.jsx(e.RenderOnDay,{date:i}):null]},a)})},`week-${r.length}-${o}`)})})},Lg=({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=b.useRef(ds()),p=Tt(),m=b.useRef(null),{date:g,range:v}=f,w=g||new Date,y=b.useRef(null),[S,T]=gc({date:w,isAnimating:!1,year:dr(w),direction:void 0,range:{from:v==null?void 0:v.from,to:v==null?void 0:v.to},months:mO(h.current,w,o),selectMode:l?"from":void 0,week:Vm({start:rn(w),end:VP(w)})},_=>({onChangeYear:k=>({year:k}),setToday:()=>({date:Qr(new Date)}),onExitComplete:()=>(Ng(y.current||null,m,_.state().date,200),y.current=null,{isAnimating:!1}),date:k=>{const L=k(_.state().date);return{date:L,year:dr(L)}},nextMonth:k=>{y.current=k.currentTarget;const L=_.state();if(L.isAnimating)return L;const P=gi(L.date,1);return{date:P,isAnimating:!0,direction:1,year:dr(P)}},previousMonth:k=>{y.current=k.currentTarget;const L=_.state();if(L.isAnimating)return L;const P=Jm(L.date,1);return{date:P,isAnimating:!0,direction:-1,year:dr(P)}},onSelectDate:k=>{const L=_.state(),P=k.currentTarget.dataset.range==="true",D=k.currentTarget.dataset.date||"",N=new Date(D);return{date:N,year:dr(N),selectMode:L.selectMode===void 0?void 0:L.selectMode==="from"?"to":"from",range:P?{from:L.selectMode==="from"?N:L.range.from,to:L.selectMode==="to"?N:L.range.to}:L.range}},onChangeMonth:k=>{const L=k.target.value,D=Array.from(k.target.options).find(B=>B.value===L),N=_.state();if(D){const B=D.dataset.index||"",H=new Date(_.state().date);return H.setMonth(+B),{...N,date:H,year:dr(H)}}return N},onKeyDown:k=>{const L=k.key,P=_.state();if(L in xc){(L==="ArrowUp"||L==="ArrowDown")&&k.preventDefault();const D=_.state().date,N=vn.keyof(xc,L)?xc[L](D,k.shiftKey?"month":"days"):null;if(N!==null)return Ng(k.target,m,N),{...P,date:N,year:dr(N)}}return _.state()}}),{props:{onChangeMonth:i,onChangeYear:a},postMiddleware:[(_,k,L)=>{var D,N;return(L.method==="onChangeMonth"||L.method==="previousMonth"||L.method==="nextMonth")&&((N=(D=L.props).onChangeMonth)==null||N.call(D,_.date)),_},(_,k,L)=>{var D,N;return L.method==="onChangeYear"&&((N=(D=L.props).onChangeYear)==null||N.call(D,_.date)),_},(_,k,L)=>{const P=L.method==="onSelectDate"||L.method==="setToday"||L.method==="onKeyDown";return l&&P&&t?(c==null||c(_.range),_):(P&&t&&(c==null||c(_.date)),_)}]}),E=Og(pO(S.date),7),I=S.date.toISOString(),A=Fg(S.date,o);b.useEffect(()=>{t||c==null||c(S.date)},[I]);const F=oO(_=>{T.date(k=>{const L=new Date(k);return L.setFullYear(+_),L})},1200),O=_=>{const k=_.currentTarget.value;T.onChangeYear(k),a==null||a(new Date(k)),F(k)};return x.jsx(xC,{transition:hO,children:x.jsxs("div",{"data-component":"calendar",ref:m,className:Me("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(Yr,{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:kg,onClick:T.previousMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary",children:x.jsx(pP,{className:"h-4 w-4"})}),x.jsx(dt.span,{layout:!0,variants:Mg,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:`${A.length}ch`},value:A,onChange:T.onChangeMonth,className:"w-fit cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary",children:S.months}),x.jsx(dg,{mask:"int",value:S.year,maxLength:4,placeholder:"YYYY",onChange:O,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:kg,className:"z-calendar rounded-full p-1.5 hover:bg-primary",onClick:T.nextMonth,children:x.jsx(tc,{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(_=>x.jsx("th",{className:Me("py-2 text-sm font-medium capitalize",u==null?void 0:u.weekDay),children:_.toLocaleDateString(o,{weekday:"short"})},_.toString()))})}),x.jsx(yO,{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})]})]},A)})}),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})})]})})},_g=({children:e,title:t,titleClassName:n="",as:r="div",container:o="",header:s=null,className:i="",...a})=>x.jsxs(Nr,{...a,as:r,"data-componen":"card",className:Me("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:Me("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:Me("min-w-full px-8",i),children:e})]}),Vg=e=>{const t=e.Icon??Am,n=Tt();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 Lt(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 vO(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $g(...e){return t=>e.forEach(n=>vO(n,t))}function fr(...e){return C.useCallback($g(...e),e)}function Bg(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,bO(o,...t)]}function bO(...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(xO);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(Tc,{...r,ref:t,children:C.isValidElement(i)?C.cloneElement(i,void 0,a):null})}return x.jsx(Tc,{...r,ref:t,children:n})});to.displayName="Slot";var Tc=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const o=SO(n);return C.cloneElement(n,{...TO(r,n.props),ref:t?$g(t,o):o})}return C.Children.count(n)>1?C.Children.only(null):null});Tc.displayName="SlotClone";var wO=({children:e})=>x.jsx(x.Fragment,{children:e});function xO(e){return C.isValidElement(e)&&e.type===wO}function TO(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 SO(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 EO(e){const t=e+"CollectionProvider",[n,r]=Bg(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:p,children:m}=h,g=b.useRef(null),v=b.useRef(new Map).current;return x.jsx(o,{scope:p,itemMap:v,collectionRef:g,children:m})};i.displayName=t;const a=e+"CollectionSlot",l=b.forwardRef((h,p)=>{const{scope:m,children:g}=h,v=s(a,m),w=fr(p,v.collectionRef);return x.jsx(to,{ref:w,children:g})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=b.forwardRef((h,p)=>{const{scope:m,children:g,...v}=h,w=b.useRef(null),y=fr(p,w),S=s(c,m);return b.useEffect(()=>(S.itemMap.set(w,{ref:w,...v}),()=>void S.itemMap.delete(w))),x.jsx(to,{[u]:"",ref:y,children:g})});d.displayName=c;function f(h){const p=s(e+"CollectionConsumer",h);return b.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 CO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],an=CO.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 Rg(e,t){e&&Lo.flushSync(()=>e.dispatchEvent(t))}function Sn(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 PO(e,t=globalThis==null?void 0:globalThis.document){const n=Sn(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 IO="DismissableLayer",Sc="dismissableLayer.update",AO="dismissableLayer.pointerDownOutside",OO="dismissableLayer.focusOutside",jg,Hg=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wg=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=C.useContext(Hg),[u,d]=C.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=C.useState({}),p=fr(t,I=>d(I)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),w=u?m.indexOf(u):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,S=w>=v,T=MO(I=>{const A=I.target,F=[...c.branches].some(O=>O.contains(A));!S||F||(o==null||o(I),i==null||i(I),I.defaultPrevented||a==null||a())},f),E=kO(I=>{const A=I.target;[...c.branches].some(O=>O.contains(A))||(s==null||s(I),i==null||i(I),I.defaultPrevented||a==null||a())},f);return PO(I=>{w===c.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},f),C.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(jg=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Ug(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jg)}},[u,f,n,c]),C.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Ug())},[u,c]),C.useEffect(()=>{const I=()=>h({});return document.addEventListener(Sc,I),()=>document.removeEventListener(Sc,I)},[]),x.jsx(an.div,{...l,ref:p,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:Lt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Lt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Lt(e.onPointerDownCapture,T.onPointerDownCapture)})});Wg.displayName=IO;var DO="DismissableLayerBranch",zg=C.forwardRef((e,t)=>{const n=C.useContext(Hg),r=C.useRef(null),o=fr(t,r);return C.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(an.div,{...e,ref:o})});zg.displayName=DO;function MO(e,t=globalThis==null?void 0:globalThis.document){const n=Sn(e),r=C.useRef(!1),o=C.useRef(()=>{});return C.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Gg(AO,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 kO(e,t=globalThis==null?void 0:globalThis.document){const n=Sn(e),r=C.useRef(!1);return C.useEffect(()=>{const o=s=>{s.target&&!r.current&&Gg(OO,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 Ug(){const e=new CustomEvent(Sc);document.dispatchEvent(e)}function Gg(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?Rg(o,s):o.dispatchEvent(s)}var FO=Wg,NO=zg,Ii=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},LO="Portal",Yg=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?Ta.createPortal(x.jsx(an.div,{...r,ref:t}),i):null});Yg.displayName=LO;function _O(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Kg=e=>{const{present:t,children:n}=e,r=VO(t),o=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=fr(r.ref,$O(o));return typeof n=="function"||r.isPresent?C.cloneElement(o,{ref:s}):null};Kg.displayName="Presence";function VO(e){const[t,n]=C.useState(),r=C.useRef({}),o=C.useRef(e),s=C.useRef("none"),i=e?"mounted":"unmounted",[a,l]=_O(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const c=Ai(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=Ai(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=Ai(r.current).includes(d.animationName);d.target===t&&h&&Lo.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=Ai(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 Ai(e){return(e==null?void 0:e.animationName)||"none"}function $O(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 BO({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=RO({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Sn(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 RO({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,o=C.useRef(r),s=Sn(t);return C.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var jO="VisuallyHidden",Ec=C.forwardRef((e,t)=>x.jsx(an.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}}));Ec.displayName=jO;var Cc="ToastProvider",[Pc,HO,WO]=EO("Toast"),[qg,OV]=Bg("Toast",[WO]),[zO,Oi]=qg(Cc),Xg=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 \`${Cc}\`. Expected non-empty \`string\`.`),x.jsx(Pc.Provider,{scope:t,children:x.jsx(zO,{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})})};Xg.displayName=Cc;var Qg="ToastViewport",UO=["F8"],Ic="toast.viewportPause",Ac="toast.viewportResume",Zg=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=UO,label:o="Notifications ({hotkey})",...s}=e,i=Oi(Qg,n),a=HO(n),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),f=fr(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 w=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(Ic);v.dispatchEvent(E),i.isClosePausedRef.current=!0}},y=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(Ac);v.dispatchEvent(E),i.isClosePausedRef.current=!1}},S=E=>{!g.contains(E.relatedTarget)&&y()},T=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",S),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",T),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",T),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[p,i.isClosePausedRef]);const m=C.useCallback(({tabbingDirection:g})=>{const w=a().map(y=>{const S=y.ref.current,T=[S,...sD(S)];return g==="forwards"?T:T.reverse()});return(g==="forwards"?w.reverse():w).flat()},[a]);return C.useEffect(()=>{const g=d.current;if(g){const v=w=>{var T,E,I;const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const A=document.activeElement,F=w.shiftKey;if(w.target===g&&F){(T=c.current)==null||T.focus();return}const k=m({tabbingDirection:F?"backwards":"forwards"}),L=k.findIndex(P=>P===A);Mc(k.slice(L+1))?w.preventDefault():F?(E=c.current)==null||E.focus():(I=u.current)==null||I.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[a,m]),x.jsxs(NO,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&x.jsx(Oc,{ref:c,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});Mc(g)}}),x.jsx(Pc.Slot,{scope:n,children:x.jsx(an.ol,{tabIndex:-1,...s,ref:f})}),p&&x.jsx(Oc,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});Mc(g)}})]})});Zg.displayName=Qg;var Jg="ToastFocusProxy",Oc=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Oi(Jg,n);return x.jsx(Ec,{"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()}})});Oc.displayName=Jg;var Di="Toast",GO="toast.swipeStart",YO="toast.swipeMove",KO="toast.swipeCancel",qO="toast.swipeEnd",ey=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,l]=BO({prop:r,defaultProp:o,onChange:s});return x.jsx(Kg,{present:n||a,children:x.jsx(ZO,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:Sn(e.onPause),onResume:Sn(e.onResume),onSwipeStart:Lt(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Lt(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:Lt(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:Lt(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)})})})});ey.displayName=Di;var[XO,QO]=qg(Di,{onClose(){}}),ZO=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=Oi(Di,n),[g,v]=C.useState(null),w=fr(t,P=>v(P)),y=C.useRef(null),S=C.useRef(null),T=o||m.duration,E=C.useRef(0),I=C.useRef(T),A=C.useRef(0),{onToastAdd:F,onToastRemove:O}=m,_=Sn(()=>{var D;(g==null?void 0:g.contains(document.activeElement))&&((D=m.viewport)==null||D.focus()),i()}),k=C.useCallback(P=>{!P||P===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(_,P))},[_]);C.useEffect(()=>{const P=m.viewport;if(P){const D=()=>{k(I.current),c==null||c()},N=()=>{const B=new Date().getTime()-E.current;I.current=I.current-B,window.clearTimeout(A.current),l==null||l()};return P.addEventListener(Ic,N),P.addEventListener(Ac,D),()=>{P.removeEventListener(Ic,N),P.removeEventListener(Ac,D)}}},[m.viewport,T,l,c,k]),C.useEffect(()=>{s&&!m.isClosePausedRef.current&&k(T)},[s,T,m.isClosePausedRef,k]),C.useEffect(()=>(F(),()=>O()),[F,O]);const L=C.useMemo(()=>g?iy(g):null,[g]);return m.viewport?x.jsxs(x.Fragment,{children:[L&&x.jsx(JO,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),x.jsx(XO,{scope:n,onClose:_,children:Lo.createPortal(x.jsx(Pc.ItemSlot,{scope:n,children:x.jsx(FO,{asChild:!0,onEscapeKeyDown:Lt(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||_(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(an.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...p,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Lt(e.onKeyDown,P=>{P.key==="Escape"&&(a==null||a(P.nativeEvent),P.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,_()))}),onPointerDown:Lt(e.onPointerDown,P=>{P.button===0&&(y.current={x:P.clientX,y:P.clientY})}),onPointerMove:Lt(e.onPointerMove,P=>{if(!y.current)return;const D=P.clientX-y.current.x,N=P.clientY-y.current.y,B=!!S.current,H=["left","right"].includes(m.swipeDirection),z=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,M=H?z(0,D):0,R=H?0:z(0,N),K=P.pointerType==="touch"?10:2,ee={x:M,y:R},Z={originalEvent:P,delta:ee};B?(S.current=ee,Mi(YO,d,Z,{discrete:!1})):ay(ee,m.swipeDirection,K)?(S.current=ee,Mi(GO,u,Z,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(D)>K||Math.abs(N)>K)&&(y.current=null)}),onPointerUp:Lt(e.onPointerUp,P=>{const D=S.current,N=P.target;if(N.hasPointerCapture(P.pointerId)&&N.releasePointerCapture(P.pointerId),S.current=null,y.current=null,D){const B=P.currentTarget,H={originalEvent:P,delta:D};ay(D,m.swipeDirection,m.swipeThreshold)?Mi(qO,h,H,{discrete:!0}):Mi(KO,f,H,{discrete:!0}),B.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),JO=e=>{const{__scopeToast:t,children:n,...r}=e,o=Oi(Di,t),[s,i]=C.useState(!1),[a,l]=C.useState(!1);return rD(()=>i(!0)),C.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:x.jsx(Yg,{asChild:!0,children:x.jsx(Ec,{...r,children:s&&x.jsxs(x.Fragment,{children:[o.label," ",n]})})})},eD="ToastTitle",ty=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(an.div,{...r,ref:t})});ty.displayName=eD;var tD="ToastDescription",ny=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(an.div,{...r,ref:t})});ny.displayName=tD;var ry="ToastAction",nD=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?x.jsx(sy,{altText:n,asChild:!0,children:x.jsx(Dc,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ry}\`. Expected non-empty \`string\`.`),null)});nD.displayName=ry;var oy="ToastClose",Dc=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=QO(oy,n);return x.jsx(sy,{asChild:!0,children:x.jsx(an.button,{type:"button",...r,ref:t,onClick:Lt(e.onClick,o.onClose)})})});Dc.displayName=oy;var sy=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return x.jsx(an.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function iy(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),oD(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(...iy(r))}}),t}function Mi(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?Rg(o,s):o.dispatchEvent(s)}var ay=(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 rD(e=()=>{}){const t=Sn(e);Ii(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function oD(e){return e.nodeType===e.ELEMENT_NODE}function sD(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 Mc(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var iD=Xg,aD=Zg,lD=ey,cD=ty,uD=ny,dD=Dc;const fD=e=>{const[t,n]=b.useState(!1),r=()=>n(!0),o=()=>n(!1);return b.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},hD=Er("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"}}),ly=b.createContext(()=>{throw new Error("Not implemented")}),pD=()=>b.useContext(ly),cy={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]}},mD=b.forwardRef(function(t,n){const r=t.closable??!0,o=t.duration,s=t.hover?"hover":t.isLast?"isLast":"other",i=hD({theme:t.theme||"default"});return x.jsx(lD,{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:cy[t.reversedIndex]||cy.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(cD,{className:"select-text truncate text-lg font-medium leading-relaxed",children:"Title"}):null,x.jsx(uD,{className:"select-text truncate",children:t.text})]}),r?x.jsx(dD,{className:"absolute right-2 top-2 rounded-full p-1 text-foreground transition hover:bg-danger/10 hover:text-danger-hover",children:x.jsx(mi,{className:"h-5 w-5"})}):null]})})})});function gD({children:e,max:t=5,duration:n=5e3}){const r=b.useRef(null),o=fD(r),[s,i]=b.useState([]),a=b.useCallback(()=>i([]),[]);b.useEffect(()=>()=>a(),[a]);const l=b.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(iD,{duration:n,swipeThreshold:150,children:[x.jsx(ly.Provider,{value:l,children:e}),x.jsx(Yr,{presenceAffectsLayout:!0,mode:"popLayout",children:s.map((c,u,d)=>{const f=()=>i(h=>h.filter(p=>p.id!==c.id));return b.createElement(mD,{...c,key:c.id,hover:o,index:u,onClose:f,isLast:d.length-1===u,reversedIndex:d.length-(u+1)})})}),x.jsx(aD,{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 yD=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:Me("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]}),uy=(e,t)=>{const[n,r]=b.useState(()=>t||e);return b.useEffect(()=>{r(e)},[e]),[n,r]},dy=b.createContext(""),vD=e=>{const[t,n]=uy(e.active),r=lr(0),o=lr(0),s=b.useRef(null),i=e.useHash?"a":"button";b.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=wf(e.onChange);b.useEffect(()=>{a.current&&a.current(t)},[a,t]);const l=b.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(dy.Provider,{value:t,children:x.jsx(_g,{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})})},bD=()=>b.useContext(dy),wD=e=>{const t=bD();return x.jsx(b.Fragment,{children:e.id===t?e.children:null})};function Bn(e){return fy(e)?(e.nodeName||"").toLowerCase():"#document"}function It(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function En(e){var t;return(t=(fy(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fy(e){return e instanceof Node||e instanceof It(e).Node}function Le(e){return e instanceof Element||e instanceof It(e).Element}function nt(e){return e instanceof HTMLElement||e instanceof It(e).HTMLElement}function kc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof It(e).ShadowRoot}function fs(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_t(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function xD(e){return["table","td","th"].includes(Bn(e))}function ki(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Fc(e){const t=Nc(),n=Le(e)?_t(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 TD(e){let t=Cn(e);for(;nt(t)&&!Rn(t);){if(Fc(t))return t;if(ki(t))return null;t=Cn(t)}return null}function Nc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rn(e){return["html","body","#document"].includes(Bn(e))}function _t(e){return It(e).getComputedStyle(e)}function Fi(e){return Le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cn(e){if(Bn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kc(e)&&e.host||En(e);return kc(t)?t.host:t}function hy(e){const t=Cn(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:nt(t)&&fs(t)?t:hy(t)}function jn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=hy(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=It(o);if(s){const a=Lc(i);return t.concat(i,i.visualViewport||[],fs(o)?o:[],a&&n?jn(a):[])}return t.concat(o,jn(o,[],n))}function Lc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ut(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 Xe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&kc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _c(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function py(){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 my(e){return e.mozInputSource===0&&e.isTrusted?!0:Bc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Vc(e){return SD()?!1:!Bc()&&e.width===0&&e.height===0||Bc()&&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 $c(){return/apple/i.test(navigator.vendor)}function Bc(){const e=/android/i;return e.test(_c())||e.test(py())}function gy(){return _c().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function SD(){return py().includes("jsdom/")}function no(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function ED(e){return"nativeEvent"in e}function CD(e){return e.matches("html,body")}function ft(e){return(e==null?void 0:e.ownerDocument)||document}function Rc(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 ln(e){return"composedPath"in e?e.composedPath()[0]:e.target}const PD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function jc(e){return nt(e)&&e.matches(PD)}function gt(e){e.preventDefault(),e.stopPropagation()}function yy(e){return e?e.getAttribute("role")==="combobox"&&jc(e):!1}const cn=Math.min,Vt=Math.max,Ni=Math.round,ro=Math.floor,Hn=e=>({x:e,y:e}),ID={left:"right",right:"left",bottom:"top",top:"bottom"},AD={start:"end",end:"start"};function Hc(e,t,n){return Vt(e,cn(t,n))}function oo(e,t){return typeof e=="function"?e(t):e}function Wn(e){return e.split("-")[0]}function so(e){return e.split("-")[1]}function vy(e){return e==="x"?"y":"x"}function Wc(e){return e==="y"?"height":"width"}function hr(e){return["top","bottom"].includes(Wn(e))?"y":"x"}function zc(e){return vy(hr(e))}function OD(e,t,n){n===void 0&&(n=!1);const r=so(e),o=zc(e),s=Wc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Li(i)),[i,Li(i)]}function DD(e){const t=Li(e);return[Uc(e),t,Uc(t)]}function Uc(e){return e.replace(/start|end/g,t=>AD[t])}function MD(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 kD(e,t,n,r){const o=so(e);let s=MD(Wn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Uc)))),s}function Li(e){return e.replace(/left|right|bottom|top/g,t=>ID[t])}function FD(e){return{top:0,right:0,bottom:0,left:0,...e}}function by(e){return typeof e!="number"?FD(e):{top:e,right:e,bottom:e,left:e}}function _i(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 ND=["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])"],Vi=ND.join(","),wy=typeof Element>"u",io=wy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$i=!wy&&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},Bi=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},LD=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},_D=function(t,n,r){if(Bi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Vi));return n&&io.call(t,Vi)&&o.unshift(t),o=o.filter(r),o},VD=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Bi(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=io.call(i,Vi);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Bi(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},xy=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ty=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||LD(t))&&!xy(t)?0:t.tabIndex},$D=function(t,n){var r=Ty(t);return r<0&&n&&!xy(t)?0:r},BD=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sy=function(t){return t.tagName==="INPUT"},RD=function(t){return Sy(t)&&t.type==="hidden"},jD=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},HD=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},WD=function(t){if(!t.name)return!0;var n=t.form||$i(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=HD(o,t.form);return!s||s===t},zD=function(t){return Sy(t)&&t.type==="radio"},UD=function(t){return zD(t)&&!WD(t)},GD=function(t){var n,r=t&&$i(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=$i(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},Ey=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},YD=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=io.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(io.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=$i(t);if(l&&!l.shadowRoot&&o(l)===!0)return Ey(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(GD(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ey(t);return!1},KD=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 io.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},qD=function(t,n){return!(n.disabled||Bi(n)||RD(n)||YD(n,t)||jD(n)||KD(n))},Gc=function(t,n){return!(UD(n)||Ty(n)<0||!qD(t,n))},XD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},QD=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=$D(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(BD).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},hs=function(t,n){n=n||{};var r;return n.getShadowRoot?r=VD([t],n.includeContainer,{filter:Gc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:XD}):r=_D(t,n.includeContainer,Gc.bind(null,n)),QD(r)},ZD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return io.call(t,Vi)===!1?!1:Gc(n,t)};function Cy(e,t,n){let{reference:r,floating:o}=e;const s=hr(t),i=zc(t),a=Wc(i),l=Wn(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(so(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1);break}return h}const JD=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}=Cy(c,r,l),f=r,h={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:v}=a[m],{x:w,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=w??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}=Cy(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Yc(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}=oo(t,e),p=by(h),g=a[f?d==="floating"?"reference":"floating":d],v=_i(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})),w=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=_i(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:l}):w);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 eM=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}=oo(e,t)||{};if(c==null)return{};const d=by(u),f={x:n,y:r},h=zc(o),p=Wc(h),m=await i.getDimensions(c),g=h==="y",v=g?"top":"left",w=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 I=E?E[y]:0;(!I||!await(i.isElement==null?void 0:i.isElement(E)))&&(I=a.floating[y]||s.floating[p]);const A=S/2-T/2,F=I/2-m[p]/2-1,O=cn(d[v],F),_=cn(d[w],F),k=O,L=I-m[p]-_,P=I/2-m[p]/2+A,D=Hc(k,P,L),N=!l.arrow&&so(o)!=null&&P!==D&&s.reference[p]/2-(P<k?O:_)-m[p]/2<0,B=N?P<k?P-k:P-L:0;return{[h]:f[h]+B,data:{[h]:D,centerOffset:P-D-B,...N&&{alignmentOffset:B}},reset:N}}}),tM=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}=oo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Wn(o),w=hr(a),y=Wn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=f||(y||!m?[Li(a)]:DD(a)),E=p!=="none";!f&&E&&T.push(...kD(a,m,p,S));const I=[a,...T],A=await Yc(t,g),F=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&F.push(A[v]),d){const P=OD(o,i,S);F.push(A[P[0]],A[P[1]])}if(O=[...O,{placement:o,overflows:F}],!F.every(P=>P<=0)){var _,k;const P=(((_=s.flip)==null?void 0:_.index)||0)+1,D=I[P];if(D)return{data:{index:P,overflows:O},reset:{placement:D}};let N=(k=O.filter(B=>B.overflows[0]<=0).sort((B,H)=>B.overflows[1]-H.overflows[1])[0])==null?void 0:k.placement;if(!N)switch(h){case"bestFit":{var L;const B=(L=O.filter(H=>{if(E){const z=hr(H.placement);return z===w||z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(z=>z>0).reduce((z,M)=>z+M,0)]).sort((H,z)=>H[1]-z[1])[0])==null?void 0:L[0];B&&(N=B);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};async function nM(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Wn(n),a=so(n),l=hr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=oo(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 rM=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 nM(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}}}}},oM=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:w}=g;return{x:v,y:w}}},...l}=oo(e,t),c={x:n,y:r},u=await Yc(t,l),d=hr(Wn(o)),f=vy(d);let h=c[f],p=c[d];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=h+u[g],y=h-u[v];h=Hc(w,h,y)}if(i){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=p+u[g],y=p-u[v];p=Hc(w,p,y)}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},sM=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}=oo(e,t),l=await Yc(t,a),c=Wn(n),u=so(n),d=hr(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,w=cn(h-l[p],g),y=cn(f-l[m],v),S=!t.middlewareData.shift;let T=w,E=y;if(d?E=u||S?cn(y,v):v:T=u||S?cn(w,g):g,S&&!u){const A=Vt(l.left,0),F=Vt(l.right,0),O=Vt(l.top,0),_=Vt(l.bottom,0);d?E=f-2*(A!==0||F!==0?A+F:Vt(l.left,l.right)):T=h-2*(O!==0||_!==0?O+_:Vt(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:T});const I=await o.getDimensions(s.floating);return f!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function Py(e){const t=_t(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ni(n)!==s||Ni(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Kc(e){return Le(e)?e:e.contextElement}function ao(e){const t=Kc(e);if(!nt(t))return Hn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Py(t);let i=(s?Ni(n.width):n.width)/r,a=(s?Ni(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const iM=Hn(0);function Iy(e){const t=It(e);return!Nc()||!t.visualViewport?iM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==It(e)?!1:t}function pr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Kc(e);let i=Hn(1);t&&(r?Le(r)&&(i=ao(r)):i=ao(e));const a=aM(s,n,r)?Iy(s):Hn(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=It(s),h=r&&Le(r)?It(r):r;let p=f,m=Lc(p);for(;m&&r&&h!==p;){const g=ao(m),v=m.getBoundingClientRect(),w=_t(m),y=v.left+(m.clientLeft+parseFloat(w.paddingLeft))*g.x,S=v.top+(m.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=y,c+=S,p=It(m),m=Lc(p)}}return _i({width:u,height:d,x:l,y:c})}function lM(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=En(r),a=t?ki(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Hn(1);const u=Hn(0),d=nt(r);if((d||!d&&!s)&&((Bn(r)!=="body"||fs(i))&&(l=Fi(r)),nt(r))){const f=pr(r);c=ao(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 cM(e){return Array.from(e.getClientRects())}function Ay(e){return pr(En(e)).left+Fi(e).scrollLeft}function uM(e){const t=En(e),n=Fi(e),r=e.ownerDocument.body,o=Vt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Vt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ay(e);const a=-n.scrollTop;return _t(r).direction==="rtl"&&(i+=Vt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function dM(e,t){const n=It(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=Nc();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function fM(e,t){const n=pr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=nt(e)?ao(e):Hn(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 Oy(e,t,n){let r;if(t==="viewport")r=dM(e,n);else if(t==="document")r=uM(En(e));else if(Le(t))r=fM(t,n);else{const o=Iy(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return _i(r)}function Dy(e,t){const n=Cn(e);return n===t||!Le(n)||Rn(n)?!1:_t(n).position==="fixed"||Dy(n,t)}function hM(e,t){const n=t.get(e);if(n)return n;let r=jn(e,[],!1).filter(a=>Le(a)&&Bn(a)!=="body"),o=null;const s=_t(e).position==="fixed";let i=s?Cn(e):e;for(;Le(i)&&!Rn(i);){const a=_t(i),l=Fc(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||fs(i)&&!l&&Dy(e,i))?r=r.filter(u=>u!==i):o=a,i=Cn(i)}return t.set(e,r),r}function pM(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ki(t)?[]:hM(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Oy(t,u,o);return c.top=Vt(d.top,c.top),c.right=cn(d.right,c.right),c.bottom=cn(d.bottom,c.bottom),c.left=Vt(d.left,c.left),c},Oy(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mM(e){const{width:t,height:n}=Py(e);return{width:t,height:n}}function gM(e,t,n){const r=nt(t),o=En(t),s=n==="fixed",i=pr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Hn(0);if(r||!r&&!s)if((Bn(t)!=="body"||fs(o))&&(a=Fi(t)),r){const d=pr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Ay(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 qc(e){return _t(e).position==="static"}function My(e,t){return!nt(e)||_t(e).position==="fixed"?null:t?t(e):e.offsetParent}function ky(e,t){const n=It(e);if(ki(e))return n;if(!nt(e)){let o=Cn(e);for(;o&&!Rn(o);){if(Le(o)&&!qc(o))return o;o=Cn(o)}return n}let r=My(e,t);for(;r&&xD(r)&&qc(r);)r=My(r,t);return r&&Rn(r)&&qc(r)&&!Fc(r)?n:r||TD(e)||n}const yM=async function(e){const t=this.getOffsetParent||ky,n=this.getDimensions,r=await n(e.floating);return{reference:gM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vM(e){return _t(e).direction==="rtl"}const bM={convertOffsetParentRelativeRectToViewportRelativeRect:lM,getDocumentElement:En,getClippingRect:pM,getOffsetParent:ky,getElementRects:yM,getClientRects:cM,getDimensions:mM,getScale:ao,isElement:Le,isRTL:vM};function wM(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=ro(u),p=ro(o.clientWidth-(c+d)),m=ro(o.clientHeight-(u+f)),g=ro(c),w={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Vt(0,cn(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,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return i(!0),s}function Ri(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=Kc(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?wM(c,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.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?pr(e):null;l&&g();function g(){const v=pr(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(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const xM=rM,TM=oM,SM=tM,EM=sM,Fy=eM,CM=(e,t,n)=>{const r=new Map,o={platform:bM,...n},s={...o.platform,_c:r};return JD(e,t,{...o,platform:s})};var ji=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Hi(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(!Hi(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)&&!Hi(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ny(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ly(e,t){const n=Ny(e);return Math.round(t*n)/n}function _y(e){const t=C.useRef(e);return ji(()=>{t.current=e}),t}function PM(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);Hi(f,r)||h(r);const[p,m]=C.useState(null),[g,v]=C.useState(null),w=C.useCallback(B=>{B!==E.current&&(E.current=B,m(B))},[]),y=C.useCallback(B=>{B!==I.current&&(I.current=B,v(B))},[]),S=s||p,T=i||g,E=C.useRef(null),I=C.useRef(null),A=C.useRef(u),F=l!=null,O=_y(l),_=_y(o),k=C.useCallback(()=>{if(!E.current||!I.current)return;const B={placement:t,strategy:n,middleware:f};_.current&&(B.platform=_.current),CM(E.current,I.current,B).then(H=>{const z={...H,isPositioned:!0};L.current&&!Hi(A.current,z)&&(A.current=z,Lo.flushSync(()=>{d(z)}))})},[f,t,n,_]);ji(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[c]);const L=C.useRef(!1);ji(()=>(L.current=!0,()=>{L.current=!1}),[]),ji(()=>{if(S&&(E.current=S),T&&(I.current=T),S&&T){if(O.current)return O.current(S,T,k);k()}},[S,T,k,O,F]);const P=C.useMemo(()=>({reference:E,floating:I,setReference:w,setFloating:y}),[w,y]),D=C.useMemo(()=>({reference:S,floating:T}),[S,T]),N=C.useMemo(()=>{const B={position:n,left:0,top:0};if(!D.floating)return B;const H=Ly(D.floating,u.x),z=Ly(D.floating,u.y);return a?{...B,transform:"translate("+H+"px, "+z+"px)",...Ny(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:z}},[n,a,D.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:k,refs:P,elements:D,floatingStyles:N}),[u,k,P,D,N])}const IM=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?Fy({element:r.current,padding:o}).fn(n):{}:r?Fy({element:r,padding:o}).fn(n):{}}}},Wi=(e,t)=>({...xM(e),options:[e,t]}),Xc=(e,t)=>({...TM(e),options:[e,t]}),Qc=(e,t)=>({...SM(e),options:[e,t]}),AM=(e,t)=>({...EM(e),options:[e,t]}),Vy=(e,t)=>({...IM(e),options:[e,t]});function Zc(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 $y={...C},OM=$y.useInsertionEffect||(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 OM(()=>{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 Jc="ArrowUp",ps="ArrowDown",lo="ArrowLeft",co="ArrowRight";function zi(e,t,n){return Math.floor(e/t)!==n}function ms(e,t){return t<0||t>=e.current.length}function eu(e,t){return St(e,{disabledIndices:t})}function By(e,t){return St(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function St(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&&Ui(i,a,o));return a}function DM(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===Jc){if(u&&gt(n),c===-1)d=l;else if(d=St(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}ms(e,d)&&(d=c)}if(n.key===ps&&(u&&gt(n),c===-1?d=a:(d=St(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=St(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),ms(e,d)&&(d=c)),r==="both"){const f=ro(c/s);n.key===co&&(u&&gt(n),c%s!==s-1?(d=St(e,{startingIndex:c,disabledIndices:i}),o&&zi(d,s,f)&&(d=St(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=St(e,{startingIndex:c-c%s-1,disabledIndices:i})),zi(d,s,f)&&(d=c)),n.key===lo&&(u&&gt(n),c%s!==0?(d=St(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&zi(d,s,f)&&(d=St(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=St(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),zi(d,s,f)&&(d=c));const h=ro(l/s)===f;ms(e,d)&&(o&&h?d=n.key===lo?l:St(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function MM(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 kM(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 FM(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Ui(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 Ry=0;function zn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ry);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Ry=requestAnimationFrame(s)}var xe=typeof document<"u"?b.useLayoutEffect:b.useEffect;function NM(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 LM(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 jy=C.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function _M(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 xe(()=>{const l=new Map(o);Array.from(l.keys()).sort(NM).forEach((u,d)=>{l.set(u,d)}),LM(o,l)||s(l)},[o]),C.createElement(jy.Provider,{value:C.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function Hy(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=C.useContext(jy),[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 xe(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),xe(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),C.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function uo(){return uo=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},uo.apply(this,arguments)}let Wy=!1,VM=0;const zy=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+VM++;function $M(){const[e,t]=C.useState(()=>Wy?zy():void 0);return xe(()=>{e==null&&t(zy())},[]),C.useEffect(()=>{Wy=!0},[]),e}const fo=$y.useId||$M;let gs;process.env.NODE_ENV!=="production"&&(gs=new Set);function Gi(){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=gs)!=null&&e.has(o))){var s;(s=gs)==null||s.add(o),console.warn(o)}}function BM(){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=gs)!=null&&e.has(o))){var s;(s=gs)==null||s.add(o),console.error(o)}}const Uy=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||Gi("The `ref` prop is required for `FloatingArrow`."));const g=fo(),[v,w]=C.useState(!1);if(xe(()=>{if(!o)return;_t(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const y=c*2,S=y/2,T=i/2*(l/-8+1),E=a/2*l/4,[I,A]=r.split("-"),F=!!f,O=I==="top"||I==="bottom",_=u&&A==="end"?"bottom":"top";let k=u&&A==="end"?"right":"left";u&&v&&(k=A==="end"?"left":"right");const L=(s==null?void 0:s.x)!=null?u||s.x:"",P=(s==null?void 0:s.y)!=null?u||s.y:"",D=f||"M0,0"+(" H"+i)+(" L"+(i-T)+","+(a-E))+(" Q"+i/2+","+a+" "+T+","+(a-E))+" Z",N={top:F?"rotate(180deg)":"",left:F?"rotate(90deg)":"rotate(-90deg)",bottom:F?"":"rotate(180deg)",right:F?"rotate(-90deg)":"rotate(90deg)"}[I];return C.createElement("svg",uo({},m,{"aria-hidden":!0,ref:n,width:F?i:i+y,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[k]:L,[_]:P,[I]:O||F?"100%":"calc(100% - "+y/2+"px)",transform:""+N+(h??""),...p}}),y>0&&C.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:y+(f?0:1),d:D}),C.createElement("path",{stroke:y&&!f?m.fill:"none",d:D}),C.createElement("clipPath",{id:g},C.createElement("rect",{x:-S,y:S*(F?-1:1),width:i+y,height:i})))});function Gy(){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 Yy=C.createContext(null),Ky=C.createContext(null),Un=()=>{var e;return((e=C.useContext(Yy))==null?void 0:e.id)||null},Gn=()=>C.useContext(Ky);function RM(e){const t=fo(),n=Gn(),o=Un();return xe(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function jM(e){const{children:t,id:n}=e,r=Un();return C.createElement(Yy.Provider,{value:C.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function HM(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(()=>Gy())[0];return C.createElement(Ky.Provider,{value:C.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function Yn(e){return"data-floating-ui-"+e}function yt(e){const t=b.useRef(e);return xe(()=>{t.current=e}),t}const qy=Yn("safe-polygon");function tu(e,t,n){return n&&!no(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function Xy(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=Gn(),p=Un(),m=yt(c),g=yt(l),v=yt(n),w=C.useRef(),y=C.useRef(-1),S=C.useRef(),T=C.useRef(-1),E=C.useRef(!0),I=C.useRef(!1),A=C.useRef(()=>{}),F=C.useCallback(()=>{var D;const N=(D=o.current.openEvent)==null?void 0:D.type;return(N==null?void 0:N.includes("mouse"))&&N!=="mousedown"},[o]);C.useEffect(()=>{if(!a)return;function D(N){let{open:B}=N;B||(clearTimeout(y.current),clearTimeout(T.current),E.current=!0)}return s.on("openchange",D),()=>{s.off("openchange",D)}},[a,s]),C.useEffect(()=>{if(!a||!m.current||!n)return;function D(B){F()&&r(!1,B,"hover")}const N=ft(i.floating).documentElement;return N.addEventListener("mouseleave",D),()=>{N.removeEventListener("mouseleave",D)}},[i.floating,n,r,a,m,F]);const O=C.useCallback(function(D,N,B){N===void 0&&(N=!0),B===void 0&&(B="hover");const H=tu(g.current,"close",w.current);H&&!S.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,D,B),H)):N&&(clearTimeout(y.current),r(!1,D,B))},[g,r]),_=at(()=>{A.current(),S.current=void 0}),k=at(()=>{if(I.current){const D=ft(i.floating).body;D.style.pointerEvents="",D.removeAttribute(qy),I.current=!1}});C.useEffect(()=>{if(!a)return;function D(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function N(M){if(clearTimeout(y.current),E.current=!1,u&&!no(w.current)||d>0&&!tu(g.current,"open"))return;const R=tu(g.current,"open",w.current);R?y.current=window.setTimeout(()=>{v.current||r(!0,M,"hover")},R):r(!0,M,"hover")}function B(M){if(D())return;A.current();const R=ft(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:M.clientX,y:M.clientY,onClose(){k(),_(),O(M,!0,"safe-polygon")}});const ee=S.current;R.addEventListener("mousemove",ee),A.current=()=>{R.removeEventListener("mousemove",ee)};return}(w.current==="touch"?!Xe(i.floating,M.relatedTarget):!0)&&O(M)}function H(M){D()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:h,x:M.clientX,y:M.clientY,onClose(){k(),_(),O(M)}})(M))}if(Le(i.domReference)){var z;const M=i.domReference;return n&&M.addEventListener("mouseleave",H),(z=i.floating)==null||z.addEventListener("mouseleave",H),f&&M.addEventListener("mousemove",N,{once:!0}),M.addEventListener("mouseenter",N),M.addEventListener("mouseleave",B),()=>{var R;n&&M.removeEventListener("mouseleave",H),(R=i.floating)==null||R.removeEventListener("mouseleave",H),f&&M.removeEventListener("mousemove",N),M.removeEventListener("mouseenter",N),M.removeEventListener("mouseleave",B)}}},[i,a,e,u,d,f,O,_,k,r,n,v,h,g,m,o]),xe(()=>{var D;if(a&&n&&(D=m.current)!=null&&D.__options.blockPointerEvents&&F()){const B=ft(i.floating).body;B.setAttribute(qy,""),B.style.pointerEvents="none",I.current=!0;const H=i.floating;if(Le(i.domReference)&&H){var N;const z=i.domReference,M=h==null||(N=h.nodesRef.current.find(R=>R.id===p))==null||(N=N.context)==null?void 0:N.elements.floating;return M&&(M.style.pointerEvents=""),z.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{z.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,i,h,m,F]),xe(()=>{n||(w.current=void 0,_(),k())},[n,_,k]),C.useEffect(()=>()=>{_(),clearTimeout(y.current),clearTimeout(T.current),k()},[a,i.domReference,_,k]);const L=C.useMemo(()=>{function D(N){w.current=N.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(N){const{nativeEvent:B}=N;function H(){!E.current&&!v.current&&r(!0,B,"hover")}u&&!no(w.current)||n||d===0||(clearTimeout(T.current),w.current==="touch"?H():T.current=window.setTimeout(H,d))}}},[u,r,n,v,d]),P=C.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(D){O(D.nativeEvent,!1)}}),[O]);return C.useMemo(()=>a?{reference:L,floating:P}:{},[a,L,P])}function WM(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 mr(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 zM(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),mr(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let ho=new WeakMap,Yi=new WeakSet,Ki={},nu=0;const UM=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Qy=e=>e&&(e.host||Qy(e.parentNode)),GM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Qy(n);return e.contains(r)?r:null}).filter(n=>n!=null);function YM(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=GM(t,e),a=new Set,l=new Set(i),c=[];Ki[o]||(Ki[o]=new WeakMap);const u=Ki[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(Bn(p)!=="script")if(a.has(p))f(p);else{const m=s?p.getAttribute(s):null,g=m!==null&&m!=="false",v=(ho.get(p)||0)+1,w=(u.get(p)||0)+1;ho.set(p,v),u.set(p,w),c.push(p),v===1&&g&&Yi.add(p),w===1&&p.setAttribute(o,""),!g&&s&&p.setAttribute(s,"true")}})}return nu++,()=>{c.forEach(h=>{const p=(ho.get(h)||0)-1,m=(u.get(h)||0)-1;ho.set(h,p),u.set(h,m),p||(!Yi.has(h)&&s&&h.removeAttribute(s),Yi.delete(h)),m||h.removeAttribute(o)}),nu--,nu||(ho=new WeakMap,ho=new WeakMap,Yi=new WeakSet,Ki={})}}function Zy(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ft(e[0]).body;return YM(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const po=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Jy(e,t){const n=hs(e,po());t==="prev"&&n.reverse();const r=n.indexOf(Ut(ft(e)));return n.slice(r+1)[0]}function ev(){return Jy(document.body,"next")}function tv(){return Jy(document.body,"prev")}function ys(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Xe(n,r)}function KM(e){hs(e,po()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function qM(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 XM(e,t,n){const r=e.indexOf(t);function o(i){const a=Yn("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||Xe(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const ru={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 QM;function nv(e){e.key==="Tab"&&(e.target,clearTimeout(QM))}const qi=C.forwardRef(function(t,n){const[r,o]=C.useState();xe(()=>($c()&&o("button"),document.addEventListener("keydown",nv),()=>{document.removeEventListener("keydown",nv)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Yn("focus-guard")]:"",style:ru};return C.createElement("span",uo({},t,s))}),rv=C.createContext(null),ov=Yn("portal");function ZM(e){e===void 0&&(e={});const{id:t,root:n}=e,r=fo(),o=sv(),[s,i]=C.useState(null),a=C.useRef(null);return xe(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),xe(()=>{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(ov,""),l.appendChild(c),a.current=c,i(c)},[t,r]),xe(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Le(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(ov,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function mo(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=ZM({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&&ys(p)&&(p.type==="focusin"?qM:KM)(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(rv.Provider,{value:C.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},f&&s&&C.createElement(qi,{"data-type":"outside",ref:l,onFocus:h=>{if(ys(h,s)){var p;(p=u.current)==null||p.focus()}else{const m=tv()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus()}}}),f&&s&&C.createElement("span",{"aria-owns":s.id,style:ru}),s&&Lo.createPortal(t,s),f&&s&&C.createElement(qi,{"data-type":"outside",ref:c,onFocus:h=>{if(ys(h,s)){var p;(p=d.current)==null||p.focus()}else{const m=ev()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,h.nativeEvent))}}}))}const sv=()=>C.useContext(rv),iv=20;let gr=[];function ou(e){gr=gr.filter(n=>n.isConnected);let t=e;if(!(!t||Bn(t)==="body")){if(!ZD(t,po())){const n=hs(t,po())[0];n&&(t=n)}gr.push(t),gr.length>iv&&(gr=gr.slice(-iv))}}function av(){return gr.slice().reverse().find(e=>e.isConnected)}const JM=C.forwardRef(function(t,n){return C.createElement("button",uo({},t,{type:"button",ref:n,tabIndex:-1,style:ru}))});function vs(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:w,elements:{domReference:y,floating:S}}=t,T=typeof i=="number"&&i<0,E=yy(y)&&T,I=UM()?s:!0,A=yt(o),F=yt(i),O=yt(a),_=Gn(),k=sv(),L=C.useRef(null),P=C.useRef(null),D=C.useRef(!1),N=C.useRef(!1),B=C.useRef(-1),H=k!=null,z=S==null?void 0:S.firstElementChild,M=(z==null?void 0:z.id)===w?z:S,R=at(function(G){return G===void 0&&(G=M),G?hs(G,po()):[]}),K=at(G=>{const V=R(G);return A.current.map(j=>y&&j==="reference"?y:M&&j==="floating"?M:V).filter(Boolean).flat()});C.useEffect(()=>{if(r||!c)return;function G(j){if(j.key==="Tab"){Xe(M,Ut(ft(M)))&&R().length===0&&!E&&gt(j);const W=K(),U=ln(j);A.current[0]==="reference"&&U===y&&(gt(j),j.shiftKey?zn(W[W.length-1]):zn(W[1])),A.current[1]==="floating"&&U===M&&j.shiftKey&&(gt(j),zn(W[0]))}}const V=ft(M);return V.addEventListener("keydown",G),()=>{V.removeEventListener("keydown",G)}},[r,y,M,c,A,E,R,K]),C.useEffect(()=>{if(r||!S)return;function G(V){const j=ln(V),U=R().indexOf(j);U!==-1&&(B.current=U)}return S.addEventListener("focusin",G),()=>{S.removeEventListener("focusin",G)}},[r,S,R]),C.useEffect(()=>{if(r||!d)return;function G(){N.current=!0,setTimeout(()=>{N.current=!1})}function V(j){const W=j.relatedTarget;queueMicrotask(()=>{const U=!(Xe(y,W)||Xe(S,W)||Xe(W,S)||Xe(k==null?void 0:k.portalNode,W)||W!=null&&W.hasAttribute(Yn("focus-guard"))||_&&(mr(_.nodesRef.current,p).find(q=>{var re,$;return Xe((re=q.context)==null?void 0:re.elements.floating,W)||Xe(($=q.context)==null?void 0:$.elements.domReference,W)})||WM(_.nodesRef.current,p).find(q=>{var re,$;return((re=q.context)==null?void 0:re.elements.floating)===W||(($=q.context)==null?void 0:$.elements.domReference)===W})));if(l&&U&&Ut(ft(M))===ft(M).body){nt(M)&&(M==null||M.focus());const q=B.current,re=R(),$=re[q]||re[re.length-1]||M;nt($)&&$.focus()}(E||!c)&&W&&U&&!N.current&&W!==av()&&(D.current=!0,m(!1,j))})}if(S&&nt(y))return y.addEventListener("focusout",V),y.addEventListener("pointerdown",G),S.addEventListener("focusout",V),()=>{y.removeEventListener("focusout",V),y.removeEventListener("pointerdown",G),S.removeEventListener("focusout",V)}},[r,y,S,M,c,p,_,k,m,d,l,R,E]),C.useEffect(()=>{var G;if(r)return;const V=Array.from((k==null||(G=k.portalNode)==null?void 0:G.querySelectorAll("["+Yn("portal")+"]"))||[]);if(S){const j=[S,...V,L.current,P.current,A.current.includes("reference")||E?y:null].filter(U=>U!=null),W=c||E?Zy(j,I,!I):Zy(j);return()=>{W()}}},[r,y,S,c,A,k,E,I]),xe(()=>{if(r||!nt(M))return;const G=ft(M),V=Ut(G);queueMicrotask(()=>{const j=K(M),W=F.current,U=(typeof W=="number"?j[W]:W.current)||M,q=Xe(M,V);!T&&!q&&f&&zn(U,{preventScroll:U===M})})},[r,f,M,T,K,F]),xe(()=>{if(r||!M)return;let G=!1;const V=ft(M),j=Ut(V);let U=v.current.openEvent;const q=h.domReference.current;ou(j);function re($){let{open:le,reason:me,event:we,nested:ze}=$;le&&(U=we),me==="escape-key"&&h.domReference.current&&ou(h.domReference.current),me==="hover"&&we.type==="mouseleave"&&(D.current=!0),me==="outside-press"&&(ze?(D.current=!1,G=!0):D.current=!(my(we)||Vc(we)))}return g.on("openchange",re),()=>{g.off("openchange",re);const $=Ut(V),le=Xe(S,$)||_&&mr(_.nodesRef.current,p).some(se=>{var ve;return Xe((ve=se.context)==null?void 0:ve.elements.floating,$)});(le||U&&["click","mousedown"].includes(U.type))&&h.domReference.current&&ou(h.domReference.current);const we=q||j,ze=hs(ft(we).body,po());queueMicrotask(()=>{let se=av();!se&&nt(we)&&S&&(se=XM(ze,we,S)),O.current&&!D.current&&nt(se)&&(!(se!==$&&$!==V.body)||le)&&se.focus({preventScroll:G})})}},[r,S,M,O,v,h,g,_,p]),xe(()=>{if(!r&&k)return k.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{k.setFocusManagerState(null)}},[r,k,c,f,m,h,d]),xe(()=>{if(r||!M||typeof MutationObserver!="function"||T)return;const G=()=>{const j=M.getAttribute("tabindex"),W=R(),U=Ut(ft(S)),q=W.indexOf(U);q!==-1&&(B.current=q),A.current.includes("floating")||U!==h.domReference.current&&W.length===0?j!=="0"&&M.setAttribute("tabindex","0"):j!=="-1"&&M.setAttribute("tabindex","-1")};G();const V=new MutationObserver(G);return V.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{V.disconnect()}},[r,S,M,h,A,R,T]);function ee(G){return r||!u||!c?null:C.createElement(JM,{ref:G==="start"?L:P,onClick:V=>m(!1,V.nativeEvent)},typeof u=="string"?u:"Dismiss")}const Z=!r&&I&&(c?!E:!0)&&(H||c);return C.createElement(C.Fragment,null,Z&&C.createElement(qi,{"data-type":"inside",ref:k==null?void 0:k.beforeInsideRef,onFocus:G=>{if(c){const j=K();zn(o[0]==="reference"?j[0]:j[j.length-1])}else if(k!=null&&k.preserveTabOrder&&k.portalNode)if(D.current=!1,ys(G,k.portalNode)){const j=ev()||y;j==null||j.focus()}else{var V;(V=k.beforeOutsideRef.current)==null||V.focus()}}}),!E&&ee("start"),n,ee("end"),Z&&C.createElement(qi,{"data-type":"inside",ref:k==null?void 0:k.afterInsideRef,onFocus:G=>{if(c)zn(K()[0]);else if(k!=null&&k.preserveTabOrder&&k.portalNode)if(d&&(D.current=!0),ys(G,k.portalNode)){const j=tv()||y;j==null||j.focus()}else{var V;(V=k.afterOutsideRef.current)==null||V.focus()}}}))}const su=new Set,ek=C.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=fo();return xe(()=>{if(!r)return;su.add(s);const i=/iP(hone|ad|od)|iOS/.test(_c()),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()=>{su.delete(s),su.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,f)))}},[s,r]),C.createElement("div",uo({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function lv(e){return nt(e.target)&&e.target.tagName==="BUTTON"}function cv(e){return jc(e)}function bs(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||lv(p))&&(p.key===" "&&!cv(s)&&(p.preventDefault(),f.current=!0),p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||lv(p)||cv(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 tk(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 uv(e){return e!=null&&e.clientX!=null}function nk(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,I)=>{d.current||r.current.openEvent&&!uv(r.current.openEvent)||i.setPositionReference(tk(s,{x:E,y:I,axis:l,dataRef:r,pointerType:h}))}),w=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=It(o);function I(A){const F=ln(A);Xe(o,F)?(E.removeEventListener("mousemove",I),f.current=null):v(A.clientX,A.clientY)}if(!r.current.openEvent||uv(r.current.openEvent)){E.addEventListener("mousemove",I);const A=()=>{E.removeEventListener("mousemove",I),f.current=null};return f.current=A,A}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]),xe(()=>{a&&(c!=null||u!=null)&&(d.current=!1,v(c,u))},[a,c,u,v]);const T=C.useMemo(()=>{function E(I){let{pointerType:A}=I;p(A)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:w,onMouseEnter:w}},[w]);return C.useMemo(()=>a?{reference:T}:{},[a,T])}const rk={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ok={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},dv=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 go(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=Gn(),g=at(typeof l=="function"?l:()=>!1),v=typeof l=="function"?g:l,w=C.useRef(!1),y=C.useRef(!1),{escapeKey:S,outsidePress:T}=dv(h),{escapeKey:E,outsidePress:I}=dv(p),A=at(P=>{var D;if(!n||!i||!a||P.key!=="Escape")return;const N=(D=s.current.floatingContext)==null?void 0:D.nodeId,B=m?mr(m.nodesRef.current,N):[];if(!S&&(P.stopPropagation(),B.length>0)){let H=!0;if(B.forEach(z=>{var M;if((M=z.context)!=null&&M.open&&!z.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,ED(P)?P.nativeEvent:P,"escape-key")}),F=at(P=>{var D;const N=()=>{var B;A(P),(B=ln(P))==null||B.removeEventListener("keydown",N)};(D=ln(P))==null||D.addEventListener("keydown",N)}),O=at(P=>{var D;const N=w.current;w.current=!1;const B=y.current;if(y.current=!1,c==="click"&&B||N||typeof v=="function"&&!v(P))return;const H=ln(P),z="["+Yn("inert")+"]",M=ft(o.floating).querySelectorAll(z);let R=Le(H)?H:null;for(;R&&!Rn(R);){const G=Cn(R);if(Rn(G)||!Le(G))break;R=G}if(M.length&&Le(H)&&!CD(H)&&!Xe(H,o.floating)&&Array.from(M).every(G=>!Xe(R,G)))return;if(nt(H)&&L){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,V=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let j=V&&P.offsetX>H.clientWidth;if(V&&_t(H).direction==="rtl"&&(j=P.offsetX<=H.offsetWidth-H.clientWidth),j||G&&P.offsetY>H.clientHeight)return}const K=(D=s.current.floatingContext)==null?void 0:D.nodeId,ee=m&&mr(m.nodesRef.current,K).some(G=>{var V;return Rc(P,(V=G.context)==null?void 0:V.elements.floating)});if(Rc(P,o.floating)||Rc(P,o.domReference)||ee)return;const Z=m?mr(m.nodesRef.current,K):[];if(Z.length>0){let G=!0;if(Z.forEach(V=>{var j;if((j=V.context)!=null&&j.open&&!V.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,P,"outside-press")}),_=at(P=>{var D;const N=()=>{var B;O(P),(B=ln(P))==null||B.removeEventListener(c,N)};(D=ln(P))==null||D.addEventListener(c,N)});C.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=T;function P(B){r(!1,B,"ancestor-scroll")}const D=ft(o.floating);a&&D.addEventListener("keydown",E?F:A,E),v&&D.addEventListener(c,I?_:O,I);let N=[];return f&&(Le(o.domReference)&&(N=jn(o.domReference)),Le(o.floating)&&(N=N.concat(jn(o.floating))),!Le(o.reference)&&o.reference&&o.reference.contextElement&&(N=N.concat(jn(o.reference.contextElement)))),N=N.filter(B=>{var H;return B!==((H=D.defaultView)==null?void 0:H.visualViewport)}),N.forEach(B=>{B.addEventListener("scroll",P,{passive:!0})}),()=>{a&&D.removeEventListener("keydown",E?F:A,E),v&&D.removeEventListener(c,I?_:O,I),N.forEach(B=>{B.removeEventListener("scroll",P)})}},[s,o,a,v,c,n,r,f,i,S,T,A,E,F,O,I,_]),C.useEffect(()=>{w.current=!1},[v,c]);const k=C.useMemo(()=>({onKeyDown:A,[rk[d]]:P=>{u&&r(!1,P.nativeEvent,"reference-press")}}),[A,r,u,d]),L=C.useMemo(()=>({onKeyDown:A,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[ok[c]]:()=>{w.current=!0}}),[A,c]);return C.useMemo(()=>i?{reference:k,floating:L}:{},[i,k,L])}function sk(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=fo(),s=C.useRef({}),[i]=C.useState(()=>Gy()),a=Un()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Le(h)&&BM("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 yo(e){e===void 0&&(e={});const{nodeId:t}=e,n=sk({...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=Gn();xe(()=>{u&&(d.current=u)},[u]);const h=PM({...e,elements:{...o,...a&&{reference:a}}}),p=C.useCallback(y=>{const S=Le(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(S),h.refs.setReference(S)},[h.refs]),m=C.useCallback(y=>{(Le(y)||y===null)&&(d.current=y,i(y)),(Le(h.refs.reference.current)||h.refs.reference.current===null||y!==null&&!Le(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]),w=C.useMemo(()=>({...h,...r,refs:g,elements:v,nodeId:t}),[h,g,v,t,r]);return xe(()=>{r.dataRef.current.floatingContext=w;const y=f==null?void 0:f.nodesRef.current.find(S=>S.id===t);y&&(y.context=w)}),C.useMemo(()=>({...h,context:w,refs:g,elements:v}),[h,g,v,w])}function ik(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=It(i.domReference);function p(){!n&&nt(i.domReference)&&i.domReference===Ut(ft(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){Vc(h.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const p=ln(h.nativeEvent);if(l&&Le(p))try{if($c()&&gy())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!d.current&&!jc(p))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const p=h.relatedTarget,m=h.nativeEvent,g=Le(p)&&p.hasAttribute(Yn("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const w=Ut(i.domReference?i.domReference.ownerDocument:document);!p&&w===i.domReference||Xe((v=s.current.floatingContext)==null?void 0:v.refs.floating.current,w)||Xe(i.domReference,w)||g||r(!1,m,"focus")})}}),[s,i.domReference,r,l]);return C.useMemo(()=>a?{reference:f}:{},[a,f])}const fv="active",hv="selected";function iu(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[fv]:i,[hv]: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&&[fv,hv].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 vo(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=>iu(a,e,"reference"),t),s=C.useCallback(a=>iu(a,e,"floating"),n),i=C.useCallback(a=>iu(a,e,"item"),r);return C.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let pv=!1;function Xi(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function mv(e,t){return Xi(t,e===Jc||e===ps,e===lo||e===co)}function au(e,t,n){return Xi(t,e===ps,n?e===lo:e===co)||e==="Enter"||e===" "||e===""}function ak(e,t,n){return Xi(t,n?e===lo:e===co,e===ps)}function gv(e,t,n){return Xi(t,n?e===co:e===lo,e===Jc)}function yv(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:w=void 0,orientation:y="vertical",cols:S=1,scrollItemIntoView:T=!0,virtualItemRef:E,itemSizes:I,dense:A=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||Gi("`useListNavigation` looping must be enabled to allow escaping."),p||Gi("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&S>1&&Gi("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const F=Un(),O=Gn(),_=at(a),k=C.useRef(m),L=C.useRef(c??-1),P=C.useRef(null),D=C.useRef(!0),N=C.useRef(_),B=C.useRef(!!o.floating),H=C.useRef(n),z=C.useRef(!1),M=C.useRef(!1),R=yt(w),K=yt(n),ee=yt(T),Z=yt(o.floating),G=yt(c),[V,j]=C.useState(),[W,U]=C.useState(),q=at(function(se,ve,ie){ie===void 0&&(ie=!1);function Te(Se){p?(j(Se.id),O==null||O.events.emit("virtualfocus",Se),E&&(E.current=Se)):zn(Se,{preventScroll:!0,sync:gy()&&$c()?pv||z.current:!1})}const ot=se.current[ve.current];ot&&Te(ot),requestAnimationFrame(()=>{const Se=se.current[ve.current]||ot;if(!Se)return;ot||Te(Se);const st=ee.current;st&&$&&(ie||!D.current)&&(Se.scrollIntoView==null||Se.scrollIntoView(typeof st=="boolean"?{block:"nearest",inline:"nearest"}:st))})});xe(()=>{document.createElement("div").focus({get preventScroll(){return pv=!0,!1}})},[]),xe(()=>{l&&(n&&o.floating?k.current&&c!=null&&(M.current=!0,L.current=c,_(c)):B.current&&(L.current=-1,N.current(null)))},[l,n,o.floating,c,_]),xe(()=>{if(l&&n&&o.floating)if(i==null){if(z.current=!1,G.current!=null)return;if(B.current&&(L.current=-1,q(s,L)),(!H.current||!B.current)&&k.current&&(P.current!=null||k.current===!0&&P.current==null)){let se=0;const ve=()=>{s.current[0]==null?(se<2&&(se?requestAnimationFrame:queueMicrotask)(ve),se++):(L.current=P.current==null||au(P.current,y,h)||f?eu(s,R.current):By(s,R.current),P.current=null,_(L.current))};ve()}}else ms(s,i)||(L.current=i,q(s,L,M.current),M.current=!1)},[l,n,o.floating,i,G,f,s,y,h,_,q,R]),xe(()=>{var se;if(!l||o.floating||!O||p||!B.current)return;const ve=O.nodesRef.current,ie=(se=ve.find(Se=>Se.id===F))==null||(se=se.context)==null?void 0:se.elements.floating,Te=Ut(ft(o.floating)),ot=ve.some(Se=>Se.context&&Xe(Se.context.elements.floating,Te));ie&&!ot&&D.current&&ie.focus({preventScroll:!0})},[l,o.floating,O,F,p]),xe(()=>{if(!l||!O||!p||F)return;function se(ve){U(ve.id),E&&(E.current=ve)}return O.events.on("virtualfocus",se),()=>{O.events.off("virtualfocus",se)}},[l,O,p,F,E]),xe(()=>{N.current=_,B.current=!!o.floating}),xe(()=>{n||(P.current=null)},[n]),xe(()=>{H.current=n},[n]);const re=i!=null,$=C.useMemo(()=>{function se(ie){if(!n)return;const Te=s.current.indexOf(ie);Te!==-1&&_(Te)}return{onFocus(ie){let{currentTarget:Te}=ie;se(Te)},onClick:ie=>{let{currentTarget:Te}=ie;return Te.focus({preventScroll:!0})},...g&&{onMouseMove(ie){let{currentTarget:Te}=ie;se(Te)},onPointerLeave(ie){let{pointerType:Te}=ie;!D.current||Te==="touch"||(L.current=-1,q(s,L),_(null),p||zn(Z.current,{preventScroll:!0}))}}}},[n,Z,q,g,s,_,p]),le=at(se=>{if(D.current=!1,z.current=!0,!K.current&&se.currentTarget===Z.current)return;if(f&&gv(se.key,y,h)){gt(se),r(!1,se.nativeEvent,"list-navigation"),nt(o.domReference)&&!p&&o.domReference.focus();return}const ve=L.current,ie=eu(s,w),Te=By(s,w);if(se.key==="Home"&&(gt(se),L.current=ie,_(L.current)),se.key==="End"&&(gt(se),L.current=Te,_(L.current)),S>1){const ot=I||Array.from({length:s.current.length},()=>({width:1,height:1})),Se=MM(ot,S,A),st=Se.findIndex(oe=>oe!=null&&!Ui(s.current,oe,w)),J=Se.reduce((oe,Ee,We)=>Ee!=null&&!Ui(s.current,Ee,w)?We:oe,-1);if(L.current=Se[DM({current:Se.map(oe=>oe!=null?s.current[oe]:null)},{event:se,orientation:y,loop:d,cols:S,disabledIndices:FM([...w||s.current.map((oe,Ee)=>Ui(s.current,Ee)?Ee:void 0),void 0],Se),minIndex:st,maxIndex:J,prevIndex:kM(L.current>Te?ie:L.current,ot,Se,S,se.key===ps?"bl":se.key===co?"tr":"tl"),stopEvent:!0})],_(L.current),y==="both")return}if(mv(se.key,y)){if(gt(se),n&&!p&&Ut(se.currentTarget.ownerDocument)===se.currentTarget){L.current=au(se.key,y,h)?ie:Te,_(L.current);return}au(se.key,y,h)?d?L.current=ve>=Te?u&&ve!==s.current.length?-1:ie:St(s,{startingIndex:ve,disabledIndices:w}):L.current=Math.min(Te,St(s,{startingIndex:ve,disabledIndices:w})):d?L.current=ve<=ie?u&&ve!==-1?s.current.length:Te:St(s,{startingIndex:ve,decrement:!0,disabledIndices:w}):L.current=Math.max(ie,St(s,{startingIndex:ve,decrement:!0,disabledIndices:w})),ms(s,L.current)?_(null):_(L.current)}}),me=C.useMemo(()=>p&&n&&re&&{"aria-activedescendant":W||V},[p,n,re,W,V]),we=C.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!yy(o.domReference)&&me,onKeyDown:le,onPointerMove(){D.current=!0}}),[me,le,o.domReference,y]),ze=C.useMemo(()=>{function se(ie){m==="auto"&&my(ie.nativeEvent)&&(k.current=!0)}function ve(ie){k.current=m,m==="auto"&&Vc(ie.nativeEvent)&&(k.current=!0)}return{...me,onKeyDown(ie){D.current=!1;const Te=ie.key.indexOf("Arrow")===0,ot=ak(ie.key,y,h),Se=gv(ie.key,y,h),st=mv(ie.key,y),J=(f?ot:st)||ie.key==="Enter"||ie.key.trim()==="";if(p&&n){const vt=O==null?void 0:O.nodesRef.current.find(Ot=>Ot.parentId==null),Pt=O&&vt?zM(O.nodesRef.current,vt.id):null;if(Te&&Pt&&E){const Ot=new KeyboardEvent("keydown",{key:ie.key,bubbles:!0});if(ot||Se){var oe,Ee;const Sr=((oe=Pt.context)==null?void 0:oe.elements.domReference)===ie.currentTarget,Fo=Se&&!Sr?(Ee=Pt.context)==null?void 0:Ee.elements.domReference:ot?s.current.find(No=>(No==null?void 0:No.id)===V):null;Fo&&(gt(ie),Fo.dispatchEvent(Ot),U(void 0))}if(st&&Pt.context&&Pt.context.open&&Pt.parentId&&ie.currentTarget!==Pt.context.elements.domReference){var We;gt(ie),(We=Pt.context.elements.domReference)==null||We.dispatchEvent(Ot);return}}return le(ie)}if(!(!n&&!v&&Te)){if(J&&(P.current=f&&st?null:ie.key),f){ot&&(gt(ie),n?(L.current=eu(s,R.current),_(L.current)):r(!0,ie.nativeEvent,"list-navigation"));return}st&&(c!=null&&(L.current=c),gt(ie),!n&&v?r(!0,ie.nativeEvent,"list-navigation"):le(ie),n&&_(L.current))}},onFocus(){n&&!p&&_(null)},onPointerDown:ve,onMouseDown:se,onClick:se}},[V,me,le,R,m,s,f,_,r,n,v,y,h,c,O,p,E]);return C.useMemo(()=>l?{reference:ze,floating:we,item:$}:{},[l,ze,we,$])}const lk=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bo(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=lk.get(i))!=null?n:i,l=fo(),u=Un()!=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 vv=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function wo(e,t){return typeof e=="function"?e(t):e}function ck(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 uk(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=ck(n,i);return!c&&a==="close"&&l("unmounted"),xe(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function dk(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(()=>({...wo(s,c),...wo(n,c)})),{isMounted:m,status:g}=uk(e,{duration:i}),v=yt(n),w=yt(r),y=yt(o),S=yt(s);return xe(()=>{const T=wo(v.current,c),E=wo(y.current,c),I=wo(S.current,c),A=wo(w.current,c)||Object.keys(T).reduce((F,O)=>(F[O]="",F),{});if(g==="initial"&&p(F=>({transitionProperty:F.transitionProperty,...I,...T})),g==="open"&&p({transitionProperty:Object.keys(A).map(vv).join(","),transitionDuration:d+"ms",...I,...A}),g==="close"){const F=E||T;p({transitionProperty:Object.keys(F).map(vv).join(","),transitionDuration:f+"ms",...I,...F})}},[f,y,v,w,S,d,g,c]),{isMounted:m,styles:h}}function fk(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),w=at(a),y=at(l),S=yt(u),T=yt(f);xe(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),xe(()=>{if(r&&m.current===""){var O;g.current=(O=h??i)!=null?O:-1}},[r,h,i]);const E=at(O=>{O?o.current.typing||(o.current.typing=O,y(O)):o.current.typing&&(o.current.typing=O,y(O))}),I=at(O=>{function _(N,B,H){const z=S.current?S.current(B,H):B.find(M=>(M==null?void 0:M.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return z?N.indexOf(z):-1}const k=s.current;if(m.current.length>0&&m.current[0]!==" "&&(_(k,k,m.current)===-1?E(!1):O.key===" "&&gt(O)),k==null||T.current.includes(O.key)||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;r&&O.key!==" "&&(gt(O),E(!0)),k.every(N=>{var B,H;return N?((B=N[0])==null?void 0:B.toLocaleLowerCase())!==((H=N[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===O.key&&(m.current="",g.current=v.current),m.current+=O.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=v.current,E(!1)},d);const P=g.current,D=_(k,[...k.slice((P||0)+1),...k.slice(0,(P||0)+1)],m.current);D!==-1?(w(D),v.current=D):O.key!==" "&&(m.current="",E(!1))}),A=C.useMemo(()=>({onKeyDown:I}),[I]),F=C.useMemo(()=>({onKeyDown:I,onKeyUp(O){O.key===" "&&E(!1)}}),[I,E]);return C.useMemo(()=>c?{reference:A,floating:F}:{},[c,A,F])}function bv(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 hk(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function wv(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,w=Math.sqrt(m*m+g*g)/p;return i=d,a=f,l=h,w}const u=d=>{let{x:f,y:h,placement:p,elements:m,onClose:g,nodeId:v,tree:w}=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:I}=S,A=[E,I],F=ln(S),O=S.type==="mouseleave",_=Xe(m.floating,F),k=Xe(m.domReference,F),L=m.domReference.getBoundingClientRect(),P=m.floating.getBoundingClientRect(),D=p.split("-")[0],N=f>P.right-P.width/2,B=h>P.bottom-P.height/2,H=hk(A,L),z=P.width>L.width,M=P.height>L.height,R=(z?L:P).left,K=(z?L:P).right,ee=(M?L:P).top,Z=(M?L:P).bottom;if(_&&(s=!0,!O))return;if(k&&(s=!1),k&&!O){s=!0;return}if(O&&Le(S.relatedTarget)&&Xe(m.floating,S.relatedTarget)||w&&mr(w.nodesRef.current,v).some(j=>{let{context:W}=j;return W==null?void 0:W.open}))return;if(D==="top"&&h>=L.bottom-1||D==="bottom"&&h<=L.top+1||D==="left"&&f>=L.right-1||D==="right"&&f<=L.left+1)return T();let G=[];switch(D){case"top":G=[[R,L.top+1],[R,P.bottom-1],[K,P.bottom-1],[K,L.top+1]];break;case"bottom":G=[[R,P.top+1],[R,L.bottom-1],[K,L.bottom-1],[K,P.top+1]];break;case"left":G=[[P.right-1,Z],[P.right-1,ee],[L.left+1,ee],[L.left+1,Z]];break;case"right":G=[[L.right-1,Z],[L.right-1,ee],[P.left+1,ee],[P.left+1,Z]];break}function V(j){let[W,U]=j;switch(D){case"top":{const q=[z?W+t/2:N?W+t*4:W-t*4,U+t+1],re=[z?W-t/2:N?W+t*4:W-t*4,U+t+1],$=[[P.left,N||z?P.bottom-t:P.top],[P.right,N?z?P.bottom-t:P.top:P.bottom-t]];return[q,re,...$]}case"bottom":{const q=[z?W+t/2:N?W+t*4:W-t*4,U-t],re=[z?W-t/2:N?W+t*4:W-t*4,U-t],$=[[P.left,N||z?P.top+t:P.bottom],[P.right,N?z?P.top+t:P.bottom:P.top+t]];return[q,re,...$]}case"left":{const q=[W+t+1,M?U+t/2:B?U+t*4:U-t*4],re=[W+t+1,M?U-t/2:B?U+t*4:U-t*4];return[...[[B||M?P.right-t:P.left,P.top],[B?M?P.right-t:P.left:P.right-t,P.bottom]],q,re]}case"right":{const q=[W-t,M?U+t/2:B?U+t*4:U-t*4],re=[W-t,M?U-t/2:B?U+t*4:U-t*4],$=[[B||M?P.left+t:P.right,P.top],[B?M?P.left+t:P.right:P.left+t,P.bottom]];return[q,re,...$]}}}if(!bv([E,I],G)){if(s&&!H)return T();if(!O&&r){const j=c(S.clientX,S.clientY);if(j!==null&&j<.1)return T()}bv([E,I],V([f,h]))?!s&&r&&(o=window.setTimeout(T,40)):T()}}};return u.__options={blockPointerEvents:n},u}const xo=e=>{const t=b.useId(),[n,r]=b.useState(e.open),o=b.useRef(null),s=b.useMemo(()=>[Wi(10),Qc({fallbackAxisSideDirection:"end"}),Xc(),Vy({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=yo({open:n,middleware:s,transform:!0,whileElementsMounted:Ri,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=bs(l),u=go(l),d=bo(l),{getReferenceProps:f,getFloatingProps:h}=vo([c,u,d]);return x.jsxs(b.Fragment,{children:[x.jsx("button",{ref:i.setReference,...f(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(mo,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(vs,{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(Uy,{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]})})})]})},pk=e=>{const t=b.useRef(null),n=b.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=b.useState(!1),{context:a,refs:l}=yo({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=bs(a),u=bo(a),d=go(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:f,getReferenceProps:h}=vo([c,u,d]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(Lr,{...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(Yr,{children:s?x.jsx(mo,{root:t,children:x.jsx(vs,{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})]})},xv=300,mk=500,Tv=(e="")=>Me("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),lu=b.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),Sv=b.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const l=Un(),c=l!==null,[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(null),g=b.useRef([]),v=b.useRef([]),w=b.useContext(lu),y=Gn(),S=RM(),T=Hy(),{floatingStyles:E,refs:I,context:A}=yo({nodeId:S,open:u,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:Ri,placement:c?"right":"bottom-start",middleware:[Wi({mainAxis:c?0:4,alignmentAxis:c?-4:0}),Qc(),Xc()]}),F=bo(A,{role:"menu",enabled:!0}),O=go(A,{bubbles:!0}),_=Xy(A,{enabled:n,delay:{open:xv},handleClose:wv({blockPointerEvents:!0})}),k=bs(A,{event:"mousedown",toggle:!c,ignoreMouse:c,keyboardHandlers:!0}),L=yv(A,{loop:!0,activeIndex:p,virtual:!0,nested:c,allowEscape:!0,listRef:g,scrollItemIntoView:!0,onNavigate:m}),P=fk(A,{activeIndex:p,listRef:v,resetMs:mk,onMatch:u?m:void 0}),{getReferenceProps:D,getFloatingProps:N,getItemProps:B}=vo([_,k,F,O,L,P]);b.useEffect(()=>{if(!y)return;const z=()=>d(!1),M=R=>{R.nodeId!==S&&R.parentId===l&&d(!1)};return y.events.on("click",z),y.events.on("menuopen",M),()=>{y.events.off("click",z),y.events.off("menuopen",M)}},[y,S,l]),b.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:l,nodeId:S})},[y,u,S,l]);const H=r?i.className:Me(Tv(i.className));return x.jsxs(jM,{id:S,children:[x.jsx(b.Fragment,{children:i.asChild?x.jsx(to,{children:s,ref:Zc([I.setReference,T.ref,a]),tabIndex:c?w.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,...D(w.getItemProps({...i,onFocus(z){var M;(M=i.onFocus)==null||M.call(i,z),h(!1),w.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",ref:Zc([I.setReference,T.ref,a]),tabIndex:c?w.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,...D(w.getItemProps({...i,onFocus(z){var M;(M=i.onFocus)==null||M.call(i,z),h(!1),w.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(tc,{size:14})]})]})}),x.jsx(lu.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:B,setHasFocusInside:h,isOpen:u},children:x.jsx(_M,{elementsRef:g,labelsRef:v,children:u&&x.jsx(mo,{preserveTabOrder:!0,children:x.jsx(vs,{context:A,modal:!1,initialFocus:c?-1:0,returnFocus:!c,children:x.jsx(t,{...N(),ref:I.setFloating,style:{...i.style,...E},className:Me("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})})})})})]})}),gk=b.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=b.useContext(lu),a=Hy({label:r?null:typeof e=="string"?e:t}),l=Gn(),c=a.index===i.activeIndex;return x.jsxs("button",{...o,ref:Zc([a.ref,s]),"data-active":c,"data-open":i.isOpen,type:"button",role:"menuitem",disabled:r,tabIndex:c?0:-1,className:Tv(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]})}),yk=b.forwardRef((e,t)=>Un()!==null?x.jsx(Sv,{...e,isParent:!1,ref:t}):x.jsx(HM,{children:x.jsx(Sv,{...e,isParent:!0,ref:t})})),vk=(e,t)=>Pi()?t:window.matchMedia(e).matches,bk=(e,t=!0)=>{const[n,r]=b.useState(t);return b.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(vk(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},Gt="600ms",wk={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:Gt},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:Gt},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:Gt}},xk={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:Gt},exit:{translateX:["0%","30%"],opacity:0,animationDuration:Gt}},cu={drawer:e=>e==="left"?wk:xk,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:Gt,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:Gt,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:Gt,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:Gt},enter:{opacity:1,scale:[1.05,1],animationDuration:Gt},exit:{opacity:0,scale:.97,animationDuration:Gt}}},Tk=Er("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"}}),Sk={top:0,left:0,right:0,bottom:-1},Ek=e=>e*.62,Ck=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=Ek(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:Sk,whileDrag:{cursor:"grabbing"},className:Me("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})},uu={drawer:"right",sheet:"none",dialog:"none"},Pk=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...s})=>{const i=b.useId(),a=b.useId(),l=bk("(min-width: 64rem)"),c=e!=="dialog",u=l?e==="drawer"?s.position:uu[e]:r?uu[e]:uu.sheet,d=l||r?cu[e]:cu.sheet,f=typeof d=="function"?d(u):d,h=l||r?e:"sheet",{refs:p,context:m}=yo({open:s.open,onOpenChange:s.onChange}),g=bs(m),v=bo(m),w=go(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:S}=vo([g,v,w]),T=s.trigger,E=lr(void 0),I=()=>s.onChange(!1);return x.jsxs(b.Fragment,{children:[s.trigger?x.jsx(b.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(mo,{children:x.jsx(Yr,{presenceAffectsLayout:!0,children:s.open?x.jsx(ek,{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(vs,{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:Tk({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:I,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(mi,{})})}):null,c&&t?x.jsx(Ck,{onChange:s.onChange,parent:p.floating,position:u,sheet:h==="sheet",value:E}):null]})})}):null})})]})},Ik=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}),Ev=({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]=b.useState(!1),f=b.useRef(null),h=e||"span",{refs:p,floatingStyles:m,context:g}=yo({open:u,placement:r,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:Ri,middleware:[Xc(),Wi(5),Qc({fallbackAxisSideDirection:"start"}),Vy({padding:5,element:f})]}),v=Xy(g,{move:!0,delay:{open:xv},enabled:i?s:!1,handleClose:a?wv():null}),w=ik(g,{enabled:i?o:!1}),y=bs(g,{enabled:i?a:!1}),S=go(g,{enabled:i}),T=bo(g,{role:"tooltip",enabled:i}),E=nk(g,{enabled:!!i&&!!l}),{getReferenceProps:I,getFloatingProps:A}=vo([T,S,E,o?w:void 0,s?v:void 0,a?y:void 0]);return x.jsxs(b.Fragment,{children:[x.jsx(h,{ref:p.setReference,...I(c),children:t}),x.jsx(mo,{preserveTabOrder:!0,children:u&&x.jsxs(Nr,{...A(),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(Uy,{ref:f,context:g,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),n]})})]})};class Qi{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++)Qi.getDescendantProperty(a[l],s,r);else s&&Qi.getDescendantProperty(a,s,r)}else r.push(t);return r}}class To{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=To.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=Qi.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=To.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=To.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 To.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 Cv=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>x.jsxs("div",{className:Me("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(Ev,{as:"button",type:"button",title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(Om,{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(b.Fragment,{children:[x.jsx(Im,{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(mP,{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]}),Zi=b.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:w,disabled:y},S)=>{const T=d??h,E=Tt(),I=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:Me("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(Cv,{info:a,hideLeft:v,reportStatus:!0,title:p,placeholder:g,children:I||n?x.jsxs(b.Fragment,{children:[w?null:x.jsx("span",{"aria-disabled":y,className:"text-opacity-70 aria-disabled:text-disabled",children:I}),n?x.jsx(b.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})]})}),Ak=e=>x.jsx(b.Fragment,{children:e.children}),Pv=b.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},s)=>{const i=r.Render??Ak,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(hP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})}),Ok={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},Dk={caseSensitive:!1,sort:!1},Mk=[],kk=b.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=Tt(),v=p.value??p.defaultValue??"",[w,y]=b.useState(!1),[S,T]=b.useState(""),[E,I]=b.useState(v),[A,F]=b.useState(()=>{var $;return(($=r.find(le=>le.value===v))==null?void 0:$.label)??v}),[O,_]=b.useState(null),k=b.useRef(Mk),L=b.useRef(null),P=h&&S!==""?[{value:S,label:S,"data-dynamic":"true"},...r]:r,D=new To(P,["value","label"],Dk).search(S),N=h?void 0:`^(${r.map($=>`${wc($.value)}${$.label?"|"+wc($.label):""}`).join("|")})$`;b.useEffect(()=>{if(p.value){const $=r.find(le=>le.value===p.value);I(($==null?void 0:$.label)??p.value)}},[p.value]);const{x:B,y:H,strategy:z,refs:M,context:R}=yo({open:w,transform:!0,strategy:"absolute",onOpenChange:y,whileElementsMounted:Ri,middleware:[Wi(4),AM({padding:10,elementContext:"reference",apply($){var se;const me=$.elements.reference.parentElement,we=(se=L.current)==null?void 0:se.getBoundingClientRect().width,ze=(me==null?void 0:me.getBoundingClientRect().width)||0;Object.assign($.elements.floating.style,{width:`${ze}px`,overflowY:"auto",maxWidth:`${we}px`,minWidth:`${we}px`,maxHeight:`${Math.min(250,$.availableHeight)}px`})}})]}),K=dk(R,Ok),{getReferenceProps:ee,getFloatingProps:Z,getItemProps:G}=vo([bo(R,{role:"listbox"}),go(R),yv(R,{cols:0,listRef:k,loop:!0,virtual:!0,allowEscape:!0,activeIndex:O,selectedIndex:O,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:$=>_(le=>$??le)})]);b.useEffect(()=>{const $=M.reference.current;if($)return Gs($)},[]);const V=($,le)=>{I($.value);const me=M.reference.current;if(!me)return;me==null||me.setAttribute("data-value",$.value),me.value=$.value;const we=new Event("change",{bubbles:!1,cancelable:!0});me.dispatchEvent(we),p.onChange&&p.onChange(we),F($.label??""),y(!1),T(""),_(le)},j=$=>{var me;const le=$.target.value;return T(le),!w&&le===""?y(!0):($.target.name=p.name||"",le?y(!0):(me=p.onChange)==null?void 0:me.call(p,$))},W=()=>{y(!0),T("")},U=()=>{var $;y(!0),($=M.reference.current)==null||$.focus()},q=$=>{var le;$.stopPropagation(),(le=M.reference.current)==null||le.setAttribute("data-value",""),bf(M.reference.current),T(""),I(""),F(""),y(!1)},re=p.id||p.name;return x.jsxs(Zi,{...p,left:e,error:t,ref:L,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(Pm,{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(mi,{size:15}),x.jsx("span",{className:"sr-only",children:g.inputCloseValue})]}):null]}),children:[x.jsx("input",{...ee({...p,onChange:j,onFocus:W,pattern:N,ref:M.setReference,name:`${re}-shadow`,id:`${re}-shadow`,onClick:$=>$.currentTarget.focus(),onKeyDown($){if($.key==="Escape")return $.currentTarget.blur(),y(!1);if($.key==="Enter"){if(O!==null&&D[O])return $.preventDefault(),V(D[O],O);if(D.length===1)return $.preventDefault(),V(D[0],0)}}}),"data-value":E,"data-error":!!t,"data-name":re,"data-target":re,required:f,value:w?S:A||E,"aria-autocomplete":"list",autoComplete:"off",className:Me("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:re,name:re,type:"hidden","data-origin":re,ref:m,required:f,defaultValue:p.value||E||void 0}),x.jsx(mo,{preserveTabOrder:!0,children:w?x.jsx(vs,{disabled:p.disabled,guards:!0,returnFocus:!1,context:R,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("ul",{...Z({ref:M.setFloating,style:{position:z,left:(B??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:[D.map(($,le)=>{const me=E===$.value||E===$.label;return x.jsx(Pv,{...G({onClick:()=>V($,le),ref:we=>void(k.current[le]=we),selected:O===le}),option:$,active:me,selected:O===le},`${$.value}-option`)}),D.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})]})}),Iv=b.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:Me("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:Me("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:Me("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),Av=(e,t,n,r)=>b.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,...w},y)=>{const S=e,T=w.id??w.name,E=b.useRef(null);return b.useEffect(()=>{if(E.current===null)return;const I=E.current,A=Gs(E.current),F=r==null?void 0:r(I),O=_=>{const k=_;if(k.key==="Enter"&&I.enterKeyHint==="next"){const L=I.getAttribute("data-next");if(L){const P=document.getElementById(L);if(P)return P.focus(),void k.preventDefault()}}};return I.addEventListener("keydown",O),()=>{F==null||F(),A(),I.removeEventListener("keydown",O)}},[]),x.jsx(Zi,{...n,componentName:t,info:a,container:h,error:v,feedback:i,hideLeft:p,left:g,optionalText:f,right:m,rightLabel:d,interactive:u,form:w.form,id:w.name||w.id,name:w.name,labelClassName:l,title:w.title,placeholder:w.placeholder,required:w.required,disabled:w.disabled,children:x.jsx(S,{...n,...w,id:T,name:T,type:s,"data-next":c,"aria-busy":w.disabled,"aria-disabled":w.disabled,"aria-readonly":w.readOnly,ref:qa(y,E),className:Me("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",w.className)})})}),ws=Av(dg,"input",{type:"text"}),Ov=new Date(1970,11,31),du={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},Dv={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},Fk={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")},fu=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},Nk=b.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=t||Pg(),l=b.useId(),c=Tt(),u=b.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[d,f]=b.useState(e||void 0),[h,p]=b.useState(!1),m=fu(u,Ov).flatMap(I=>vn.keyof(du,I.type)?du[I.type](I.value):[]),g=fu(u,Ov).reduce((I,A)=>I+(vn.keyof(Dv,A.type)?Dv[A.type](A.value):""),""),[v,w]=b.useState(d?fu(u,d).reduce((I,A)=>I+(vn.keyof(du,A.type)?Fk[A.type](d,A.value):""),""):""),y=I=>{const A=I.target.value;if(w(A),m.length===A.length&&m.every((O,_)=>{const k=A.charAt(_);return typeof O=="string"?k===O:O.test(k)})){const O=Qr(CA(A,g,new Date));return f(O),r==null?void 0:r(O)}return f(void 0),r==null?void 0:r(void 0)},S=I=>(f(I),r==null||r(I),w(I?PI(I,g):"")),T=_m(d),E=T?d.toISOString():void 0;return x.jsx(ws,{...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(b.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(xo,{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(fP,{})]}),buttonProps:{"aria-describedby":l},children:x.jsx(Lg,{...s,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:S,disabledDate:n,date:T?d:void 0})})]})})}),Lk=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],_k=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Vk=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],$k=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Mv=(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 kv(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?$k:Vk:t.binary?_k:Lk,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=Mv(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=Mv(Number(e),t.locale,i),c=n[a];return s+l+r+c}var hu={exports:{}},Ji={exports:{}},Oe={};/** @license React v16.13.1
177
+ */var ND=["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])"],Vi=ND.join(","),wy=typeof Element>"u",io=wy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$i=!wy&&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},Bi=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},LD=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},_D=function(t,n,r){if(Bi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Vi));return n&&io.call(t,Vi)&&o.unshift(t),o=o.filter(r),o},VD=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Bi(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=io.call(i,Vi);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Bi(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},xy=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ty=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||LD(t))&&!xy(t)?0:t.tabIndex},$D=function(t,n){var r=Ty(t);return r<0&&n&&!xy(t)?0:r},BD=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sy=function(t){return t.tagName==="INPUT"},RD=function(t){return Sy(t)&&t.type==="hidden"},jD=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},HD=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},WD=function(t){if(!t.name)return!0;var n=t.form||$i(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=HD(o,t.form);return!s||s===t},zD=function(t){return Sy(t)&&t.type==="radio"},UD=function(t){return zD(t)&&!WD(t)},GD=function(t){var n,r=t&&$i(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=$i(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},Ey=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},YD=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=io.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(io.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=$i(t);if(l&&!l.shadowRoot&&o(l)===!0)return Ey(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(GD(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ey(t);return!1},KD=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 io.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},qD=function(t,n){return!(n.disabled||Bi(n)||RD(n)||YD(n,t)||jD(n)||KD(n))},Gc=function(t,n){return!(UD(n)||Ty(n)<0||!qD(t,n))},XD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},QD=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=$D(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(BD).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},hs=function(t,n){n=n||{};var r;return n.getShadowRoot?r=VD([t],n.includeContainer,{filter:Gc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:XD}):r=_D(t,n.includeContainer,Gc.bind(null,n)),QD(r)},ZD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return io.call(t,Vi)===!1?!1:Gc(n,t)};function Cy(e,t,n){let{reference:r,floating:o}=e;const s=hr(t),i=zc(t),a=Wc(i),l=Wn(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(so(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1);break}return h}const JD=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}=Cy(c,r,l),f=r,h={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:v}=a[m],{x:w,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=w??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}=Cy(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Yc(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}=oo(t,e),p=by(h),g=a[f?d==="floating"?"reference":"floating":d],v=_i(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})),w=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=_i(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:l}):w);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 eM=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}=oo(e,t)||{};if(c==null)return{};const d=by(u),f={x:n,y:r},h=zc(o),p=Wc(h),m=await i.getDimensions(c),g=h==="y",v=g?"top":"left",w=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 I=E?E[y]:0;(!I||!await(i.isElement==null?void 0:i.isElement(E)))&&(I=a.floating[y]||s.floating[p]);const A=S/2-T/2,F=I/2-m[p]/2-1,O=cn(d[v],F),_=cn(d[w],F),k=O,L=I-m[p]-_,P=I/2-m[p]/2+A,D=Hc(k,P,L),N=!l.arrow&&so(o)!=null&&P!==D&&s.reference[p]/2-(P<k?O:_)-m[p]/2<0,B=N?P<k?P-k:P-L:0;return{[h]:f[h]+B,data:{[h]:D,centerOffset:P-D-B,...N&&{alignmentOffset:B}},reset:N}}}),tM=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}=oo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Wn(o),w=hr(a),y=Wn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=f||(y||!m?[Li(a)]:DD(a)),E=p!=="none";!f&&E&&T.push(...kD(a,m,p,S));const I=[a,...T],A=await Yc(t,g),F=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&F.push(A[v]),d){const P=OD(o,i,S);F.push(A[P[0]],A[P[1]])}if(O=[...O,{placement:o,overflows:F}],!F.every(P=>P<=0)){var _,k;const P=(((_=s.flip)==null?void 0:_.index)||0)+1,D=I[P];if(D)return{data:{index:P,overflows:O},reset:{placement:D}};let N=(k=O.filter(B=>B.overflows[0]<=0).sort((B,H)=>B.overflows[1]-H.overflows[1])[0])==null?void 0:k.placement;if(!N)switch(h){case"bestFit":{var L;const B=(L=O.filter(H=>{if(E){const z=hr(H.placement);return z===w||z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(z=>z>0).reduce((z,M)=>z+M,0)]).sort((H,z)=>H[1]-z[1])[0])==null?void 0:L[0];B&&(N=B);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};async function nM(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Wn(n),a=so(n),l=hr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=oo(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 rM=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 nM(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}}}}},oM=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:w}=g;return{x:v,y:w}}},...l}=oo(e,t),c={x:n,y:r},u=await Yc(t,l),d=hr(Wn(o)),f=vy(d);let h=c[f],p=c[d];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=h+u[g],y=h-u[v];h=Hc(w,h,y)}if(i){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=p+u[g],y=p-u[v];p=Hc(w,p,y)}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},sM=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}=oo(e,t),l=await Yc(t,a),c=Wn(n),u=so(n),d=hr(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,w=cn(h-l[p],g),y=cn(f-l[m],v),S=!t.middlewareData.shift;let T=w,E=y;if(d?E=u||S?cn(y,v):v:T=u||S?cn(w,g):g,S&&!u){const A=Vt(l.left,0),F=Vt(l.right,0),O=Vt(l.top,0),_=Vt(l.bottom,0);d?E=f-2*(A!==0||F!==0?A+F:Vt(l.left,l.right)):T=h-2*(O!==0||_!==0?O+_:Vt(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:T});const I=await o.getDimensions(s.floating);return f!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function Py(e){const t=_t(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ni(n)!==s||Ni(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Kc(e){return Le(e)?e:e.contextElement}function ao(e){const t=Kc(e);if(!nt(t))return Hn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Py(t);let i=(s?Ni(n.width):n.width)/r,a=(s?Ni(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const iM=Hn(0);function Iy(e){const t=It(e);return!Nc()||!t.visualViewport?iM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==It(e)?!1:t}function pr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Kc(e);let i=Hn(1);t&&(r?Le(r)&&(i=ao(r)):i=ao(e));const a=aM(s,n,r)?Iy(s):Hn(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=It(s),h=r&&Le(r)?It(r):r;let p=f,m=Lc(p);for(;m&&r&&h!==p;){const g=ao(m),v=m.getBoundingClientRect(),w=_t(m),y=v.left+(m.clientLeft+parseFloat(w.paddingLeft))*g.x,S=v.top+(m.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=y,c+=S,p=It(m),m=Lc(p)}}return _i({width:u,height:d,x:l,y:c})}function lM(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=En(r),a=t?ki(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Hn(1);const u=Hn(0),d=nt(r);if((d||!d&&!s)&&((Bn(r)!=="body"||fs(i))&&(l=Fi(r)),nt(r))){const f=pr(r);c=ao(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 cM(e){return Array.from(e.getClientRects())}function Ay(e){return pr(En(e)).left+Fi(e).scrollLeft}function uM(e){const t=En(e),n=Fi(e),r=e.ownerDocument.body,o=Vt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Vt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ay(e);const a=-n.scrollTop;return _t(r).direction==="rtl"&&(i+=Vt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function dM(e,t){const n=It(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=Nc();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function fM(e,t){const n=pr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=nt(e)?ao(e):Hn(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 Oy(e,t,n){let r;if(t==="viewport")r=dM(e,n);else if(t==="document")r=uM(En(e));else if(Le(t))r=fM(t,n);else{const o=Iy(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return _i(r)}function Dy(e,t){const n=Cn(e);return n===t||!Le(n)||Rn(n)?!1:_t(n).position==="fixed"||Dy(n,t)}function hM(e,t){const n=t.get(e);if(n)return n;let r=jn(e,[],!1).filter(a=>Le(a)&&Bn(a)!=="body"),o=null;const s=_t(e).position==="fixed";let i=s?Cn(e):e;for(;Le(i)&&!Rn(i);){const a=_t(i),l=Fc(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||fs(i)&&!l&&Dy(e,i))?r=r.filter(u=>u!==i):o=a,i=Cn(i)}return t.set(e,r),r}function pM(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ki(t)?[]:hM(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Oy(t,u,o);return c.top=Vt(d.top,c.top),c.right=cn(d.right,c.right),c.bottom=cn(d.bottom,c.bottom),c.left=Vt(d.left,c.left),c},Oy(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mM(e){const{width:t,height:n}=Py(e);return{width:t,height:n}}function gM(e,t,n){const r=nt(t),o=En(t),s=n==="fixed",i=pr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Hn(0);if(r||!r&&!s)if((Bn(t)!=="body"||fs(o))&&(a=Fi(t)),r){const d=pr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Ay(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 qc(e){return _t(e).position==="static"}function My(e,t){return!nt(e)||_t(e).position==="fixed"?null:t?t(e):e.offsetParent}function ky(e,t){const n=It(e);if(ki(e))return n;if(!nt(e)){let o=Cn(e);for(;o&&!Rn(o);){if(Le(o)&&!qc(o))return o;o=Cn(o)}return n}let r=My(e,t);for(;r&&xD(r)&&qc(r);)r=My(r,t);return r&&Rn(r)&&qc(r)&&!Fc(r)?n:r||TD(e)||n}const yM=async function(e){const t=this.getOffsetParent||ky,n=this.getDimensions,r=await n(e.floating);return{reference:gM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vM(e){return _t(e).direction==="rtl"}const bM={convertOffsetParentRelativeRectToViewportRelativeRect:lM,getDocumentElement:En,getClippingRect:pM,getOffsetParent:ky,getElementRects:yM,getClientRects:cM,getDimensions:mM,getScale:ao,isElement:Le,isRTL:vM};function wM(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=ro(u),p=ro(o.clientWidth-(c+d)),m=ro(o.clientHeight-(u+f)),g=ro(c),w={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Vt(0,cn(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,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return i(!0),s}function Ri(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=Kc(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?wM(c,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.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?pr(e):null;l&&g();function g(){const v=pr(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(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const xM=rM,TM=oM,SM=tM,EM=sM,Fy=eM,CM=(e,t,n)=>{const r=new Map,o={platform:bM,...n},s={...o.platform,_c:r};return JD(e,t,{...o,platform:s})};var ji=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Hi(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(!Hi(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)&&!Hi(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ny(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ly(e,t){const n=Ny(e);return Math.round(t*n)/n}function _y(e){const t=C.useRef(e);return ji(()=>{t.current=e}),t}function PM(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);Hi(f,r)||h(r);const[p,m]=C.useState(null),[g,v]=C.useState(null),w=C.useCallback(B=>{B!==E.current&&(E.current=B,m(B))},[]),y=C.useCallback(B=>{B!==I.current&&(I.current=B,v(B))},[]),S=s||p,T=i||g,E=C.useRef(null),I=C.useRef(null),A=C.useRef(u),F=l!=null,O=_y(l),_=_y(o),k=C.useCallback(()=>{if(!E.current||!I.current)return;const B={placement:t,strategy:n,middleware:f};_.current&&(B.platform=_.current),CM(E.current,I.current,B).then(H=>{const z={...H,isPositioned:!0};L.current&&!Hi(A.current,z)&&(A.current=z,Lo.flushSync(()=>{d(z)}))})},[f,t,n,_]);ji(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[c]);const L=C.useRef(!1);ji(()=>(L.current=!0,()=>{L.current=!1}),[]),ji(()=>{if(S&&(E.current=S),T&&(I.current=T),S&&T){if(O.current)return O.current(S,T,k);k()}},[S,T,k,O,F]);const P=C.useMemo(()=>({reference:E,floating:I,setReference:w,setFloating:y}),[w,y]),D=C.useMemo(()=>({reference:S,floating:T}),[S,T]),N=C.useMemo(()=>{const B={position:n,left:0,top:0};if(!D.floating)return B;const H=Ly(D.floating,u.x),z=Ly(D.floating,u.y);return a?{...B,transform:"translate("+H+"px, "+z+"px)",...Ny(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:z}},[n,a,D.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:k,refs:P,elements:D,floatingStyles:N}),[u,k,P,D,N])}const IM=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?Fy({element:r.current,padding:o}).fn(n):{}:r?Fy({element:r,padding:o}).fn(n):{}}}},Wi=(e,t)=>({...xM(e),options:[e,t]}),Xc=(e,t)=>({...TM(e),options:[e,t]}),Qc=(e,t)=>({...SM(e),options:[e,t]}),AM=(e,t)=>({...EM(e),options:[e,t]}),Vy=(e,t)=>({...IM(e),options:[e,t]});function Zc(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 $y={...C},OM=$y.useInsertionEffect||(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 OM(()=>{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 Jc="ArrowUp",ps="ArrowDown",lo="ArrowLeft",co="ArrowRight";function zi(e,t,n){return Math.floor(e/t)!==n}function ms(e,t){return t<0||t>=e.current.length}function eu(e,t){return St(e,{disabledIndices:t})}function By(e,t){return St(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function St(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&&Ui(i,a,o));return a}function DM(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===Jc){if(u&&gt(n),c===-1)d=l;else if(d=St(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}ms(e,d)&&(d=c)}if(n.key===ps&&(u&&gt(n),c===-1?d=a:(d=St(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=St(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),ms(e,d)&&(d=c)),r==="both"){const f=ro(c/s);n.key===co&&(u&&gt(n),c%s!==s-1?(d=St(e,{startingIndex:c,disabledIndices:i}),o&&zi(d,s,f)&&(d=St(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=St(e,{startingIndex:c-c%s-1,disabledIndices:i})),zi(d,s,f)&&(d=c)),n.key===lo&&(u&&gt(n),c%s!==0?(d=St(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&zi(d,s,f)&&(d=St(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=St(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),zi(d,s,f)&&(d=c));const h=ro(l/s)===f;ms(e,d)&&(o&&h?d=n.key===lo?l:St(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function MM(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 kM(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 FM(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Ui(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 Ry=0;function zn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ry);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Ry=requestAnimationFrame(s)}var xe=typeof document<"u"?b.useLayoutEffect:b.useEffect;function NM(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 LM(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 jy=C.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function _M(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 xe(()=>{const l=new Map(o);Array.from(l.keys()).sort(NM).forEach((u,d)=>{l.set(u,d)}),LM(o,l)||s(l)},[o]),C.createElement(jy.Provider,{value:C.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function Hy(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=C.useContext(jy),[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 xe(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),xe(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),C.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function uo(){return uo=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},uo.apply(this,arguments)}let Wy=!1,VM=0;const zy=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+VM++;function $M(){const[e,t]=C.useState(()=>Wy?zy():void 0);return xe(()=>{e==null&&t(zy())},[]),C.useEffect(()=>{Wy=!0},[]),e}const fo=$y.useId||$M;let gs;process.env.NODE_ENV!=="production"&&(gs=new Set);function Gi(){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=gs)!=null&&e.has(o))){var s;(s=gs)==null||s.add(o),console.warn(o)}}function BM(){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=gs)!=null&&e.has(o))){var s;(s=gs)==null||s.add(o),console.error(o)}}const Uy=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||Gi("The `ref` prop is required for `FloatingArrow`."));const g=fo(),[v,w]=C.useState(!1);if(xe(()=>{if(!o)return;_t(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const y=c*2,S=y/2,T=i/2*(l/-8+1),E=a/2*l/4,[I,A]=r.split("-"),F=!!f,O=I==="top"||I==="bottom",_=u&&A==="end"?"bottom":"top";let k=u&&A==="end"?"right":"left";u&&v&&(k=A==="end"?"left":"right");const L=(s==null?void 0:s.x)!=null?u||s.x:"",P=(s==null?void 0:s.y)!=null?u||s.y:"",D=f||"M0,0"+(" H"+i)+(" L"+(i-T)+","+(a-E))+(" Q"+i/2+","+a+" "+T+","+(a-E))+" Z",N={top:F?"rotate(180deg)":"",left:F?"rotate(90deg)":"rotate(-90deg)",bottom:F?"":"rotate(180deg)",right:F?"rotate(-90deg)":"rotate(90deg)"}[I];return C.createElement("svg",uo({},m,{"aria-hidden":!0,ref:n,width:F?i:i+y,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[k]:L,[_]:P,[I]:O||F?"100%":"calc(100% - "+y/2+"px)",transform:""+N+(h??""),...p}}),y>0&&C.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:y+(f?0:1),d:D}),C.createElement("path",{stroke:y&&!f?m.fill:"none",d:D}),C.createElement("clipPath",{id:g},C.createElement("rect",{x:-S,y:S*(F?-1:1),width:i+y,height:i})))});function Gy(){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 Yy=C.createContext(null),Ky=C.createContext(null),Un=()=>{var e;return((e=C.useContext(Yy))==null?void 0:e.id)||null},Gn=()=>C.useContext(Ky);function RM(e){const t=fo(),n=Gn(),o=Un();return xe(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function jM(e){const{children:t,id:n}=e,r=Un();return C.createElement(Yy.Provider,{value:C.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function HM(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(()=>Gy())[0];return C.createElement(Ky.Provider,{value:C.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function Yn(e){return"data-floating-ui-"+e}function yt(e){const t=b.useRef(e);return xe(()=>{t.current=e}),t}const qy=Yn("safe-polygon");function tu(e,t,n){return n&&!no(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function Xy(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=Gn(),p=Un(),m=yt(c),g=yt(l),v=yt(n),w=C.useRef(),y=C.useRef(-1),S=C.useRef(),T=C.useRef(-1),E=C.useRef(!0),I=C.useRef(!1),A=C.useRef(()=>{}),F=C.useCallback(()=>{var D;const N=(D=o.current.openEvent)==null?void 0:D.type;return(N==null?void 0:N.includes("mouse"))&&N!=="mousedown"},[o]);C.useEffect(()=>{if(!a)return;function D(N){let{open:B}=N;B||(clearTimeout(y.current),clearTimeout(T.current),E.current=!0)}return s.on("openchange",D),()=>{s.off("openchange",D)}},[a,s]),C.useEffect(()=>{if(!a||!m.current||!n)return;function D(B){F()&&r(!1,B,"hover")}const N=ft(i.floating).documentElement;return N.addEventListener("mouseleave",D),()=>{N.removeEventListener("mouseleave",D)}},[i.floating,n,r,a,m,F]);const O=C.useCallback(function(D,N,B){N===void 0&&(N=!0),B===void 0&&(B="hover");const H=tu(g.current,"close",w.current);H&&!S.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,D,B),H)):N&&(clearTimeout(y.current),r(!1,D,B))},[g,r]),_=at(()=>{A.current(),S.current=void 0}),k=at(()=>{if(I.current){const D=ft(i.floating).body;D.style.pointerEvents="",D.removeAttribute(qy),I.current=!1}});C.useEffect(()=>{if(!a)return;function D(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function N(M){if(clearTimeout(y.current),E.current=!1,u&&!no(w.current)||d>0&&!tu(g.current,"open"))return;const R=tu(g.current,"open",w.current);R?y.current=window.setTimeout(()=>{v.current||r(!0,M,"hover")},R):r(!0,M,"hover")}function B(M){if(D())return;A.current();const R=ft(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:M.clientX,y:M.clientY,onClose(){k(),_(),O(M,!0,"safe-polygon")}});const ee=S.current;R.addEventListener("mousemove",ee),A.current=()=>{R.removeEventListener("mousemove",ee)};return}(w.current==="touch"?!Xe(i.floating,M.relatedTarget):!0)&&O(M)}function H(M){D()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:h,x:M.clientX,y:M.clientY,onClose(){k(),_(),O(M)}})(M))}if(Le(i.domReference)){var z;const M=i.domReference;return n&&M.addEventListener("mouseleave",H),(z=i.floating)==null||z.addEventListener("mouseleave",H),f&&M.addEventListener("mousemove",N,{once:!0}),M.addEventListener("mouseenter",N),M.addEventListener("mouseleave",B),()=>{var R;n&&M.removeEventListener("mouseleave",H),(R=i.floating)==null||R.removeEventListener("mouseleave",H),f&&M.removeEventListener("mousemove",N),M.removeEventListener("mouseenter",N),M.removeEventListener("mouseleave",B)}}},[i,a,e,u,d,f,O,_,k,r,n,v,h,g,m,o]),xe(()=>{var D;if(a&&n&&(D=m.current)!=null&&D.__options.blockPointerEvents&&F()){const B=ft(i.floating).body;B.setAttribute(qy,""),B.style.pointerEvents="none",I.current=!0;const H=i.floating;if(Le(i.domReference)&&H){var N;const z=i.domReference,M=h==null||(N=h.nodesRef.current.find(R=>R.id===p))==null||(N=N.context)==null?void 0:N.elements.floating;return M&&(M.style.pointerEvents=""),z.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{z.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,i,h,m,F]),xe(()=>{n||(w.current=void 0,_(),k())},[n,_,k]),C.useEffect(()=>()=>{_(),clearTimeout(y.current),clearTimeout(T.current),k()},[a,i.domReference,_,k]);const L=C.useMemo(()=>{function D(N){w.current=N.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(N){const{nativeEvent:B}=N;function H(){!E.current&&!v.current&&r(!0,B,"hover")}u&&!no(w.current)||n||d===0||(clearTimeout(T.current),w.current==="touch"?H():T.current=window.setTimeout(H,d))}}},[u,r,n,v,d]),P=C.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(D){O(D.nativeEvent,!1)}}),[O]);return C.useMemo(()=>a?{reference:L,floating:P}:{},[a,L,P])}function WM(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 mr(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 zM(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),mr(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let ho=new WeakMap,Yi=new WeakSet,Ki={},nu=0;const UM=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Qy=e=>e&&(e.host||Qy(e.parentNode)),GM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Qy(n);return e.contains(r)?r:null}).filter(n=>n!=null);function YM(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=GM(t,e),a=new Set,l=new Set(i),c=[];Ki[o]||(Ki[o]=new WeakMap);const u=Ki[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(Bn(p)!=="script")if(a.has(p))f(p);else{const m=s?p.getAttribute(s):null,g=m!==null&&m!=="false",v=(ho.get(p)||0)+1,w=(u.get(p)||0)+1;ho.set(p,v),u.set(p,w),c.push(p),v===1&&g&&Yi.add(p),w===1&&p.setAttribute(o,""),!g&&s&&p.setAttribute(s,"true")}})}return nu++,()=>{c.forEach(h=>{const p=(ho.get(h)||0)-1,m=(u.get(h)||0)-1;ho.set(h,p),u.set(h,m),p||(!Yi.has(h)&&s&&h.removeAttribute(s),Yi.delete(h)),m||h.removeAttribute(o)}),nu--,nu||(ho=new WeakMap,ho=new WeakMap,Yi=new WeakSet,Ki={})}}function Zy(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ft(e[0]).body;return YM(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const po=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Jy(e,t){const n=hs(e,po());t==="prev"&&n.reverse();const r=n.indexOf(Ut(ft(e)));return n.slice(r+1)[0]}function ev(){return Jy(document.body,"next")}function tv(){return Jy(document.body,"prev")}function ys(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Xe(n,r)}function KM(e){hs(e,po()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function qM(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 XM(e,t,n){const r=e.indexOf(t);function o(i){const a=Yn("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||Xe(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const ru={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 QM;function nv(e){e.key==="Tab"&&(e.target,clearTimeout(QM))}const qi=C.forwardRef(function(t,n){const[r,o]=C.useState();xe(()=>($c()&&o("button"),document.addEventListener("keydown",nv),()=>{document.removeEventListener("keydown",nv)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Yn("focus-guard")]:"",style:ru};return C.createElement("span",uo({},t,s))}),rv=C.createContext(null),ov=Yn("portal");function ZM(e){e===void 0&&(e={});const{id:t,root:n}=e,r=fo(),o=sv(),[s,i]=C.useState(null),a=C.useRef(null);return xe(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),xe(()=>{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(ov,""),l.appendChild(c),a.current=c,i(c)},[t,r]),xe(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Le(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(ov,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function mo(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=ZM({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&&ys(p)&&(p.type==="focusin"?qM:KM)(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(rv.Provider,{value:C.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},f&&s&&C.createElement(qi,{"data-type":"outside",ref:l,onFocus:h=>{if(ys(h,s)){var p;(p=u.current)==null||p.focus()}else{const m=tv()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus()}}}),f&&s&&C.createElement("span",{"aria-owns":s.id,style:ru}),s&&Lo.createPortal(t,s),f&&s&&C.createElement(qi,{"data-type":"outside",ref:c,onFocus:h=>{if(ys(h,s)){var p;(p=d.current)==null||p.focus()}else{const m=ev()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,h.nativeEvent))}}}))}const sv=()=>C.useContext(rv),iv=20;let gr=[];function ou(e){gr=gr.filter(n=>n.isConnected);let t=e;if(!(!t||Bn(t)==="body")){if(!ZD(t,po())){const n=hs(t,po())[0];n&&(t=n)}gr.push(t),gr.length>iv&&(gr=gr.slice(-iv))}}function av(){return gr.slice().reverse().find(e=>e.isConnected)}const JM=C.forwardRef(function(t,n){return C.createElement("button",uo({},t,{type:"button",ref:n,tabIndex:-1,style:ru}))});function vs(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:w,elements:{domReference:y,floating:S}}=t,T=typeof i=="number"&&i<0,E=yy(y)&&T,I=UM()?s:!0,A=yt(o),F=yt(i),O=yt(a),_=Gn(),k=sv(),L=C.useRef(null),P=C.useRef(null),D=C.useRef(!1),N=C.useRef(!1),B=C.useRef(-1),H=k!=null,z=S==null?void 0:S.firstElementChild,M=(z==null?void 0:z.id)===w?z:S,R=at(function(G){return G===void 0&&(G=M),G?hs(G,po()):[]}),K=at(G=>{const V=R(G);return A.current.map(j=>y&&j==="reference"?y:M&&j==="floating"?M:V).filter(Boolean).flat()});C.useEffect(()=>{if(r||!c)return;function G(j){if(j.key==="Tab"){Xe(M,Ut(ft(M)))&&R().length===0&&!E&&gt(j);const W=K(),U=ln(j);A.current[0]==="reference"&&U===y&&(gt(j),j.shiftKey?zn(W[W.length-1]):zn(W[1])),A.current[1]==="floating"&&U===M&&j.shiftKey&&(gt(j),zn(W[0]))}}const V=ft(M);return V.addEventListener("keydown",G),()=>{V.removeEventListener("keydown",G)}},[r,y,M,c,A,E,R,K]),C.useEffect(()=>{if(r||!S)return;function G(V){const j=ln(V),U=R().indexOf(j);U!==-1&&(B.current=U)}return S.addEventListener("focusin",G),()=>{S.removeEventListener("focusin",G)}},[r,S,R]),C.useEffect(()=>{if(r||!d)return;function G(){N.current=!0,setTimeout(()=>{N.current=!1})}function V(j){const W=j.relatedTarget;queueMicrotask(()=>{const U=!(Xe(y,W)||Xe(S,W)||Xe(W,S)||Xe(k==null?void 0:k.portalNode,W)||W!=null&&W.hasAttribute(Yn("focus-guard"))||_&&(mr(_.nodesRef.current,p).find(q=>{var re,$;return Xe((re=q.context)==null?void 0:re.elements.floating,W)||Xe(($=q.context)==null?void 0:$.elements.domReference,W)})||WM(_.nodesRef.current,p).find(q=>{var re,$;return((re=q.context)==null?void 0:re.elements.floating)===W||(($=q.context)==null?void 0:$.elements.domReference)===W})));if(l&&U&&Ut(ft(M))===ft(M).body){nt(M)&&(M==null||M.focus());const q=B.current,re=R(),$=re[q]||re[re.length-1]||M;nt($)&&$.focus()}(E||!c)&&W&&U&&!N.current&&W!==av()&&(D.current=!0,m(!1,j))})}if(S&&nt(y))return y.addEventListener("focusout",V),y.addEventListener("pointerdown",G),S.addEventListener("focusout",V),()=>{y.removeEventListener("focusout",V),y.removeEventListener("pointerdown",G),S.removeEventListener("focusout",V)}},[r,y,S,M,c,p,_,k,m,d,l,R,E]),C.useEffect(()=>{var G;if(r)return;const V=Array.from((k==null||(G=k.portalNode)==null?void 0:G.querySelectorAll("["+Yn("portal")+"]"))||[]);if(S){const j=[S,...V,L.current,P.current,A.current.includes("reference")||E?y:null].filter(U=>U!=null),W=c||E?Zy(j,I,!I):Zy(j);return()=>{W()}}},[r,y,S,c,A,k,E,I]),xe(()=>{if(r||!nt(M))return;const G=ft(M),V=Ut(G);queueMicrotask(()=>{const j=K(M),W=F.current,U=(typeof W=="number"?j[W]:W.current)||M,q=Xe(M,V);!T&&!q&&f&&zn(U,{preventScroll:U===M})})},[r,f,M,T,K,F]),xe(()=>{if(r||!M)return;let G=!1;const V=ft(M),j=Ut(V);let U=v.current.openEvent;const q=h.domReference.current;ou(j);function re($){let{open:le,reason:me,event:we,nested:ze}=$;le&&(U=we),me==="escape-key"&&h.domReference.current&&ou(h.domReference.current),me==="hover"&&we.type==="mouseleave"&&(D.current=!0),me==="outside-press"&&(ze?(D.current=!1,G=!0):D.current=!(my(we)||Vc(we)))}return g.on("openchange",re),()=>{g.off("openchange",re);const $=Ut(V),le=Xe(S,$)||_&&mr(_.nodesRef.current,p).some(se=>{var ve;return Xe((ve=se.context)==null?void 0:ve.elements.floating,$)});(le||U&&["click","mousedown"].includes(U.type))&&h.domReference.current&&ou(h.domReference.current);const we=q||j,ze=hs(ft(we).body,po());queueMicrotask(()=>{let se=av();!se&&nt(we)&&S&&(se=XM(ze,we,S)),O.current&&!D.current&&nt(se)&&(!(se!==$&&$!==V.body)||le)&&se.focus({preventScroll:G})})}},[r,S,M,O,v,h,g,_,p]),xe(()=>{if(!r&&k)return k.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{k.setFocusManagerState(null)}},[r,k,c,f,m,h,d]),xe(()=>{if(r||!M||typeof MutationObserver!="function"||T)return;const G=()=>{const j=M.getAttribute("tabindex"),W=R(),U=Ut(ft(S)),q=W.indexOf(U);q!==-1&&(B.current=q),A.current.includes("floating")||U!==h.domReference.current&&W.length===0?j!=="0"&&M.setAttribute("tabindex","0"):j!=="-1"&&M.setAttribute("tabindex","-1")};G();const V=new MutationObserver(G);return V.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{V.disconnect()}},[r,S,M,h,A,R,T]);function ee(G){return r||!u||!c?null:C.createElement(JM,{ref:G==="start"?L:P,onClick:V=>m(!1,V.nativeEvent)},typeof u=="string"?u:"Dismiss")}const Z=!r&&I&&(c?!E:!0)&&(H||c);return C.createElement(C.Fragment,null,Z&&C.createElement(qi,{"data-type":"inside",ref:k==null?void 0:k.beforeInsideRef,onFocus:G=>{if(c){const j=K();zn(o[0]==="reference"?j[0]:j[j.length-1])}else if(k!=null&&k.preserveTabOrder&&k.portalNode)if(D.current=!1,ys(G,k.portalNode)){const j=ev()||y;j==null||j.focus()}else{var V;(V=k.beforeOutsideRef.current)==null||V.focus()}}}),!E&&ee("start"),n,ee("end"),Z&&C.createElement(qi,{"data-type":"inside",ref:k==null?void 0:k.afterInsideRef,onFocus:G=>{if(c)zn(K()[0]);else if(k!=null&&k.preserveTabOrder&&k.portalNode)if(d&&(D.current=!0),ys(G,k.portalNode)){const j=tv()||y;j==null||j.focus()}else{var V;(V=k.afterOutsideRef.current)==null||V.focus()}}}))}const su=new Set,ek=C.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=fo();return xe(()=>{if(!r)return;su.add(s);const i=/iP(hone|ad|od)|iOS/.test(_c()),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()=>{su.delete(s),su.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,f)))}},[s,r]),C.createElement("div",uo({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function lv(e){return nt(e.target)&&e.target.tagName==="BUTTON"}function cv(e){return jc(e)}function bs(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||lv(p))&&(p.key===" "&&!cv(s)&&(p.preventDefault(),f.current=!0),p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||lv(p)||cv(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 tk(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 uv(e){return e!=null&&e.clientX!=null}function nk(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,I)=>{d.current||r.current.openEvent&&!uv(r.current.openEvent)||i.setPositionReference(tk(s,{x:E,y:I,axis:l,dataRef:r,pointerType:h}))}),w=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=It(o);function I(A){const F=ln(A);Xe(o,F)?(E.removeEventListener("mousemove",I),f.current=null):v(A.clientX,A.clientY)}if(!r.current.openEvent||uv(r.current.openEvent)){E.addEventListener("mousemove",I);const A=()=>{E.removeEventListener("mousemove",I),f.current=null};return f.current=A,A}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]),xe(()=>{a&&(c!=null||u!=null)&&(d.current=!1,v(c,u))},[a,c,u,v]);const T=C.useMemo(()=>{function E(I){let{pointerType:A}=I;p(A)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:w,onMouseEnter:w}},[w]);return C.useMemo(()=>a?{reference:T}:{},[a,T])}const rk={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ok={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},dv=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 go(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=Gn(),g=at(typeof l=="function"?l:()=>!1),v=typeof l=="function"?g:l,w=C.useRef(!1),y=C.useRef(!1),{escapeKey:S,outsidePress:T}=dv(h),{escapeKey:E,outsidePress:I}=dv(p),A=at(P=>{var D;if(!n||!i||!a||P.key!=="Escape")return;const N=(D=s.current.floatingContext)==null?void 0:D.nodeId,B=m?mr(m.nodesRef.current,N):[];if(!S&&(P.stopPropagation(),B.length>0)){let H=!0;if(B.forEach(z=>{var M;if((M=z.context)!=null&&M.open&&!z.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,ED(P)?P.nativeEvent:P,"escape-key")}),F=at(P=>{var D;const N=()=>{var B;A(P),(B=ln(P))==null||B.removeEventListener("keydown",N)};(D=ln(P))==null||D.addEventListener("keydown",N)}),O=at(P=>{var D;const N=w.current;w.current=!1;const B=y.current;if(y.current=!1,c==="click"&&B||N||typeof v=="function"&&!v(P))return;const H=ln(P),z="["+Yn("inert")+"]",M=ft(o.floating).querySelectorAll(z);let R=Le(H)?H:null;for(;R&&!Rn(R);){const G=Cn(R);if(Rn(G)||!Le(G))break;R=G}if(M.length&&Le(H)&&!CD(H)&&!Xe(H,o.floating)&&Array.from(M).every(G=>!Xe(R,G)))return;if(nt(H)&&L){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,V=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let j=V&&P.offsetX>H.clientWidth;if(V&&_t(H).direction==="rtl"&&(j=P.offsetX<=H.offsetWidth-H.clientWidth),j||G&&P.offsetY>H.clientHeight)return}const K=(D=s.current.floatingContext)==null?void 0:D.nodeId,ee=m&&mr(m.nodesRef.current,K).some(G=>{var V;return Rc(P,(V=G.context)==null?void 0:V.elements.floating)});if(Rc(P,o.floating)||Rc(P,o.domReference)||ee)return;const Z=m?mr(m.nodesRef.current,K):[];if(Z.length>0){let G=!0;if(Z.forEach(V=>{var j;if((j=V.context)!=null&&j.open&&!V.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,P,"outside-press")}),_=at(P=>{var D;const N=()=>{var B;O(P),(B=ln(P))==null||B.removeEventListener(c,N)};(D=ln(P))==null||D.addEventListener(c,N)});C.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=T;function P(B){r(!1,B,"ancestor-scroll")}const D=ft(o.floating);a&&D.addEventListener("keydown",E?F:A,E),v&&D.addEventListener(c,I?_:O,I);let N=[];return f&&(Le(o.domReference)&&(N=jn(o.domReference)),Le(o.floating)&&(N=N.concat(jn(o.floating))),!Le(o.reference)&&o.reference&&o.reference.contextElement&&(N=N.concat(jn(o.reference.contextElement)))),N=N.filter(B=>{var H;return B!==((H=D.defaultView)==null?void 0:H.visualViewport)}),N.forEach(B=>{B.addEventListener("scroll",P,{passive:!0})}),()=>{a&&D.removeEventListener("keydown",E?F:A,E),v&&D.removeEventListener(c,I?_:O,I),N.forEach(B=>{B.removeEventListener("scroll",P)})}},[s,o,a,v,c,n,r,f,i,S,T,A,E,F,O,I,_]),C.useEffect(()=>{w.current=!1},[v,c]);const k=C.useMemo(()=>({onKeyDown:A,[rk[d]]:P=>{u&&r(!1,P.nativeEvent,"reference-press")}}),[A,r,u,d]),L=C.useMemo(()=>({onKeyDown:A,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[ok[c]]:()=>{w.current=!0}}),[A,c]);return C.useMemo(()=>i?{reference:k,floating:L}:{},[i,k,L])}function sk(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=fo(),s=C.useRef({}),[i]=C.useState(()=>Gy()),a=Un()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Le(h)&&BM("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 yo(e){e===void 0&&(e={});const{nodeId:t}=e,n=sk({...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=Gn();xe(()=>{u&&(d.current=u)},[u]);const h=PM({...e,elements:{...o,...a&&{reference:a}}}),p=C.useCallback(y=>{const S=Le(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(S),h.refs.setReference(S)},[h.refs]),m=C.useCallback(y=>{(Le(y)||y===null)&&(d.current=y,i(y)),(Le(h.refs.reference.current)||h.refs.reference.current===null||y!==null&&!Le(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]),w=C.useMemo(()=>({...h,...r,refs:g,elements:v,nodeId:t}),[h,g,v,t,r]);return xe(()=>{r.dataRef.current.floatingContext=w;const y=f==null?void 0:f.nodesRef.current.find(S=>S.id===t);y&&(y.context=w)}),C.useMemo(()=>({...h,context:w,refs:g,elements:v}),[h,g,v,w])}function ik(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=It(i.domReference);function p(){!n&&nt(i.domReference)&&i.domReference===Ut(ft(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){Vc(h.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const p=ln(h.nativeEvent);if(l&&Le(p))try{if($c()&&gy())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!d.current&&!jc(p))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const p=h.relatedTarget,m=h.nativeEvent,g=Le(p)&&p.hasAttribute(Yn("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const w=Ut(i.domReference?i.domReference.ownerDocument:document);!p&&w===i.domReference||Xe((v=s.current.floatingContext)==null?void 0:v.refs.floating.current,w)||Xe(i.domReference,w)||g||r(!1,m,"focus")})}}),[s,i.domReference,r,l]);return C.useMemo(()=>a?{reference:f}:{},[a,f])}const fv="active",hv="selected";function iu(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[fv]:i,[hv]: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&&[fv,hv].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 vo(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=>iu(a,e,"reference"),t),s=C.useCallback(a=>iu(a,e,"floating"),n),i=C.useCallback(a=>iu(a,e,"item"),r);return C.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let pv=!1;function Xi(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function mv(e,t){return Xi(t,e===Jc||e===ps,e===lo||e===co)}function au(e,t,n){return Xi(t,e===ps,n?e===lo:e===co)||e==="Enter"||e===" "||e===""}function ak(e,t,n){return Xi(t,n?e===lo:e===co,e===ps)}function gv(e,t,n){return Xi(t,n?e===co:e===lo,e===Jc)}function yv(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:w=void 0,orientation:y="vertical",cols:S=1,scrollItemIntoView:T=!0,virtualItemRef:E,itemSizes:I,dense:A=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||Gi("`useListNavigation` looping must be enabled to allow escaping."),p||Gi("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&S>1&&Gi("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const F=Un(),O=Gn(),_=at(a),k=C.useRef(m),L=C.useRef(c??-1),P=C.useRef(null),D=C.useRef(!0),N=C.useRef(_),B=C.useRef(!!o.floating),H=C.useRef(n),z=C.useRef(!1),M=C.useRef(!1),R=yt(w),K=yt(n),ee=yt(T),Z=yt(o.floating),G=yt(c),[V,j]=C.useState(),[W,U]=C.useState(),q=at(function(se,ve,ie){ie===void 0&&(ie=!1);function Te(Se){p?(j(Se.id),O==null||O.events.emit("virtualfocus",Se),E&&(E.current=Se)):zn(Se,{preventScroll:!0,sync:gy()&&$c()?pv||z.current:!1})}const ot=se.current[ve.current];ot&&Te(ot),requestAnimationFrame(()=>{const Se=se.current[ve.current]||ot;if(!Se)return;ot||Te(Se);const st=ee.current;st&&$&&(ie||!D.current)&&(Se.scrollIntoView==null||Se.scrollIntoView(typeof st=="boolean"?{block:"nearest",inline:"nearest"}:st))})});xe(()=>{document.createElement("div").focus({get preventScroll(){return pv=!0,!1}})},[]),xe(()=>{l&&(n&&o.floating?k.current&&c!=null&&(M.current=!0,L.current=c,_(c)):B.current&&(L.current=-1,N.current(null)))},[l,n,o.floating,c,_]),xe(()=>{if(l&&n&&o.floating)if(i==null){if(z.current=!1,G.current!=null)return;if(B.current&&(L.current=-1,q(s,L)),(!H.current||!B.current)&&k.current&&(P.current!=null||k.current===!0&&P.current==null)){let se=0;const ve=()=>{s.current[0]==null?(se<2&&(se?requestAnimationFrame:queueMicrotask)(ve),se++):(L.current=P.current==null||au(P.current,y,h)||f?eu(s,R.current):By(s,R.current),P.current=null,_(L.current))};ve()}}else ms(s,i)||(L.current=i,q(s,L,M.current),M.current=!1)},[l,n,o.floating,i,G,f,s,y,h,_,q,R]),xe(()=>{var se;if(!l||o.floating||!O||p||!B.current)return;const ve=O.nodesRef.current,ie=(se=ve.find(Se=>Se.id===F))==null||(se=se.context)==null?void 0:se.elements.floating,Te=Ut(ft(o.floating)),ot=ve.some(Se=>Se.context&&Xe(Se.context.elements.floating,Te));ie&&!ot&&D.current&&ie.focus({preventScroll:!0})},[l,o.floating,O,F,p]),xe(()=>{if(!l||!O||!p||F)return;function se(ve){U(ve.id),E&&(E.current=ve)}return O.events.on("virtualfocus",se),()=>{O.events.off("virtualfocus",se)}},[l,O,p,F,E]),xe(()=>{N.current=_,B.current=!!o.floating}),xe(()=>{n||(P.current=null)},[n]),xe(()=>{H.current=n},[n]);const re=i!=null,$=C.useMemo(()=>{function se(ie){if(!n)return;const Te=s.current.indexOf(ie);Te!==-1&&_(Te)}return{onFocus(ie){let{currentTarget:Te}=ie;se(Te)},onClick:ie=>{let{currentTarget:Te}=ie;return Te.focus({preventScroll:!0})},...g&&{onMouseMove(ie){let{currentTarget:Te}=ie;se(Te)},onPointerLeave(ie){let{pointerType:Te}=ie;!D.current||Te==="touch"||(L.current=-1,q(s,L),_(null),p||zn(Z.current,{preventScroll:!0}))}}}},[n,Z,q,g,s,_,p]),le=at(se=>{if(D.current=!1,z.current=!0,!K.current&&se.currentTarget===Z.current)return;if(f&&gv(se.key,y,h)){gt(se),r(!1,se.nativeEvent,"list-navigation"),nt(o.domReference)&&!p&&o.domReference.focus();return}const ve=L.current,ie=eu(s,w),Te=By(s,w);if(se.key==="Home"&&(gt(se),L.current=ie,_(L.current)),se.key==="End"&&(gt(se),L.current=Te,_(L.current)),S>1){const ot=I||Array.from({length:s.current.length},()=>({width:1,height:1})),Se=MM(ot,S,A),st=Se.findIndex(oe=>oe!=null&&!Ui(s.current,oe,w)),J=Se.reduce((oe,Ee,We)=>Ee!=null&&!Ui(s.current,Ee,w)?We:oe,-1);if(L.current=Se[DM({current:Se.map(oe=>oe!=null?s.current[oe]:null)},{event:se,orientation:y,loop:d,cols:S,disabledIndices:FM([...w||s.current.map((oe,Ee)=>Ui(s.current,Ee)?Ee:void 0),void 0],Se),minIndex:st,maxIndex:J,prevIndex:kM(L.current>Te?ie:L.current,ot,Se,S,se.key===ps?"bl":se.key===co?"tr":"tl"),stopEvent:!0})],_(L.current),y==="both")return}if(mv(se.key,y)){if(gt(se),n&&!p&&Ut(se.currentTarget.ownerDocument)===se.currentTarget){L.current=au(se.key,y,h)?ie:Te,_(L.current);return}au(se.key,y,h)?d?L.current=ve>=Te?u&&ve!==s.current.length?-1:ie:St(s,{startingIndex:ve,disabledIndices:w}):L.current=Math.min(Te,St(s,{startingIndex:ve,disabledIndices:w})):d?L.current=ve<=ie?u&&ve!==-1?s.current.length:Te:St(s,{startingIndex:ve,decrement:!0,disabledIndices:w}):L.current=Math.max(ie,St(s,{startingIndex:ve,decrement:!0,disabledIndices:w})),ms(s,L.current)?_(null):_(L.current)}}),me=C.useMemo(()=>p&&n&&re&&{"aria-activedescendant":W||V},[p,n,re,W,V]),we=C.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!yy(o.domReference)&&me,onKeyDown:le,onPointerMove(){D.current=!0}}),[me,le,o.domReference,y]),ze=C.useMemo(()=>{function se(ie){m==="auto"&&my(ie.nativeEvent)&&(k.current=!0)}function ve(ie){k.current=m,m==="auto"&&Vc(ie.nativeEvent)&&(k.current=!0)}return{...me,onKeyDown(ie){D.current=!1;const Te=ie.key.indexOf("Arrow")===0,ot=ak(ie.key,y,h),Se=gv(ie.key,y,h),st=mv(ie.key,y),J=(f?ot:st)||ie.key==="Enter"||ie.key.trim()==="";if(p&&n){const vt=O==null?void 0:O.nodesRef.current.find(Ot=>Ot.parentId==null),Pt=O&&vt?zM(O.nodesRef.current,vt.id):null;if(Te&&Pt&&E){const Ot=new KeyboardEvent("keydown",{key:ie.key,bubbles:!0});if(ot||Se){var oe,Ee;const Sr=((oe=Pt.context)==null?void 0:oe.elements.domReference)===ie.currentTarget,Fo=Se&&!Sr?(Ee=Pt.context)==null?void 0:Ee.elements.domReference:ot?s.current.find(No=>(No==null?void 0:No.id)===V):null;Fo&&(gt(ie),Fo.dispatchEvent(Ot),U(void 0))}if(st&&Pt.context&&Pt.context.open&&Pt.parentId&&ie.currentTarget!==Pt.context.elements.domReference){var We;gt(ie),(We=Pt.context.elements.domReference)==null||We.dispatchEvent(Ot);return}}return le(ie)}if(!(!n&&!v&&Te)){if(J&&(P.current=f&&st?null:ie.key),f){ot&&(gt(ie),n?(L.current=eu(s,R.current),_(L.current)):r(!0,ie.nativeEvent,"list-navigation"));return}st&&(c!=null&&(L.current=c),gt(ie),!n&&v?r(!0,ie.nativeEvent,"list-navigation"):le(ie),n&&_(L.current))}},onFocus(){n&&!p&&_(null)},onPointerDown:ve,onMouseDown:se,onClick:se}},[V,me,le,R,m,s,f,_,r,n,v,y,h,c,O,p,E]);return C.useMemo(()=>l?{reference:ze,floating:we,item:$}:{},[l,ze,we,$])}const lk=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bo(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=lk.get(i))!=null?n:i,l=fo(),u=Un()!=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 vv=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function wo(e,t){return typeof e=="function"?e(t):e}function ck(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 uk(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=ck(n,i);return!c&&a==="close"&&l("unmounted"),xe(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function dk(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(()=>({...wo(s,c),...wo(n,c)})),{isMounted:m,status:g}=uk(e,{duration:i}),v=yt(n),w=yt(r),y=yt(o),S=yt(s);return xe(()=>{const T=wo(v.current,c),E=wo(y.current,c),I=wo(S.current,c),A=wo(w.current,c)||Object.keys(T).reduce((F,O)=>(F[O]="",F),{});if(g==="initial"&&p(F=>({transitionProperty:F.transitionProperty,...I,...T})),g==="open"&&p({transitionProperty:Object.keys(A).map(vv).join(","),transitionDuration:d+"ms",...I,...A}),g==="close"){const F=E||T;p({transitionProperty:Object.keys(F).map(vv).join(","),transitionDuration:f+"ms",...I,...F})}},[f,y,v,w,S,d,g,c]),{isMounted:m,styles:h}}function fk(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),w=at(a),y=at(l),S=yt(u),T=yt(f);xe(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),xe(()=>{if(r&&m.current===""){var O;g.current=(O=h??i)!=null?O:-1}},[r,h,i]);const E=at(O=>{O?o.current.typing||(o.current.typing=O,y(O)):o.current.typing&&(o.current.typing=O,y(O))}),I=at(O=>{function _(N,B,H){const z=S.current?S.current(B,H):B.find(M=>(M==null?void 0:M.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return z?N.indexOf(z):-1}const k=s.current;if(m.current.length>0&&m.current[0]!==" "&&(_(k,k,m.current)===-1?E(!1):O.key===" "&&gt(O)),k==null||T.current.includes(O.key)||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;r&&O.key!==" "&&(gt(O),E(!0)),k.every(N=>{var B,H;return N?((B=N[0])==null?void 0:B.toLocaleLowerCase())!==((H=N[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===O.key&&(m.current="",g.current=v.current),m.current+=O.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=v.current,E(!1)},d);const P=g.current,D=_(k,[...k.slice((P||0)+1),...k.slice(0,(P||0)+1)],m.current);D!==-1?(w(D),v.current=D):O.key!==" "&&(m.current="",E(!1))}),A=C.useMemo(()=>({onKeyDown:I}),[I]),F=C.useMemo(()=>({onKeyDown:I,onKeyUp(O){O.key===" "&&E(!1)}}),[I,E]);return C.useMemo(()=>c?{reference:A,floating:F}:{},[c,A,F])}function bv(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 hk(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function wv(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,w=Math.sqrt(m*m+g*g)/p;return i=d,a=f,l=h,w}const u=d=>{let{x:f,y:h,placement:p,elements:m,onClose:g,nodeId:v,tree:w}=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:I}=S,A=[E,I],F=ln(S),O=S.type==="mouseleave",_=Xe(m.floating,F),k=Xe(m.domReference,F),L=m.domReference.getBoundingClientRect(),P=m.floating.getBoundingClientRect(),D=p.split("-")[0],N=f>P.right-P.width/2,B=h>P.bottom-P.height/2,H=hk(A,L),z=P.width>L.width,M=P.height>L.height,R=(z?L:P).left,K=(z?L:P).right,ee=(M?L:P).top,Z=(M?L:P).bottom;if(_&&(s=!0,!O))return;if(k&&(s=!1),k&&!O){s=!0;return}if(O&&Le(S.relatedTarget)&&Xe(m.floating,S.relatedTarget)||w&&mr(w.nodesRef.current,v).some(j=>{let{context:W}=j;return W==null?void 0:W.open}))return;if(D==="top"&&h>=L.bottom-1||D==="bottom"&&h<=L.top+1||D==="left"&&f>=L.right-1||D==="right"&&f<=L.left+1)return T();let G=[];switch(D){case"top":G=[[R,L.top+1],[R,P.bottom-1],[K,P.bottom-1],[K,L.top+1]];break;case"bottom":G=[[R,P.top+1],[R,L.bottom-1],[K,L.bottom-1],[K,P.top+1]];break;case"left":G=[[P.right-1,Z],[P.right-1,ee],[L.left+1,ee],[L.left+1,Z]];break;case"right":G=[[L.right-1,Z],[L.right-1,ee],[P.left+1,ee],[P.left+1,Z]];break}function V(j){let[W,U]=j;switch(D){case"top":{const q=[z?W+t/2:N?W+t*4:W-t*4,U+t+1],re=[z?W-t/2:N?W+t*4:W-t*4,U+t+1],$=[[P.left,N||z?P.bottom-t:P.top],[P.right,N?z?P.bottom-t:P.top:P.bottom-t]];return[q,re,...$]}case"bottom":{const q=[z?W+t/2:N?W+t*4:W-t*4,U-t],re=[z?W-t/2:N?W+t*4:W-t*4,U-t],$=[[P.left,N||z?P.top+t:P.bottom],[P.right,N?z?P.top+t:P.bottom:P.top+t]];return[q,re,...$]}case"left":{const q=[W+t+1,M?U+t/2:B?U+t*4:U-t*4],re=[W+t+1,M?U-t/2:B?U+t*4:U-t*4];return[...[[B||M?P.right-t:P.left,P.top],[B?M?P.right-t:P.left:P.right-t,P.bottom]],q,re]}case"right":{const q=[W-t,M?U+t/2:B?U+t*4:U-t*4],re=[W-t,M?U-t/2:B?U+t*4:U-t*4],$=[[B||M?P.left+t:P.right,P.top],[B?M?P.left+t:P.right:P.left+t,P.bottom]];return[q,re,...$]}}}if(!bv([E,I],G)){if(s&&!H)return T();if(!O&&r){const j=c(S.clientX,S.clientY);if(j!==null&&j<.1)return T()}bv([E,I],V([f,h]))?!s&&r&&(o=window.setTimeout(T,40)):T()}}};return u.__options={blockPointerEvents:n},u}const xo=e=>{const t=b.useId(),[n,r]=b.useState(e.open),o=b.useRef(null),s=b.useMemo(()=>[Wi(10),Qc({fallbackAxisSideDirection:"end"}),Xc(),Vy({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=yo({open:n,middleware:s,transform:!0,whileElementsMounted:Ri,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=bs(l),u=go(l),d=bo(l),{getReferenceProps:f,getFloatingProps:h}=vo([c,u,d]);return x.jsxs(b.Fragment,{children:[x.jsx("button",{ref:i.setReference,...f(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(mo,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(vs,{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(Uy,{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]})})})]})},pk=e=>{const t=b.useRef(null),n=b.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=b.useState(!1),{context:a,refs:l}=yo({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=bs(a),u=bo(a),d=go(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:f,getReferenceProps:h}=vo([c,u,d]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(Lr,{...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(Yr,{children:s?x.jsx(mo,{root:t,children:x.jsx(vs,{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})]})},xv=300,mk=500,Tv=(e="")=>Me("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary focus:bg-primary aria-expanded:opacity-80","focus:text-primary-foreground hover:text-primary-foreground","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),lu=b.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),Sv=b.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const l=Un(),c=l!==null,[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(null),g=b.useRef([]),v=b.useRef([]),w=b.useContext(lu),y=Gn(),S=RM(),T=Hy(),{floatingStyles:E,refs:I,context:A}=yo({nodeId:S,open:u,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:Ri,placement:c?"right":"bottom-start",middleware:[Wi({mainAxis:c?0:4,alignmentAxis:c?-4:0}),Qc(),Xc()]}),F=bo(A,{role:"menu",enabled:!0}),O=go(A,{bubbles:!0}),_=Xy(A,{enabled:n,delay:{open:xv},handleClose:wv({blockPointerEvents:!0,buffer:1})}),k=bs(A,{event:"mousedown",toggle:!c,ignoreMouse:c,keyboardHandlers:!0}),L=yv(A,{loop:!0,activeIndex:p,virtual:!0,nested:c,allowEscape:!0,listRef:g,scrollItemIntoView:!0,onNavigate:m}),P=fk(A,{activeIndex:p,listRef:v,resetMs:mk,onMatch:u?m:void 0}),{getReferenceProps:D,getFloatingProps:N,getItemProps:B}=vo([_,k,F,O,L,P]);b.useEffect(()=>{if(!y)return;const z=()=>d(!1),M=R=>{R.nodeId!==S&&R.parentId===l&&d(!1)};return y.events.on("click",z),y.events.on("menuopen",M),()=>{y.events.off("click",z),y.events.off("menuopen",M)}},[y,S,l]),b.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:l,nodeId:S})},[y,u,S,l]);const H=r?i.className:Me(Tv(i.className));return x.jsxs(jM,{id:S,children:[x.jsx(b.Fragment,{children:i.asChild?x.jsx(to,{children:s,ref:Zc([I.setReference,T.ref,a]),tabIndex:c?w.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,...D(w.getItemProps({...i,onFocus(z){var M;(M=i.onFocus)==null||M.call(i,z),h(!1),w.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",ref:Zc([I.setReference,T.ref,a]),tabIndex:c?w.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,...D(w.getItemProps({...i,onFocus(z){var M;(M=i.onFocus)==null||M.call(i,z),h(!1),w.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(tc,{size:14})]})]})}),x.jsx(lu.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:B,setHasFocusInside:h,isOpen:u},children:x.jsx(_M,{elementsRef:g,labelsRef:v,children:u&&x.jsx(mo,{preserveTabOrder:!0,children:x.jsx(vs,{context:A,modal:!1,initialFocus:c?-1:0,returnFocus:!c,children:x.jsx(t,{...N(),ref:I.setFloating,style:{...i.style,...E},className:Me("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})})})})})]})}),gk=b.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=b.useContext(lu),a=Hy({label:r?null:typeof e=="string"?e:t}),l=Gn(),c=a.index===i.activeIndex;return x.jsxs("button",{...o,ref:Zc([a.ref,s]),"data-active":c,"data-open":i.isOpen,type:"button",role:"menuitem",disabled:r,tabIndex:c?0:-1,className:Tv(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]})}),yk=b.forwardRef((e,t)=>Un()!==null?x.jsx(Sv,{...e,isParent:!1,ref:t}):x.jsx(HM,{children:x.jsx(Sv,{...e,isParent:!0,ref:t})})),vk=(e,t)=>Pi()?t:window.matchMedia(e).matches,bk=(e,t=!0)=>{const[n,r]=b.useState(t);return b.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(vk(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},Gt="600ms",wk={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:Gt},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:Gt},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:Gt}},xk={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:Gt},exit:{translateX:["0%","30%"],opacity:0,animationDuration:Gt}},cu={drawer:e=>e==="left"?wk:xk,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:Gt,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:Gt,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:Gt,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:Gt},enter:{opacity:1,scale:[1.05,1],animationDuration:Gt},exit:{opacity:0,scale:.97,animationDuration:Gt}}},Tk=Er("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"}}),Sk={top:0,left:0,right:0,bottom:-1},Ek=e=>e*.62,Ck=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=Ek(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:Sk,whileDrag:{cursor:"grabbing"},className:Me("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})},uu={drawer:"right",sheet:"none",dialog:"none"},Pk=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...s})=>{const i=b.useId(),a=b.useId(),l=bk("(min-width: 64rem)"),c=e!=="dialog",u=l?e==="drawer"?s.position:uu[e]:r?uu[e]:uu.sheet,d=l||r?cu[e]:cu.sheet,f=typeof d=="function"?d(u):d,h=l||r?e:"sheet",{refs:p,context:m}=yo({open:s.open,onOpenChange:s.onChange}),g=bs(m),v=bo(m),w=go(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:S}=vo([g,v,w]),T=s.trigger,E=lr(void 0),I=()=>s.onChange(!1);return x.jsxs(b.Fragment,{children:[s.trigger?x.jsx(b.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(mo,{children:x.jsx(Yr,{presenceAffectsLayout:!0,children:s.open?x.jsx(ek,{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(vs,{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:Tk({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:I,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(mi,{})})}):null,c&&t?x.jsx(Ck,{onChange:s.onChange,parent:p.floating,position:u,sheet:h==="sheet",value:E}):null]})})}):null})})]})},Ik=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}),Ev=({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]=b.useState(!1),f=b.useRef(null),h=e||"span",{refs:p,floatingStyles:m,context:g}=yo({open:u,placement:r,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:Ri,middleware:[Xc(),Wi(5),Qc({fallbackAxisSideDirection:"start"}),Vy({padding:5,element:f})]}),v=Xy(g,{move:!0,delay:{open:xv},enabled:i?s:!1,handleClose:a?wv():null}),w=ik(g,{enabled:i?o:!1}),y=bs(g,{enabled:i?a:!1}),S=go(g,{enabled:i}),T=bo(g,{role:"tooltip",enabled:i}),E=nk(g,{enabled:!!i&&!!l}),{getReferenceProps:I,getFloatingProps:A}=vo([T,S,E,o?w:void 0,s?v:void 0,a?y:void 0]);return x.jsxs(b.Fragment,{children:[x.jsx(h,{ref:p.setReference,...I(c),children:t}),x.jsx(mo,{preserveTabOrder:!0,children:u&&x.jsxs(Nr,{...A(),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(Uy,{ref:f,context:g,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),n]})})]})};class Qi{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++)Qi.getDescendantProperty(a[l],s,r);else s&&Qi.getDescendantProperty(a,s,r)}else r.push(t);return r}}class To{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=To.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=Qi.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=To.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=To.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 To.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 Cv=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>x.jsxs("div",{className:Me("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(Ev,{as:"button",type:"button",title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(Om,{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(b.Fragment,{children:[x.jsx(Im,{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(mP,{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]}),Zi=b.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:w,disabled:y},S)=>{const T=d??h,E=Tt(),I=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:Me("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(Cv,{info:a,hideLeft:v,reportStatus:!0,title:p,placeholder:g,children:I||n?x.jsxs(b.Fragment,{children:[w?null:x.jsx("span",{"aria-disabled":y,className:"text-opacity-70 aria-disabled:text-disabled",children:I}),n?x.jsx(b.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})]})}),Ak=e=>x.jsx(b.Fragment,{children:e.children}),Pv=b.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},s)=>{const i=r.Render??Ak,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(hP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})}),Ok={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},Dk={caseSensitive:!1,sort:!1},Mk=[],kk=b.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=Tt(),v=p.value??p.defaultValue??"",[w,y]=b.useState(!1),[S,T]=b.useState(""),[E,I]=b.useState(v),[A,F]=b.useState(()=>{var $;return(($=r.find(le=>le.value===v))==null?void 0:$.label)??v}),[O,_]=b.useState(null),k=b.useRef(Mk),L=b.useRef(null),P=h&&S!==""?[{value:S,label:S,"data-dynamic":"true"},...r]:r,D=new To(P,["value","label"],Dk).search(S),N=h?void 0:`^(${r.map($=>`${wc($.value)}${$.label?"|"+wc($.label):""}`).join("|")})$`;b.useEffect(()=>{if(p.value){const $=r.find(le=>le.value===p.value);I(($==null?void 0:$.label)??p.value)}},[p.value]);const{x:B,y:H,strategy:z,refs:M,context:R}=yo({open:w,transform:!0,strategy:"absolute",onOpenChange:y,whileElementsMounted:Ri,middleware:[Wi(4),AM({padding:10,elementContext:"reference",apply($){var se;const me=$.elements.reference.parentElement,we=(se=L.current)==null?void 0:se.getBoundingClientRect().width,ze=(me==null?void 0:me.getBoundingClientRect().width)||0;Object.assign($.elements.floating.style,{width:`${ze}px`,overflowY:"auto",maxWidth:`${we}px`,minWidth:`${we}px`,maxHeight:`${Math.min(250,$.availableHeight)}px`})}})]}),K=dk(R,Ok),{getReferenceProps:ee,getFloatingProps:Z,getItemProps:G}=vo([bo(R,{role:"listbox"}),go(R),yv(R,{cols:0,listRef:k,loop:!0,virtual:!0,allowEscape:!0,activeIndex:O,selectedIndex:O,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:$=>_(le=>$??le)})]);b.useEffect(()=>{const $=M.reference.current;if($)return Gs($)},[]);const V=($,le)=>{I($.value);const me=M.reference.current;if(!me)return;me==null||me.setAttribute("data-value",$.value),me.value=$.value;const we=new Event("change",{bubbles:!1,cancelable:!0});me.dispatchEvent(we),p.onChange&&p.onChange(we),F($.label??""),y(!1),T(""),_(le)},j=$=>{var me;const le=$.target.value;return T(le),!w&&le===""?y(!0):($.target.name=p.name||"",le?y(!0):(me=p.onChange)==null?void 0:me.call(p,$))},W=()=>{y(!0),T("")},U=()=>{var $;y(!0),($=M.reference.current)==null||$.focus()},q=$=>{var le;$.stopPropagation(),(le=M.reference.current)==null||le.setAttribute("data-value",""),bf(M.reference.current),T(""),I(""),F(""),y(!1)},re=p.id||p.name;return x.jsxs(Zi,{...p,left:e,error:t,ref:L,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(Pm,{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(mi,{size:15}),x.jsx("span",{className:"sr-only",children:g.inputCloseValue})]}):null]}),children:[x.jsx("input",{...ee({...p,onChange:j,onFocus:W,pattern:N,ref:M.setReference,name:`${re}-shadow`,id:`${re}-shadow`,onClick:$=>$.currentTarget.focus(),onKeyDown($){if($.key==="Escape")return $.currentTarget.blur(),y(!1);if($.key==="Enter"){if(O!==null&&D[O])return $.preventDefault(),V(D[O],O);if(D.length===1)return $.preventDefault(),V(D[0],0)}}}),"data-value":E,"data-error":!!t,"data-name":re,"data-target":re,required:f,value:w?S:A||E,"aria-autocomplete":"list",autoComplete:"off",className:Me("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:re,name:re,type:"hidden","data-origin":re,ref:m,required:f,defaultValue:p.value||E||void 0}),x.jsx(mo,{preserveTabOrder:!0,children:w?x.jsx(vs,{disabled:p.disabled,guards:!0,returnFocus:!1,context:R,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("ul",{...Z({ref:M.setFloating,style:{position:z,left:(B??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:[D.map(($,le)=>{const me=E===$.value||E===$.label;return x.jsx(Pv,{...G({onClick:()=>V($,le),ref:we=>void(k.current[le]=we),selected:O===le}),option:$,active:me,selected:O===le},`${$.value}-option`)}),D.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})]})}),Iv=b.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:Me("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:Me("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:Me("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),Av=(e,t,n,r)=>b.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,...w},y)=>{const S=e,T=w.id??w.name,E=b.useRef(null);return b.useEffect(()=>{if(E.current===null)return;const I=E.current,A=Gs(E.current),F=r==null?void 0:r(I),O=_=>{const k=_;if(k.key==="Enter"&&I.enterKeyHint==="next"){const L=I.getAttribute("data-next");if(L){const P=document.getElementById(L);if(P)return P.focus(),void k.preventDefault()}}};return I.addEventListener("keydown",O),()=>{F==null||F(),A(),I.removeEventListener("keydown",O)}},[]),x.jsx(Zi,{...n,componentName:t,info:a,container:h,error:v,feedback:i,hideLeft:p,left:g,optionalText:f,right:m,rightLabel:d,interactive:u,form:w.form,id:w.name||w.id,name:w.name,labelClassName:l,title:w.title,placeholder:w.placeholder,required:w.required,disabled:w.disabled,children:x.jsx(S,{...n,...w,id:T,name:T,type:s,"data-next":c,"aria-busy":w.disabled,"aria-disabled":w.disabled,"aria-readonly":w.readOnly,ref:qa(y,E),className:Me("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",w.className)})})}),ws=Av(dg,"input",{type:"text"}),Ov=new Date(1970,11,31),du={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},Dv={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},Fk={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")},fu=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},Nk=b.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=t||Pg(),l=b.useId(),c=Tt(),u=b.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[d,f]=b.useState(e||void 0),[h,p]=b.useState(!1),m=fu(u,Ov).flatMap(I=>vn.keyof(du,I.type)?du[I.type](I.value):[]),g=fu(u,Ov).reduce((I,A)=>I+(vn.keyof(Dv,A.type)?Dv[A.type](A.value):""),""),[v,w]=b.useState(d?fu(u,d).reduce((I,A)=>I+(vn.keyof(du,A.type)?Fk[A.type](d,A.value):""),""):""),y=I=>{const A=I.target.value;if(w(A),m.length===A.length&&m.every((O,_)=>{const k=A.charAt(_);return typeof O=="string"?k===O:O.test(k)})){const O=Qr(CA(A,g,new Date));return f(O),r==null?void 0:r(O)}return f(void 0),r==null?void 0:r(void 0)},S=I=>(f(I),r==null||r(I),w(I?PI(I,g):"")),T=_m(d),E=T?d.toISOString():void 0;return x.jsx(ws,{...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(b.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(xo,{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(fP,{})]}),buttonProps:{"aria-describedby":l},children:x.jsx(Lg,{...s,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:S,disabledDate:n,date:T?d:void 0})})]})})}),Lk=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],_k=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Vk=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],$k=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Mv=(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 kv(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?$k:Vk:t.binary?_k:Lk,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=Mv(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=Mv(Number(e),t.locale,i),c=n[a];return s+l+r+c}var hu={exports:{}},Ji={exports:{}},Oe={};/** @license React v16.13.1
178
178
  * react-is.production.min.js
179
179
  *
180
180
  * Copyright (c) Facebook, Inc. and its affiliates.