tokentracker-cli 0.5.89 → 0.5.90
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/dashboard/dist/assets/{Card-CnqcfvmO.js → Card-DmEuggKt.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-CL9LvAb4.js → DashboardPage-y-23SkNx.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-DnSCeL3V.js → FadeIn-CIKEJ1mC.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-BzBH9Pzc.js → IpCheckPage-gySQmJPU.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage--a89meL8.js → LeaderboardPage-NXXlBlrm.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-CPlgciKL.js → LeaderboardProfilePage-DzLc0enb.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-gI3NxbAg.js → LimitsPage-DuFEVRFB.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-DSxDP7iu.js → PopoverPopup-RgvO6hnU.js} +1 -1
- package/dashboard/dist/assets/ProviderIcon-C4FxGWlI.js +1 -0
- package/dashboard/dist/assets/{SettingsPage-CSBDnXij.js → SettingsPage-CmdNVChM.js} +1 -1
- package/dashboard/dist/assets/SkillsPage-Dkv9LvM1.js +1 -0
- package/dashboard/dist/assets/{WidgetsPage-COk7qbro.js → WidgetsPage-C8SSZ3VZ.js} +1 -1
- package/dashboard/dist/assets/{chevron-down-DoncrDIk.js → chevron-down-BS4d25ie.js} +1 -1
- package/dashboard/dist/assets/{download-DjhGgU2Q.js → download-Cs4or3vN.js} +1 -1
- package/dashboard/dist/assets/{leaderboard-columns-eCqUMOqF.js → leaderboard-columns-5fNRo700.js} +1 -1
- package/dashboard/dist/assets/{main-BkcFhXuV.js → main-Dirgz7qK.js} +2 -2
- package/dashboard/dist/assets/main-HVmSQFS6.css +1 -0
- package/dashboard/dist/assets/{refresh-cw-BvjQfCG5.js → refresh-cw-oESlYWjZ.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-D8X45HMo.js → use-limits-display-prefs-LMbFljwt.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-BHpLvxeC.js → use-native-settings-B9dgqLeX.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-B6fyz2im.js → use-usage-limits-Z6xWV0y7.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/dashboard/dist/assets/ProviderIcon-CXJvW9mJ.js +0 -1
- package/dashboard/dist/assets/SkillsPage-ZSajczMn.js +0 -1
- package/dashboard/dist/assets/main-DDHZqhEq.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aD as Ue,av as se,az as et,aI as Mo,aJ as Ao,r as d,aw as z,aA as Fo,aK as ls,ax as be,aL as us,D as ee,aB as je,aM as Ot,a6 as _e,aN as fs,F as ze,aF as qn,aG as Ce,aO as Pe,aP as ct,aC as ie,aQ as We,aR as Gn,aS as Cn,aT as Tn,aU as ft,aV as Ke,aW as ds,aX as Lo,aY as ps,aZ as Pt,a_ as Zt,E as gs}from"./main-BkcFhXuV.js";const ms=500,hs={style:{transition:"none"}},Do="data-base-ui-click-trigger",Ya={fallbackAxisSide:"none"},bs={fallbackAxisSide:"end"},vs={clipPath:"inset(50%)",position:"fixed",top:0,left:0},No={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Bo={...No,position:"fixed",top:0,left:0},Ua={...No,position:"absolute"};function Fe(e){const t=Ue(ys,e).current;return t.next=e,se(t.effect),t}function ys(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ht=Symbol("NOT_FOUND");function Es(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Rs(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function xs(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var Xn=e=>Array.isArray(e)?e:[e];function Ss(e){const t=Array.isArray(e[0])?e[0]:e;return xs(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ws(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function Cs(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Ht},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ts(e,t){let n=[];function o(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return Ht}function r(a,c){o(a)===Ht&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var Os=(e,t)=>e===t;function Ps(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Is(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=Os,maxSize:r=1,resultEqualityCheck:s}=n,i=Ps(o);let a=0;const c=r<=1?Cs(i):Ts(r,i);function l(){let u=c.get(arguments);if(u===Ht){if(u=e.apply(null,arguments),a++,s){const p=c.getEntries().find(m=>s(m.value,u));p&&(u=p.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var ks=class{constructor(e){this.value=e}deref(){return this.value}},Ms=typeof WeakRef<"u"?WeakRef:ks,As=0,Kn=1;function Ft(){return{s:As,v:void 0,o:null,p:null}}function $o(e,t={}){let n=Ft();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const m=arguments[f];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=a.o;g===null&&(a.o=g=new WeakMap);const h=g.get(m);h===void 0?(a=Ft(),g.set(m,a)):a=h}else{let g=a.p;g===null&&(a.p=g=new Map);const h=g.get(m);h===void 0?(a=Ft(),g.set(m,a)):a=h}}const l=a;let u;if(a.s===Kn)u=a.v;else if(u=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,u)&&(u=f,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Ms(u):u}return l.s=Kn,l.v=u,u}return i.clearCache=()=>{n=Ft(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Wo(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),Es(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:m=$o,argsMemoizeOptions:g=[]}=u,h=Xn(p),v=Xn(g),y=Ss(r),b=f(function(){return s++,l.apply(null,arguments)},...h),E=m(function(){i++;const w=ws(y,arguments);return a=b.apply(null,w),a},...v);return Object.assign(E,{resultFunc:l,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:m})};return Object.assign(o,{withTypes:()=>o}),o}var Fs=Wo($o),Ls=Object.assign((e,t=Fs)=>{Rs(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>Ls});Wo({memoize:Is,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const G=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(et(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var on={exports:{}},rn={};var Zn;function Ds(){if(Zn)return rn;Zn=1;var e=Mo();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var m=p(),g=o({inst:{value:m,getSnapshot:p}}),h=g[0].inst,v=g[1];return s(function(){h.value=m,h.getSnapshot=p,c(h)&&v({inst:h})},[f,m,p]),r(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),i(m),m}function c(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!n(f,m)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return rn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,rn}var Jn;function Vo(){return Jn||(Jn=1,on.exports=Ds()),on.exports}var Ns=Vo(),sn={exports:{}},cn={};var Qn;function Bs(){if(Qn)return cn;Qn=1;var e=Mo(),t=Vo();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return cn.useSyncExternalStoreWithSelector=function(l,u,f,p,m){var g=s(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=a(function(){function y(O){if(!b){if(b=!0,E=O,O=p(O),m!==void 0&&h.hasValue){var C=h.value;if(m(C,O))return S=C}return S=O}if(C=S,o(E,O))return C;var I=p(O);return m!==void 0&&m(C,I)?(E=O,C):(E=O,S=I)}var b=!1,E,S,w=f===void 0?null:f;return[function(){return y(u())},w===null?void 0:function(){return y(w())}]},[u,f,p,m]);var v=r(l,g[0],g[1]);return i(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},cn}var eo;function $s(){return eo||(eo=1,sn.exports=Bs()),sn.exports}var Ws=$s();const Vs=Ao(19),js=Vs?_s:Ys;function Hs(e,t,n,o,r){return js(e,t,n,o,r)}function _s(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return Ns.useSyncExternalStore(e.subscribe,s,s)}function Ys(e,t,n,o,r){return Ws.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class St{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){St.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||St.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};St.prototype.setState.call(this,t)}}class On extends St{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;se(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);se(()=>{n.update(t)},[n,...o])}useControlledProp(t,n,o){d.useDebugValue(t);const r=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),se(()=>{s&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,o,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{d.useDebugValue(t);const s=this.selectors[t];return Hs(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=z(n??Fo);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const Us=[];function Pn(e){d.useEffect(e,Us)}const Lt=null;class zs{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Dt=new zs;class Ae{static create(){return new Ae}static request(t){return Dt.request(t)}static cancel(t){return Dt.cancel(t)}currentId=Lt;request(t){this.cancel(),this.currentId=Dt.request(()=>{this.currentId=Lt,t()})}cancel=()=>{this.currentId!==Lt&&(Dt.cancel(this.currentId),this.currentId=Lt)};disposeEffect=()=>this.cancel}function In(){const e=Ue(Ae.create).current;return Pn(e.disposeEffect),e}const xt=0;class Ye{static create(){return new Ye}currentId=xt;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xt,n()},t)}isStarted(){return this.currentId!==xt}clear=()=>{this.currentId!==xt&&(clearTimeout(this.currentId),this.currentId=xt)};disposeEffect=()=>this.clear}function Je(){const e=Ue(Ye.create).current;return Pn(e.disposeEffect),e}const ht=typeof navigator<"u",an=Ks(),jo=Js(),Ho=Zs(),qs=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),_o=an.platform==="MacIntel"&&an.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(an.platform),Gs=ht&&/apple/i.test(navigator.vendor),hn=ht&&/android/i.test(jo)||/android/i.test(Ho);ht&&jo.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Xs=Ho.includes("jsdom/");function Ks(){if(!ht)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Zs(){if(!ht)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Js(){if(!ht)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const bn="data-base-ui-focusable",Yo="active",Uo="selected",zo="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",za="ArrowLeft",qa="ArrowRight",Ga="ArrowUp",Xa="ArrowDown";function it(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ls(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ee(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Te(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 Qs(e){return e.matches("html,body")}function fe(e){return e?.ownerDocument||document}function qo(e){return be(e)&&e.matches(zo)}function to(e){return e?e.getAttribute("role")==="combobox"&&qo(e):!1}function vn(e){return e?e.hasAttribute(bn)?e:e.querySelector(`[${bn}]`)||e:null}function Ze(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...Ze(e,r.id,n)])}function no(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function ei(e){e.preventDefault(),e.stopPropagation()}function ti(e){return"nativeEvent"in e}function ni(e){return e.mozInputSource===0&&e.isTrusted?!0:hn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oi(e){return Xs?!1:!hn&&e.width===0&&e.height===0||hn&&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 dt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Go(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const ri=["top","right","bottom","left"],pt=Math.min,Re=Math.max,_t=Math.round,Nt=Math.floor,Le=e=>({x:e,y:e}),si={left:"right",right:"left",bottom:"top",top:"bottom"};function yn(e,t,n){return Re(e,pt(t,n))}function $e(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function kn(e){return e==="x"?"y":"x"}function Mn(e){return e==="y"?"height":"width"}function we(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function An(e){return kn(we(e))}function ii(e,t,n){n===void 0&&(n=!1);const o=qe(e),r=An(e),s=Mn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yt(i)),[i,Yt(i)]}function ci(e){const t=Yt(e);return[En(e),t,En(t)]}function En(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const oo=["left","right"],ro=["right","left"],ai=["top","bottom"],li=["bottom","top"];function ui(e,t,n){switch(e){case"top":case"bottom":return n?t?ro:oo:t?oo:ro;case"left":case"right":return t?ai:li;default:return[]}}function fi(e,t,n,o){const r=qe(e);let s=ui(ye(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(En)))),s}function Yt(e){const t=ye(e);return si[t]+e.slice(t.length)}function di(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xo(e){return typeof e!="number"?di(e):{top:e,right:e,bottom:e,left:e}}function Ut(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}var pi=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],zt=pi.join(","),Ko=typeof Element>"u",gt=Ko?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qt=!Ko&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Gt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Gt(t.parentNode));return i},gi=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Zo=function(t,n,o){if(Gt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(zt));return n&>.call(t,zt)&&r.unshift(t),r=r.filter(o),r},Xt=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Gt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Xt(c,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=gt.call(i,zt);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Gt(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var m=Xt(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,m):r.push({scopeParent:i,candidates:m})}else s.unshift.apply(s,i.children)}}return r},Jo=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Qo=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||gi(t))&&!Jo(t)?0:t.tabIndex},mi=function(t,n){var o=Qo(t);return o<0&&n&&!Jo(t)?0:o},hi=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},er=function(t){return t.tagName==="INPUT"},bi=function(t){return er(t)&&t.type==="hidden"},vi=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},yi=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ei=function(t){if(!t.name)return!0;var n=t.form||qt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(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=yi(r,t.form);return!s||s===t},Ri=function(t){return er(t)&&t.type==="radio"},xi=function(t){return Ri(t)&&!Ei(t)},Si=function(t){var n,o=t&&qt(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,c;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var l,u,f;o=qt(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},so=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},wi=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=gt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(gt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=qt(t);if(l&&!l.shadowRoot&&r(l)===!0)return so(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(Si(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return so(t);return!1},Ci=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return gt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Rn=function(t,n){return!(n.disabled||bi(n)||wi(n,t)||vi(n)||Ci(n))},xn=function(t,n){return!(xi(n)||Qo(n)<0||!Rn(t,n))},Ti=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},tr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=mi(a,i),l=i?tr(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:l})}),o.sort(hi).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},It=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Xt([t],n.includeContainer,{filter:xn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ti}):o=Zo(t,n.includeContainer,xn.bind(null,n)),tr(o)},Oi=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Xt([t],n.includeContainer,{filter:Rn.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Zo(t,n.includeContainer,Rn.bind(null,n)),o},nr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return gt.call(t,zt)===!1?!1:xn(n,t)};const bt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function or(e,t){const n=It(e,bt()),o=n.length;if(o===0)return;const r=it(fe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Fn(e){return or(fe(e).body,1)||e}function rr(e){return or(fe(e).body,-1)||e}function sr(e,t){if(!e)return null;const n=It(fe(e).body,bt()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function Pi(e){return sr(e,1)}function Ii(e){return sr(e,-1)}function at(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!re(n,o)}function ki(e){It(e,bt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function io(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const Mi={...us};let co=0;function Ai(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(co+=1,o(`${t}-${co}`))},[n,t]),r}const ao=Mi.useId;function vt(e,t){if(ao!==void 0){const n=ao();return e??(t?`${t}-${n}`:n)}return Ai(e,t)}function ir(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Fi{nodesRef={current:[]};events=ir();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const cr=d.createContext(null),ar=d.createContext(null),tt=()=>d.useContext(cr)?.id||null,yt=e=>{const t=d.useContext(ar);return e??t};function Li(e){const t=vt(),n=yt(e),o=tt();return se(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function Di(e){const{children:t,id:n}=e,o=tt();return ee.jsx(cr.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Ni(e){const{children:t,externalTree:n}=e,o=Ue(()=>n??new Fi).current;return ee.jsx(ar.Provider,{value:o,children:t})}const Bi="none",He="trigger-press",xe="trigger-hover",lr="outside-press",Ka="item-press",Za="close-press",wt="focus-out",ur="escape-key",Ja="list-navigation",Qa="cancel-open",fr="imperative-action",el="window-resize";function ce(e,t,n,o){let r=!1,s=!1;const i=je;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function Ct(e){return`data-base-ui-${e}`}function ln(e,t,n){if(n&&!dt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function nt(e){return e?.ownerDocument||document}const mt=d.forwardRef(function(t,n){const[o,r]=d.useState();se(()=>{Gs&&r("button")},[]);const s={tabIndex:0,role:o};return ee.jsx("span",{...t,ref:n,style:Bo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let lo=0;function un(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(lo);const s=()=>e?.focus({preventScroll:n});r?s():lo=requestAnimationFrame(s)}const lt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function uo(e){return e==="inert"?lt.inert:e==="aria-hidden"?lt["aria-hidden"]:lt.none}let Bt=new WeakSet,$t={},fn=0;const dr=e=>e&&(e.host||dr(e.parentNode)),$i=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=dr(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Wi(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=$i(t,e),a=new Set,c=new Set(i),l=[];$t[r]||($t[r]=new WeakMap);const u=$t[r];i.forEach(f),p(t),a.clear();function f(m){!m||a.has(m)||(a.add(m),m.parentNode&&f(m.parentNode))}function p(m){!m||c.has(m)||[].forEach.call(m.children,g=>{if(Ot(g)!=="script")if(a.has(g))p(g);else{const h=s?g.getAttribute(s):null,v=h!==null&&h!=="false",y=uo(s),b=(y.get(g)||0)+1,E=(u.get(g)||0)+1;y.set(g,b),u.set(g,E),l.push(g),b===1&&v&&Bt.add(g),E===1&&g.setAttribute(r,""),!v&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return fn+=1,()=>{l.forEach(m=>{const g=uo(s),v=(g.get(m)||0)-1,y=(u.get(m)||0)-1;g.set(m,v),u.set(m,y),v||(!Bt.has(m)&&s&&m.removeAttribute(s),Bt.delete(m)),y||m.removeAttribute(r)}),fn-=1,fn||(lt.inert=new WeakMap,lt["aria-hidden"]=new WeakMap,lt.none=new WeakMap,Bt=new WeakSet,$t={})}}function Vi(e,t=!1,n=!1){const o=fe(e[0]).body;return Wi(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const pr=d.createContext(null),gr=()=>d.useContext(pr),ji=Ct("portal");function Hi(e={}){const{ref:t,container:n,componentProps:o=je,elementProps:r,elementState:s}=e,i=vt(),c=gr()?.portalNode,[l,u]=d.useState(null),[f,p]=d.useState(null),m=z(y=>{y!==null&&p(y)}),g=d.useRef(null);se(()=>{if(n===null){g.current&&(g.current=null,p(null),u(null));return}if(i==null)return;const y=(n&&(fs(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,p(null),u(null));return}g.current!==y&&(g.current=y,p(null),u(y))},[n,c,i]);const h=ze("div",o,{ref:[t,m],state:s,props:[{id:i,[ji]:""},r]});return{portalNode:f,portalSubtree:l&&h?_e.createPortal(h,l):null}}const mr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=Hi({container:r,ref:n,componentProps:t,elementProps:c}),f=d.useRef(null),p=d.useRef(null),m=d.useRef(null),g=d.useRef(null),[h,v]=d.useState(null),y=h?.modal,b=h?.open,E=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!l;d.useEffect(()=>{if(!l||y)return;function w(O){l&&O.relatedTarget&&at(O)&&(O.type==="focusin"?io:ki)(l)}return l.addEventListener("focusin",w,!0),l.addEventListener("focusout",w,!0),()=>{l.removeEventListener("focusin",w,!0),l.removeEventListener("focusout",w,!0)}},[l,y]),d.useEffect(()=>{!l||b||io(l)},[b,l]);const S=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return ee.jsxs(d.Fragment,{children:[u,ee.jsxs(pr.Provider,{value:S,children:[E&&l&&ee.jsx(mt,{"data-type":"outside",ref:f,onFocus:w=>{if(at(w,l))m.current?.focus();else{const O=h?h.domReference:null;rr(O)?.focus()}}}),E&&l&&ee.jsx("span",{"aria-owns":l.id,style:vs}),l&&_e.createPortal(o,l),E&&l&&ee.jsx(mt,{"data-type":"outside",ref:p,onFocus:w=>{if(at(w,l))g.current?.focus();else{const O=h?h.domReference:null;Fn(O)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ce(wt,w.nativeEvent))}}})]})]})});function Be(e){return e==null?e:"current"in e?e.current:e}function _i(e,t){const n=Ce(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const fo=20;let Ve=[];function Ln(){Ve=Ve.filter(e=>e.isConnected)}function Yi(e){Ln(),e&&Ot(e)!=="body"&&(Ve.push(e),Ve.length>fo&&(Ve=Ve.slice(-fo)))}function dn(){return Ln(),Ve[Ve.length-1]}function Ui(e){if(!e)return null;const t=bt();return nr(e,t)?e:It(e,t)[0]||e}function zi(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Pe(e).display!=="none"}function po(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=bt(),r=Oi(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return nr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function hr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:h}=e,v="rootStore"in t?t.rootStore:t,y=v.useState("open"),b=v.useState("domReferenceElement"),E=v.useState("floatingElement"),{events:S,dataRef:w}=v.context,O=z(()=>w.current.floatingContext?.nodeId),C=z(f),I=s===!1,N=to(b)&&I,k=Fe(r),L=Fe(s),A=Fe(i),T=Fe(u),D=yt(h),P=gr(),V=d.useRef(null),B=d.useRef(null),x=d.useRef(!1),F=d.useRef(!1),Q=d.useRef(!1),X=d.useRef(-1),K=d.useRef(""),Z=d.useRef(""),_=d.useRef(null),ne=d.useRef(null),U=qn(_,g,P?.beforeInsideRef),J=qn(ne,P?.afterInsideRef),de=Je(),pe=Je(),ge=In(),De=P!=null,R=vn(E),Y=z((M=R)=>M?It(M,bt()):[]),$=z(M=>{const W=Y(M);return k.current.map(()=>W).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function M(q){q.key==="Tab"&&re(R,it(fe(R)))&&Y().length===0&&!N&&ei(q)}const W=fe(R);return W.addEventListener("keydown",M),()=>{W.removeEventListener("keydown",M)}},[o,b,R,c,k,N,Y,$]),d.useEffect(()=>{if(o||!E)return;function M(W){const q=Ee(W),oe=Y().indexOf(q);oe!==-1&&(X.current=oe)}return E.addEventListener("focusin",M),()=>{E.removeEventListener("focusin",M)}},[o,E,Y]),d.useEffect(()=>{if(o||!y)return;const M=fe(R);function W(){Q.current=!1}function q(oe){const H=Ee(oe),j=re(E,H)||re(b,H)||re(P?.portalNode,H);Q.current=!j,Z.current=oe.pointerType||"keyboard"}function te(){Z.current="keyboard"}return M.addEventListener("pointerdown",q,!0),M.addEventListener("pointerup",W,!0),M.addEventListener("pointercancel",W,!0),M.addEventListener("keydown",te,!0),()=>{M.removeEventListener("pointerdown",q,!0),M.removeEventListener("pointerup",W,!0),M.removeEventListener("pointercancel",W,!0),M.removeEventListener("keydown",te,!0)}},[o,E,b,R,y,P]),d.useEffect(()=>{if(o||!l)return;function M(){F.current=!0,pe.start(0,()=>{F.current=!1})}function W(H){const j=H.relatedTarget,me=H.currentTarget,ae=Ee(H);queueMicrotask(()=>{const Ne=O(),Ge=v.context.triggerElements,ot=j?.hasAttribute(Ct("focus-guard"))&&[_.current,ne.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Be(m),Be(p)].includes(j),Xe=!(re(b,j)||re(E,j)||re(j,E)||re(P?.portalNode,j)||j!=null&&Ge.hasElement(j)||Ge.hasMatchingElement(he=>re(he,j))||ot||D&&(Ze(D.nodesRef.current,Ne).find(he=>re(he.context?.elements.floating,j)||re(he.context?.elements.domReference,j))||no(D.nodesRef.current,Ne).find(he=>[he.context?.elements.floating,vn(he.context?.elements.floating)].includes(j)||he.context?.elements.domReference===j)));if(me===b&&R&&po(R,k),a&&me!==b&&!zi(ae)&&it(fe(R))===fe(R).body){if(be(R)&&(R.focus(),a==="popup")){ge.request(()=>{R.focus()});return}const he=X.current,Ie=Y(),ke=Ie[he]||Ie[Ie.length-1]||R;be(ke)&&ke.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!c)&&j&&Xe&&!F.current&&(N||j!==dn())&&(x.current=!0,v.setOpen(!1,ce(wt,H)))})}function q(){Q.current||(w.current.insideReactTree=!0,de.start(0,()=>{w.current.insideReactTree=!1}))}const te=be(b)?b:null,oe=[];if(!(!E&&!te))return te&&(te.addEventListener("focusout",W),te.addEventListener("pointerdown",M),oe.push(()=>{te.removeEventListener("focusout",W),te.removeEventListener("pointerdown",M)})),E&&(E.addEventListener("focusout",W),P&&(E.addEventListener("focusout",q,!0),oe.push(()=>{E.removeEventListener("focusout",q,!0)})),oe.push(()=>{E.removeEventListener("focusout",W)})),()=>{oe.forEach(H=>{H()})}},[o,b,E,R,c,D,P,v,l,a,Y,N,O,k,w,de,pe,ge,p,m]),d.useEffect(()=>{if(o||!E||!y)return;const M=Array.from(P?.portalNode?.querySelectorAll(`[${Ct("portal")}]`)||[]),q=(D?no(D.nodesRef.current,O()):[]).find(H=>to(H.context?.elements.domReference||null))?.context?.elements.domReference,te=[E,q,...M,...C(),V.current,B.current,_.current,ne.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Be(m),Be(p),N?b:null].filter(H=>H!=null),oe=Vi(te,c||N);return()=>{oe()}},[y,o,b,E,c,k,P,N,D,O,C,p,m]),se(()=>{if(!y||o||!be(R))return;const M=fe(R),W=it(M);queueMicrotask(()=>{const q=$(R),te=L.current,oe=typeof te=="function"?te(T.current||""):te;if(oe===void 0||oe===!1)return;let H;oe===!0||oe===null?H=q[0]||R:H=Be(oe),H=H||q[0]||R,!re(R,W)&&un(H,{preventScroll:H===R})})},[o,y,R,I,$,L,T]),se(()=>{if(o||!R)return;const M=fe(R),W=it(M);Yi(W);function q(H){if(H.open||(K.current=_i(H.nativeEvent,Z.current)),H.reason===xe&&H.nativeEvent.type==="mouseleave"&&(x.current=!0),H.reason===lr)if(H.nested)x.current=!1;else if(ni(H.nativeEvent)||oi(H.nativeEvent))x.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?x.current=!1:x.current=!0}}S.on("openchange",q);const te=M.createElement("span");te.setAttribute("tabindex","-1"),te.setAttribute("aria-hidden","true"),Object.assign(te.style,Bo),De&&b&&b.insertAdjacentElement("afterend",te);function oe(){const H=A.current;let j=typeof H=="function"?H(K.current):H;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const ae=b||dn();return ae&&ae.isConnected?ae:te}const me=b||dn()||te;return Be(j)||me}return()=>{S.off("openchange",q);const H=it(M),j=re(E,H)||D&&Ze(D.nodesRef.current,O(),!1).some(ae=>re(ae.context?.elements.floating,H)),me=oe();queueMicrotask(()=>{const ae=Ui(me),Ne=typeof A.current!="boolean";A.current&&!x.current&&be(ae)&&(!(!Ne&&ae!==H&&H!==M.body)||j)&&ae.focus({preventScroll:!0}),te.remove()})}},[o,E,R,A,w,S,D,De,b,O]),d.useEffect(()=>{queueMicrotask(()=>{x.current=!1})},[o]),d.useEffect(()=>{if(o||!y)return;function M(q){Ee(q)?.closest(`[${Do}]`)&&(F.current=!0)}const W=fe(R);return W.addEventListener("pointerdown",M,!0),()=>{W.removeEventListener("pointerdown",M,!0)}},[o,y,R]),se(()=>{if(!o&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:y,onOpenChange:v.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,c,y,v,l,b]),se(()=>{if(!(o||!R))return po(R,k),()=>{queueMicrotask(Ln)}},[o,R,k]);const ue=!o&&(c?!N:!0)&&(De||c);return ee.jsxs(d.Fragment,{children:[ue&&ee.jsx(mt,{"data-type":"inside",ref:U,onFocus:M=>{if(c){const W=$();un(W[W.length-1])}else P?.portalNode&&(x.current=!1,at(M,P.portalNode)?Fn(b)?.focus():Be(m??P.beforeOutsideRef)?.focus())}}),n,ue&&ee.jsx(mt,{"data-type":"inside",ref:J,onFocus:M=>{c?un($()[0]):P?.portalNode&&(l&&(x.current=!0),at(M,P.portalNode)?rr(b)?.focus():Be(p??P.afterOutsideRef)?.focus())}})]})}function qi(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=d.useRef(void 0),f=In(),p=Je(),m=d.useMemo(()=>({onPointerDown(g){u.current=g.pointerType},onMouseDown(g){const h=u.current,v=g.nativeEvent,y=n.select("open");if(g.button!==0||s==="click"||dt(h,!0)&&a)return;const b=o.current.openEvent,E=b?.type,S=n.select("domReferenceElement")!==g.currentTarget,w=y&&S||!(y&&i&&(!(b&&c)||E==="click"||E==="mousedown"));if(qo(v.target)){const C=ce(He,v,v.target);w&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,C)}):n.setOpen(w,C);return}const O=g.currentTarget;f.request(()=>{const C=ce(He,v,O);w&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,C)}):n.setOpen(w,C)})},onClick(g){if(s==="mousedown-only")return;const h=u.current;if(s==="mousedown"&&h){u.current=void 0;return}if(dt(h,!0)&&a)return;const v=n.select("open"),y=o.current.openEvent,b=n.select("domReferenceElement")!==g.currentTarget,E=v&&b||!(v&&i&&(!(y&&c)||Go(y))),S=ce(He,g.nativeEvent,g.currentTarget);E&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,S)}):n.setOpen(E,S)},onKeyDown(){u.current=void 0}}),[o,s,a,n,c,i,f,p,l]);return d.useMemo(()=>r?{reference:m}:je,[r,m])}function go(e,t,n){let{reference:o,floating:r}=e;const s=we(t),i=An(t),a=Mn(i),c=ye(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let m;switch(c){case"top":m={x:u,y:o.y-r.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:f};break;case"left":m={x:o.x-r.width,y:f};break;default:m={x:o.x,y:o.y}}switch(qe(t)){case"start":m[i]-=p*(n&&l?-1:1);break;case"end":m[i]+=p*(n&&l?-1:1);break}return m}async function Gi(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=$e(t,e),g=Xo(m),v=a[p?f==="floating"?"reference":"floating":f],y=Ut(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},w=Ut(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:E,strategy:c}):b);return{top:(y.top-w.top+g.top)/S.y,bottom:(w.bottom-y.bottom+g.bottom)/S.y,left:(y.left-w.left+g.left)/S.x,right:(w.right-y.right+g.right)/S.x}}const Xi=50,Ki=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Gi},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=go(l,o,c),p=o,m=0;const g={};for(let h=0;h<s.length;h++){const v=s[h];if(!v)continue;const{name:y,fn:b}=v,{x:E,y:S,data:w,reset:O}=await b({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:l,platform:a,elements:{reference:e,floating:t}});u=E??u,f=S??f,g[y]={...g[y],...w},O&&m<Xi&&(m++,typeof O=="object"&&(O.placement&&(p=O.placement),O.rects&&(l=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):O.rects),{x:u,y:f}=go(l,p,c)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:g}},Zi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...v}=$e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ye(r),b=we(a),E=ye(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),w=p||(E||!h?[Yt(a)]:ci(a)),O=g!=="none";!p&&O&&w.push(...fi(a,h,g,S));const C=[a,...w],I=await c.detectOverflow(t,v),N=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&N.push(I[y]),f){const D=ii(r,i,S);N.push(I[D[0]],I[D[1]])}if(k=[...k,{placement:r,overflows:N}],!N.every(D=>D<=0)){var L,A;const D=(((L=s.flip)==null?void 0:L.index)||0)+1,P=C[D];if(P&&(!(f==="alignment"?b!==we(P):!1)||k.every(x=>we(x.placement)===b?x.overflows[0]>0:!0)))return{data:{index:D,overflows:k},reset:{placement:P}};let V=(A=k.filter(B=>B.overflows[0]<=0).sort((B,x)=>B.overflows[1]-x.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(m){case"bestFit":{var T;const B=(T=k.filter(x=>{if(O){const F=we(x.placement);return F===b||F==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(F=>F>0).reduce((F,Q)=>F+Q,0)]).sort((x,F)=>x[1]-F[1])[0])==null?void 0:T[0];B&&(V=B);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ho(e){return ri.some(t=>e[t]>=0)}const Ji=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=$e(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=mo(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ho(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=mo(i,n.floating);return{data:{escapedOffsets:a,escaped:ho(a)}}}default:return{}}}}},br=new Set(["left","top"]);async function Qi(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ye(n),a=qe(n),c=we(n)==="y",l=br.has(i)?-1:1,u=s&&c?-1:1,f=$e(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*u,y:p*l}:{x:p*l,y:m*u}}const ec=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await Qi(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},tc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:E}=y;return{x:b,y:E}}},...l}=$e(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=we(ye(r)),m=kn(p);let g=u[m],h=u[p];if(i){const y=m==="y"?"top":"left",b=m==="y"?"bottom":"right",E=g+f[y],S=g-f[b];g=yn(E,g,S)}if(a){const y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",E=h+f[y],S=h-f[b];h=yn(E,h,S)}const v=c.fn({...t,[m]:g,[p]:h});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[m]:i,[p]:a}}}}}},nc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=$e(e,t),u={x:n,y:o},f=we(r),p=kn(f);let m=u[p],g=u[f];const h=$e(a,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const E=p==="y"?"height":"width",S=s.reference[p]-s.floating[E]+v.mainAxis,w=s.reference[p]+s.reference[E]-v.mainAxis;m<S?m=S:m>w&&(m=w)}if(l){var y,b;const E=p==="y"?"width":"height",S=br.has(ye(r)),w=s.reference[f]-s.floating[E]+(S&&((y=i.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),O=s.reference[f]+s.reference[E]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);g<w?g=w:g>O&&(g=O)}return{[p]:m,[f]:g}}}},oc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=$e(e,t),u=await i.detectOverflow(t,l),f=ye(r),p=qe(r),m=we(r)==="y",{width:g,height:h}=s.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,v=p==="end"?"top":"bottom");const b=h-u.top-u.bottom,E=g-u.left-u.right,S=pt(h-u[v],b),w=pt(g-u[y],E),O=!t.middlewareData.shift;let C=S,I=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=E),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=b),O&&!p){const k=Re(u.left,0),L=Re(u.right,0),A=Re(u.top,0),T=Re(u.bottom,0);m?I=g-2*(k!==0||L!==0?k+L:Re(u.left,u.right)):C=h-2*(A!==0||T!==0?A+T:Re(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:C});const N=await i.getDimensions(a.floating);return g!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function vr(e){const t=Pe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=be(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=_t(n)!==s||_t(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Dn(e){return ie(e)?e:e.contextElement}function ut(e){const t=Dn(e);if(!be(t))return Le(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=vr(t);let i=(s?_t(n.width):n.width)/o,a=(s?_t(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const rc=Le(0);function yr(e){const t=Ce(e);return!Cn()||!t.visualViewport?rc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ce(e)?!1:t}function Qe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Dn(e);let i=Le(1);t&&(o?ie(o)&&(i=ut(o)):i=ut(e));const a=sc(s,n,o)?yr(s):Le(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=Ce(s),m=o&&ie(o)?Ce(o):o;let g=p,h=Gn(g);for(;h&&o&&m!==g;){const v=ut(h),y=h.getBoundingClientRect(),b=Pe(h),E=y.left+(h.clientLeft+parseFloat(b.paddingLeft))*v.x,S=y.top+(h.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=E,l+=S,g=Ce(h),h=Gn(g)}}return Ut({width:u,height:f,x:c,y:l})}function Jt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:Qe(We(e)).left+n}function Er(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ic(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=We(o),a=t?Tn(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Le(1);const u=Le(0),f=be(o);if((f||!f&&!s)&&((Ot(o)!=="body"||Pt(i))&&(c=Zt(o)),f)){const m=Qe(o);l=ut(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const p=i&&!f&&!s?Er(i,c):Le(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function cc(e){return Array.from(e.getClientRects())}function ac(e){const t=We(e),n=Zt(e),o=e.ownerDocument.body,r=Re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Jt(e);const a=-n.scrollTop;return Pe(o).direction==="rtl"&&(i+=Re(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const bo=25;function lc(e,t){const n=Ce(e),o=We(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,c=0;if(r){s=r.width,i=r.height;const u=Cn();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=Jt(o);if(l<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-m);g<=bo&&(s-=g)}else l<=bo&&(s+=l);return{width:s,height:i,x:a,y:c}}function uc(e,t){const n=Qe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=be(e)?ut(e):Le(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function vo(e,t,n){let o;if(t==="viewport")o=lc(e,n);else if(t==="document")o=ac(We(e));else if(ie(t))o=uc(t,n);else{const r=yr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ut(o)}function Rr(e,t){const n=ft(e);return n===t||!ie(n)||Ke(n)?!1:Pe(n).position==="fixed"||Rr(n,t)}function fc(e,t){const n=t.get(e);if(n)return n;let o=ct(e,[],!1).filter(a=>ie(a)&&Ot(a)!=="body"),r=null;const s=Pe(e).position==="fixed";let i=s?ft(e):e;for(;ie(i)&&!Ke(i);){const a=Pe(i),c=Lo(i);!c&&a.position==="fixed"&&(r=null),(s?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Pt(i)&&!c&&Rr(e,i))?o=o.filter(u=>u!==i):r=a,i=ft(i)}return t.set(e,o),o}function dc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Tn(t)?[]:fc(t,this._c):[].concat(n),o],a=vo(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const m=vo(t,i[p],r);c=Re(m.top,c),l=pt(m.right,l),u=pt(m.bottom,u),f=Re(m.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function pc(e){const{width:t,height:n}=vr(e);return{width:t,height:n}}function gc(e,t,n){const o=be(t),r=We(t),s=n==="fixed",i=Qe(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Le(0);function l(){c.x=Jt(r)}if(o||!o&&!s)if((Ot(t)!=="body"||Pt(r))&&(a=Zt(t)),o){const m=Qe(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?Er(r,a):Le(0),f=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function pn(e){return Pe(e).position==="static"}function yo(e,t){if(!be(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return We(e)===n&&(n=n.ownerDocument.body),n}function xr(e,t){const n=Ce(e);if(Tn(e))return n;if(!be(e)){let r=ft(e);for(;r&&!Ke(r);){if(ie(r)&&!pn(r))return r;r=ft(r)}return n}let o=yo(e,t);for(;o&&ds(o)&&pn(o);)o=yo(o,t);return o&&Ke(o)&&pn(o)&&!Lo(o)?n:o||ps(e)||n}const mc=async function(e){const t=this.getOffsetParent||xr,n=this.getDimensions,o=await n(e.floating);return{reference:gc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function hc(e){return Pe(e).direction==="rtl"}const bc={convertOffsetParentRelativeRectToViewportRelativeRect:ic,getDocumentElement:We,getClippingRect:dc,getOffsetParent:xr,getElementRects:mc,getClientRects:cc,getDimensions:pc,getScale:ut,isElement:ie,isRTL:hc};function Sr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t){let n=null,o;const r=We(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:m}=l;if(a||t(),!p||!m)return;const g=Nt(f),h=Nt(r.clientWidth-(u+p)),v=Nt(r.clientHeight-(f+m)),y=Nt(u),E={rootMargin:-g+"px "+-h+"px "+-v+"px "+-y+"px",threshold:Re(0,pt(1,c))||1};let S=!0;function w(O){const C=O[0].intersectionRatio;if(C!==c){if(!S)return i();C?i(!1,C):o=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!Sr(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(w,{...E,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return i(!0),s}function Eo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Dn(e),u=r||s?[...l?ct(l):[],...t?ct(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=l&&a?vc(l,n):null;let p=-1,m=null;i&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),n()}),l&&!c&&m.observe(l),t&&m.observe(t));let g,h=c?Qe(e):null;c&&v();function v(){const y=Qe(e);h&&!Sr(h,y)&&n(),h=y,g=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const yc=ec,Ec=tc,Rc=Zi,xc=oc,Sc=Ji,wc=nc,Cc=(e,t,n)=>{const o=new Map,r={platform:bc,...n},s={...r.platform,_c:o};return Ki(e,t,{...r,platform:s})};var Tc=typeof document<"u",Oc=function(){},Vt=Tc?d.useLayoutEffect:Oc;function Kt(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Kt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Kt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function wr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ro(e,t){const n=wr(e);return Math.round(t*n)/n}function gn(e){const t=d.useRef(e);return Vt(()=>{t.current=e}),t}function Pc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(o);Kt(p,o)||m(o);const[g,h]=d.useState(null),[v,y]=d.useState(null),b=d.useCallback(x=>{x!==O.current&&(O.current=x,h(x))},[]),E=d.useCallback(x=>{x!==C.current&&(C.current=x,y(x))},[]),S=s||g,w=i||v,O=d.useRef(null),C=d.useRef(null),I=d.useRef(u),N=c!=null,k=gn(c),L=gn(r),A=gn(l),T=d.useCallback(()=>{if(!O.current||!C.current)return;const x={placement:t,strategy:n,middleware:p};L.current&&(x.platform=L.current),Cc(O.current,C.current,x).then(F=>{const Q={...F,isPositioned:A.current!==!1};D.current&&!Kt(I.current,Q)&&(I.current=Q,_e.flushSync(()=>{f(Q)}))})},[p,t,n,L,A]);Vt(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(x=>({...x,isPositioned:!1})))},[l]);const D=d.useRef(!1);Vt(()=>(D.current=!0,()=>{D.current=!1}),[]),Vt(()=>{if(S&&(O.current=S),w&&(C.current=w),S&&w){if(k.current)return k.current(S,w,T);T()}},[S,w,T,k,N]);const P=d.useMemo(()=>({reference:O,floating:C,setReference:b,setFloating:E}),[b,E]),V=d.useMemo(()=>({reference:S,floating:w}),[S,w]),B=d.useMemo(()=>{const x={position:n,left:0,top:0};if(!V.floating)return x;const F=Ro(V.floating,u.x),Q=Ro(V.floating,u.y);return a?{...x,transform:"translate("+F+"px, "+Q+"px)",...wr(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Q}},[n,a,V.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:T,refs:P,elements:V,floatingStyles:B}),[u,T,P,V,B])}const Ic=(e,t)=>{const n=yc(e);return{name:n.name,fn:n.fn,options:[e,t]}},kc=(e,t)=>{const n=Ec(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mc=(e,t)=>({fn:wc(e).fn,options:[e,t]}),Ac=(e,t)=>{const n=Rc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fc=(e,t)=>{const n=xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lc=(e,t)=>{const n=Sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc={intentional:"onClick",sloppy:"onPointerDown"};function Nc(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Cr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:m=!1,referencePressEvent:g="sloppy",ancestorScroll:h=!1,bubbles:v,externalTree:y}=t,b=yt(y),E=z(typeof f=="function"?f:()=>!1),S=typeof f=="function"?E:f,w=d.useRef(!1),{escapeKey:O,outsidePress:C}=Nc(v),I=d.useRef(null),N=Je(),k=Je(),L=z(()=>{k.clear(),c.current.insideReactTree=!1}),A=d.useRef(!1),T=d.useRef(""),D=z(R=>{T.current=R.pointerType}),P=z(()=>{const R=T.current,Y=R==="pen"||!R?"mouse":R,$=typeof p=="function"?p():p;return typeof $=="string"?$:$[Y]}),V=z(R=>{if(!o||!l||!u||R.key!=="Escape"||A.current)return;const Y=c.current.floatingContext?.nodeId,$=b?Ze(b.nodesRef.current,Y):[];if(!O&&$.length>0){let W=!0;if($.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__escapeKeyBubbles&&(W=!1)}),!W)return}const ue=ti(R)?R.nativeEvent:R,M=ce(ur,ue);n.setOpen(!1,M),!O&&!M.isPropagationAllowed&&R.stopPropagation()}),B=z(R=>{const Y=P();return Y==="intentional"&&R.type!=="click"||Y==="sloppy"&&R.type==="click"}),x=z(()=>{c.current.insideReactTree=!0,k.start(0,L)}),F=z((R,Y=!1)=>{if(B(R)){L();return}if(c.current.insideReactTree){L();return}if(P()==="intentional"&&Y||typeof S=="function"&&!S(R))return;const $=Ee(R),ue=`[${Ct("inert")}]`,M=fe(n.select("floatingElement")).querySelectorAll(ue),W=n.context.triggerElements;if($&&(W.hasElement($)||W.hasMatchingElement(j=>re(j,$))))return;let q=ie($)?$:null;for(;q&&!Ke(q);){const j=ft(q);if(Ke(j)||!ie(j))break;q=j}if(M.length&&ie($)&&!Qs($)&&!re($,n.select("floatingElement"))&&Array.from(M).every(j=>!re(q,j)))return;if(be($)&&!("touches"in R)){const j=Ke($),me=Pe($),ae=/auto|scroll/,Ne=j||ae.test(me.overflowX),Ge=j||ae.test(me.overflowY),ot=Ne&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,Xe=Ge&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,he=me.direction==="rtl",Ie=Xe&&(he?R.offsetX<=$.offsetWidth-$.clientWidth:R.offsetX>$.clientWidth),ke=ot&&R.offsetY>$.clientHeight;if(Ie||ke)return}const te=c.current.floatingContext?.nodeId,oe=b&&Ze(b.nodesRef.current,te).some(j=>Te(R,j.context?.elements.floating));if(Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||oe)return;const H=b?Ze(b.nodesRef.current,te):[];if(H.length>0){let j=!0;if(H.forEach(me=>{me.context?.open&&!me.context.dataRef.current.__outsidePressBubbles&&(j=!1)}),!j)return}n.setOpen(!1,ce(lr,R)),L()}),Q=z(R=>{P()!=="sloppy"||R.pointerType==="touch"||!n.select("open")||!l||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||F(R)}),X=z(R=>{if(P()!=="sloppy"||!n.select("open")||!l||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement")))return;const Y=R.touches[0];Y&&(I.current={startTime:Date.now(),startX:Y.clientX,startY:Y.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),K=z(R=>{const Y=Ee(R);function $(){X(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)}),Z=z(R=>{const Y=w.current;if(w.current=!1,N.clear(),R.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const $=Ee(R);function ue(){R.type==="pointerdown"?Q(R):F(R,Y),$?.removeEventListener(R.type,ue)}$?.addEventListener(R.type,ue)}),_=z(R=>{if(P()!=="sloppy"||!I.current||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement")))return;const Y=R.touches[0];if(!Y)return;const $=Math.abs(Y.clientX-I.current.startX),ue=Math.abs(Y.clientY-I.current.startY),M=Math.sqrt($*$+ue*ue);M>5&&(I.current.dismissOnTouchEnd=!0),M>10&&(F(R),N.clear(),I.current=null)}),ne=z(R=>{const Y=Ee(R);function $(){_(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)}),U=z(R=>{P()!=="sloppy"||!I.current||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&F(R),N.clear(),I.current=null)}),J=z(R=>{const Y=Ee(R);function $(){U(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)});d.useEffect(()=>{if(!o||!l)return;c.current.__escapeKeyBubbles=O,c.current.__outsidePressBubbles=C;const R=new Ye;function Y(q){n.setOpen(!1,ce(Bi,q))}function $(){R.clear(),A.current=!0}function ue(){R.start(Cn()?5:0,()=>{A.current=!1})}const M=fe(r);M.addEventListener("pointerdown",D,!0),u&&(M.addEventListener("keydown",V),M.addEventListener("compositionstart",$),M.addEventListener("compositionend",ue)),S&&(M.addEventListener("click",Z,!0),M.addEventListener("pointerdown",Z,!0),M.addEventListener("touchstart",K,!0),M.addEventListener("touchmove",ne,!0),M.addEventListener("touchend",J,!0),M.addEventListener("mousedown",Z,!0));let W=[];return h&&(ie(i)&&(W=ct(i)),ie(r)&&(W=W.concat(ct(r))),!ie(s)&&s&&s.contextElement&&(W=W.concat(ct(s.contextElement)))),W=W.filter(q=>q!==M.defaultView?.visualViewport),W.forEach(q=>{q.addEventListener("scroll",Y,{passive:!0})}),()=>{M.removeEventListener("pointerdown",D,!0),u&&(M.removeEventListener("keydown",V),M.removeEventListener("compositionstart",$),M.removeEventListener("compositionend",ue)),S&&(M.removeEventListener("click",Z,!0),M.removeEventListener("pointerdown",Z,!0),M.removeEventListener("touchstart",K,!0),M.removeEventListener("touchmove",ne,!0),M.removeEventListener("touchend",J,!0),M.removeEventListener("mousedown",Z,!0)),W.forEach(q=>{q.removeEventListener("scroll",Y)}),R.clear(),w.current=!1}},[c,r,s,i,u,S,o,a,h,l,O,C,V,F,Z,Q,K,ne,J,D,n]),d.useEffect(L,[S,L]);const de=d.useMemo(()=>({onKeyDown:V,...m&&{[Dc[g]]:R=>{n.setOpen(!1,ce(He,R.nativeEvent))},...g!=="intentional"&&{onClick(R){n.setOpen(!1,ce(He,R.nativeEvent))}}}}),[V,n,m,g]),pe=z(R=>{const Y=Ee(R.nativeEvent);!re(n.select("floatingElement"),Y)||R.button!==0||(w.current=!0)}),ge=z(R=>{!o||!l||R.button!==0||(w.current=!0)}),De=d.useMemo(()=>({onKeyDown:V,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:x,onMouseDownCapture(R){x(),ge(R)},onPointerDownCapture(R){x(),ge(R)},onMouseUpCapture:x,onTouchEndCapture:x,onTouchMoveCapture:x}),[V,pe,x,ge]);return d.useMemo(()=>l?{reference:de,floating:De,trigger:de}:{},[l,de,De])}const Bc={open:G(e=>e.open),domReferenceElement:G(e=>e.domReferenceElement),referenceElement:G(e=>e.positionReference??e.referenceElement),floatingElement:G(e=>e.floatingElement),floatingId:G(e=>e.floatingId)};class Nn extends On{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ir(),nested:n,noEmit:o,triggerElements:s},Bc)}setOpen=(t,n)=>{if((!t||!this.state.open||Go(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function $c(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),se(()=>{if(!e&&s&&o!=="ending"&&n){const a=Ae.request(()=>{r("ending")});return()=>{Ae.cancel(a)}}},[e,s,o,n]),se(()=>{if(!e||t)return;const a=Ae.request(()=>{r(void 0)});return()=>{Ae.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Ae.request(()=>{r("idle")});return()=>{Ae.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Tt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Wc={[Tt.startingStyle]:""},Vc={[Tt.endingStyle]:""},Qt={transitionStatus(e){return e==="starting"?Wc:e==="ending"?Vc:null}};function Tr(e,t=!1,n=!0){const o=In();return z((r,s=null)=>{o.cancel();function i(){_e.flushSync(r)}const a=Be(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Tt.startingStyle;if(!c.hasAttribute(f)){o.request(u);return}const p=new MutationObserver(()=>{c.hasAttribute(f)||(p.disconnect(),u())});p.observe(c,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(p=>p.pending||p.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Bn(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=z(r),i=Tr(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}function jc(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Hc(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=jc(e,n),i=z(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return se(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Or(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Pr(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=$c(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=z(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Bn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class en{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elements.delete(o),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function _c(){return new Nn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new en,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Ir(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:_c(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:je,inactiveTriggerProps:je,popupProps:je}}const kr={open:G(e=>e.open),mounted:G(e=>e.mounted),transitionStatus:G(e=>e.transitionStatus),floatingRootContext:G(e=>e.floatingRootContext),preventUnmountingOnClose:G(e=>e.preventUnmountingOnClose),payload:G(e=>e.payload),activeTriggerId:G(e=>e.activeTriggerId),activeTriggerElement:G(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:G((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:G((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:G(e=>e.popupProps),popupElement:G(e=>e.popupElement),positionerElement:G(e=>e.positionerElement)};function Yc(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=vt(),s=tt()!=null,i=Ue(()=>new Nn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new en,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return se(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=ie(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Uc(e={}){const{nodeId:t,externalTree:n}=e,o=Yc(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),c=d.useRef(null),l=yt(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=Pc({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(C=>{const I=ie(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;a(I),u.refs.setReference(I)},[u.refs]),[p,m]=d.useState(null),[g,h]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",ie(p)?p:null),r.useSyncedValue("floatingElement",g);const v=d.useCallback(C=>{(ie(C)||C===null)&&(c.current=C,m(C)),(ie(u.refs.reference.current)||u.refs.reference.current===null||C!==null&&!ie(C))&&u.refs.setReference(C)},[u.refs,m]),y=d.useCallback(C=>{h(C),u.refs.setFloating(C)},[u.refs]),b=d.useMemo(()=>({...u.refs,setReference:v,setFloating:y,setPositionReference:f,domReference:c}),[u.refs,v,y,f]),E=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),S=r.useState("open"),w=r.useState("floatingId"),O=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:S,onOpenChange:r.setOpen,events:r.context.events,floatingId:w,refs:b,elements:E,nodeId:t,rootStore:r}),[u,b,E,t,r,S,w]);return se(()=>{r.context.dataRef.current.floatingContext=O;const C=l?.nodesRef.current.find(I=>I.id===t);C&&(C.context=O)}),d.useMemo(()=>({...u,context:O,refs:b,elements:E,rootStore:r}),[u,b,E,O,r])}function Mr(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=vt(),i=tt()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=Ue(()=>new Nn({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return se(()=>{const p={open:a,floatingId:s,referenceElement:c,floatingElement:l};ie(c)&&(p.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(p.positionReference=c),f.update(p)},[a,s,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const Sn=Ct("safe-polygon"),zc=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zo}`;function qc(e){return e?!!e.closest(zc):!1}function Ar(e){const t=d.useRef(void 0),n=d.useRef(!1),o=d.useRef(void 0),r=d.useRef(!0),s=d.useRef(!1),i=d.useRef(()=>{}),a=d.useRef(!1),c=Je(),l=Je(),u=d.useRef(void 0);return d.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,o,r,s,i,a,c,l,u])}const Gc=new Set(["click","mousedown"]);function Xc(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:m,unbindMouseMoveRef:g,restTimeoutPendingRef:h,openChangeTimeout:v,handleCloseOptionsRef:y}=Ar(n),b=yt(l),E=tt(),S=z(()=>f.current?!0:i.current.openEvent?Gc.has(i.current.openEvent.type):!1),w=z(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),O=d.useCallback((k,L=!0)=>{const A=Kc(c,u.current);A&&!p.current?v.start(A,()=>n.setOpen(!1,ce(xe,k))):L&&(v.clear(),n.setOpen(!1,ce(xe,k)))},[c,p,n,u,v]),C=z(()=>{g.current(),p.current=void 0}),I=z(()=>{if(m.current){const k=fe(r).body;k.style.pointerEvents="",k.removeAttribute(Sn),m.current=!1}}),N=z(k=>{const L=Ee(k);if(!qc(L)){f.current=!1;return}f.current=!0});se(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,C(),I())},[o,u,h,f,C,I]),d.useEffect(()=>()=>{C()},[C]),d.useEffect(()=>I,[I]),se(()=>{if(a&&o&&y.current?.blockPointerEvents&&w()&&ie(s)&&r){m.current=!0;const k=fe(r).body;k.setAttribute(Sn,"");const L=s,A=r,T=b?.nodesRef.current.find(D=>D.id===E)?.context?.elements.floating;return T&&(T.style.pointerEvents=""),k.style.pointerEvents="none",L.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",L.style.pointerEvents="",A.style.pointerEvents=""}}},[a,o,s,r,y,w,b,E,m]),d.useEffect(()=>{if(!a)return;function k(D){if(S()||!i.current.floatingContext||!n.select("open"))return;const P=n.context.triggerElements;D.relatedTarget&&P.hasElement(D.relatedTarget)||(I(),C(),S()||O(D))}function L(D){v.clear(),I(),p.current?.(D),C()}function A(D){S()||O(D,!1)}const T=r;return T&&(T.addEventListener("mouseleave",k),T.addEventListener("mouseenter",L),T.addEventListener("mouseleave",A),T.addEventListener("pointerdown",N,!0)),()=>{T&&(T.removeEventListener("mouseleave",k),T.removeEventListener("mouseenter",L),T.removeEventListener("mouseleave",A),T.removeEventListener("pointerdown",N,!0))}})}function Kc(e,t){return t&&!dt(t)?0:typeof e=="function"?e():e}function mn(e){return typeof e=="function"?e():e}const Zc={current:null};function Jc(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Zc,externalTree:p,isActiveTrigger:m=!0}=t,g=yt(p),{pointerTypeRef:h,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:E,unbindMouseMoveRef:S,restTimeoutPendingRef:w,openChangeTimeout:O,restTimeout:C,handleCloseOptionsRef:I}=Ar(n),N=Fe(a),k=Fe(i),L=Fe(l);m&&(I.current=N.current?.__options);const A=z(()=>v.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),T=d.useCallback((B,x=!0)=>{const F=ln(k.current,"close",h.current);F&&!y.current?O.start(F,()=>n.setOpen(!1,ce(xe,B))):x&&(O.clear(),n.setOpen(!1,ce(xe,B)))},[k,y,n,h,O]),D=z(()=>{S.current(),y.current=void 0}),P=z(()=>{if(E.current){const B=fe(n.select("domReferenceElement")).body;B.style.pointerEvents="",B.removeAttribute(Sn),E.current=!1}});d.useEffect(()=>{if(!s)return;function B(x){x.open||(O.clear(),C.clear(),b.current=!0,w.current=!1)}return r.on("openchange",B),()=>{r.off("openchange",B)}},[s,r,O,C,b,w]);const V=z(B=>{if(A()||!o.current.floatingContext)return;const x=n.context.triggerElements;if(B.relatedTarget&&x.hasElement(B.relatedTarget))return;const F=f.current;N.current?.({...o.current.floatingContext,tree:g,x:B.clientX,y:B.clientY,onClose(){P(),D(),!A()&&F===n.select("domReferenceElement")&&T(B)}})(B)});return d.useEffect(()=>{if(!s)return;const B=f.current??(m?n.select("domReferenceElement"):null);if(!ie(B))return;function x(X){if(O.clear(),b.current=!1,c&&!dt(h.current)||mn(L.current)>0&&!ln(k.current,"open"))return;const K=ln(k.current,"open",h.current),Z=n.select("domReferenceElement"),_=n.context.triggerElements,ne=(_.hasElement(X.target)||_.hasMatchingElement(pe=>re(pe,X.target)))&&(!Z||!re(Z,X.target)),U=X.currentTarget??null,J=n.select("open"),de=!J||ne;ne&&J?n.setOpen(!0,ce(xe,X,U)):K?O.start(K,()=>{de&&n.setOpen(!0,ce(xe,X,U))}):de&&n.setOpen(!0,ce(xe,X,U))}function F(X){if(A()){P();return}S.current();const K=n.select("domReferenceElement"),Z=fe(K);C.clear(),w.current=!1;const _=n.context.triggerElements;if(X.relatedTarget&&_.hasElement(X.relatedTarget))return;if(N.current&&o.current.floatingContext){n.select("open")||O.clear();const U=f.current;y.current=N.current({...o.current.floatingContext,tree:g,x:X.clientX,y:X.clientY,onClose(){P(),D(),!A()&&U===n.select("domReferenceElement")&&T(X,!0)}});const J=y.current;J(X),Z.addEventListener("mousemove",J),S.current=()=>{Z.removeEventListener("mousemove",J)};return}(h.current!=="touch"||!re(n.select("floatingElement"),X.relatedTarget))&&T(X)}function Q(X){V(X)}return n.select("open")&&B.addEventListener("mouseleave",Q),u&&B.addEventListener("mousemove",x,{once:!0}),B.addEventListener("mouseenter",x),B.addEventListener("mouseleave",F),()=>{B.removeEventListener("mouseleave",Q),u&&B.removeEventListener("mousemove",x),B.removeEventListener("mouseenter",x),B.removeEventListener("mouseleave",F)}},[D,P,b,o,k,T,n,s,N,V,m,A,c,u,h,L,C,w,O,f,g,S,y]),d.useMemo(()=>{function B(x){h.current=x.pointerType}return{onPointerDown:B,onPointerEnter:B,onMouseMove(x){const{nativeEvent:F}=x,Q=x.currentTarget,X=n.select("domReferenceElement"),K=n.context.triggerElements,Z=n.select("open"),_=(K.hasElement(x.target)||K.hasMatchingElement(U=>re(U,x.target)))&&(!X||!re(X,x.target));if(c&&!dt(h.current)||Z&&!_||mn(L.current)===0||!_&&w.current&&x.movementX**2+x.movementY**2<2)return;C.clear();function ne(){if(w.current=!1,A())return;const U=n.select("open");!b.current&&(!U||_)&&n.setOpen(!0,ce(xe,F,Q))}h.current==="touch"?_e.flushSync(()=>{ne()}):_&&Z?ne():(w.current=!0,C.start(mn(L.current),ne))}}},[b,A,c,n,h,L,C,w])}function $n(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=d.useCallback(l=>Wt(l,e,"reference"),t),i=d.useCallback(l=>Wt(l,e,"floating"),n),a=d.useCallback(l=>Wt(l,e,"item"),o),c=d.useCallback(l=>Wt(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Wt(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[bn]="");for(const i in e)r&&e&&(i===Yo||i===Uo)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&xo(s,a,r,o)}return xo(s,e,r,o),s}function xo(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Yo||r===Uo)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Qc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Fr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=vt(),u=s?.id||l,f=d.useMemo(()=>vn(i)?.id||r,[i,r]),p=Qc.get(c)??c,g=tt()!=null,h=d.useMemo(()=>p==="tooltip"||c==="label"?je:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,g,c]),v=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:u}},[p,f,o,u,c,h]),y=d.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,c]),b=d.useCallback(({active:E,selected:S})=>{const w={role:"option",...E&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...w,"aria-selected":S}}return{}},[f,c]);return d.useMemo(()=>a?{reference:v,floating:y,item:b,trigger:h}:{},[a,v,y,h,b])}function So(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=o!=f>=o&&n<=(u-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function ea(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ta(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Ye;let s=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,p){const m=performance.now(),g=m-c;if(i===null||a===null||g===0)return i=f,a=p,c=m,null;const h=f-i,v=p-a,b=Math.sqrt(h*h+v*v)/g;return i=f,a=p,c=m,b}const u=({x:f,y:p,placement:m,elements:g,onClose:h,nodeId:v,tree:y})=>function(E){function S(){r.clear(),h()}if(r.clear(),!g.domReference||!g.floating||m==null||f==null||p==null)return;const{clientX:w,clientY:O}=E,C=[w,O],I=Ee(E),N=E.type==="mouseleave",k=re(g.floating,I),L=re(g.domReference,I),A=g.domReference.getBoundingClientRect(),T=g.floating.getBoundingClientRect(),D=m.split("-")[0],P=f>T.right-T.width/2,V=p>T.bottom-T.height/2,B=ea(C,A),x=T.width>A.width,F=T.height>A.height,Q=(x?A:T).left,X=(x?A:T).right,K=(F?A:T).top,Z=(F?A:T).bottom;if(k&&(s=!0,!N))return;if(L&&(s=!1),L&&!N){s=!0;return}if(N&&ie(E.relatedTarget)&&re(g.floating,E.relatedTarget)||y&&Ze(y.nodesRef.current,v).some(({context:U})=>U?.open))return;if(D==="top"&&p>=A.bottom-1||D==="bottom"&&p<=A.top+1||D==="left"&&f>=A.right-1||D==="right"&&f<=A.left+1)return S();let _=[];switch(D){case"top":_=[[Q,A.top+1],[Q,T.bottom-1],[X,T.bottom-1],[X,A.top+1]];break;case"bottom":_=[[Q,T.top+1],[Q,A.bottom-1],[X,A.bottom-1],[X,T.top+1]];break;case"left":_=[[T.right-1,Z],[T.right-1,K],[A.left+1,K],[A.left+1,Z]];break;case"right":_=[[A.right-1,Z],[A.right-1,K],[T.left+1,K],[T.left+1,Z]];break}function ne([U,J]){switch(D){case"top":{const de=[x?U+t/2:P?U+t*4:U-t*4,J+t+1],pe=[x?U-t/2:P?U+t*4:U-t*4,J+t+1],ge=[[T.left,P||x?T.bottom-t:T.top],[T.right,P?x?T.bottom-t:T.top:T.bottom-t]];return[de,pe,...ge]}case"bottom":{const de=[x?U+t/2:P?U+t*4:U-t*4,J-t],pe=[x?U-t/2:P?U+t*4:U-t*4,J-t],ge=[[T.left,P||x?T.top+t:T.bottom],[T.right,P?x?T.top+t:T.bottom:T.top+t]];return[de,pe,...ge]}case"left":{const de=[U+t+1,F?J+t/2:V?J+t*4:J-t*4],pe=[U+t+1,F?J-t/2:V?J+t*4:J-t*4];return[...[[V||F?T.right-t:T.left,T.top],[V?F?T.right-t:T.left:T.right-t,T.bottom]],de,pe]}case"right":{const de=[U-t,F?J+t/2:V?J+t*4:J-t*4],pe=[U-t,F?J-t/2:V?J+t*4:J-t*4],ge=[[V||F?T.left+t:T.right,T.top],[V?F?T.left+t:T.right:T.left+t,T.bottom]];return[de,pe,...ge]}default:return[]}}if(!So([w,O],_)){if(s&&!B)return S();if(!N&&o){const U=l(E.clientX,E.clientY);if(U!==null&&U<.1)return S()}So([w,O],ne([f,p]))?!s&&o&&r.start(40,S):S()}};return u.__options={blockPointerEvents:n},u}function Lr(e){return vt(e,"base-ui")}function na(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Dr(e){const[t,n]=d.useState(null),o=z((a,c)=>{e||n(c||(_o?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=na(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Oe=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Tt.startingStyle]="startingStyle",e[e.endingStyle=Tt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),wn=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const oa={[wn.popupOpen]:""},ra={[wn.popupOpen]:"",[wn.pressed]:""},sa={[Oe.open]:""},ia={[Oe.closed]:""},ca={[Oe.anchorHidden]:""},aa={open(e){return e?oa:null}},la={open(e){return e?ra:null}},kt={open(e){return e?sa:ia},anchorHidden(e){return e?ca:null}};function Nr(e){return Ao(19)?e:e?"true":void 0}let wo={},Co={},To="";function ua(e){if(typeof document>"u")return!1;const t=nt(e);return Ce(t).innerWidth-t.documentElement.clientWidth>0}function fa(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=nt(e).documentElement,r={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const i=o.offsetWidth;return Object.assign(o.style,r),s===i}function da(e){const t=nt(e),n=t.documentElement,o=t.body,r=Pt(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function pa(e){const t=nt(e),n=t.documentElement,o=t.body,r=Ce(n);let s=0,i=0,a=!1;const c=Ae.create();if(qs&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),m=r.getComputedStyle(o),v=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,wo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},To=n.style.scrollBehavior,Co={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,E=p.overflowY==="scroll"||m.overflowY==="scroll",S=p.overflowX==="scroll"||m.overflowX==="scroll",w=Math.max(0,r.innerWidth-o.clientWidth),O=Math.max(0,r.innerHeight-o.clientHeight),C=parseFloat(m.marginTop)+parseFloat(m.marginBottom),I=parseFloat(m.marginLeft)+parseFloat(m.marginRight),N=Pt(n)?n:o;if(a=fa(e),a){n.style.scrollbarGutter=v,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||E)&&(n.style.overflowY="scroll"),(b||S)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:C||O?`calc(100dvh - ${C+O}px)`:"100dvh",width:I||w?`calc(100vw - ${I+w}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,wo),Object.assign(o.style,Co),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=To)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class ga{lockCount=0;restore=null;timeoutLock=Ye.create();timeoutUnlock=Ye.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=nt(t).documentElement,r=Ce(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=Fo;return}const s=_o||!ua(t);this.restore=s?da(t):pa(t)}}const ma=new ga;function Br(e=!0,t=null){se(()=>{if(e)return ma.acquire(t)},[e,t])}const ha=d.createContext(void 0);function ba(){return d.useContext(ha)?.direction??"ltr"}const va=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=$e(e,t)||{};if(l==null)return{};const p=Xo(u),m={x:n,y:o},g=An(r),h=Mn(g),v=await i.getDimensions(l),y=g==="y",b=y?"top":"left",E=y?"bottom":"right",S=y?"clientHeight":"clientWidth",w=s.reference[h]+s.reference[g]-m[g]-s.floating[h],O=m[g]-s.reference[g],C=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[S]||s.floating[h];(!I||!await i.isElement?.(C))&&(I=a.floating[S]||s.floating[h]);const N=w/2-O/2,k=I/2-v[h]/2-1,L=Math.min(p[b],k),A=Math.min(p[E],k),T=L,D=I-v[h]-A,P=I/2-v[h]/2+N,V=yn(T,P,D),B=!c.arrow&&qe(r)!=null&&P!==V&&s.reference[h]/2-(P<T?L:A)-v[h]/2<0,x=B?P<T?P-T:P-D:0;return{[g]:m[g]+x,data:{[g]:V,centerOffset:P-V-x,...B&&{alignmentOffset:x}},reset:B}}}),ya=(e,t)=>({...va(e),options:[e,t]}),Ea={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Lc().fn(e)).data?.referenceHidden||s}}}},jt={sideX:"left",sideY:"top"},Ra={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=Ce(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:jt};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=nt(r);p={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const m=ye(a);let g=t,h=n;m==="left"&&(g=p.width-(t+o.width)),m==="top"&&(h=p.height-(n+o.height));const v=m==="left"?"right":jt.sideX,y=m==="top"?"bottom":jt.sideY;return{x:g,y:h,data:{sideX:v,sideY:y}}}};function $r(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Oo(e,t,n){const{rects:o,placement:r}=e;return{side:$r(t,ye(r),n),align:qe(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function xa(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:m,mounted:g,collisionAvoidance:h,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:E=!1,externalTree:S}=e,[w,O]=d.useState(null);!g&&w!==null&&O(null);const C=h.side||"flip",I=h.align||"flip",N=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,L=z(k),A=k?L:t,T=Fe(t),P=ba()==="rtl",V=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],B=s==="center"?V:`${V}-${s}`;let x=c;const F=1,Q=o==="bottom"?F:0,X=o==="top"?F:0,K=o==="right"?F:0,Z=o==="left"?F:0;typeof x=="number"?x={top:x+Q,right:x+Z,bottom:x+X,left:x+K}:x&&(x={top:(x.top||0)+Q,right:(x.right||0)+Z,bottom:(x.bottom||0)+X,left:(x.left||0)+K});const _={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:x},ne=d.useRef(null),U=Fe(r),J=Fe(i),ge=[Ic(le=>{const ve=Oo(le,o,P),Me=typeof U.current=="function"?U.current(ve):U.current,Se=typeof J.current=="function"?J.current(ve):J.current;return{mainAxis:Me,crossAxis:Se,alignmentAxis:Se}},[typeof r!="function"?r:0,typeof i!="function"?i:0,P,o])],De=I==="none"&&C!=="shift",R=!De&&(l||v||C==="shift"),Y=C==="none"?null:Ac({..._,padding:{top:x.top+F,right:x.right+F,bottom:x.bottom+F,left:x.left+F},mainAxis:!v&&C==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),$=De?null:kc(le=>{const ve=nt(le.elements.floating).documentElement;return{..._,rootBoundary:v?{x:0,y:0,width:ve.clientWidth,height:ve.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:R,limiter:l||v?void 0:Mc(Me=>{if(!ne.current)return{};const{width:Se,height:rt}=ne.current.getBoundingClientRect(),st=we(ye(Me.placement)),At=st==="y"?Se:rt,tn=st==="y"?x.left+x.right:x.top+x.bottom;return{offset:At/2+tn/2}})}},[_,l,v,x,I]);C==="shift"||I==="shift"||s==="center"?ge.push($,Y):ge.push(Y,$),ge.push(Fc({..._,apply({elements:{floating:le},rects:{reference:ve},availableWidth:Me,availableHeight:Se}){Object.entries({"--available-width":`${Me}px`,"--available-height":`${Se}px`,"--anchor-width":`${ve.width}px`,"--anchor-height":`${ve.height}px`}).forEach(([rt,st])=>{le.style.setProperty(rt,st)})}}),ya(()=>({element:ne.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(le){const{elements:ve,middlewareData:Me,placement:Se,rects:rt,y:st}=le,At=ye(Se),tn=we(At),Un=ne.current,es=Me.arrow?.x||0,ts=Me.arrow?.y||0,ns=Un?.clientWidth||0,os=Un?.clientHeight||0,nn=es+ns/2,zn=ts+os/2,rs=Math.abs(Me.shift?.y||0),ss=rt.reference.height/2,Rt=typeof r=="function"?r(Oo(le,o,P)):r,is=rs>Rt,cs={top:`${nn}px calc(100% + ${Rt}px)`,bottom:`${nn}px ${-Rt}px`,left:`calc(100% + ${Rt}px) ${zn}px`,right:`${-Rt}px ${zn}px`}[At],as=`${nn}px ${rt.reference.y+ss-st}px`;return ve.floating.style.setProperty("--transform-origin",R&&tn==="y"&&is?as:cs),{}}},Ea,b),se(()=>{!g&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,m]);const ue=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:M,elements:W,x:q,y:te,middlewareData:oe,update:H,placement:j,context:me,isPositioned:ae,floatingStyles:Ne}=Uc({rootContext:m,placement:B,middleware:ge,strategy:n,whileElementsMounted:p?void 0:(...le)=>Eo(...le,ue),nodeId:y,externalTree:S}),{sideX:Ge,sideY:ot}=oe.adaptiveOrigin||jt,Xe=ae?n:"fixed",he=d.useMemo(()=>b?{position:Xe,[Ge]:q,[ot]:te}:{position:Xe,...Ne},[b,Xe,Ge,q,ot,te,Ne]),Ie=d.useRef(null);se(()=>{if(!g)return;const le=T.current,ve=typeof le=="function"?le():le,Se=(Po(ve)?ve.current:ve)||null||null;Se!==Ie.current&&(M.setPositionReference(Se),Ie.current=Se)},[g,M,A,T]),d.useEffect(()=>{if(!g)return;const le=T.current;typeof le!="function"&&Po(le)&&le.current!==Ie.current&&(M.setPositionReference(le.current),Ie.current=le.current)},[g,M,A,T]),d.useEffect(()=>{if(p&&g&&W.domReference&&W.floating)return Eo(W.domReference,W.floating,H,ue)},[p,g,W,H,ue]);const ke=ye(j),Vn=$r(o,ke,P),jn=qe(j)||"center",Hn=!!oe.hide?.referenceHidden;se(()=>{E&&g&&ae&&O(ke)},[E,g,ae,ke]);const _n=d.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),Yn=oe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:he,arrowStyles:_n,arrowRef:ne,arrowUncentered:Yn,side:Vn,align:jn,physicalSide:ke,anchorHidden:Hn,refs:M,context:me,isPositioned:ae,update:H}),[he,_n,ne,Yn,Vn,jn,ke,Hn,M,me,ae,H])}function Po(e){return e!=null&&"current"in e}const Wr=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|
|
1
|
+
import{aD as Ue,av as se,az as et,aI as Mo,aJ as Ao,r as d,aw as z,aA as Fo,aK as ls,ax as be,aL as us,D as ee,aB as je,aM as Ot,a6 as _e,aN as fs,F as ze,aF as qn,aG as Ce,aO as Pe,aP as ct,aC as ie,aQ as We,aR as Gn,aS as Cn,aT as Tn,aU as ft,aV as Ke,aW as ds,aX as Lo,aY as ps,aZ as Pt,a_ as Zt,E as gs}from"./main-Dirgz7qK.js";const ms=500,hs={style:{transition:"none"}},Do="data-base-ui-click-trigger",Ya={fallbackAxisSide:"none"},bs={fallbackAxisSide:"end"},vs={clipPath:"inset(50%)",position:"fixed",top:0,left:0},No={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Bo={...No,position:"fixed",top:0,left:0},Ua={...No,position:"absolute"};function Fe(e){const t=Ue(ys,e).current;return t.next=e,se(t.effect),t}function ys(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ht=Symbol("NOT_FOUND");function Es(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Rs(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function xs(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var Xn=e=>Array.isArray(e)?e:[e];function Ss(e){const t=Array.isArray(e[0])?e[0]:e;return xs(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ws(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function Cs(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Ht},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ts(e,t){let n=[];function o(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return Ht}function r(a,c){o(a)===Ht&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var Os=(e,t)=>e===t;function Ps(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Is(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=Os,maxSize:r=1,resultEqualityCheck:s}=n,i=Ps(o);let a=0;const c=r<=1?Cs(i):Ts(r,i);function l(){let u=c.get(arguments);if(u===Ht){if(u=e.apply(null,arguments),a++,s){const p=c.getEntries().find(m=>s(m.value,u));p&&(u=p.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var ks=class{constructor(e){this.value=e}deref(){return this.value}},Ms=typeof WeakRef<"u"?WeakRef:ks,As=0,Kn=1;function Ft(){return{s:As,v:void 0,o:null,p:null}}function $o(e,t={}){let n=Ft();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const m=arguments[f];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=a.o;g===null&&(a.o=g=new WeakMap);const h=g.get(m);h===void 0?(a=Ft(),g.set(m,a)):a=h}else{let g=a.p;g===null&&(a.p=g=new Map);const h=g.get(m);h===void 0?(a=Ft(),g.set(m,a)):a=h}}const l=a;let u;if(a.s===Kn)u=a.v;else if(u=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,u)&&(u=f,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Ms(u):u}return l.s=Kn,l.v=u,u}return i.clearCache=()=>{n=Ft(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Wo(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),Es(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:m=$o,argsMemoizeOptions:g=[]}=u,h=Xn(p),v=Xn(g),y=Ss(r),b=f(function(){return s++,l.apply(null,arguments)},...h),E=m(function(){i++;const w=ws(y,arguments);return a=b.apply(null,w),a},...v);return Object.assign(E,{resultFunc:l,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:m})};return Object.assign(o,{withTypes:()=>o}),o}var Fs=Wo($o),Ls=Object.assign((e,t=Fs)=>{Rs(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>Ls});Wo({memoize:Is,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const G=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(et(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var on={exports:{}},rn={};var Zn;function Ds(){if(Zn)return rn;Zn=1;var e=Mo();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var m=p(),g=o({inst:{value:m,getSnapshot:p}}),h=g[0].inst,v=g[1];return s(function(){h.value=m,h.getSnapshot=p,c(h)&&v({inst:h})},[f,m,p]),r(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),i(m),m}function c(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!n(f,m)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return rn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,rn}var Jn;function Vo(){return Jn||(Jn=1,on.exports=Ds()),on.exports}var Ns=Vo(),sn={exports:{}},cn={};var Qn;function Bs(){if(Qn)return cn;Qn=1;var e=Mo(),t=Vo();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return cn.useSyncExternalStoreWithSelector=function(l,u,f,p,m){var g=s(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=a(function(){function y(O){if(!b){if(b=!0,E=O,O=p(O),m!==void 0&&h.hasValue){var C=h.value;if(m(C,O))return S=C}return S=O}if(C=S,o(E,O))return C;var I=p(O);return m!==void 0&&m(C,I)?(E=O,C):(E=O,S=I)}var b=!1,E,S,w=f===void 0?null:f;return[function(){return y(u())},w===null?void 0:function(){return y(w())}]},[u,f,p,m]);var v=r(l,g[0],g[1]);return i(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},cn}var eo;function $s(){return eo||(eo=1,sn.exports=Bs()),sn.exports}var Ws=$s();const Vs=Ao(19),js=Vs?_s:Ys;function Hs(e,t,n,o,r){return js(e,t,n,o,r)}function _s(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return Ns.useSyncExternalStore(e.subscribe,s,s)}function Ys(e,t,n,o,r){return Ws.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class St{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){St.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||St.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};St.prototype.setState.call(this,t)}}class On extends St{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;se(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);se(()=>{n.update(t)},[n,...o])}useControlledProp(t,n,o){d.useDebugValue(t);const r=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),se(()=>{s&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,o,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{d.useDebugValue(t);const s=this.selectors[t];return Hs(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=z(n??Fo);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const Us=[];function Pn(e){d.useEffect(e,Us)}const Lt=null;class zs{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Dt=new zs;class Ae{static create(){return new Ae}static request(t){return Dt.request(t)}static cancel(t){return Dt.cancel(t)}currentId=Lt;request(t){this.cancel(),this.currentId=Dt.request(()=>{this.currentId=Lt,t()})}cancel=()=>{this.currentId!==Lt&&(Dt.cancel(this.currentId),this.currentId=Lt)};disposeEffect=()=>this.cancel}function In(){const e=Ue(Ae.create).current;return Pn(e.disposeEffect),e}const xt=0;class Ye{static create(){return new Ye}currentId=xt;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xt,n()},t)}isStarted(){return this.currentId!==xt}clear=()=>{this.currentId!==xt&&(clearTimeout(this.currentId),this.currentId=xt)};disposeEffect=()=>this.clear}function Je(){const e=Ue(Ye.create).current;return Pn(e.disposeEffect),e}const ht=typeof navigator<"u",an=Ks(),jo=Js(),Ho=Zs(),qs=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),_o=an.platform==="MacIntel"&&an.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(an.platform),Gs=ht&&/apple/i.test(navigator.vendor),hn=ht&&/android/i.test(jo)||/android/i.test(Ho);ht&&jo.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Xs=Ho.includes("jsdom/");function Ks(){if(!ht)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Zs(){if(!ht)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Js(){if(!ht)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const bn="data-base-ui-focusable",Yo="active",Uo="selected",zo="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",za="ArrowLeft",qa="ArrowRight",Ga="ArrowUp",Xa="ArrowDown";function it(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ls(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ee(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Te(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 Qs(e){return e.matches("html,body")}function fe(e){return e?.ownerDocument||document}function qo(e){return be(e)&&e.matches(zo)}function to(e){return e?e.getAttribute("role")==="combobox"&&qo(e):!1}function vn(e){return e?e.hasAttribute(bn)?e:e.querySelector(`[${bn}]`)||e:null}function Ze(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...Ze(e,r.id,n)])}function no(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function ei(e){e.preventDefault(),e.stopPropagation()}function ti(e){return"nativeEvent"in e}function ni(e){return e.mozInputSource===0&&e.isTrusted?!0:hn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oi(e){return Xs?!1:!hn&&e.width===0&&e.height===0||hn&&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 dt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Go(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const ri=["top","right","bottom","left"],pt=Math.min,Re=Math.max,_t=Math.round,Nt=Math.floor,Le=e=>({x:e,y:e}),si={left:"right",right:"left",bottom:"top",top:"bottom"};function yn(e,t,n){return Re(e,pt(t,n))}function $e(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function kn(e){return e==="x"?"y":"x"}function Mn(e){return e==="y"?"height":"width"}function we(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function An(e){return kn(we(e))}function ii(e,t,n){n===void 0&&(n=!1);const o=qe(e),r=An(e),s=Mn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yt(i)),[i,Yt(i)]}function ci(e){const t=Yt(e);return[En(e),t,En(t)]}function En(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const oo=["left","right"],ro=["right","left"],ai=["top","bottom"],li=["bottom","top"];function ui(e,t,n){switch(e){case"top":case"bottom":return n?t?ro:oo:t?oo:ro;case"left":case"right":return t?ai:li;default:return[]}}function fi(e,t,n,o){const r=qe(e);let s=ui(ye(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(En)))),s}function Yt(e){const t=ye(e);return si[t]+e.slice(t.length)}function di(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xo(e){return typeof e!="number"?di(e):{top:e,right:e,bottom:e,left:e}}function Ut(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}var pi=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],zt=pi.join(","),Ko=typeof Element>"u",gt=Ko?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qt=!Ko&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Gt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Gt(t.parentNode));return i},gi=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Zo=function(t,n,o){if(Gt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(zt));return n&>.call(t,zt)&&r.unshift(t),r=r.filter(o),r},Xt=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Gt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Xt(c,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=gt.call(i,zt);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Gt(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var m=Xt(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,m):r.push({scopeParent:i,candidates:m})}else s.unshift.apply(s,i.children)}}return r},Jo=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Qo=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||gi(t))&&!Jo(t)?0:t.tabIndex},mi=function(t,n){var o=Qo(t);return o<0&&n&&!Jo(t)?0:o},hi=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},er=function(t){return t.tagName==="INPUT"},bi=function(t){return er(t)&&t.type==="hidden"},vi=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},yi=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ei=function(t){if(!t.name)return!0;var n=t.form||qt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(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=yi(r,t.form);return!s||s===t},Ri=function(t){return er(t)&&t.type==="radio"},xi=function(t){return Ri(t)&&!Ei(t)},Si=function(t){var n,o=t&&qt(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,c;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var l,u,f;o=qt(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},so=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},wi=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=gt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(gt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=qt(t);if(l&&!l.shadowRoot&&r(l)===!0)return so(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(Si(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return so(t);return!1},Ci=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return gt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Rn=function(t,n){return!(n.disabled||bi(n)||wi(n,t)||vi(n)||Ci(n))},xn=function(t,n){return!(xi(n)||Qo(n)<0||!Rn(t,n))},Ti=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},tr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=mi(a,i),l=i?tr(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:l})}),o.sort(hi).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},It=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Xt([t],n.includeContainer,{filter:xn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ti}):o=Zo(t,n.includeContainer,xn.bind(null,n)),tr(o)},Oi=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Xt([t],n.includeContainer,{filter:Rn.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Zo(t,n.includeContainer,Rn.bind(null,n)),o},nr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return gt.call(t,zt)===!1?!1:xn(n,t)};const bt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function or(e,t){const n=It(e,bt()),o=n.length;if(o===0)return;const r=it(fe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Fn(e){return or(fe(e).body,1)||e}function rr(e){return or(fe(e).body,-1)||e}function sr(e,t){if(!e)return null;const n=It(fe(e).body,bt()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function Pi(e){return sr(e,1)}function Ii(e){return sr(e,-1)}function at(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!re(n,o)}function ki(e){It(e,bt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function io(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const Mi={...us};let co=0;function Ai(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(co+=1,o(`${t}-${co}`))},[n,t]),r}const ao=Mi.useId;function vt(e,t){if(ao!==void 0){const n=ao();return e??(t?`${t}-${n}`:n)}return Ai(e,t)}function ir(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Fi{nodesRef={current:[]};events=ir();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const cr=d.createContext(null),ar=d.createContext(null),tt=()=>d.useContext(cr)?.id||null,yt=e=>{const t=d.useContext(ar);return e??t};function Li(e){const t=vt(),n=yt(e),o=tt();return se(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function Di(e){const{children:t,id:n}=e,o=tt();return ee.jsx(cr.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Ni(e){const{children:t,externalTree:n}=e,o=Ue(()=>n??new Fi).current;return ee.jsx(ar.Provider,{value:o,children:t})}const Bi="none",He="trigger-press",xe="trigger-hover",lr="outside-press",Ka="item-press",Za="close-press",wt="focus-out",ur="escape-key",Ja="list-navigation",Qa="cancel-open",fr="imperative-action",el="window-resize";function ce(e,t,n,o){let r=!1,s=!1;const i=je;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function Ct(e){return`data-base-ui-${e}`}function ln(e,t,n){if(n&&!dt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function nt(e){return e?.ownerDocument||document}const mt=d.forwardRef(function(t,n){const[o,r]=d.useState();se(()=>{Gs&&r("button")},[]);const s={tabIndex:0,role:o};return ee.jsx("span",{...t,ref:n,style:Bo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let lo=0;function un(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(lo);const s=()=>e?.focus({preventScroll:n});r?s():lo=requestAnimationFrame(s)}const lt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function uo(e){return e==="inert"?lt.inert:e==="aria-hidden"?lt["aria-hidden"]:lt.none}let Bt=new WeakSet,$t={},fn=0;const dr=e=>e&&(e.host||dr(e.parentNode)),$i=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=dr(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Wi(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=$i(t,e),a=new Set,c=new Set(i),l=[];$t[r]||($t[r]=new WeakMap);const u=$t[r];i.forEach(f),p(t),a.clear();function f(m){!m||a.has(m)||(a.add(m),m.parentNode&&f(m.parentNode))}function p(m){!m||c.has(m)||[].forEach.call(m.children,g=>{if(Ot(g)!=="script")if(a.has(g))p(g);else{const h=s?g.getAttribute(s):null,v=h!==null&&h!=="false",y=uo(s),b=(y.get(g)||0)+1,E=(u.get(g)||0)+1;y.set(g,b),u.set(g,E),l.push(g),b===1&&v&&Bt.add(g),E===1&&g.setAttribute(r,""),!v&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return fn+=1,()=>{l.forEach(m=>{const g=uo(s),v=(g.get(m)||0)-1,y=(u.get(m)||0)-1;g.set(m,v),u.set(m,y),v||(!Bt.has(m)&&s&&m.removeAttribute(s),Bt.delete(m)),y||m.removeAttribute(r)}),fn-=1,fn||(lt.inert=new WeakMap,lt["aria-hidden"]=new WeakMap,lt.none=new WeakMap,Bt=new WeakSet,$t={})}}function Vi(e,t=!1,n=!1){const o=fe(e[0]).body;return Wi(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const pr=d.createContext(null),gr=()=>d.useContext(pr),ji=Ct("portal");function Hi(e={}){const{ref:t,container:n,componentProps:o=je,elementProps:r,elementState:s}=e,i=vt(),c=gr()?.portalNode,[l,u]=d.useState(null),[f,p]=d.useState(null),m=z(y=>{y!==null&&p(y)}),g=d.useRef(null);se(()=>{if(n===null){g.current&&(g.current=null,p(null),u(null));return}if(i==null)return;const y=(n&&(fs(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,p(null),u(null));return}g.current!==y&&(g.current=y,p(null),u(y))},[n,c,i]);const h=ze("div",o,{ref:[t,m],state:s,props:[{id:i,[ji]:""},r]});return{portalNode:f,portalSubtree:l&&h?_e.createPortal(h,l):null}}const mr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=Hi({container:r,ref:n,componentProps:t,elementProps:c}),f=d.useRef(null),p=d.useRef(null),m=d.useRef(null),g=d.useRef(null),[h,v]=d.useState(null),y=h?.modal,b=h?.open,E=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!l;d.useEffect(()=>{if(!l||y)return;function w(O){l&&O.relatedTarget&&at(O)&&(O.type==="focusin"?io:ki)(l)}return l.addEventListener("focusin",w,!0),l.addEventListener("focusout",w,!0),()=>{l.removeEventListener("focusin",w,!0),l.removeEventListener("focusout",w,!0)}},[l,y]),d.useEffect(()=>{!l||b||io(l)},[b,l]);const S=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return ee.jsxs(d.Fragment,{children:[u,ee.jsxs(pr.Provider,{value:S,children:[E&&l&&ee.jsx(mt,{"data-type":"outside",ref:f,onFocus:w=>{if(at(w,l))m.current?.focus();else{const O=h?h.domReference:null;rr(O)?.focus()}}}),E&&l&&ee.jsx("span",{"aria-owns":l.id,style:vs}),l&&_e.createPortal(o,l),E&&l&&ee.jsx(mt,{"data-type":"outside",ref:p,onFocus:w=>{if(at(w,l))g.current?.focus();else{const O=h?h.domReference:null;Fn(O)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ce(wt,w.nativeEvent))}}})]})]})});function Be(e){return e==null?e:"current"in e?e.current:e}function _i(e,t){const n=Ce(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const fo=20;let Ve=[];function Ln(){Ve=Ve.filter(e=>e.isConnected)}function Yi(e){Ln(),e&&Ot(e)!=="body"&&(Ve.push(e),Ve.length>fo&&(Ve=Ve.slice(-fo)))}function dn(){return Ln(),Ve[Ve.length-1]}function Ui(e){if(!e)return null;const t=bt();return nr(e,t)?e:It(e,t)[0]||e}function zi(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Pe(e).display!=="none"}function po(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=bt(),r=Oi(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return nr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function hr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:h}=e,v="rootStore"in t?t.rootStore:t,y=v.useState("open"),b=v.useState("domReferenceElement"),E=v.useState("floatingElement"),{events:S,dataRef:w}=v.context,O=z(()=>w.current.floatingContext?.nodeId),C=z(f),I=s===!1,N=to(b)&&I,k=Fe(r),L=Fe(s),A=Fe(i),T=Fe(u),D=yt(h),P=gr(),V=d.useRef(null),B=d.useRef(null),x=d.useRef(!1),F=d.useRef(!1),Q=d.useRef(!1),X=d.useRef(-1),K=d.useRef(""),Z=d.useRef(""),_=d.useRef(null),ne=d.useRef(null),U=qn(_,g,P?.beforeInsideRef),J=qn(ne,P?.afterInsideRef),de=Je(),pe=Je(),ge=In(),De=P!=null,R=vn(E),Y=z((M=R)=>M?It(M,bt()):[]),$=z(M=>{const W=Y(M);return k.current.map(()=>W).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function M(q){q.key==="Tab"&&re(R,it(fe(R)))&&Y().length===0&&!N&&ei(q)}const W=fe(R);return W.addEventListener("keydown",M),()=>{W.removeEventListener("keydown",M)}},[o,b,R,c,k,N,Y,$]),d.useEffect(()=>{if(o||!E)return;function M(W){const q=Ee(W),oe=Y().indexOf(q);oe!==-1&&(X.current=oe)}return E.addEventListener("focusin",M),()=>{E.removeEventListener("focusin",M)}},[o,E,Y]),d.useEffect(()=>{if(o||!y)return;const M=fe(R);function W(){Q.current=!1}function q(oe){const H=Ee(oe),j=re(E,H)||re(b,H)||re(P?.portalNode,H);Q.current=!j,Z.current=oe.pointerType||"keyboard"}function te(){Z.current="keyboard"}return M.addEventListener("pointerdown",q,!0),M.addEventListener("pointerup",W,!0),M.addEventListener("pointercancel",W,!0),M.addEventListener("keydown",te,!0),()=>{M.removeEventListener("pointerdown",q,!0),M.removeEventListener("pointerup",W,!0),M.removeEventListener("pointercancel",W,!0),M.removeEventListener("keydown",te,!0)}},[o,E,b,R,y,P]),d.useEffect(()=>{if(o||!l)return;function M(){F.current=!0,pe.start(0,()=>{F.current=!1})}function W(H){const j=H.relatedTarget,me=H.currentTarget,ae=Ee(H);queueMicrotask(()=>{const Ne=O(),Ge=v.context.triggerElements,ot=j?.hasAttribute(Ct("focus-guard"))&&[_.current,ne.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Be(m),Be(p)].includes(j),Xe=!(re(b,j)||re(E,j)||re(j,E)||re(P?.portalNode,j)||j!=null&&Ge.hasElement(j)||Ge.hasMatchingElement(he=>re(he,j))||ot||D&&(Ze(D.nodesRef.current,Ne).find(he=>re(he.context?.elements.floating,j)||re(he.context?.elements.domReference,j))||no(D.nodesRef.current,Ne).find(he=>[he.context?.elements.floating,vn(he.context?.elements.floating)].includes(j)||he.context?.elements.domReference===j)));if(me===b&&R&&po(R,k),a&&me!==b&&!zi(ae)&&it(fe(R))===fe(R).body){if(be(R)&&(R.focus(),a==="popup")){ge.request(()=>{R.focus()});return}const he=X.current,Ie=Y(),ke=Ie[he]||Ie[Ie.length-1]||R;be(ke)&&ke.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!c)&&j&&Xe&&!F.current&&(N||j!==dn())&&(x.current=!0,v.setOpen(!1,ce(wt,H)))})}function q(){Q.current||(w.current.insideReactTree=!0,de.start(0,()=>{w.current.insideReactTree=!1}))}const te=be(b)?b:null,oe=[];if(!(!E&&!te))return te&&(te.addEventListener("focusout",W),te.addEventListener("pointerdown",M),oe.push(()=>{te.removeEventListener("focusout",W),te.removeEventListener("pointerdown",M)})),E&&(E.addEventListener("focusout",W),P&&(E.addEventListener("focusout",q,!0),oe.push(()=>{E.removeEventListener("focusout",q,!0)})),oe.push(()=>{E.removeEventListener("focusout",W)})),()=>{oe.forEach(H=>{H()})}},[o,b,E,R,c,D,P,v,l,a,Y,N,O,k,w,de,pe,ge,p,m]),d.useEffect(()=>{if(o||!E||!y)return;const M=Array.from(P?.portalNode?.querySelectorAll(`[${Ct("portal")}]`)||[]),q=(D?no(D.nodesRef.current,O()):[]).find(H=>to(H.context?.elements.domReference||null))?.context?.elements.domReference,te=[E,q,...M,...C(),V.current,B.current,_.current,ne.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Be(m),Be(p),N?b:null].filter(H=>H!=null),oe=Vi(te,c||N);return()=>{oe()}},[y,o,b,E,c,k,P,N,D,O,C,p,m]),se(()=>{if(!y||o||!be(R))return;const M=fe(R),W=it(M);queueMicrotask(()=>{const q=$(R),te=L.current,oe=typeof te=="function"?te(T.current||""):te;if(oe===void 0||oe===!1)return;let H;oe===!0||oe===null?H=q[0]||R:H=Be(oe),H=H||q[0]||R,!re(R,W)&&un(H,{preventScroll:H===R})})},[o,y,R,I,$,L,T]),se(()=>{if(o||!R)return;const M=fe(R),W=it(M);Yi(W);function q(H){if(H.open||(K.current=_i(H.nativeEvent,Z.current)),H.reason===xe&&H.nativeEvent.type==="mouseleave"&&(x.current=!0),H.reason===lr)if(H.nested)x.current=!1;else if(ni(H.nativeEvent)||oi(H.nativeEvent))x.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?x.current=!1:x.current=!0}}S.on("openchange",q);const te=M.createElement("span");te.setAttribute("tabindex","-1"),te.setAttribute("aria-hidden","true"),Object.assign(te.style,Bo),De&&b&&b.insertAdjacentElement("afterend",te);function oe(){const H=A.current;let j=typeof H=="function"?H(K.current):H;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const ae=b||dn();return ae&&ae.isConnected?ae:te}const me=b||dn()||te;return Be(j)||me}return()=>{S.off("openchange",q);const H=it(M),j=re(E,H)||D&&Ze(D.nodesRef.current,O(),!1).some(ae=>re(ae.context?.elements.floating,H)),me=oe();queueMicrotask(()=>{const ae=Ui(me),Ne=typeof A.current!="boolean";A.current&&!x.current&&be(ae)&&(!(!Ne&&ae!==H&&H!==M.body)||j)&&ae.focus({preventScroll:!0}),te.remove()})}},[o,E,R,A,w,S,D,De,b,O]),d.useEffect(()=>{queueMicrotask(()=>{x.current=!1})},[o]),d.useEffect(()=>{if(o||!y)return;function M(q){Ee(q)?.closest(`[${Do}]`)&&(F.current=!0)}const W=fe(R);return W.addEventListener("pointerdown",M,!0),()=>{W.removeEventListener("pointerdown",M,!0)}},[o,y,R]),se(()=>{if(!o&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:y,onOpenChange:v.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,c,y,v,l,b]),se(()=>{if(!(o||!R))return po(R,k),()=>{queueMicrotask(Ln)}},[o,R,k]);const ue=!o&&(c?!N:!0)&&(De||c);return ee.jsxs(d.Fragment,{children:[ue&&ee.jsx(mt,{"data-type":"inside",ref:U,onFocus:M=>{if(c){const W=$();un(W[W.length-1])}else P?.portalNode&&(x.current=!1,at(M,P.portalNode)?Fn(b)?.focus():Be(m??P.beforeOutsideRef)?.focus())}}),n,ue&&ee.jsx(mt,{"data-type":"inside",ref:J,onFocus:M=>{c?un($()[0]):P?.portalNode&&(l&&(x.current=!0),at(M,P.portalNode)?rr(b)?.focus():Be(p??P.afterOutsideRef)?.focus())}})]})}function qi(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=d.useRef(void 0),f=In(),p=Je(),m=d.useMemo(()=>({onPointerDown(g){u.current=g.pointerType},onMouseDown(g){const h=u.current,v=g.nativeEvent,y=n.select("open");if(g.button!==0||s==="click"||dt(h,!0)&&a)return;const b=o.current.openEvent,E=b?.type,S=n.select("domReferenceElement")!==g.currentTarget,w=y&&S||!(y&&i&&(!(b&&c)||E==="click"||E==="mousedown"));if(qo(v.target)){const C=ce(He,v,v.target);w&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,C)}):n.setOpen(w,C);return}const O=g.currentTarget;f.request(()=>{const C=ce(He,v,O);w&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,C)}):n.setOpen(w,C)})},onClick(g){if(s==="mousedown-only")return;const h=u.current;if(s==="mousedown"&&h){u.current=void 0;return}if(dt(h,!0)&&a)return;const v=n.select("open"),y=o.current.openEvent,b=n.select("domReferenceElement")!==g.currentTarget,E=v&&b||!(v&&i&&(!(y&&c)||Go(y))),S=ce(He,g.nativeEvent,g.currentTarget);E&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,S)}):n.setOpen(E,S)},onKeyDown(){u.current=void 0}}),[o,s,a,n,c,i,f,p,l]);return d.useMemo(()=>r?{reference:m}:je,[r,m])}function go(e,t,n){let{reference:o,floating:r}=e;const s=we(t),i=An(t),a=Mn(i),c=ye(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let m;switch(c){case"top":m={x:u,y:o.y-r.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:f};break;case"left":m={x:o.x-r.width,y:f};break;default:m={x:o.x,y:o.y}}switch(qe(t)){case"start":m[i]-=p*(n&&l?-1:1);break;case"end":m[i]+=p*(n&&l?-1:1);break}return m}async function Gi(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=$e(t,e),g=Xo(m),v=a[p?f==="floating"?"reference":"floating":f],y=Ut(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},w=Ut(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:E,strategy:c}):b);return{top:(y.top-w.top+g.top)/S.y,bottom:(w.bottom-y.bottom+g.bottom)/S.y,left:(y.left-w.left+g.left)/S.x,right:(w.right-y.right+g.right)/S.x}}const Xi=50,Ki=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Gi},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=go(l,o,c),p=o,m=0;const g={};for(let h=0;h<s.length;h++){const v=s[h];if(!v)continue;const{name:y,fn:b}=v,{x:E,y:S,data:w,reset:O}=await b({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:l,platform:a,elements:{reference:e,floating:t}});u=E??u,f=S??f,g[y]={...g[y],...w},O&&m<Xi&&(m++,typeof O=="object"&&(O.placement&&(p=O.placement),O.rects&&(l=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):O.rects),{x:u,y:f}=go(l,p,c)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:g}},Zi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...v}=$e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ye(r),b=we(a),E=ye(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),w=p||(E||!h?[Yt(a)]:ci(a)),O=g!=="none";!p&&O&&w.push(...fi(a,h,g,S));const C=[a,...w],I=await c.detectOverflow(t,v),N=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&N.push(I[y]),f){const D=ii(r,i,S);N.push(I[D[0]],I[D[1]])}if(k=[...k,{placement:r,overflows:N}],!N.every(D=>D<=0)){var L,A;const D=(((L=s.flip)==null?void 0:L.index)||0)+1,P=C[D];if(P&&(!(f==="alignment"?b!==we(P):!1)||k.every(x=>we(x.placement)===b?x.overflows[0]>0:!0)))return{data:{index:D,overflows:k},reset:{placement:P}};let V=(A=k.filter(B=>B.overflows[0]<=0).sort((B,x)=>B.overflows[1]-x.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(m){case"bestFit":{var T;const B=(T=k.filter(x=>{if(O){const F=we(x.placement);return F===b||F==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(F=>F>0).reduce((F,Q)=>F+Q,0)]).sort((x,F)=>x[1]-F[1])[0])==null?void 0:T[0];B&&(V=B);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ho(e){return ri.some(t=>e[t]>=0)}const Ji=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=$e(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=mo(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ho(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=mo(i,n.floating);return{data:{escapedOffsets:a,escaped:ho(a)}}}default:return{}}}}},br=new Set(["left","top"]);async function Qi(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ye(n),a=qe(n),c=we(n)==="y",l=br.has(i)?-1:1,u=s&&c?-1:1,f=$e(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*u,y:p*l}:{x:p*l,y:m*u}}const ec=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await Qi(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},tc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:E}=y;return{x:b,y:E}}},...l}=$e(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=we(ye(r)),m=kn(p);let g=u[m],h=u[p];if(i){const y=m==="y"?"top":"left",b=m==="y"?"bottom":"right",E=g+f[y],S=g-f[b];g=yn(E,g,S)}if(a){const y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",E=h+f[y],S=h-f[b];h=yn(E,h,S)}const v=c.fn({...t,[m]:g,[p]:h});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[m]:i,[p]:a}}}}}},nc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=$e(e,t),u={x:n,y:o},f=we(r),p=kn(f);let m=u[p],g=u[f];const h=$e(a,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const E=p==="y"?"height":"width",S=s.reference[p]-s.floating[E]+v.mainAxis,w=s.reference[p]+s.reference[E]-v.mainAxis;m<S?m=S:m>w&&(m=w)}if(l){var y,b;const E=p==="y"?"width":"height",S=br.has(ye(r)),w=s.reference[f]-s.floating[E]+(S&&((y=i.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),O=s.reference[f]+s.reference[E]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);g<w?g=w:g>O&&(g=O)}return{[p]:m,[f]:g}}}},oc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=$e(e,t),u=await i.detectOverflow(t,l),f=ye(r),p=qe(r),m=we(r)==="y",{width:g,height:h}=s.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,v=p==="end"?"top":"bottom");const b=h-u.top-u.bottom,E=g-u.left-u.right,S=pt(h-u[v],b),w=pt(g-u[y],E),O=!t.middlewareData.shift;let C=S,I=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=E),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=b),O&&!p){const k=Re(u.left,0),L=Re(u.right,0),A=Re(u.top,0),T=Re(u.bottom,0);m?I=g-2*(k!==0||L!==0?k+L:Re(u.left,u.right)):C=h-2*(A!==0||T!==0?A+T:Re(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:C});const N=await i.getDimensions(a.floating);return g!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function vr(e){const t=Pe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=be(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=_t(n)!==s||_t(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Dn(e){return ie(e)?e:e.contextElement}function ut(e){const t=Dn(e);if(!be(t))return Le(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=vr(t);let i=(s?_t(n.width):n.width)/o,a=(s?_t(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const rc=Le(0);function yr(e){const t=Ce(e);return!Cn()||!t.visualViewport?rc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ce(e)?!1:t}function Qe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Dn(e);let i=Le(1);t&&(o?ie(o)&&(i=ut(o)):i=ut(e));const a=sc(s,n,o)?yr(s):Le(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=Ce(s),m=o&&ie(o)?Ce(o):o;let g=p,h=Gn(g);for(;h&&o&&m!==g;){const v=ut(h),y=h.getBoundingClientRect(),b=Pe(h),E=y.left+(h.clientLeft+parseFloat(b.paddingLeft))*v.x,S=y.top+(h.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=E,l+=S,g=Ce(h),h=Gn(g)}}return Ut({width:u,height:f,x:c,y:l})}function Jt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:Qe(We(e)).left+n}function Er(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ic(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=We(o),a=t?Tn(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Le(1);const u=Le(0),f=be(o);if((f||!f&&!s)&&((Ot(o)!=="body"||Pt(i))&&(c=Zt(o)),f)){const m=Qe(o);l=ut(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const p=i&&!f&&!s?Er(i,c):Le(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function cc(e){return Array.from(e.getClientRects())}function ac(e){const t=We(e),n=Zt(e),o=e.ownerDocument.body,r=Re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Jt(e);const a=-n.scrollTop;return Pe(o).direction==="rtl"&&(i+=Re(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const bo=25;function lc(e,t){const n=Ce(e),o=We(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,c=0;if(r){s=r.width,i=r.height;const u=Cn();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=Jt(o);if(l<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-m);g<=bo&&(s-=g)}else l<=bo&&(s+=l);return{width:s,height:i,x:a,y:c}}function uc(e,t){const n=Qe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=be(e)?ut(e):Le(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function vo(e,t,n){let o;if(t==="viewport")o=lc(e,n);else if(t==="document")o=ac(We(e));else if(ie(t))o=uc(t,n);else{const r=yr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ut(o)}function Rr(e,t){const n=ft(e);return n===t||!ie(n)||Ke(n)?!1:Pe(n).position==="fixed"||Rr(n,t)}function fc(e,t){const n=t.get(e);if(n)return n;let o=ct(e,[],!1).filter(a=>ie(a)&&Ot(a)!=="body"),r=null;const s=Pe(e).position==="fixed";let i=s?ft(e):e;for(;ie(i)&&!Ke(i);){const a=Pe(i),c=Lo(i);!c&&a.position==="fixed"&&(r=null),(s?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Pt(i)&&!c&&Rr(e,i))?o=o.filter(u=>u!==i):r=a,i=ft(i)}return t.set(e,o),o}function dc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Tn(t)?[]:fc(t,this._c):[].concat(n),o],a=vo(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const m=vo(t,i[p],r);c=Re(m.top,c),l=pt(m.right,l),u=pt(m.bottom,u),f=Re(m.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function pc(e){const{width:t,height:n}=vr(e);return{width:t,height:n}}function gc(e,t,n){const o=be(t),r=We(t),s=n==="fixed",i=Qe(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Le(0);function l(){c.x=Jt(r)}if(o||!o&&!s)if((Ot(t)!=="body"||Pt(r))&&(a=Zt(t)),o){const m=Qe(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?Er(r,a):Le(0),f=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function pn(e){return Pe(e).position==="static"}function yo(e,t){if(!be(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return We(e)===n&&(n=n.ownerDocument.body),n}function xr(e,t){const n=Ce(e);if(Tn(e))return n;if(!be(e)){let r=ft(e);for(;r&&!Ke(r);){if(ie(r)&&!pn(r))return r;r=ft(r)}return n}let o=yo(e,t);for(;o&&ds(o)&&pn(o);)o=yo(o,t);return o&&Ke(o)&&pn(o)&&!Lo(o)?n:o||ps(e)||n}const mc=async function(e){const t=this.getOffsetParent||xr,n=this.getDimensions,o=await n(e.floating);return{reference:gc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function hc(e){return Pe(e).direction==="rtl"}const bc={convertOffsetParentRelativeRectToViewportRelativeRect:ic,getDocumentElement:We,getClippingRect:dc,getOffsetParent:xr,getElementRects:mc,getClientRects:cc,getDimensions:pc,getScale:ut,isElement:ie,isRTL:hc};function Sr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t){let n=null,o;const r=We(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:m}=l;if(a||t(),!p||!m)return;const g=Nt(f),h=Nt(r.clientWidth-(u+p)),v=Nt(r.clientHeight-(f+m)),y=Nt(u),E={rootMargin:-g+"px "+-h+"px "+-v+"px "+-y+"px",threshold:Re(0,pt(1,c))||1};let S=!0;function w(O){const C=O[0].intersectionRatio;if(C!==c){if(!S)return i();C?i(!1,C):o=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!Sr(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(w,{...E,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return i(!0),s}function Eo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Dn(e),u=r||s?[...l?ct(l):[],...t?ct(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=l&&a?vc(l,n):null;let p=-1,m=null;i&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),n()}),l&&!c&&m.observe(l),t&&m.observe(t));let g,h=c?Qe(e):null;c&&v();function v(){const y=Qe(e);h&&!Sr(h,y)&&n(),h=y,g=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const yc=ec,Ec=tc,Rc=Zi,xc=oc,Sc=Ji,wc=nc,Cc=(e,t,n)=>{const o=new Map,r={platform:bc,...n},s={...r.platform,_c:o};return Ki(e,t,{...r,platform:s})};var Tc=typeof document<"u",Oc=function(){},Vt=Tc?d.useLayoutEffect:Oc;function Kt(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Kt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Kt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function wr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ro(e,t){const n=wr(e);return Math.round(t*n)/n}function gn(e){const t=d.useRef(e);return Vt(()=>{t.current=e}),t}function Pc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(o);Kt(p,o)||m(o);const[g,h]=d.useState(null),[v,y]=d.useState(null),b=d.useCallback(x=>{x!==O.current&&(O.current=x,h(x))},[]),E=d.useCallback(x=>{x!==C.current&&(C.current=x,y(x))},[]),S=s||g,w=i||v,O=d.useRef(null),C=d.useRef(null),I=d.useRef(u),N=c!=null,k=gn(c),L=gn(r),A=gn(l),T=d.useCallback(()=>{if(!O.current||!C.current)return;const x={placement:t,strategy:n,middleware:p};L.current&&(x.platform=L.current),Cc(O.current,C.current,x).then(F=>{const Q={...F,isPositioned:A.current!==!1};D.current&&!Kt(I.current,Q)&&(I.current=Q,_e.flushSync(()=>{f(Q)}))})},[p,t,n,L,A]);Vt(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(x=>({...x,isPositioned:!1})))},[l]);const D=d.useRef(!1);Vt(()=>(D.current=!0,()=>{D.current=!1}),[]),Vt(()=>{if(S&&(O.current=S),w&&(C.current=w),S&&w){if(k.current)return k.current(S,w,T);T()}},[S,w,T,k,N]);const P=d.useMemo(()=>({reference:O,floating:C,setReference:b,setFloating:E}),[b,E]),V=d.useMemo(()=>({reference:S,floating:w}),[S,w]),B=d.useMemo(()=>{const x={position:n,left:0,top:0};if(!V.floating)return x;const F=Ro(V.floating,u.x),Q=Ro(V.floating,u.y);return a?{...x,transform:"translate("+F+"px, "+Q+"px)",...wr(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Q}},[n,a,V.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:T,refs:P,elements:V,floatingStyles:B}),[u,T,P,V,B])}const Ic=(e,t)=>{const n=yc(e);return{name:n.name,fn:n.fn,options:[e,t]}},kc=(e,t)=>{const n=Ec(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mc=(e,t)=>({fn:wc(e).fn,options:[e,t]}),Ac=(e,t)=>{const n=Rc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fc=(e,t)=>{const n=xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lc=(e,t)=>{const n=Sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc={intentional:"onClick",sloppy:"onPointerDown"};function Nc(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Cr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:m=!1,referencePressEvent:g="sloppy",ancestorScroll:h=!1,bubbles:v,externalTree:y}=t,b=yt(y),E=z(typeof f=="function"?f:()=>!1),S=typeof f=="function"?E:f,w=d.useRef(!1),{escapeKey:O,outsidePress:C}=Nc(v),I=d.useRef(null),N=Je(),k=Je(),L=z(()=>{k.clear(),c.current.insideReactTree=!1}),A=d.useRef(!1),T=d.useRef(""),D=z(R=>{T.current=R.pointerType}),P=z(()=>{const R=T.current,Y=R==="pen"||!R?"mouse":R,$=typeof p=="function"?p():p;return typeof $=="string"?$:$[Y]}),V=z(R=>{if(!o||!l||!u||R.key!=="Escape"||A.current)return;const Y=c.current.floatingContext?.nodeId,$=b?Ze(b.nodesRef.current,Y):[];if(!O&&$.length>0){let W=!0;if($.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__escapeKeyBubbles&&(W=!1)}),!W)return}const ue=ti(R)?R.nativeEvent:R,M=ce(ur,ue);n.setOpen(!1,M),!O&&!M.isPropagationAllowed&&R.stopPropagation()}),B=z(R=>{const Y=P();return Y==="intentional"&&R.type!=="click"||Y==="sloppy"&&R.type==="click"}),x=z(()=>{c.current.insideReactTree=!0,k.start(0,L)}),F=z((R,Y=!1)=>{if(B(R)){L();return}if(c.current.insideReactTree){L();return}if(P()==="intentional"&&Y||typeof S=="function"&&!S(R))return;const $=Ee(R),ue=`[${Ct("inert")}]`,M=fe(n.select("floatingElement")).querySelectorAll(ue),W=n.context.triggerElements;if($&&(W.hasElement($)||W.hasMatchingElement(j=>re(j,$))))return;let q=ie($)?$:null;for(;q&&!Ke(q);){const j=ft(q);if(Ke(j)||!ie(j))break;q=j}if(M.length&&ie($)&&!Qs($)&&!re($,n.select("floatingElement"))&&Array.from(M).every(j=>!re(q,j)))return;if(be($)&&!("touches"in R)){const j=Ke($),me=Pe($),ae=/auto|scroll/,Ne=j||ae.test(me.overflowX),Ge=j||ae.test(me.overflowY),ot=Ne&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,Xe=Ge&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,he=me.direction==="rtl",Ie=Xe&&(he?R.offsetX<=$.offsetWidth-$.clientWidth:R.offsetX>$.clientWidth),ke=ot&&R.offsetY>$.clientHeight;if(Ie||ke)return}const te=c.current.floatingContext?.nodeId,oe=b&&Ze(b.nodesRef.current,te).some(j=>Te(R,j.context?.elements.floating));if(Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||oe)return;const H=b?Ze(b.nodesRef.current,te):[];if(H.length>0){let j=!0;if(H.forEach(me=>{me.context?.open&&!me.context.dataRef.current.__outsidePressBubbles&&(j=!1)}),!j)return}n.setOpen(!1,ce(lr,R)),L()}),Q=z(R=>{P()!=="sloppy"||R.pointerType==="touch"||!n.select("open")||!l||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||F(R)}),X=z(R=>{if(P()!=="sloppy"||!n.select("open")||!l||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement")))return;const Y=R.touches[0];Y&&(I.current={startTime:Date.now(),startX:Y.clientX,startY:Y.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),K=z(R=>{const Y=Ee(R);function $(){X(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)}),Z=z(R=>{const Y=w.current;if(w.current=!1,N.clear(),R.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const $=Ee(R);function ue(){R.type==="pointerdown"?Q(R):F(R,Y),$?.removeEventListener(R.type,ue)}$?.addEventListener(R.type,ue)}),_=z(R=>{if(P()!=="sloppy"||!I.current||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement")))return;const Y=R.touches[0];if(!Y)return;const $=Math.abs(Y.clientX-I.current.startX),ue=Math.abs(Y.clientY-I.current.startY),M=Math.sqrt($*$+ue*ue);M>5&&(I.current.dismissOnTouchEnd=!0),M>10&&(F(R),N.clear(),I.current=null)}),ne=z(R=>{const Y=Ee(R);function $(){_(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)}),U=z(R=>{P()!=="sloppy"||!I.current||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&F(R),N.clear(),I.current=null)}),J=z(R=>{const Y=Ee(R);function $(){U(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)});d.useEffect(()=>{if(!o||!l)return;c.current.__escapeKeyBubbles=O,c.current.__outsidePressBubbles=C;const R=new Ye;function Y(q){n.setOpen(!1,ce(Bi,q))}function $(){R.clear(),A.current=!0}function ue(){R.start(Cn()?5:0,()=>{A.current=!1})}const M=fe(r);M.addEventListener("pointerdown",D,!0),u&&(M.addEventListener("keydown",V),M.addEventListener("compositionstart",$),M.addEventListener("compositionend",ue)),S&&(M.addEventListener("click",Z,!0),M.addEventListener("pointerdown",Z,!0),M.addEventListener("touchstart",K,!0),M.addEventListener("touchmove",ne,!0),M.addEventListener("touchend",J,!0),M.addEventListener("mousedown",Z,!0));let W=[];return h&&(ie(i)&&(W=ct(i)),ie(r)&&(W=W.concat(ct(r))),!ie(s)&&s&&s.contextElement&&(W=W.concat(ct(s.contextElement)))),W=W.filter(q=>q!==M.defaultView?.visualViewport),W.forEach(q=>{q.addEventListener("scroll",Y,{passive:!0})}),()=>{M.removeEventListener("pointerdown",D,!0),u&&(M.removeEventListener("keydown",V),M.removeEventListener("compositionstart",$),M.removeEventListener("compositionend",ue)),S&&(M.removeEventListener("click",Z,!0),M.removeEventListener("pointerdown",Z,!0),M.removeEventListener("touchstart",K,!0),M.removeEventListener("touchmove",ne,!0),M.removeEventListener("touchend",J,!0),M.removeEventListener("mousedown",Z,!0)),W.forEach(q=>{q.removeEventListener("scroll",Y)}),R.clear(),w.current=!1}},[c,r,s,i,u,S,o,a,h,l,O,C,V,F,Z,Q,K,ne,J,D,n]),d.useEffect(L,[S,L]);const de=d.useMemo(()=>({onKeyDown:V,...m&&{[Dc[g]]:R=>{n.setOpen(!1,ce(He,R.nativeEvent))},...g!=="intentional"&&{onClick(R){n.setOpen(!1,ce(He,R.nativeEvent))}}}}),[V,n,m,g]),pe=z(R=>{const Y=Ee(R.nativeEvent);!re(n.select("floatingElement"),Y)||R.button!==0||(w.current=!0)}),ge=z(R=>{!o||!l||R.button!==0||(w.current=!0)}),De=d.useMemo(()=>({onKeyDown:V,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:x,onMouseDownCapture(R){x(),ge(R)},onPointerDownCapture(R){x(),ge(R)},onMouseUpCapture:x,onTouchEndCapture:x,onTouchMoveCapture:x}),[V,pe,x,ge]);return d.useMemo(()=>l?{reference:de,floating:De,trigger:de}:{},[l,de,De])}const Bc={open:G(e=>e.open),domReferenceElement:G(e=>e.domReferenceElement),referenceElement:G(e=>e.positionReference??e.referenceElement),floatingElement:G(e=>e.floatingElement),floatingId:G(e=>e.floatingId)};class Nn extends On{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ir(),nested:n,noEmit:o,triggerElements:s},Bc)}setOpen=(t,n)=>{if((!t||!this.state.open||Go(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function $c(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),se(()=>{if(!e&&s&&o!=="ending"&&n){const a=Ae.request(()=>{r("ending")});return()=>{Ae.cancel(a)}}},[e,s,o,n]),se(()=>{if(!e||t)return;const a=Ae.request(()=>{r(void 0)});return()=>{Ae.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Ae.request(()=>{r("idle")});return()=>{Ae.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Tt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Wc={[Tt.startingStyle]:""},Vc={[Tt.endingStyle]:""},Qt={transitionStatus(e){return e==="starting"?Wc:e==="ending"?Vc:null}};function Tr(e,t=!1,n=!0){const o=In();return z((r,s=null)=>{o.cancel();function i(){_e.flushSync(r)}const a=Be(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Tt.startingStyle;if(!c.hasAttribute(f)){o.request(u);return}const p=new MutationObserver(()=>{c.hasAttribute(f)||(p.disconnect(),u())});p.observe(c,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(p=>p.pending||p.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Bn(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=z(r),i=Tr(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}function jc(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Hc(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=jc(e,n),i=z(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return se(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Or(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Pr(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=$c(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=z(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Bn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class en{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elements.delete(o),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function _c(){return new Nn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new en,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Ir(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:_c(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:je,inactiveTriggerProps:je,popupProps:je}}const kr={open:G(e=>e.open),mounted:G(e=>e.mounted),transitionStatus:G(e=>e.transitionStatus),floatingRootContext:G(e=>e.floatingRootContext),preventUnmountingOnClose:G(e=>e.preventUnmountingOnClose),payload:G(e=>e.payload),activeTriggerId:G(e=>e.activeTriggerId),activeTriggerElement:G(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:G((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:G((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:G(e=>e.popupProps),popupElement:G(e=>e.popupElement),positionerElement:G(e=>e.positionerElement)};function Yc(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=vt(),s=tt()!=null,i=Ue(()=>new Nn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new en,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return se(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=ie(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Uc(e={}){const{nodeId:t,externalTree:n}=e,o=Yc(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),c=d.useRef(null),l=yt(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=Pc({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(C=>{const I=ie(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;a(I),u.refs.setReference(I)},[u.refs]),[p,m]=d.useState(null),[g,h]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",ie(p)?p:null),r.useSyncedValue("floatingElement",g);const v=d.useCallback(C=>{(ie(C)||C===null)&&(c.current=C,m(C)),(ie(u.refs.reference.current)||u.refs.reference.current===null||C!==null&&!ie(C))&&u.refs.setReference(C)},[u.refs,m]),y=d.useCallback(C=>{h(C),u.refs.setFloating(C)},[u.refs]),b=d.useMemo(()=>({...u.refs,setReference:v,setFloating:y,setPositionReference:f,domReference:c}),[u.refs,v,y,f]),E=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),S=r.useState("open"),w=r.useState("floatingId"),O=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:S,onOpenChange:r.setOpen,events:r.context.events,floatingId:w,refs:b,elements:E,nodeId:t,rootStore:r}),[u,b,E,t,r,S,w]);return se(()=>{r.context.dataRef.current.floatingContext=O;const C=l?.nodesRef.current.find(I=>I.id===t);C&&(C.context=O)}),d.useMemo(()=>({...u,context:O,refs:b,elements:E,rootStore:r}),[u,b,E,O,r])}function Mr(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=vt(),i=tt()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=Ue(()=>new Nn({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return se(()=>{const p={open:a,floatingId:s,referenceElement:c,floatingElement:l};ie(c)&&(p.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(p.positionReference=c),f.update(p)},[a,s,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const Sn=Ct("safe-polygon"),zc=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zo}`;function qc(e){return e?!!e.closest(zc):!1}function Ar(e){const t=d.useRef(void 0),n=d.useRef(!1),o=d.useRef(void 0),r=d.useRef(!0),s=d.useRef(!1),i=d.useRef(()=>{}),a=d.useRef(!1),c=Je(),l=Je(),u=d.useRef(void 0);return d.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,o,r,s,i,a,c,l,u])}const Gc=new Set(["click","mousedown"]);function Xc(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:m,unbindMouseMoveRef:g,restTimeoutPendingRef:h,openChangeTimeout:v,handleCloseOptionsRef:y}=Ar(n),b=yt(l),E=tt(),S=z(()=>f.current?!0:i.current.openEvent?Gc.has(i.current.openEvent.type):!1),w=z(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),O=d.useCallback((k,L=!0)=>{const A=Kc(c,u.current);A&&!p.current?v.start(A,()=>n.setOpen(!1,ce(xe,k))):L&&(v.clear(),n.setOpen(!1,ce(xe,k)))},[c,p,n,u,v]),C=z(()=>{g.current(),p.current=void 0}),I=z(()=>{if(m.current){const k=fe(r).body;k.style.pointerEvents="",k.removeAttribute(Sn),m.current=!1}}),N=z(k=>{const L=Ee(k);if(!qc(L)){f.current=!1;return}f.current=!0});se(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,C(),I())},[o,u,h,f,C,I]),d.useEffect(()=>()=>{C()},[C]),d.useEffect(()=>I,[I]),se(()=>{if(a&&o&&y.current?.blockPointerEvents&&w()&&ie(s)&&r){m.current=!0;const k=fe(r).body;k.setAttribute(Sn,"");const L=s,A=r,T=b?.nodesRef.current.find(D=>D.id===E)?.context?.elements.floating;return T&&(T.style.pointerEvents=""),k.style.pointerEvents="none",L.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",L.style.pointerEvents="",A.style.pointerEvents=""}}},[a,o,s,r,y,w,b,E,m]),d.useEffect(()=>{if(!a)return;function k(D){if(S()||!i.current.floatingContext||!n.select("open"))return;const P=n.context.triggerElements;D.relatedTarget&&P.hasElement(D.relatedTarget)||(I(),C(),S()||O(D))}function L(D){v.clear(),I(),p.current?.(D),C()}function A(D){S()||O(D,!1)}const T=r;return T&&(T.addEventListener("mouseleave",k),T.addEventListener("mouseenter",L),T.addEventListener("mouseleave",A),T.addEventListener("pointerdown",N,!0)),()=>{T&&(T.removeEventListener("mouseleave",k),T.removeEventListener("mouseenter",L),T.removeEventListener("mouseleave",A),T.removeEventListener("pointerdown",N,!0))}})}function Kc(e,t){return t&&!dt(t)?0:typeof e=="function"?e():e}function mn(e){return typeof e=="function"?e():e}const Zc={current:null};function Jc(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Zc,externalTree:p,isActiveTrigger:m=!0}=t,g=yt(p),{pointerTypeRef:h,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:E,unbindMouseMoveRef:S,restTimeoutPendingRef:w,openChangeTimeout:O,restTimeout:C,handleCloseOptionsRef:I}=Ar(n),N=Fe(a),k=Fe(i),L=Fe(l);m&&(I.current=N.current?.__options);const A=z(()=>v.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),T=d.useCallback((B,x=!0)=>{const F=ln(k.current,"close",h.current);F&&!y.current?O.start(F,()=>n.setOpen(!1,ce(xe,B))):x&&(O.clear(),n.setOpen(!1,ce(xe,B)))},[k,y,n,h,O]),D=z(()=>{S.current(),y.current=void 0}),P=z(()=>{if(E.current){const B=fe(n.select("domReferenceElement")).body;B.style.pointerEvents="",B.removeAttribute(Sn),E.current=!1}});d.useEffect(()=>{if(!s)return;function B(x){x.open||(O.clear(),C.clear(),b.current=!0,w.current=!1)}return r.on("openchange",B),()=>{r.off("openchange",B)}},[s,r,O,C,b,w]);const V=z(B=>{if(A()||!o.current.floatingContext)return;const x=n.context.triggerElements;if(B.relatedTarget&&x.hasElement(B.relatedTarget))return;const F=f.current;N.current?.({...o.current.floatingContext,tree:g,x:B.clientX,y:B.clientY,onClose(){P(),D(),!A()&&F===n.select("domReferenceElement")&&T(B)}})(B)});return d.useEffect(()=>{if(!s)return;const B=f.current??(m?n.select("domReferenceElement"):null);if(!ie(B))return;function x(X){if(O.clear(),b.current=!1,c&&!dt(h.current)||mn(L.current)>0&&!ln(k.current,"open"))return;const K=ln(k.current,"open",h.current),Z=n.select("domReferenceElement"),_=n.context.triggerElements,ne=(_.hasElement(X.target)||_.hasMatchingElement(pe=>re(pe,X.target)))&&(!Z||!re(Z,X.target)),U=X.currentTarget??null,J=n.select("open"),de=!J||ne;ne&&J?n.setOpen(!0,ce(xe,X,U)):K?O.start(K,()=>{de&&n.setOpen(!0,ce(xe,X,U))}):de&&n.setOpen(!0,ce(xe,X,U))}function F(X){if(A()){P();return}S.current();const K=n.select("domReferenceElement"),Z=fe(K);C.clear(),w.current=!1;const _=n.context.triggerElements;if(X.relatedTarget&&_.hasElement(X.relatedTarget))return;if(N.current&&o.current.floatingContext){n.select("open")||O.clear();const U=f.current;y.current=N.current({...o.current.floatingContext,tree:g,x:X.clientX,y:X.clientY,onClose(){P(),D(),!A()&&U===n.select("domReferenceElement")&&T(X,!0)}});const J=y.current;J(X),Z.addEventListener("mousemove",J),S.current=()=>{Z.removeEventListener("mousemove",J)};return}(h.current!=="touch"||!re(n.select("floatingElement"),X.relatedTarget))&&T(X)}function Q(X){V(X)}return n.select("open")&&B.addEventListener("mouseleave",Q),u&&B.addEventListener("mousemove",x,{once:!0}),B.addEventListener("mouseenter",x),B.addEventListener("mouseleave",F),()=>{B.removeEventListener("mouseleave",Q),u&&B.removeEventListener("mousemove",x),B.removeEventListener("mouseenter",x),B.removeEventListener("mouseleave",F)}},[D,P,b,o,k,T,n,s,N,V,m,A,c,u,h,L,C,w,O,f,g,S,y]),d.useMemo(()=>{function B(x){h.current=x.pointerType}return{onPointerDown:B,onPointerEnter:B,onMouseMove(x){const{nativeEvent:F}=x,Q=x.currentTarget,X=n.select("domReferenceElement"),K=n.context.triggerElements,Z=n.select("open"),_=(K.hasElement(x.target)||K.hasMatchingElement(U=>re(U,x.target)))&&(!X||!re(X,x.target));if(c&&!dt(h.current)||Z&&!_||mn(L.current)===0||!_&&w.current&&x.movementX**2+x.movementY**2<2)return;C.clear();function ne(){if(w.current=!1,A())return;const U=n.select("open");!b.current&&(!U||_)&&n.setOpen(!0,ce(xe,F,Q))}h.current==="touch"?_e.flushSync(()=>{ne()}):_&&Z?ne():(w.current=!0,C.start(mn(L.current),ne))}}},[b,A,c,n,h,L,C,w])}function $n(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=d.useCallback(l=>Wt(l,e,"reference"),t),i=d.useCallback(l=>Wt(l,e,"floating"),n),a=d.useCallback(l=>Wt(l,e,"item"),o),c=d.useCallback(l=>Wt(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Wt(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[bn]="");for(const i in e)r&&e&&(i===Yo||i===Uo)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&xo(s,a,r,o)}return xo(s,e,r,o),s}function xo(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Yo||r===Uo)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Qc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Fr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=vt(),u=s?.id||l,f=d.useMemo(()=>vn(i)?.id||r,[i,r]),p=Qc.get(c)??c,g=tt()!=null,h=d.useMemo(()=>p==="tooltip"||c==="label"?je:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,g,c]),v=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:u}},[p,f,o,u,c,h]),y=d.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,c]),b=d.useCallback(({active:E,selected:S})=>{const w={role:"option",...E&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...w,"aria-selected":S}}return{}},[f,c]);return d.useMemo(()=>a?{reference:v,floating:y,item:b,trigger:h}:{},[a,v,y,h,b])}function So(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=o!=f>=o&&n<=(u-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function ea(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ta(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Ye;let s=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,p){const m=performance.now(),g=m-c;if(i===null||a===null||g===0)return i=f,a=p,c=m,null;const h=f-i,v=p-a,b=Math.sqrt(h*h+v*v)/g;return i=f,a=p,c=m,b}const u=({x:f,y:p,placement:m,elements:g,onClose:h,nodeId:v,tree:y})=>function(E){function S(){r.clear(),h()}if(r.clear(),!g.domReference||!g.floating||m==null||f==null||p==null)return;const{clientX:w,clientY:O}=E,C=[w,O],I=Ee(E),N=E.type==="mouseleave",k=re(g.floating,I),L=re(g.domReference,I),A=g.domReference.getBoundingClientRect(),T=g.floating.getBoundingClientRect(),D=m.split("-")[0],P=f>T.right-T.width/2,V=p>T.bottom-T.height/2,B=ea(C,A),x=T.width>A.width,F=T.height>A.height,Q=(x?A:T).left,X=(x?A:T).right,K=(F?A:T).top,Z=(F?A:T).bottom;if(k&&(s=!0,!N))return;if(L&&(s=!1),L&&!N){s=!0;return}if(N&&ie(E.relatedTarget)&&re(g.floating,E.relatedTarget)||y&&Ze(y.nodesRef.current,v).some(({context:U})=>U?.open))return;if(D==="top"&&p>=A.bottom-1||D==="bottom"&&p<=A.top+1||D==="left"&&f>=A.right-1||D==="right"&&f<=A.left+1)return S();let _=[];switch(D){case"top":_=[[Q,A.top+1],[Q,T.bottom-1],[X,T.bottom-1],[X,A.top+1]];break;case"bottom":_=[[Q,T.top+1],[Q,A.bottom-1],[X,A.bottom-1],[X,T.top+1]];break;case"left":_=[[T.right-1,Z],[T.right-1,K],[A.left+1,K],[A.left+1,Z]];break;case"right":_=[[A.right-1,Z],[A.right-1,K],[T.left+1,K],[T.left+1,Z]];break}function ne([U,J]){switch(D){case"top":{const de=[x?U+t/2:P?U+t*4:U-t*4,J+t+1],pe=[x?U-t/2:P?U+t*4:U-t*4,J+t+1],ge=[[T.left,P||x?T.bottom-t:T.top],[T.right,P?x?T.bottom-t:T.top:T.bottom-t]];return[de,pe,...ge]}case"bottom":{const de=[x?U+t/2:P?U+t*4:U-t*4,J-t],pe=[x?U-t/2:P?U+t*4:U-t*4,J-t],ge=[[T.left,P||x?T.top+t:T.bottom],[T.right,P?x?T.top+t:T.bottom:T.top+t]];return[de,pe,...ge]}case"left":{const de=[U+t+1,F?J+t/2:V?J+t*4:J-t*4],pe=[U+t+1,F?J-t/2:V?J+t*4:J-t*4];return[...[[V||F?T.right-t:T.left,T.top],[V?F?T.right-t:T.left:T.right-t,T.bottom]],de,pe]}case"right":{const de=[U-t,F?J+t/2:V?J+t*4:J-t*4],pe=[U-t,F?J-t/2:V?J+t*4:J-t*4],ge=[[V||F?T.left+t:T.right,T.top],[V?F?T.left+t:T.right:T.left+t,T.bottom]];return[de,pe,...ge]}default:return[]}}if(!So([w,O],_)){if(s&&!B)return S();if(!N&&o){const U=l(E.clientX,E.clientY);if(U!==null&&U<.1)return S()}So([w,O],ne([f,p]))?!s&&o&&r.start(40,S):S()}};return u.__options={blockPointerEvents:n},u}function Lr(e){return vt(e,"base-ui")}function na(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Dr(e){const[t,n]=d.useState(null),o=z((a,c)=>{e||n(c||(_o?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=na(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Oe=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Tt.startingStyle]="startingStyle",e[e.endingStyle=Tt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),wn=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const oa={[wn.popupOpen]:""},ra={[wn.popupOpen]:"",[wn.pressed]:""},sa={[Oe.open]:""},ia={[Oe.closed]:""},ca={[Oe.anchorHidden]:""},aa={open(e){return e?oa:null}},la={open(e){return e?ra:null}},kt={open(e){return e?sa:ia},anchorHidden(e){return e?ca:null}};function Nr(e){return Ao(19)?e:e?"true":void 0}let wo={},Co={},To="";function ua(e){if(typeof document>"u")return!1;const t=nt(e);return Ce(t).innerWidth-t.documentElement.clientWidth>0}function fa(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=nt(e).documentElement,r={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const i=o.offsetWidth;return Object.assign(o.style,r),s===i}function da(e){const t=nt(e),n=t.documentElement,o=t.body,r=Pt(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function pa(e){const t=nt(e),n=t.documentElement,o=t.body,r=Ce(n);let s=0,i=0,a=!1;const c=Ae.create();if(qs&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),m=r.getComputedStyle(o),v=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,wo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},To=n.style.scrollBehavior,Co={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,E=p.overflowY==="scroll"||m.overflowY==="scroll",S=p.overflowX==="scroll"||m.overflowX==="scroll",w=Math.max(0,r.innerWidth-o.clientWidth),O=Math.max(0,r.innerHeight-o.clientHeight),C=parseFloat(m.marginTop)+parseFloat(m.marginBottom),I=parseFloat(m.marginLeft)+parseFloat(m.marginRight),N=Pt(n)?n:o;if(a=fa(e),a){n.style.scrollbarGutter=v,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||E)&&(n.style.overflowY="scroll"),(b||S)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:C||O?`calc(100dvh - ${C+O}px)`:"100dvh",width:I||w?`calc(100vw - ${I+w}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,wo),Object.assign(o.style,Co),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=To)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class ga{lockCount=0;restore=null;timeoutLock=Ye.create();timeoutUnlock=Ye.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=nt(t).documentElement,r=Ce(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=Fo;return}const s=_o||!ua(t);this.restore=s?da(t):pa(t)}}const ma=new ga;function Br(e=!0,t=null){se(()=>{if(e)return ma.acquire(t)},[e,t])}const ha=d.createContext(void 0);function ba(){return d.useContext(ha)?.direction??"ltr"}const va=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=$e(e,t)||{};if(l==null)return{};const p=Xo(u),m={x:n,y:o},g=An(r),h=Mn(g),v=await i.getDimensions(l),y=g==="y",b=y?"top":"left",E=y?"bottom":"right",S=y?"clientHeight":"clientWidth",w=s.reference[h]+s.reference[g]-m[g]-s.floating[h],O=m[g]-s.reference[g],C=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[S]||s.floating[h];(!I||!await i.isElement?.(C))&&(I=a.floating[S]||s.floating[h]);const N=w/2-O/2,k=I/2-v[h]/2-1,L=Math.min(p[b],k),A=Math.min(p[E],k),T=L,D=I-v[h]-A,P=I/2-v[h]/2+N,V=yn(T,P,D),B=!c.arrow&&qe(r)!=null&&P!==V&&s.reference[h]/2-(P<T?L:A)-v[h]/2<0,x=B?P<T?P-T:P-D:0;return{[g]:m[g]+x,data:{[g]:V,centerOffset:P-V-x,...B&&{alignmentOffset:x}},reset:B}}}),ya=(e,t)=>({...va(e),options:[e,t]}),Ea={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Lc().fn(e)).data?.referenceHidden||s}}}},jt={sideX:"left",sideY:"top"},Ra={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=Ce(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:jt};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=nt(r);p={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const m=ye(a);let g=t,h=n;m==="left"&&(g=p.width-(t+o.width)),m==="top"&&(h=p.height-(n+o.height));const v=m==="left"?"right":jt.sideX,y=m==="top"?"bottom":jt.sideY;return{x:g,y:h,data:{sideX:v,sideY:y}}}};function $r(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Oo(e,t,n){const{rects:o,placement:r}=e;return{side:$r(t,ye(r),n),align:qe(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function xa(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:m,mounted:g,collisionAvoidance:h,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:E=!1,externalTree:S}=e,[w,O]=d.useState(null);!g&&w!==null&&O(null);const C=h.side||"flip",I=h.align||"flip",N=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,L=z(k),A=k?L:t,T=Fe(t),P=ba()==="rtl",V=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],B=s==="center"?V:`${V}-${s}`;let x=c;const F=1,Q=o==="bottom"?F:0,X=o==="top"?F:0,K=o==="right"?F:0,Z=o==="left"?F:0;typeof x=="number"?x={top:x+Q,right:x+Z,bottom:x+X,left:x+K}:x&&(x={top:(x.top||0)+Q,right:(x.right||0)+Z,bottom:(x.bottom||0)+X,left:(x.left||0)+K});const _={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:x},ne=d.useRef(null),U=Fe(r),J=Fe(i),ge=[Ic(le=>{const ve=Oo(le,o,P),Me=typeof U.current=="function"?U.current(ve):U.current,Se=typeof J.current=="function"?J.current(ve):J.current;return{mainAxis:Me,crossAxis:Se,alignmentAxis:Se}},[typeof r!="function"?r:0,typeof i!="function"?i:0,P,o])],De=I==="none"&&C!=="shift",R=!De&&(l||v||C==="shift"),Y=C==="none"?null:Ac({..._,padding:{top:x.top+F,right:x.right+F,bottom:x.bottom+F,left:x.left+F},mainAxis:!v&&C==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),$=De?null:kc(le=>{const ve=nt(le.elements.floating).documentElement;return{..._,rootBoundary:v?{x:0,y:0,width:ve.clientWidth,height:ve.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:R,limiter:l||v?void 0:Mc(Me=>{if(!ne.current)return{};const{width:Se,height:rt}=ne.current.getBoundingClientRect(),st=we(ye(Me.placement)),At=st==="y"?Se:rt,tn=st==="y"?x.left+x.right:x.top+x.bottom;return{offset:At/2+tn/2}})}},[_,l,v,x,I]);C==="shift"||I==="shift"||s==="center"?ge.push($,Y):ge.push(Y,$),ge.push(Fc({..._,apply({elements:{floating:le},rects:{reference:ve},availableWidth:Me,availableHeight:Se}){Object.entries({"--available-width":`${Me}px`,"--available-height":`${Se}px`,"--anchor-width":`${ve.width}px`,"--anchor-height":`${ve.height}px`}).forEach(([rt,st])=>{le.style.setProperty(rt,st)})}}),ya(()=>({element:ne.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(le){const{elements:ve,middlewareData:Me,placement:Se,rects:rt,y:st}=le,At=ye(Se),tn=we(At),Un=ne.current,es=Me.arrow?.x||0,ts=Me.arrow?.y||0,ns=Un?.clientWidth||0,os=Un?.clientHeight||0,nn=es+ns/2,zn=ts+os/2,rs=Math.abs(Me.shift?.y||0),ss=rt.reference.height/2,Rt=typeof r=="function"?r(Oo(le,o,P)):r,is=rs>Rt,cs={top:`${nn}px calc(100% + ${Rt}px)`,bottom:`${nn}px ${-Rt}px`,left:`calc(100% + ${Rt}px) ${zn}px`,right:`${-Rt}px ${zn}px`}[At],as=`${nn}px ${rt.reference.y+ss-st}px`;return ve.floating.style.setProperty("--transform-origin",R&&tn==="y"&&is?as:cs),{}}},Ea,b),se(()=>{!g&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,m]);const ue=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:M,elements:W,x:q,y:te,middlewareData:oe,update:H,placement:j,context:me,isPositioned:ae,floatingStyles:Ne}=Uc({rootContext:m,placement:B,middleware:ge,strategy:n,whileElementsMounted:p?void 0:(...le)=>Eo(...le,ue),nodeId:y,externalTree:S}),{sideX:Ge,sideY:ot}=oe.adaptiveOrigin||jt,Xe=ae?n:"fixed",he=d.useMemo(()=>b?{position:Xe,[Ge]:q,[ot]:te}:{position:Xe,...Ne},[b,Xe,Ge,q,ot,te,Ne]),Ie=d.useRef(null);se(()=>{if(!g)return;const le=T.current,ve=typeof le=="function"?le():le,Se=(Po(ve)?ve.current:ve)||null||null;Se!==Ie.current&&(M.setPositionReference(Se),Ie.current=Se)},[g,M,A,T]),d.useEffect(()=>{if(!g)return;const le=T.current;typeof le!="function"&&Po(le)&&le.current!==Ie.current&&(M.setPositionReference(le.current),Ie.current=le.current)},[g,M,A,T]),d.useEffect(()=>{if(p&&g&&W.domReference&&W.floating)return Eo(W.domReference,W.floating,H,ue)},[p,g,W,H,ue]);const ke=ye(j),Vn=$r(o,ke,P),jn=qe(j)||"center",Hn=!!oe.hide?.referenceHidden;se(()=>{E&&g&&ae&&O(ke)},[E,g,ae,ke]);const _n=d.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),Yn=oe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:he,arrowStyles:_n,arrowRef:ne,arrowUncentered:Yn,side:Vn,align:jn,physicalSide:ke,anchorHidden:Hn,refs:M,context:me,isPositioned:ae,update:H}),[he,_n,ne,Yn,Vn,jn,ke,Hn,M,me,ae,H])}function Po(e){return e!=null&&"current"in e}const Wr=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|
|
2
2
|
0% 0%,
|
|
3
3
|
100% 0%,
|
|
4
4
|
100% 100%,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as o}from"./main-Dirgz7qK.js";function i({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function d({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:c,children:o.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function a({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function v({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function u({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function s({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function g({size:l=16,className:c=""}){return o.jsxs("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:[o.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),o.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function x({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function f({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:c,children:o.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function C({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 16 16",fill:"currentColor",className:c,children:o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}const j={CLAUDE:i,CODEX:d,COPILOT:x,CURSOR:a,GEMINI:v,GITHUB:C,HERMES:f,KIMI:g,KIRO:u,OPENCODE:s},I={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function p({provider:l,size:c=16,color:h,className:n=""}){const e=l?.toUpperCase?.()||"",r=I[e];if(r)return o.jsx("img",{src:r,alt:"",width:c,height:c,className:n,style:{width:c,height:c,objectFit:"contain"},"aria-hidden":!0});const t=j[e];return t?o.jsx(t,{size:c,className:n}):o.jsx("div",{className:"rounded-full shrink-0",style:{width:c*.5,height:c*.5,backgroundColor:h}})}export{p as P};
|