react-lib-tools 0.0.39 → 0.0.40

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.
Files changed (29) hide show
  1. package/dist/{CommonQuestionsRoute-DKgVI5bf.cjs → CommonQuestionsRoute-BaUo7C5J.cjs} +2 -2
  2. package/dist/{CommonQuestionsRoute-DKgVI5bf.cjs.map → CommonQuestionsRoute-BaUo7C5J.cjs.map} +1 -1
  3. package/dist/{CommonQuestionsRoute-XeGPl1Yz.js → CommonQuestionsRoute-xnhbeLos.js} +2 -2
  4. package/dist/{CommonQuestionsRoute-XeGPl1Yz.js.map → CommonQuestionsRoute-xnhbeLos.js.map} +1 -1
  5. package/dist/{GettingStartedRoute-Dj9vAFwF.cjs → GettingStartedRoute-Caqc6Q58.cjs} +2 -2
  6. package/dist/{GettingStartedRoute-Dj9vAFwF.cjs.map → GettingStartedRoute-Caqc6Q58.cjs.map} +1 -1
  7. package/dist/{GettingStartedRoute-B1_jfqKR.js → GettingStartedRoute-Cp6EFnMw.js} +2 -2
  8. package/dist/{GettingStartedRoute-B1_jfqKR.js.map → GettingStartedRoute-Cp6EFnMw.js.map} +1 -1
  9. package/dist/{PageNotFound-pPQgf0wT.cjs → PageNotFound-7zWg_AHz.cjs} +2 -2
  10. package/dist/{PageNotFound-pPQgf0wT.cjs.map → PageNotFound-7zWg_AHz.cjs.map} +1 -1
  11. package/dist/{PageNotFound-BcpV_MGp.js → PageNotFound-CB141q5L.js} +2 -2
  12. package/dist/{PageNotFound-BcpV_MGp.js.map → PageNotFound-CB141q5L.js.map} +1 -1
  13. package/dist/{SupportRoute-CxxAV1Mo.js → SupportRoute-BdQqhjzf.js} +2 -2
  14. package/dist/{SupportRoute-CxxAV1Mo.js.map → SupportRoute-BdQqhjzf.js.map} +1 -1
  15. package/dist/{SupportRoute-BbSurNA_.cjs → SupportRoute-CIsa-DtE.cjs} +2 -2
  16. package/dist/{SupportRoute-BbSurNA_.cjs.map → SupportRoute-CIsa-DtE.cjs.map} +1 -1
  17. package/dist/{VersionsRoute-DpDr0_Rf.cjs → VersionsRoute-5s8sUTHm.cjs} +2 -2
  18. package/dist/{VersionsRoute-DpDr0_Rf.cjs.map → VersionsRoute-5s8sUTHm.cjs.map} +1 -1
  19. package/dist/{VersionsRoute-CeLRC38k.js → VersionsRoute-BuGTWWLr.js} +2 -2
  20. package/dist/{VersionsRoute-CeLRC38k.js.map → VersionsRoute-BuGTWWLr.js.map} +1 -1
  21. package/dist/{index-5mMRCwy2.js → index-Cpw2WkF7.js} +7 -7
  22. package/dist/{index-5mMRCwy2.js.map → index-Cpw2WkF7.js.map} +1 -1
  23. package/dist/{index-BWhTJgvX.cjs → index-rOOr2GGh.cjs} +2 -2
  24. package/dist/{index-BWhTJgvX.cjs.map → index-rOOr2GGh.cjs.map} +1 -1
  25. package/dist/react-lib-tools.cjs +1 -1
  26. package/dist/react-lib-tools.js +1 -1
  27. package/package.json +1 -2
  28. package/scripts/compile-search-index.ts +0 -10
  29. package/scripts/utils/search/crawlPage.ts +11 -3
@@ -4,5 +4,5 @@ Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}
4
4
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(`
5
5
  `)].join(`
6
6
  `))}else{let h=u.props,d=h?.className,g=typeof d=="function"?(...x)=>pr(d(...x),a.className):pr(d,a.className),v=g?{className:g}:{},b=vs(u.props,ze(Vn(a,["ref"])));for(let x in f)x in b&&delete f[x];return p.cloneElement(u,Object.assign({},b,f,c,{ref:o(Zu(u),c.ref)},v))}return p.createElement(i,Object.assign({},Vn(a,["ref"]),!ft(i)&&c,!ft(i)&&f),u)}function Yu(){let e=p.useRef([]),t=p.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Xu(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function vs(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o?.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let l of s){if((o instanceof Event||o?.nativeEvent instanceof Event)&&o.defaultPrevented)return;l(o,...i)}}});return t}function Lt(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s?.(...o)}});return t}function oe(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function ze(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Vn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Zu(e){return p.version.split(".")[0]>="19"?e.props.ref:e.ref}function ft(e){return e===p.Fragment||e===Symbol.for("react.fragment")}function Ju(e){return ft(e.type)}let Qu="button";function ed(e,t){var n;let r=wn(),{disabled:o=r||!1,autoFocus:i=!1,...s}=e,{isFocusVisible:l,focusProps:a}=Br({autoFocus:i}),{isHovered:c,hoverProps:u}=_r({isDisabled:o}),{pressed:f,pressProps:h}=Hr({disabled:o}),d=Lt({ref:t,type:(n=s.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},a,u,h),g=ye({disabled:o,hover:c,focus:l,active:f,autofocus:i});return ie()({ourProps:d,theirProps:s,slot:g,defaultTag:Qu,name:"Button"})}let td=oe(ed);function nd(e,t,n){let[r,o]=p.useState(n),i=e!==void 0,s=p.useRef(i),l=p.useRef(!1),a=p.useRef(!1);return i&&!s.current&&!l.current?(l.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!a.current&&(a.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,q(c=>(i||Ye.flushSync(()=>o(c)),t?.(c)))]}function rd(e){let[t]=p.useState(e);return t}function bs(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))ws(n,xs(t,r),o);return n}function xs(e,t){return e?e+"["+t+"]":t}function ws(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())ws(e,xs(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):id(n)&&!p.isValidElement(n)&&bs(n,t,e)}function od(e){var t,n;let r=(t=e?.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function id(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let sd="span";var Vr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Vr||{});function ld(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return ie()({ourProps:i,theirProps:o,slot:{},defaultTag:sd,name:"Hidden"})}let ys=oe(ld),ad=p.createContext(null);function cd({children:e}){let t=p.useContext(ad);if(!t)return p.createElement(p.Fragment,null,e);let{target:n}=t;return n?Ye.createPortal(p.createElement(p.Fragment,null,e),n):null}function ud({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=p.useState(null),l=ot();return p.useEffect(()=>{if(r&&i)return l.addEventListener(i,"reset",r)},[i,t,r]),p.createElement(cd,null,p.createElement(dd,{setForm:s,formId:t}),bs(e).map(([a,c])=>p.createElement(ys,{features:Vr.Hidden,...ze({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:c,...o})})))}function dd({setForm:e,formId:t}){return p.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:p.createElement(ys,{features:Vr.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let fd=p.createContext(void 0);function Es(){return p.useContext(fd)}function Cs(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function yn(e){return Cs(e)&&"tagName"in e}function Ve(e){return yn(e)&&"accessKey"in e}function qe(e){return yn(e)&&"tabIndex"in e}function md(e){return yn(e)&&"style"in e}function pd(e){return Ve(e)&&e.nodeName==="IFRAME"}function Rs(e){return Ve(e)&&e.nodeName==="INPUT"}function So(e){return Ve(e)&&e.nodeName==="LABEL"}function hd(e){return Ve(e)&&e.nodeName==="FIELDSET"}function Ss(e){return Ve(e)&&e.nodeName==="LEGEND"}function gd(e){return yn(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function hr(e){let t=e.parentElement,n=null;for(;t&&!hd(t);)Ss(t)&&(n=t),t=t.parentElement;let r=t?.getAttribute("disabled")==="";return r&&vd(n)?!1:r}function vd(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Ss(t))return!1;t=t.previousElementSibling}return!0}let ks=Symbol();function $s(e,t=!0){return Object.assign(e,{[ks]:t})}function ue(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let n=q(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||r?.[ks])?void 0:n}let Wr=p.createContext(null);Wr.displayName="DescriptionContext";function Ps(){let e=p.useContext(Wr);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ps),t}return e}function bd(){var e,t;return(t=(e=p.useContext(Wr))==null?void 0:e.value)!=null?t:void 0}let xd="p";function wd(e,t){let n=p.useId(),r=wn(),{id:o=`headlessui-description-${n}`,...i}=e,s=Ps(),l=ue(t);te(()=>s.register(o),[o,s.register]);let a=ye({...s.slot,disabled:r||!1}),c={ref:l,...s.props,id:o};return ie()({ourProps:c,theirProps:i,slot:a,defaultTag:xd,name:s.name||"Description"})}let yd=oe(wd);Object.assign(yd,{});var J=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(J||{});let En=p.createContext(null);En.displayName="LabelContext";function Ts(){let e=p.useContext(En);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ts),t}return e}function Os(e){var t,n,r;let o=(n=(t=p.useContext(En))==null?void 0:t.value)!=null?n:void 0;return((r=e?.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Ed({inherit:e=!1}={}){let t=Os(),[n,r]=p.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,p.useMemo(()=>function(i){let s=q(a=>(r(c=>[...c,a]),()=>r(c=>{let u=c.slice(),f=u.indexOf(a);return f!==-1&&u.splice(f,1),u}))),l=p.useMemo(()=>({register:s,slot:i.slot,name:i.name,props:i.props,value:i.value}),[s,i.slot,i.name,i.props,i.value]);return p.createElement(En.Provider,{value:l},i.children)},[r])]}let Cd="label";function Rd(e,t){var n;let r=p.useId(),o=Ts(),i=Es(),s=wn(),{id:l=`headlessui-label-${r}`,htmlFor:a=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,f=ue(t);te(()=>o.register(l),[l,o.register]);let h=q(v=>{let b=v.currentTarget;if(!(v.target!==v.currentTarget&&gd(v.target))&&(So(b)&&v.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(v),So(b))){let x=document.getElementById(b.htmlFor);if(x){let y=x.getAttribute("disabled");if(y==="true"||y==="")return;let w=x.getAttribute("aria-disabled");if(w==="true"||w==="")return;(Rs(x)&&(x.type==="file"||x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),d=ye({...o.slot,disabled:s||!1}),g={ref:f,...o.props,id:l,htmlFor:a,onClick:h};return c&&("onClick"in g&&(delete g.htmlFor,delete g.onClick),"onClick"in u&&delete u.onClick),ie()({ourProps:g,theirProps:u,slot:d,defaultTag:a?Cd:"div",name:o.name||"Label"})}let Sd=oe(Rd),kd=Object.assign(Sd,{}),$d=p.createContext(()=>{});function Pd({value:e,children:t}){return p.createElement($d.Provider,{value:e},t)}function Td(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Od(e=Td){return p.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return t?.[r]===n?.[r]}return e(t,n)},[e])}function ko(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Ld(e,t,n=!1){let[r,o]=p.useState(()=>ko(t));return te(()=>{if(!t||!e)return;let i=ve();return i.requestAnimationFrame(function s(){i.requestAnimationFrame(s),o(l=>{let a=ko(t);return a.width===l.width&&a.height===l.height?l:a})}),()=>{i.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var Ls=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ls||{});function Md(e){let t=p.useRef(null),n=q(o=>{t.current=o.pointerType,!hr(o.currentTarget)&&o.pointerType==="mouse"&&o.button===Ls.Left&&(o.preventDefault(),e(o))}),r=q(o=>{t.current!=="mouse"&&(hr(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let Ms=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var Ad=Object.defineProperty,Fd=(e,t,n)=>t in e?Ad(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nd=(e,t,n)=>(Fd(e,t+"",n),n),As=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},be=(e,t,n)=>(As(e,t,"read from private field"),n?n.call(e):t.get(e)),Wn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},$o=(e,t,n,r)=>(As(e,t,"write to private field"),t.set(e,n),n),Se,St,kt;let Fs=class{constructor(t){Wn(this,Se,{}),Wn(this,St,new Ms(()=>new Set)),Wn(this,kt,new Set),Nd(this,"disposables",ve()),$o(this,Se,t),$e.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return be(this,Se)}subscribe(t,n){if($e.isServer)return()=>{};let r={selector:t,callback:n,current:t(be(this,Se))};return be(this,kt).add(r),this.disposables.add(()=>{be(this,kt).delete(r)})}on(t,n){return $e.isServer?()=>{}:(be(this,St).get(t).add(n),this.disposables.add(()=>{be(this,St).get(t).delete(n)}))}send(t){let n=this.reduce(be(this,Se),t);if(n!==be(this,Se)){$o(this,Se,n);for(let r of be(this,kt)){let o=r.selector(be(this,Se));Ns(r.current,o)||(r.current=o,r.callback(o))}for(let r of be(this,St).get(t.type))r(be(this,Se),t)}}};Se=new WeakMap,St=new WeakMap,kt=new WeakMap;function Ns(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:zn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:zn(e.entries(),t.entries()):Po(e)&&Po(t)?zn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function zn(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Po(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Un(e){let[t,n]=e(),r=ve();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Id=Object.defineProperty,Dd=(e,t,n)=>t in e?Id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,To=(e,t,n)=>(Dd(e,typeof t!="symbol"?t+"":t,n),n),Is=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Is||{});let jd={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let i=e.stack.slice();return i.splice(o,1),i.push(n),r=i,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},_d=class Ds extends Fs{constructor(){super(...arguments),To(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),To(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Ds({stack:[]})}reduce(t,n){return ce(n.type,jd,t,n)}};const zr=new Ms(()=>_d.new());var Xt={exports:{}},qn={};var Oo;function Bd(){if(Oo)return qn;Oo=1;var e=p;function t(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return qn.useSyncExternalStoreWithSelector=function(a,c,u,f,h){var d=o(null);if(d.current===null){var g={hasValue:!1,value:null};d.current=g}else g=d.current;d=s(function(){function b(R){if(!x){if(x=!0,y=R,R=f(R),h!==void 0&&g.hasValue){var P=g.value;if(h(P,R))return w=P}return w=R}if(P=w,n(y,R))return P;var T=f(R);return h!==void 0&&h(P,T)?(y=R,P):(y=R,w=T)}var x=!1,y,w,S=u===void 0?null:u;return[function(){return b(c())},S===null?void 0:function(){return b(S())}]},[c,u,f,h]);var v=r(a,d[0],d[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),l(v),v},qn}var Gn={};var Lo;function Hd(){return Lo||(Lo=1,process.env.NODE_ENV!=="production"&&(function(){function e(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;Gn.useSyncExternalStoreWithSelector=function(a,c,u,f,h){var d=o(null);if(d.current===null){var g={hasValue:!1,value:null};d.current=g}else g=d.current;d=s(function(){function b(R){if(!x){if(x=!0,y=R,R=f(R),h!==void 0&&g.hasValue){var P=g.value;if(h(P,R))return w=P}return w=R}if(P=w,n(y,R))return P;var T=f(R);return h!==void 0&&h(P,T)?(y=R,P):(y=R,w=T)}var x=!1,y,w,S=u===void 0?null:u;return[function(){return b(c())},S===null?void 0:function(){return b(S())}]},[c,u,f,h]);var v=r(a,d[0],d[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),l(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Gn}var Mo;function Vd(){return Mo||(Mo=1,process.env.NODE_ENV==="production"?Xt.exports=Bd():Xt.exports=Hd()),Xt.exports}var Wd=Vd();function fe(e,t,n=Ns){return Wd.useSyncExternalStoreWithSelector(q(r=>e.subscribe(zd,r)),q(()=>e.state),q(()=>e.state),q(t),n)}function zd(e){return e}function js(e,t){let n=p.useId(),r=zr.get(t),[o,i]=fe(r,p.useCallback(s=>[r.selectors.isTop(s,n),r.selectors.inStack(s,n)],[r,n]));return te(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let gr=new Map,Pt=new Map;function Ao(e){var t;let n=(t=Pt.get(e))!=null?t:0;return Pt.set(e,n+1),n!==0?()=>Fo(e):(gr.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Fo(e))}function Fo(e){var t;let n=(t=Pt.get(e))!=null?t:1;if(n===1?Pt.delete(e):Pt.set(e,n-1),n!==1)return;let r=gr.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,gr.delete(e))}function Ud(e,{allowed:t,disallowed:n}={}){let r=js(e,"inert-others");te(()=>{var o,i;if(!r)return;let s=ve();for(let a of(o=n?.())!=null?o:[])a&&s.add(Ao(a));let l=(i=t?.())!=null?i:[];for(let a of l){if(!a)continue;let c=_t(a);if(!c)continue;let u=a.parentElement;for(;u&&u!==c.body;){for(let f of u.children)l.some(h=>f.contains(h))||s.add(Ao(f));u=u.parentElement}}return s.dispose},[r,t,n])}function qd(e,t,n){let r=it(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});p.useEffect(()=>{if(!e)return;let o=t===null?null:Ve(t)?t:t.current;if(!o)return;let i=ve();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let vr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Gd=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var br=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(br||{}),Kd=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Kd||{}),Yd=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Yd||{});function _s(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(vr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Xd(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Gd)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ur=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ur||{});function Bs(e,t=0){var n;return e===((n=_t(e))==null?void 0:n.body)?!1:ce(t,{0(){return e.matches(vr)},1(){let r=e;for(;r!==null;){if(r.matches(vr))return!0;r=r.parentElement}return!1}})}var Zd=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Zd||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Jd=["textarea","input"].join(",");function Qd(e){var t,n;return(n=(t=e?.matches)==null?void 0:t.call(e,Jd))!=null?n:!1}function Hs(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ef(e,t,n=e===null?document.body:fn(e)){return tf(_s(n),t,{relativeTo:e})}function tf(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?fn(e[0]):document:fn(e),s=Array.isArray(e)?n?Hs(e):e:t&64?Xd(e):_s(e);o.length>0&&s.length>1&&(s=s.filter(d=>!o.some(g=>g!=null&&"current"in g?g?.current===d:g===d))),r=r??i?.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(r))-1;if(t&4)return Math.max(0,s.indexOf(r))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},u=0,f=s.length,h;do{if(u>=f||u+f<=0)return 0;let d=a+u;if(t&16)d=(d+f)%f;else{if(d<0)return 3;if(d>=f)return 1}h=s[d],h?.focus(c),u+=l}while(h!==hs(h));return t&6&&Qd(h)&&h.select(),2}function Vs(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function nf(){return/Android/gi.test(window.navigator.userAgent)}function No(){return Vs()||nf()}function dt(e,t,n,r){let o=it(n);p.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function rf(e,t,n,r){let o=it(n);p.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const Io=30;function of(e,t,n){let r=it(n),o=p.useCallback(function(l,a){if(l.defaultPrevented)return;let c=a(l);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let u=(function f(h){return typeof h=="function"?f(h()):Array.isArray(h)||h instanceof Set?h:[h]})(t);for(let f of u)if(f!==null&&(f.contains(c)||l.composed&&l.composedPath().includes(f)))return;return!Bs(c,Ur.Loose)&&c.tabIndex!==-1&&l.preventDefault(),r.current(l,c)},[r,t]),i=p.useRef(null);dt(e,"pointerdown",l=>{var a,c;No()||(i.current=((c=(a=l.composedPath)==null?void 0:a.call(l))==null?void 0:c[0])||l.target)},!0),dt(e,"pointerup",l=>{if(No()||!i.current)return;let a=i.current;return i.current=null,o(l,()=>a)},!0);let s=p.useRef({x:0,y:0});dt(e,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),dt(e,"touchend",l=>{let a={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(a.x-s.current.x)>=Io||Math.abs(a.y-s.current.y)>=Io))return o(l,()=>qe(l.target)?l.target:null)},!0),rf(e,"blur",l=>o(l,()=>pd(window.document.activeElement)?window.document.activeElement:null),!0)}function xr(...e){return p.useMemo(()=>_t(...e),[...e])}var sf=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(sf||{});const Zt={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},lf=200,Do=5;function af(e,{trigger:t,action:n,close:r,select:o}){let i=p.useRef(null),s=p.useRef(null),l=p.useRef(null);dt(e&&t!==null,"pointerdown",a=>{Cs(a?.target)&&t!=null&&t.contains(a.target)&&(s.current=a.x,l.current=a.y,i.current=a.timeStamp)}),dt(e&&t!==null,"pointerup",a=>{var c,u;let f=i.current;if(f===null||(i.current=null,!qe(a.target))||Math.abs(a.x-((c=s.current)!=null?c:a.x))<Do&&Math.abs(a.y-((u=l.current)!=null?u:a.y))<Do)return;let h=n(a);switch(h.kind){case 0:return;case 1:{a.timeStamp-f>lf&&(o(h.target),r());break}case 2:{r();break}}},{capture:!0})}function Ws(e,t){return p.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||t?.tagName==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function cf(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function uf(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(l=>l()))}}}function df(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function ff(){return Vs()?{before({doc:e,d:t,meta:n}){function r(o){for(let i of n().containers)for(let s of i())if(s.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=ve();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",l=>{if(qe(l.target))try{let a=l.target.closest("a");if(!a)return;let{hash:c}=new URL(a.href),u=e.querySelector(c);qe(u)&&!r(u)&&(s=u)}catch{}},!0),t.group(l=>{t.addEventListener(e,"touchstart",a=>{if(l.dispose(),qe(a.target)&&md(a.target))if(r(a.target)){let c=a.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;l.style(c,"overscrollBehavior","contain")}else l.style(a.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",l=>{if(qe(l.target)){if(Rs(l.target))return;if(r(l.target)){let a=l.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let a=(l=window.scrollY)!=null?l:window.pageYOffset;i!==a&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function mf(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function jo(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Qe=uf(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ve(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=jo(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=jo(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[ff(),df(),mf()];n.forEach(({before:r})=>r?.(t)),n.forEach(({after:r})=>r?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Qe.subscribe(()=>{let e=Qe.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Qe.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Qe.dispatch("TEARDOWN",n)}});function pf(e,t,n=()=>({containers:[]})){let r=cf(Qe),o=t?r.get(t):void 0,i=o?o.count>0:!1;return te(()=>{if(!(!t||!e))return Qe.dispatch("PUSH",t,n),()=>Qe.dispatch("POP",t,n)},[e,t]),i}function hf(e,t,n=()=>[document.body]){let r=js(e,"scroll-lock");pf(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function _o(e){return[e.screenX,e.screenY]}function gf(){let e=p.useRef([-1,-1]);return{wasMoved(t){let n=_o(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=_o(t)}}}function vf(e=0){let[t,n]=p.useState(e),r=p.useCallback(a=>n(a),[]),o=p.useCallback(a=>n(c=>c|a),[]),i=p.useCallback(a=>(t&a)===a,[t]),s=p.useCallback(a=>n(c=>c&~a),[]),l=p.useCallback(a=>n(c=>c^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:l}}var Bo,Ho;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Bo=process==null?void 0:process.env)==null?void 0:Bo.NODE_ENV)==="test"&&typeof((Ho=Element?.prototype)==null?void 0:Ho.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
7
- `)),[]});var bf=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(bf||{});function qr(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Gr(e,t,n,r){let[o,i]=p.useState(n),{hasFlag:s,addFlag:l,removeFlag:a}=vf(e&&o?3:0),c=p.useRef(!1),u=p.useRef(!1),f=ot();return te(()=>{var h;if(e){if(n&&i(!0),!t){n&&l(3);return}return(h=r?.start)==null||h.call(r,n),xf(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(l(3),a(4)):(l(4),a(2)))},run(){u.current?n?(a(3),l(4)):(a(4),l(3)):n?a(1):l(1)},done(){var d;u.current&&Ef(t)||(c.current=!1,a(7),n||i(!1),(d=r?.end)==null||d.call(r,n))}})}},[e,n,t,f]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function xf(e,{prepare:t,run:n,done:r,inFlight:o}){let i=ve();return yf(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(wf(e,r))})}),i.dispose}function wf(e,t){var n,r;let o=ve();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(l=>l.finished)).then(()=>{i||t()}),o.dispose)}function yf(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Ef(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function Cn(){return typeof window<"u"}function wt(e){return Kr(e)?(e.nodeName||"").toLowerCase():"#document"}function me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Le(e){var t;return(t=(Kr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kr(e){return Cn()?e instanceof Node||e instanceof me(e).Node:!1}function K(e){return Cn()?e instanceof Element||e instanceof me(e).Element:!1}function ge(e){return Cn()?e instanceof HTMLElement||e instanceof me(e).HTMLElement:!1}function wr(e){return!Cn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof me(e).ShadowRoot}const Cf=new Set(["inline","contents"]);function Bt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Cf.has(o)}const Rf=new Set(["table","td","th"]);function Sf(e){return Rf.has(wt(e))}const kf=[":popover-open",":modal"];function Rn(e){return kf.some(t=>{try{return e.matches(t)}catch{return!1}})}const $f=["transform","translate","scale","rotate","perspective"],Pf=["transform","translate","scale","rotate","perspective","filter"],Tf=["paint","layout","strict","content"];function Yr(e){const t=Sn(),n=K(e)?Ee(e):e;return $f.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Pf.some(r=>(n.willChange||"").includes(r))||Tf.some(r=>(n.contain||"").includes(r))}function Of(e){let t=je(e);for(;ge(t)&&!Ne(t);){if(Yr(t))return t;if(Rn(t))return null;t=je(t)}return null}function Sn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Lf=new Set(["html","body","#document"]);function Ne(e){return Lf.has(wt(e))}function Ee(e){return me(e).getComputedStyle(e)}function kn(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wr(e)&&e.host||Le(e);return wr(t)?t.host:t}function zs(e){const t=je(e);return Ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&Bt(t)?t:zs(t)}function Ke(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=zs(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=me(o);if(i){const l=yr(s);return t.concat(s,s.visualViewport||[],Bt(o)?o:[],l&&n?Ke(l):[])}return t.concat(o,Ke(o,[],n))}function yr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mf(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const Af=["top","right","bottom","left"],Vo=["start","end"],Wo=Af.reduce((e,t)=>e.concat(t,t+"-"+Vo[0],t+"-"+Vo[1]),[]),nt=Math.min,se=Math.max,Mt=Math.round,Jt=Math.floor,Pe=e=>({x:e,y:e}),Ff={left:"right",right:"left",bottom:"top",top:"bottom"},Nf={start:"end",end:"start"};function zo(e,t,n){return se(e,nt(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function Oe(e){return e.split("-")[0]}function Te(e){return e.split("-")[1]}function Us(e){return e==="x"?"y":"x"}function qs(e){return e==="y"?"height":"width"}const If=new Set(["top","bottom"]);function Ae(e){return If.has(Oe(e))?"y":"x"}function Gs(e){return Us(Ae(e))}function Ks(e,t,n){n===void 0&&(n=!1);const r=Te(e),o=Gs(e),i=qs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pn(s)),[s,pn(s)]}function Df(e){const t=pn(e);return[mn(e),t,mn(t)]}function mn(e){return e.replace(/start|end/g,t=>Nf[t])}const Uo=["left","right"],qo=["right","left"],jf=["top","bottom"],_f=["bottom","top"];function Bf(e,t,n){switch(e){case"top":case"bottom":return n?t?qo:Uo:t?Uo:qo;case"left":case"right":return t?jf:_f;default:return[]}}function Hf(e,t,n,r){const o=Te(e);let i=Bf(Oe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(mn)))),i}function pn(e){return e.replace(/left|right|bottom|top/g,t=>Ff[t])}function Vf(e){return{top:0,right:0,bottom:0,left:0,...e}}function Wf(e){return typeof e!="number"?Vf(e):{top:e,right:e,bottom:e,left:e}}function hn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Go(e,t,n){let{reference:r,floating:o}=e;const i=Ae(t),s=Gs(t),l=qs(s),a=Oe(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let d;switch(a){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Te(t)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1);break}return d}const zf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Go(c,r,a),h=r,d={},g=0;for(let v=0;v<l.length;v++){const{name:b,fn:x}=l[v],{x:y,y:w,data:S,reset:R}=await x({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:d,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=w??f,d={...d,[b]:{...d[b],...S}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(c=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:u,y:f}=Go(c,h,a)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:d}};async function Ht(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=st(t,e),g=Wf(d),b=l[h?f==="floating"?"reference":"floating":f],x=hn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},R=hn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(x.top-R.top+g.top)/S.y,bottom:(R.bottom-x.bottom+g.bottom)/S.y,left:(x.left-R.left+g.left)/S.x,right:(R.right-x.right+g.right)/S.x}}function Uf(e,t,n){return(e?[...n.filter(o=>Te(o)===e),...n.filter(o=>Te(o)!==e)]:n.filter(o=>Oe(o)===o)).filter(o=>e?Te(o)===e||(t?mn(o)!==o:!1):!0)}const qf=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:s,placement:l,platform:a,elements:c}=t,{crossAxis:u=!1,alignment:f,allowedPlacements:h=Wo,autoAlignment:d=!0,...g}=st(e,t),v=f!==void 0||h===Wo?Uf(f||null,d,h):h,b=await Ht(t,g),x=((n=s.autoPlacement)==null?void 0:n.index)||0,y=v[x];if(y==null)return{};const w=Ks(y,i,await(a.isRTL==null?void 0:a.isRTL(c.floating)));if(l!==y)return{reset:{placement:v[0]}};const S=[b[Oe(y)],b[w[0]],b[w[1]]],R=[...((r=s.autoPlacement)==null?void 0:r.overflows)||[],{placement:y,overflows:S}],P=v[x+1];if(P)return{data:{index:x+1,overflows:R},reset:{placement:P}};const T=R.map(k=>{const D=Te(k.placement);return[k.placement,D&&u?k.overflows.slice(0,2).reduce((W,z)=>W+z,0):k.overflows[0],k.overflows]}).sort((k,D)=>k[1]-D[1]),F=((o=T.filter(k=>k[2].slice(0,Te(k[0])?2:3).every(D=>D<=0))[0])==null?void 0:o[0])||T[0][0];return F!==l?{data:{index:x+1,overflows:R},reset:{placement:F}}:{}}}},Gf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...b}=st(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Oe(o),y=Ae(l),w=Oe(l)===l,S=await(a.isRTL==null?void 0:a.isRTL(c.floating)),R=h||(w||!v?[pn(l)]:Df(l)),P=g!=="none";!h&&P&&R.push(...Hf(l,v,g,S));const T=[l,...R],$=await Ht(t,b),F=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&F.push($[x]),f){const O=Ks(o,s,S);F.push($[O[0]],$[O[1]])}if(k=[...k,{placement:o,overflows:F}],!F.every(O=>O<=0)){var D,W;const O=(((D=i.flip)==null?void 0:D.index)||0)+1,A=T[O];if(A&&(!(f==="alignment"?y!==Ae(A):!1)||k.every(C=>Ae(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:O,overflows:k},reset:{placement:A}};let _=(W=k.filter(L=>L.overflows[0]<=0).sort((L,C)=>L.overflows[1]-C.overflows[1])[0])==null?void 0:W.placement;if(!_)switch(d){case"bestFit":{var z;const L=(z=k.filter(C=>{if(P){const M=Ae(C.placement);return M===y||M==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(M=>M>0).reduce((M,V)=>M+V,0)]).sort((C,M)=>C[1]-M[1])[0])==null?void 0:z[0];L&&(_=L);break}case"initialPlacement":_=l;break}if(o!==_)return{reset:{placement:_}}}return{}}}},Kf=new Set(["left","top"]);async function Yf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Oe(n),l=Te(n),a=Ae(n)==="y",c=Kf.has(s)?-1:1,u=i&&a?-1:1,f=st(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(d=l==="end"?g*-1:g),a?{x:d*u,y:h*c}:{x:h*c,y:d*u}}const Xf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,a=await Yf(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:s}}}}},Zf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y}=b;return{x,y}}},...a}=st(e,t),c={x:n,y:r},u=await Ht(t,a),f=Ae(Oe(o)),h=Us(f);let d=c[h],g=c[f];if(i){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=d+u[b],w=d-u[x];d=zo(y,d,w)}if(s){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+u[b],w=g-u[x];g=zo(y,g,w)}const v=l.fn({...t,[h]:d,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[f]:s}}}}}},Jf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:a=()=>{},...c}=st(e,t),u=await Ht(t,c),f=Oe(o),h=Te(o),d=Ae(o)==="y",{width:g,height:v}=i.floating;let b,x;f==="top"||f==="bottom"?(b=f,x=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,b=h==="end"?"top":"bottom");const y=v-u.top-u.bottom,w=g-u.left-u.right,S=nt(v-u[b],y),R=nt(g-u[x],w),P=!t.middlewareData.shift;let T=S,$=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=y),P&&!h){const k=se(u.left,0),D=se(u.right,0),W=se(u.top,0),z=se(u.bottom,0);d?$=g-2*(k!==0||D!==0?k+D:se(u.left,u.right)):T=v-2*(W!==0||z!==0?W+z:se(u.top,u.bottom))}await a({...t,availableWidth:$,availableHeight:T});const F=await s.getDimensions(l.floating);return g!==F.width||v!==F.height?{reset:{rects:!0}}:{}}}};function Ys(e){const t=Ee(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ge(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=Mt(n)!==i||Mt(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Xr(e){return K(e)?e:e.contextElement}function mt(e){const t=Xr(e);if(!ge(t))return Pe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ys(t);let s=(i?Mt(n.width):n.width)/r,l=(i?Mt(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Qf=Pe(0);function Xs(e){const t=me(e);return!Sn()||!t.visualViewport?Qf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function em(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==me(e)?!1:t}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Xr(e);let s=Pe(1);t&&(r?K(r)&&(s=mt(r)):s=mt(e));const l=em(i,n,r)?Xs(i):Pe(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=me(i),d=r&&K(r)?me(r):r;let g=h,v=yr(g);for(;v&&r&&d!==g;){const b=mt(v),x=v.getBoundingClientRect(),y=Ee(v),w=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,f*=b.y,a+=w,c+=S,g=me(v),v=yr(g)}}return hn({width:u,height:f,x:a,y:c})}function $n(e,t){const n=kn(e).scrollLeft;return t?t.left+n:rt(Le(e)).left+n}function Zs(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$n(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function tm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Le(r),l=t?Rn(t.floating):!1;if(r===s||l&&i)return n;let a={scrollLeft:0,scrollTop:0},c=Pe(1);const u=Pe(0),f=ge(r);if((f||!f&&!i)&&((wt(r)!=="body"||Bt(s))&&(a=kn(r)),ge(r))){const d=rt(r);c=mt(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const h=s&&!f&&!i?Zs(s,a):Pe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-a.scrollTop*c.y+u.y+h.y}}function nm(e){return Array.from(e.getClientRects())}function rm(e){const t=Le(e),n=kn(e),r=e.ownerDocument.body,o=se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+$n(e);const l=-n.scrollTop;return Ee(r).direction==="rtl"&&(s+=se(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ko=25;function om(e,t){const n=me(e),r=Le(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;const u=Sn();(!u||u&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}const c=$n(r);if(c<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-d);g<=Ko&&(i-=g)}else c<=Ko&&(i+=c);return{width:i,height:s,x:l,y:a}}const im=new Set(["absolute","fixed"]);function sm(e,t){const n=rt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ge(e)?mt(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,a=o*i.x,c=r*i.y;return{width:s,height:l,x:a,y:c}}function Yo(e,t,n){let r;if(t==="viewport")r=om(e,n);else if(t==="document")r=rm(Le(e));else if(K(t))r=sm(t,n);else{const o=Xs(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return hn(r)}function Js(e,t){const n=je(e);return n===t||!K(n)||Ne(n)?!1:Ee(n).position==="fixed"||Js(n,t)}function lm(e,t){const n=t.get(e);if(n)return n;let r=Ke(e,[],!1).filter(l=>K(l)&&wt(l)!=="body"),o=null;const i=Ee(e).position==="fixed";let s=i?je(e):e;for(;K(s)&&!Ne(s);){const l=Ee(s),a=Yr(s);!a&&l.position==="fixed"&&(o=null),(i?!a&&!o:!a&&l.position==="static"&&!!o&&im.has(o.position)||Bt(s)&&!a&&Js(e,s))?r=r.filter(u=>u!==s):o=l,s=je(s)}return t.set(e,r),r}function am(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Rn(t)?[]:lm(t,this._c):[].concat(n),r],l=s[0],a=s.reduce((c,u)=>{const f=Yo(t,u,o);return c.top=se(f.top,c.top),c.right=nt(f.right,c.right),c.bottom=nt(f.bottom,c.bottom),c.left=se(f.left,c.left),c},Yo(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function cm(e){const{width:t,height:n}=Ys(e);return{width:t,height:n}}function um(e,t,n){const r=ge(t),o=Le(t),i=n==="fixed",s=rt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const a=Pe(0);function c(){a.x=$n(o)}if(r||!r&&!i)if((wt(t)!=="body"||Bt(o))&&(l=kn(t)),r){const d=rt(t,!0,i,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?Zs(o,l):Pe(0),f=s.left+l.scrollLeft-a.x-u.x,h=s.top+l.scrollTop-a.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function Kn(e){return Ee(e).position==="static"}function Xo(e,t){if(!ge(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Le(e)===n&&(n=n.ownerDocument.body),n}function Qs(e,t){const n=me(e);if(Rn(e))return n;if(!ge(e)){let o=je(e);for(;o&&!Ne(o);){if(K(o)&&!Kn(o))return o;o=je(o)}return n}let r=Xo(e,t);for(;r&&Sf(r)&&Kn(r);)r=Xo(r,t);return r&&Ne(r)&&Kn(r)&&!Yr(r)?n:r||Of(e)||n}const dm=async function(e){const t=this.getOffsetParent||Qs,n=this.getDimensions,r=await n(e.floating);return{reference:um(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fm(e){return Ee(e).direction==="rtl"}const mm={convertOffsetParentRelativeRectToViewportRelativeRect:tm,getDocumentElement:Le,getClippingRect:am,getOffsetParent:Qs,getElementRects:dm,getClientRects:nm,getDimensions:cm,getScale:mt,isElement:K,isRTL:fm};function el(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pm(e,t){let n=null,r;const o=Le(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:h,height:d}=c;if(l||t(),!h||!d)return;const g=Jt(f),v=Jt(o.clientWidth-(u+h)),b=Jt(o.clientHeight-(f+d)),x=Jt(u),w={rootMargin:-g+"px "+-v+"px "+-b+"px "+-x+"px",threshold:se(0,nt(1,a))||1};let S=!0;function R(P){const T=P[0].intersectionRatio;if(T!==a){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!el(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(R,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,w)}n.observe(e)}return s(!0),i}function hm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Xr(e),u=o||i?[...c?Ke(c):[],...Ke(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&l?pm(c,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),c&&!a&&d.observe(c),d.observe(t));let g,v=a?rt(e):null;a&&b();function b(){const x=rt(e);v&&!el(v,x)&&n(),v=x,g=requestAnimationFrame(b)}return n(),()=>{var x;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(x=d)==null||x.disconnect(),d=null,a&&cancelAnimationFrame(g)}}const Yn=Ht,gm=Xf,vm=qf,bm=Zf,xm=Gf,wm=Jf,ym=(e,t,n)=>{const r=new Map,o={platform:mm,...n},i={...o.platform,_c:r};return zf(e,t,{...o,platform:i})};var Em=typeof document<"u",Cm=function(){},rn=Em?p.useLayoutEffect:Cm;function gn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!gn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function tl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zo(e,t){const n=tl(e);return Math.round(t*n)/n}function Xn(e){const t=m.useRef(e);return rn(()=>{t.current=e}),t}function nl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=m.useState(r);gn(h,r)||d(r);const[g,v]=m.useState(null),[b,x]=m.useState(null),y=m.useCallback(C=>{C!==P.current&&(P.current=C,v(C))},[]),w=m.useCallback(C=>{C!==T.current&&(T.current=C,x(C))},[]),S=i||g,R=s||b,P=m.useRef(null),T=m.useRef(null),$=m.useRef(u),F=a!=null,k=Xn(a),D=Xn(o),W=Xn(c),z=m.useCallback(()=>{if(!P.current||!T.current)return;const C={placement:t,strategy:n,middleware:h};D.current&&(C.platform=D.current),ym(P.current,T.current,C).then(M=>{const V={...M,isPositioned:W.current!==!1};O.current&&!gn($.current,V)&&($.current=V,an.flushSync(()=>{f(V)}))})},[h,t,n,D,W]);rn(()=>{c===!1&&$.current.isPositioned&&($.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[c]);const O=m.useRef(!1);rn(()=>(O.current=!0,()=>{O.current=!1}),[]),rn(()=>{if(S&&(P.current=S),R&&(T.current=R),S&&R){if(k.current)return k.current(S,R,z);z()}},[S,R,z,k,F]);const A=m.useMemo(()=>({reference:P,floating:T,setReference:y,setFloating:w}),[y,w]),_=m.useMemo(()=>({reference:S,floating:R}),[S,R]),L=m.useMemo(()=>{const C={position:n,left:0,top:0};if(!_.floating)return C;const M=Zo(_.floating,u.x),V=Zo(_.floating,u.y);return l?{...C,transform:"translate("+M+"px, "+V+"px)",...tl(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:V}},[n,l,_.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:z,refs:A,elements:_,floatingStyles:L}),[u,z,A,_,L])}const Zr=(e,t)=>({...gm(e),options:[e,t]}),rl=(e,t)=>({...bm(e),options:[e,t]}),Rm=(e,t)=>({...xm(e),options:[e,t]}),Sm=(e,t)=>({...wm(e),options:[e,t]}),km=(e,t)=>({...vm(e),options:[e,t]}),ol={...m},$m=ol.useInsertionEffect,Pm=$m||(e=>e());function il(e){const t=m.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Pm(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Er=typeof document<"u"?p.useLayoutEffect:p.useEffect;let Jo=!1,Tm=0;const Qo=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Tm++;function Om(){const[e,t]=m.useState(()=>Jo?Qo():void 0);return Er(()=>{e==null&&t(Qo())},[]),m.useEffect(()=>{Jo=!0},[]),e}const Lm=ol.useId,Mm=Lm||Om;let At;process.env.NODE_ENV!=="production"&&(At=new Set);function Am(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=At)!=null&&e.has(o))){var i;(i=At)==null||i.add(o),console.warn(o)}}function Fm(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=At)!=null&&e.has(o))){var i;(i=At)==null||i.add(o),console.error(o)}}function Nm(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Im=m.createContext(null),Dm=m.createContext(null),jm=()=>{var e;return((e=m.useContext(Im))==null?void 0:e.id)||null},_m=()=>m.useContext(Dm),Bm="data-floating-ui-focusable";function Hm(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Mm(),i=m.useRef({}),[s]=m.useState(()=>Nm()),l=jm()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!K(d)&&Fm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=m.useState(r.reference),u=il((d,g,v)=>{i.current.openEvent=d?g:void 0,s.emit("openchange",{open:d,event:g,reason:v,nested:l}),n?.(d,g,v)}),f=m.useMemo(()=>({setPositionReference:c}),[]),h=m.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return m.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:f}),[t,u,h,s,o,f])}function Vm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Hm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=m.useState(null),[l,a]=m.useState(null),u=o?.domReference||i,f=m.useRef(null),h=_m();Er(()=>{u&&(f.current=u)},[u]);const d=nl({...e,elements:{...o,...l&&{reference:l}}}),g=m.useCallback(w=>{const S=K(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;a(S),d.refs.setReference(S)},[d.refs]),v=m.useCallback(w=>{(K(w)||w===null)&&(f.current=w,s(w)),(K(d.refs.reference.current)||d.refs.reference.current===null||w!==null&&!K(w))&&d.refs.setReference(w)},[d.refs]),b=m.useMemo(()=>({...d.refs,setReference:v,setPositionReference:g,domReference:f}),[d.refs,v,g]),x=m.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),y=m.useMemo(()=>({...d,...r,refs:b,elements:x,nodeId:t}),[d,b,x,t,r]);return Er(()=>{r.dataRef.current.floatingContext=y;const w=h?.nodesRef.current.find(S=>S.id===t);w&&(w.context=y)}),m.useMemo(()=>({...d,context:y,refs:b,elements:x}),[d,b,x,y])}const ei="active",ti="selected";function Zn(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[ei]:s,[ti]:l,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[Bm]:""},...i,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[ei,ti].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var h,d=arguments.length,g=new Array(d),v=0;v<d;v++)g[v]=arguments[v];return(h=r.get(c))==null?void 0:h.map(b=>b(...g)).find(b=>b!==void 0)}}}else s[c]=u}),s),{})}}function Wm(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=m.useCallback(l=>Zn(l,e,"reference"),t),i=m.useCallback(l=>Zn(l,e,"floating"),n),s=m.useCallback(l=>Zn(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function ni(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const zm=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:l=4,referenceOverflowThreshold:a=0,scrollRef:c,...u}=st(e,t),{rects:f,elements:{floating:h}}=t,d=n.current[s],g=c?.current||h,v=h.clientTop||g.clientTop,b=h.clientTop!==0,x=g.clientTop!==0,y=h===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Am('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const w={...t,...await Zr(-d.offsetTop-h.clientTop-f.reference.height/2-d.offsetHeight/2-i).fn(t)},S=await Yn(ni(w,g.scrollHeight+v+h.clientTop),u),R=await Yn(w,{...u,elementContext:"reference"}),P=se(0,S.top),T=w.y+P,k=(g.scrollHeight>g.clientHeight?D=>D:Mt)(se(0,g.scrollHeight+(b&&y||x?v*2:0)-P-se(0,S.bottom)));if(g.style.maxHeight=k+"px",g.scrollTop=P,o){const D=g.offsetHeight<d.offsetHeight*nt(l,n.current.length)-1||R.top>=-a||R.bottom>=-a;an.flushSync(()=>o(D))}return r&&(r.current=await Yn(ni({...w,y:T},g.offsetHeight+v+h.clientTop),u)),{y:T}}});function Um(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:l}=t,a=il(l),c=m.useRef(!1),u=m.useRef(null),f=m.useRef(null);m.useEffect(()=>{if(!o)return;function d(v){if(v.ctrlKey||!g||i.current==null)return;const b=v.deltaY,x=i.current.top>=-.5,y=i.current.bottom>=-.5,w=g.scrollHeight-g.clientHeight,S=b<0?-1:1,R=b<0?"max":"min";g.scrollHeight<=g.clientHeight||(!x&&b>0||!y&&b<0?(v.preventDefault(),an.flushSync(()=>{a(P=>P+Math[R](b,w*S))})):/firefox/i.test(Mf())&&(g.scrollTop+=b))}const g=s?.current||r.floating;if(n&&g)return g.addEventListener("wheel",d),requestAnimationFrame(()=>{u.current=g.scrollTop,i.current!=null&&(f.current={...i.current})}),()=>{u.current=null,f.current=null,g.removeEventListener("wheel",d)}},[o,n,r.floating,i,s,a]);const h=m.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const d=s?.current||r.floating;if(!(!i.current||!d||!c.current)){if(u.current!==null){const g=d.scrollTop-u.current;(i.current.bottom<-.5&&g<-1||i.current.top<-.5&&g>1)&&an.flushSync(()=>a(v=>v+g))}requestAnimationFrame(()=>{u.current=d.scrollTop})}}}),[r.floating,a,i,s]);return m.useMemo(()=>o?{floating:h}:{},[o,h])}let yt=p.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});yt.displayName="FloatingContext";let Jr=p.createContext(null);Jr.displayName="PlacementContext";function qm(e){return p.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Gm(){return p.useContext(yt).setReference}function Km(){return p.useContext(yt).getReferenceProps}function Ym(){let{getFloatingProps:e,slot:t}=p.useContext(yt);return p.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Xm(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=p.useContext(Jr),n=p.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i?.outerHTML)!=null?s:i})]);te(()=>{t?.(n??null)},[t,n]);let r=p.useContext(yt);return p.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let ri=4;function Zm({children:e,enabled:t=!0}){let[n,r]=p.useState(null),[o,i]=p.useState(0),s=p.useRef(null),[l,a]=p.useState(null);Jm(l);let c=t&&n!==null&&l!==null,{to:u="bottom",gap:f=0,offset:h=0,padding:d=0,inner:g}=Qm(n,l),[v,b="center"]=u.split(" ");te(()=>{c&&i(0)},[c]);let{refs:x,floatingStyles:y,context:w}=Vm({open:c,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[Zr({mainAxis:v==="selection"?0:f,crossAxis:h}),rl({padding:d}),v!=="selection"&&Rm({padding:d}),v==="selection"&&g?zm({...g,padding:d,overflowRef:s,offset:o,minItemsVisible:ri,referenceOverflowThreshold:d,onFallbackChange(D){var W,z;if(!D)return;let O=w.elements.floating;if(!O)return;let A=parseFloat(getComputedStyle(O).scrollPaddingBottom)||0,_=Math.min(ri,O.childElementCount),L=0,C=0;for(let M of(z=(W=w.elements.floating)==null?void 0:W.childNodes)!=null?z:[])if(Ve(M)){let V=M.offsetTop,X=V+M.clientHeight+A,B=O.scrollTop,j=B+O.clientHeight;if(V>=B&&X<=j)_--;else{C=Math.max(0,Math.min(X,j)-Math.max(V,B)),L=M.clientHeight;break}}_>=1&&i(M=>{let V=L*_-C+A;return M>=V?M:V})}}):null,Sm({padding:d,apply({availableWidth:D,availableHeight:W,elements:z}){Object.assign(z.floating.style,{overflow:"auto",maxWidth:`${D}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${W}px)`})}})].filter(Boolean),whileElementsMounted:hm}),[S=v,R=b]=w.placement.split("-");v==="selection"&&(S="selection");let P=p.useMemo(()=>({anchor:[S,R].filter(Boolean).join(" ")}),[S,R]),T=Um(w,{overflowRef:s,onChange:i}),{getReferenceProps:$,getFloatingProps:F}=Wm([T]),k=q(D=>{a(D),x.setFloating(D)});return m.createElement(Jr.Provider,{value:r},m.createElement(yt.Provider,{value:{setFloating:k,setReference:x.setReference,styles:y,getReferenceProps:$,getFloatingProps:F,slot:P}},e))}function Jm(e){te(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Qm(e,t){var n,r,o;let i=Jn((n=e?.gap)!=null?n:"var(--anchor-gap, 0)",t),s=Jn((r=e?.offset)!=null?r:"var(--anchor-offset, 0)",t),l=Jn((o=e?.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:l}}function Jn(e,t,n=void 0){let r=ot(),o=q((a,c)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!c)return[n,null];let u=oi(a,c);return[u,f=>{let h=sl(a);{let d=h.map(g=>window.getComputedStyle(c).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[x,y]of h.entries()){let w=window.getComputedStyle(c).getPropertyValue(y);if(d[x]!==w){d[x]=w,v=!0;break}}if(!v)return;let b=oi(a,c);u!==b&&(f(b),u=b)})}return r.dispose}]}return[n,null]}),i=p.useMemo(()=>o(e,t)[0],[e,t]),[s=i,l]=p.useState();return te(()=>{let[a,c]=o(e,t);if(l(a),!!c)return c(l)},[e,t]),s}function sl(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...sl(o)]:[r]}return[]}function oi(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function ep({children:e,freeze:t},n){let r=ll(t,e);return p.isValidElement(r)?p.cloneElement(r,{ref:n}):p.createElement(p.Fragment,null,r)}p.forwardRef(ep);function ll(e,t){let[n,r]=p.useState(t);return!e&&n!==t&&r(t),e?n:t}let Pn=p.createContext(null);Pn.displayName="OpenClosedContext";var ae=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ae||{});function Tn(){return p.useContext(Pn)}function Qr({value:e,children:t}){return p.createElement(Pn.Provider,{value:e},t)}function tp({children:e}){return p.createElement(Pn.Provider,{value:null},e)}function np(e){throw new Error("Unexpected object: "+e)}var Q=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Q||{});function Qt(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:np(e)}}function al(e){let t=q(e),n=p.useRef(!1);p.useEffect(()=>(n.current=!1,()=>{n.current=!0,gs(()=>{n.current&&t()})}),[t])}let rp=p.createContext(!1);function op(){return p.useContext(rp)}function ip(e){let t=op(),n=p.useContext(ul),[r,o]=p.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if($e.isServer)return null;let s=e?.getElementById("headlessui-portal-root");if(s)return s;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return p.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),p.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let cl=p.Fragment,sp=oe(function(e,t){let{ownerDocument:n=null,...r}=e,o=p.useRef(null),i=ue($s(h=>{o.current=h}),t),s=xr(o.current),l=n??s,a=ip(l),c=p.useContext(up),u=ot(),f=ie();return al(()=>{var h;a&&a.childNodes.length<=0&&((h=a.parentElement)==null||h.removeChild(a))}),a?Ye.createPortal(p.createElement("div",{"data-headlessui-portal":"",ref:h=>{u.dispose(),c&&h&&u.add(c.register(h))}},f({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:cl,name:"Portal"})),a):null});function lp(e,t){let n=ue(t),{enabled:r=!0,ownerDocument:o,...i}=e,s=ie();return r?p.createElement(sp,{...i,ownerDocument:o,ref:n}):s({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:cl,name:"Portal"})}let ap=p.Fragment,ul=p.createContext(null);function cp(e,t){let{target:n,...r}=e,o={ref:ue(t)},i=ie();return p.createElement(ul.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:ap,name:"Popover.Group"}))}let up=p.createContext(null),dp=oe(lp),fp=oe(cp),mp=Object.assign(dp,{Group:fp});const on={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function dl(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function pp(e,t,n){let r=ve();if(t.kind==="Tracked"){let o=function(){i!==dl(e)&&(r.dispose(),n())},{position:i}=t,s=new ResizeObserver(o);s.observe(e),r.add(()=>s.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function hp(){let e=typeof document>"u";return"useSyncExternalStore"in m?(t=>t.useSyncExternalStore)(m)(()=>()=>{},()=>!1,()=>!e):!1}function fl(){let e=hp(),[t,n]=m.useState($e.isHandoffComplete);return t&&$e.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>$e.handoff(),[]),e?!1:t}function gp(){let e=p.useRef(!1);return te(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ml(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!ft((t=e.as)!=null?t:hl)||p.Children.count(e.children)===1}let On=p.createContext(null);On.displayName="TransitionContext";var vp=(e=>(e.Visible="visible",e.Hidden="hidden",e))(vp||{});function bp(){let e=p.useContext(On);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function xp(){let e=p.useContext(Ln);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ln=p.createContext(null);Ln.displayName="NestingContext";function Mn(e){return"children"in e?Mn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function pl(e,t){let n=it(e),r=p.useRef([]),o=gp(),i=ot(),s=q((d,g=Ue.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===d);v!==-1&&(ce(g,{[Ue.Unmount](){r.current.splice(v,1)},[Ue.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var b;!Mn(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),l=q(d=>{let g=r.current.find(({el:v})=>v===d);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:d,state:"visible"}),()=>s(d,Ue.Unmount)}),a=p.useRef([]),c=p.useRef(Promise.resolve()),u=p.useRef({enter:[],leave:[]}),f=q((d,g,v)=>{a.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([b])=>b!==d)),t?.chains.current[g].push([d,new Promise(b=>{a.current.push(b)})]),t?.chains.current[g].push([d,new Promise(b=>{Promise.all(u.current[g].map(([x,y])=>y)).then(()=>b())})]),g==="enter"?c.current=c.current.then(()=>t?.wait.current).then(()=>v(g)):v(g)}),h=q((d,g,v)=>{Promise.all(u.current[g].splice(0).map(([b,x])=>x)).then(()=>{var b;(b=a.current.shift())==null||b()}).then(()=>v(g))});return p.useMemo(()=>({children:r,register:l,unregister:s,onStart:f,onStop:h,wait:c,chains:u}),[l,s,r,f,h,u,c])}let hl=p.Fragment,gl=pt.RenderStrategy;function wp(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:l,afterLeave:a,enter:c,enterFrom:u,enterTo:f,entered:h,leave:d,leaveFrom:g,leaveTo:v,...b}=e,[x,y]=p.useState(null),w=p.useRef(null),S=ml(e),R=ue(...S?[w,t,y]:t===null?[]:[t]),P=(n=b.unmount)==null||n?Ue.Unmount:Ue.Hidden,{show:T,appear:$,initial:F}=bp(),[k,D]=p.useState(T?"visible":"hidden"),W=xp(),{register:z,unregister:O}=W;te(()=>z(w),[z,w]),te(()=>{if(P===Ue.Hidden&&w.current){if(T&&k!=="visible"){D("visible");return}return ce(k,{hidden:()=>O(w),visible:()=>z(w)})}},[k,w,z,O,T,P]);let A=fl();te(()=>{if(S&&A&&k==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,k,A,S]);let _=F&&!$,L=$&&T&&F,C=p.useRef(!1),M=pl(()=>{C.current||(D("hidden"),O(w))},W),V=q(G=>{C.current=!0;let pe=G?"enter":"leave";M.onStart(w,pe,de=>{de==="enter"?i?.():de==="leave"&&l?.()})}),X=q(G=>{let pe=G?"enter":"leave";C.current=!1,M.onStop(w,pe,de=>{de==="enter"?s?.():de==="leave"&&a?.()}),pe==="leave"&&!Mn(M)&&(D("hidden"),O(w))});p.useEffect(()=>{S&&o||(V(T),X(T))},[T,S,o]);let B=!(!o||!S||!A||_),[,j]=Gr(B,x,T,{start:V,end:X}),ee=ze({ref:R,className:((r=pr(b.className,L&&c,L&&u,j.enter&&c,j.enter&&j.closed&&u,j.enter&&!j.closed&&f,j.leave&&d,j.leave&&!j.closed&&g,j.leave&&j.closed&&v,!j.transition&&T&&h))==null?void 0:r.trim())||void 0,...qr(j)}),Y=0;k==="visible"&&(Y|=ae.Open),k==="hidden"&&(Y|=ae.Closed),T&&k==="hidden"&&(Y|=ae.Opening),!T&&k==="visible"&&(Y|=ae.Closing);let H=ie();return p.createElement(Ln.Provider,{value:M},p.createElement(Qr,{value:Y},H({ourProps:ee,theirProps:b,defaultTag:hl,features:gl,visible:k==="visible",name:"Transition.Child"})))}function yp(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=p.useRef(null),l=ml(e),a=ue(...l?[s,t]:t===null?[]:[t]);fl();let c=Tn();if(n===void 0&&c!==null&&(n=(c&ae.Open)===ae.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=p.useState(n?"visible":"hidden"),h=pl(()=>{n||f("hidden")}),[d,g]=p.useState(!0),v=p.useRef([n]);te(()=>{d!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let b=p.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);te(()=>{n?f("visible"):!Mn(h)&&s.current!==null&&f("hidden")},[n,h]);let x={unmount:o},y=q(()=>{var R;d&&g(!1),(R=e.beforeEnter)==null||R.call(e)}),w=q(()=>{var R;d&&g(!1),(R=e.beforeLeave)==null||R.call(e)}),S=ie();return p.createElement(Ln.Provider,{value:h},p.createElement(On.Provider,{value:b},S({ourProps:{...x,as:p.Fragment,children:p.createElement(vl,{ref:a,...x,...i,beforeEnter:y,beforeLeave:w})},theirProps:{},defaultTag:p.Fragment,features:gl,visible:u==="visible",name:"Transition"})))}function Ep(e,t){let n=p.useContext(On)!==null,r=Tn()!==null;return p.createElement(p.Fragment,null,!n&&r?p.createElement(Cr,{ref:t,...e}):p.createElement(vl,{ref:t,...e}))}let Cr=oe(yp),vl=oe(wp),Cp=oe(Ep),Rp=Object.assign(Cr,{Child:Cp,Root:Cr});var ii;let Sp=(ii=p.startTransition)!=null?ii:function(e){e()};var kp=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(kp||{}),$p=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))($p||{});let Pp={0:e=>({...e,disclosureState:ce(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},eo=p.createContext(null);eo.displayName="DisclosureContext";function to(e){let t=p.useContext(eo);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,to),n}return t}let no=p.createContext(null);no.displayName="DisclosureAPIContext";function bl(e){let t=p.useContext(no);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,bl),n}return t}let ro=p.createContext(null);ro.displayName="DisclosurePanelContext";function Tp(){return p.useContext(ro)}function Op(e,t){return ce(t.type,Pp,e,t)}let Lp=p.Fragment;function Mp(e,t){let{defaultOpen:n=!1,...r}=e,o=p.useRef(null),i=ue(t,$s(v=>{o.current=v},e.as===void 0||ft(e.as))),s=p.useReducer(Op,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:a},c]=s,u=q(v=>{c({type:1});let b=_t(o.current);if(!b||!a)return;let x=v?qe(v)?v:"current"in v&&qe(v.current)?v.current:b.getElementById(a):b.getElementById(a);x?.focus()}),f=p.useMemo(()=>({close:u}),[u]),h=ye({open:l===0,close:u}),d={ref:i},g=ie();return p.createElement(eo.Provider,{value:s},p.createElement(no.Provider,{value:f},p.createElement(Pd,{value:u},p.createElement(Qr,{value:ce(l,{0:ae.Open,1:ae.Closed})},g({ourProps:d,theirProps:r,slot:h,defaultTag:Lp,name:"Disclosure"})))))}let Ap="button";function Fp(e,t){let n=p.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:o=!1,autoFocus:i=!1,...s}=e,[l,a]=to("Disclosure.Button"),c=Tp(),u=c===null?!1:c===l.panelId,f=p.useRef(null),h=ue(f,t,q(F=>{if(!u)return a({type:4,element:F})}));p.useEffect(()=>{if(!u)return a({type:2,buttonId:r}),()=>{a({type:2,buttonId:null})}},[r,a,u]);let d=q(F=>{var k;if(u){if(l.disclosureState===1)return;switch(F.key){case J.Space:case J.Enter:F.preventDefault(),F.stopPropagation(),a({type:0}),(k=l.buttonElement)==null||k.focus();break}}else switch(F.key){case J.Space:case J.Enter:F.preventDefault(),F.stopPropagation(),a({type:0});break}}),g=q(F=>{F.key===J.Space&&F.preventDefault()}),v=q(F=>{var k;hr(F.currentTarget)||o||(u?(a({type:0}),(k=l.buttonElement)==null||k.focus()):a({type:0}))}),{isFocusVisible:b,focusProps:x}=Br({autoFocus:i}),{isHovered:y,hoverProps:w}=_r({isDisabled:o}),{pressed:S,pressProps:R}=Hr({disabled:o}),P=ye({open:l.disclosureState===0,hover:y,active:S,disabled:o,focus:b,autofocus:i}),T=Ws(e,l.buttonElement),$=Lt(u?{ref:h,type:T,disabled:o||void 0,autoFocus:i,onKeyDown:d,onClick:v}:{ref:h,id:r,type:T,"aria-expanded":l.disclosureState===0,"aria-controls":l.panelElement?l.panelId:void 0,disabled:o||void 0,autoFocus:i,onKeyDown:d,onKeyUp:g,onClick:v},x,w,R);return ie()({ourProps:$,theirProps:s,slot:P,defaultTag:Ap,name:"Disclosure.Button"})}let Np="div",Ip=pt.RenderStrategy|pt.Static;function Dp(e,t){let n=p.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:o=!1,...i}=e,[s,l]=to("Disclosure.Panel"),{close:a}=bl("Disclosure.Panel"),[c,u]=p.useState(null),f=ue(t,q(y=>{Sp(()=>l({type:5,element:y}))}),u);p.useEffect(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let h=Tn(),[d,g]=Gr(o,c,h!==null?(h&ae.Open)===ae.Open:s.disclosureState===0),v=ye({open:s.disclosureState===0,close:a}),b={ref:f,id:r,...qr(g)},x=ie();return p.createElement(tp,null,p.createElement(ro.Provider,{value:s.panelId},x({ourProps:b,theirProps:i,slot:v,defaultTag:Np,features:Ip,visible:d,name:"Disclosure.Panel"})))}let jp=oe(Mp),xl=oe(Fp),wl=oe(Dp),_p=Object.assign(jp,{Button:xl,Panel:wl}),si=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function li(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!Ve(o))return r;let i=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),i=!0;let s=i?(n=o.innerText)!=null?n:"":r;return si.test(s)&&(s=s.replace(si,"")),s}function Bp(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let i=document.getElementById(o);if(i){let s=i.getAttribute("aria-label");return typeof s=="string"?s.trim():li(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return li(e).trim()}function Hp(e){let t=p.useRef(""),n=p.useRef("");return q(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Bp(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Vp=Object.defineProperty,Wp=(e,t,n)=>t in e?Vp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ai=(e,t,n)=>(Wp(e,typeof t!="symbol"?t+"":t,n),n),le=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(le||{}),Ge=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Ge||{}),sn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(sn||{}),yl=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(yl||{});function ci(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Hs(t(e.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let zp={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?on.Tracked(dl(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:Q.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:on.Idle}},2(e,t){var n,r,o,i,s;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Q.Nothing)return{...l,activeOptionIndex:null};if(t.focus===Q.Specific)return{...l,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===Q.Previous){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,h=Qt(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(h!==null){let d=e.options[h].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===d.current||((o=d.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:h}}}}else if(t.focus===Q.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,h=Qt(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(h!==null){let d=e.options[h].dataRef.current.domRef;if(((i=f.current)==null?void 0:i.nextElementSibling)===d.current||((s=d.current)==null?void 0:s.nextElementSibling)===null)return{...l,activeOptionIndex:h}}}}let a=ci(e),c=Qt(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...l,...a,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(s=>{var l;return!s.dataRef.current.disabled&&((l=s.dataRef.current.textValue)==null?void 0:l.startsWith(r))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==Q.Nothing&&(r=Qt(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let i=n.findIndex(s=>o?.(s.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:Q.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,s]of n.entries())if(o.has(s.id)&&(r.push(i),o.delete(s.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...ci(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:on.Moved}}};class oo extends Fs{constructor(t){super(t),ai(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:s}=this.state.dataRef.current;return ce(i,{0:()=>r?.(n),1:()=>{let l=s.slice(),a=l.findIndex(c=>o(c,n));return a===-1?l.push(n):l.splice(a,1),r?.(l)}})},registerOption:Un(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Un(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Un(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),ai(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,s=n.options;return i!==null?((o=s[i])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=zr.get(null);this.disposables.add(r.on(Is.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(pp(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new oo({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:Q.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:on.Idle})}reduce(t,n){return ce(n.type,zp,t,n)}}const El=p.createContext(null);function io(e){let t=p.useContext(El);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Cl),n}return t}function Cl({id:e,__demoMode:t=!1}){let n=p.useMemo(()=>oo.new({id:e,__demoMode:t}),[]);return al(()=>n.dispose()),n}let An=p.createContext(null);An.displayName="ListboxDataContext";function Vt(e){let t=p.useContext(An);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Vt),n}return t}let Up=p.Fragment;function qp(e,t){let n=p.useId(),r=wn(),{value:o,defaultValue:i,form:s,name:l,onChange:a,by:c,invalid:u=!1,disabled:f=r||!1,horizontal:h=!1,multiple:d=!1,__demoMode:g=!1,...v}=e;const b=h?"horizontal":"vertical";let x=ue(t),y=rd(i),[w=d?[]:void 0,S]=nd(o,a,y),R=Cl({id:n,__demoMode:g}),P=p.useRef({static:!1,hold:!1}),T=p.useRef(new Map),$=Od(c),F=p.useCallback(B=>ce(k.mode,{[Ge.Multi]:()=>w.some(j=>$(j,B)),[Ge.Single]:()=>$(w,B)}),[w]),k=ye({value:w,disabled:f,invalid:u,mode:d?Ge.Multi:Ge.Single,orientation:b,onChange:S,compare:$,isSelected:F,optionsPropsRef:P,listRef:T});te(()=>{R.state.dataRef.current=k},[k]);let D=fe(R,B=>B.listboxState),W=zr.get(null),z=fe(W,p.useCallback(B=>W.selectors.isTop(B,n),[W,n])),[O,A]=fe(R,B=>[B.buttonElement,B.optionsElement]);of(z,[O,A],(B,j)=>{R.send({type:yl.CloseListbox}),Bs(j,Ur.Loose)||(B.preventDefault(),O?.focus())});let _=ye({open:D===le.Open,disabled:f,invalid:u,value:w}),[L,C]=Ed({inherit:!0}),M={ref:x},V=p.useCallback(()=>{if(y!==void 0)return S?.(y)},[S,y]),X=ie();return p.createElement(C,{value:L,props:{htmlFor:O?.id},slot:{open:D===le.Open,disabled:f}},p.createElement(Zm,null,p.createElement(El.Provider,{value:R},p.createElement(An.Provider,{value:k},p.createElement(Qr,{value:ce(D,{[le.Open]:ae.Open,[le.Closed]:ae.Closed})},l!=null&&w!=null&&p.createElement(ud,{disabled:f,data:{[l]:w},form:s,onReset:V}),X({ourProps:M,theirProps:v,slot:_,defaultTag:Up,name:"Listbox"}))))))}let Gp="button";function Kp(e,t){let n=p.useId(),r=Es(),o=Vt("Listbox.Button"),i=io("Listbox.Button"),{id:s=r||`headlessui-listbox-button-${n}`,disabled:l=o.disabled||!1,autoFocus:a=!1,...c}=e,u=ue(t,Gm(),i.actions.setButtonElement),f=Km(),[h,d,g]=fe(i,A=>[A.listboxState,A.buttonElement,A.optionsElement]),v=h===le.Open;af(v,{trigger:d,action:p.useCallback(A=>{if(d!=null&&d.contains(A.target))return Zt.Ignore;let _=A.target.closest('[role="option"]:not([data-disabled])');return Ve(_)?Zt.Select(_):g!=null&&g.contains(A.target)?Zt.Ignore:Zt.Close},[d,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let b=q(A=>{switch(A.key){case J.Enter:od(A.currentTarget);break;case J.Space:case J.ArrowDown:A.preventDefault(),i.actions.openListbox({focus:o.value?Q.Nothing:Q.First});break;case J.ArrowUp:A.preventDefault(),i.actions.openListbox({focus:o.value?Q.Nothing:Q.Last});break}}),x=q(A=>{A.key===J.Space&&A.preventDefault()}),y=Md(A=>{var _;i.state.listboxState===le.Open?(Ye.flushSync(()=>i.actions.closeListbox()),(_=i.state.buttonElement)==null||_.focus({preventScroll:!0})):(A.preventDefault(),i.actions.openListbox({focus:Q.Nothing}))}),w=q(A=>A.preventDefault()),S=Os([s]),R=bd(),{isFocusVisible:P,focusProps:T}=Br({autoFocus:a}),{isHovered:$,hoverProps:F}=_r({isDisabled:l}),{pressed:k,pressProps:D}=Hr({disabled:l}),W=ye({open:h===le.Open,active:k||h===le.Open,disabled:l,invalid:o.invalid,value:o.value,hover:$,focus:P,autofocus:a}),z=fe(i,A=>A.listboxState===le.Open),O=Lt(f(),{ref:u,id:s,type:Ws(e,d),"aria-haspopup":"listbox","aria-controls":g?.id,"aria-expanded":z,"aria-labelledby":S,"aria-describedby":R,disabled:l||void 0,autoFocus:a,onKeyDown:b,onKeyUp:x,onKeyPress:w},y,T,F,D);return ie()({ourProps:O,theirProps:c,slot:W,defaultTag:Gp,name:"Listbox.Button"})}let Rl=p.createContext(!1),Yp="div",Xp=pt.RenderStrategy|pt.Static;function Zp(e,t){let n=p.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:s=!0,transition:l=!1,...a}=e,c=qm(o),[u,f]=p.useState(null);c&&(i=!0);let h=Vt("Listbox.Options"),d=io("Listbox.Options"),[g,v,b,x]=fe(d,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),y=xr(v),w=xr(b),S=Tn(),[R,P]=Gr(l,u,S!==null?(S&ae.Open)===ae.Open:g===le.Open);qd(R,v,d.actions.closeListbox);let T=x?!1:s&&g===le.Open;hf(T,w);let $=x?!1:s&&g===le.Open;Ud($,{allowed:p.useCallback(()=>[v,b],[v,b])});let F=fe(d,d.selectors.didButtonMove)?!1:R,k=fe(d,d.selectors.hasFrozenValue)&&!e.static,D=ll(k,h.value),W=p.useCallback(H=>h.compare(D,H),[h.compare,D]),z=fe(d,H=>{var G;if(c==null||!((G=c?.to)!=null&&G.includes("selection")))return null;let pe=H.options.findIndex(de=>W(de.dataRef.current.value));return pe===-1&&(pe=0),pe}),O=(()=>{if(c==null)return;if(z===null)return{...c,inner:void 0};let H=Array.from(h.listRef.current.values());return{...c,inner:{listRef:{current:H},index:z}}})(),[A,_]=Xm(O),L=Ym(),C=ue(t,c?A:null,d.actions.setOptionsElement,f),M=ot();p.useEffect(()=>{let H=b;H&&g===le.Open&&(zu(H)||H==null||H.focus({preventScroll:!0}))},[g,b]);let V=q(H=>{var G;switch(M.dispose(),H.key){case J.Space:if(d.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),d.actions.search(H.key);case J.Enter:H.preventDefault(),H.stopPropagation(),d.actions.selectActiveOption();break;case ce(h.orientation,{vertical:J.ArrowDown,horizontal:J.ArrowRight}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.Next});case ce(h.orientation,{vertical:J.ArrowUp,horizontal:J.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.Previous});case J.Home:case J.PageUp:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.First});case J.End:case J.PageDown:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.Last});case J.Escape:H.preventDefault(),H.stopPropagation(),Ye.flushSync(()=>d.actions.closeListbox()),(G=d.state.buttonElement)==null||G.focus({preventScroll:!0});return;case J.Tab:H.preventDefault(),H.stopPropagation(),Ye.flushSync(()=>d.actions.closeListbox()),ef(d.state.buttonElement,H.shiftKey?br.Previous:br.Next);break;default:H.key.length===1&&(d.actions.search(H.key),M.setTimeout(()=>d.actions.clearSearch(),350));break}}),X=fe(d,H=>{var G;return(G=H.buttonElement)==null?void 0:G.id}),B=ye({open:g===le.Open}),j=Lt(c?L():{},{id:r,ref:C,"aria-activedescendant":fe(d,d.selectors.activeDescendantId),"aria-multiselectable":h.mode===Ge.Multi?!0:void 0,"aria-labelledby":X,"aria-orientation":h.orientation,onKeyDown:V,role:"listbox",tabIndex:g===le.Open?0:void 0,style:{...a.style,..._,"--button-width":Ld(R,v,!0).width},...qr(P)}),ee=ie(),Y=p.useMemo(()=>h.mode===Ge.Multi?h:{...h,isSelected:W},[h,W]);return p.createElement(mp,{enabled:i?e.static||R:!1,ownerDocument:y},p.createElement(An.Provider,{value:Y},ee({ourProps:j,theirProps:a,slot:B,defaultTag:Yp,features:Xp,visible:F,name:"Listbox.Options"})))}let Jp="div";function Qp(e,t){let n=p.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...s}=e,l=p.useContext(Rl)===!0,a=Vt("Listbox.Option"),c=io("Listbox.Option"),u=fe(c,k=>c.selectors.isActive(k,r)),f=a.isSelected(i),h=p.useRef(null),d=Hp(h),g=it({disabled:o,value:i,domRef:h,get textValue(){return d()}}),v=ue(t,h,k=>{k?a.listRef.current.set(r,k):a.listRef.current.delete(r)}),b=fe(c,k=>c.selectors.shouldScrollIntoView(k,r));te(()=>{if(b)return ve().requestAnimationFrame(()=>{var k,D;(D=(k=h.current)==null?void 0:k.scrollIntoView)==null||D.call(k,{block:"nearest"})})},[b,h]),te(()=>{if(!l)return c.actions.registerOption(r,g),()=>c.actions.unregisterOption(r)},[g,r,l]);let x=q(k=>{if(o)return k.preventDefault();c.actions.selectOption(i)}),y=q(()=>{if(o)return c.actions.goToOption({focus:Q.Nothing});c.actions.goToOption({focus:Q.Specific,id:r})}),w=gf(),S=q(k=>w.update(k)),R=q(k=>{w.wasMoved(k)&&(o||u&&c.state.activationTrigger===sn.Pointer||c.actions.goToOption({focus:Q.Specific,id:r},sn.Pointer))}),P=q(k=>{w.wasMoved(k)&&(o||u&&c.state.activationTrigger===sn.Pointer&&c.actions.goToOption({focus:Q.Nothing}))}),T=ye({active:u,focus:u,selected:f,disabled:o,selectedOption:f&&l}),$=l?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:x,onFocus:y,onPointerEnter:S,onMouseEnter:S,onPointerMove:R,onMouseMove:R,onPointerLeave:P,onMouseLeave:P},F=ie();return!f&&l?null:F({ourProps:$,theirProps:s,slot:T,defaultTag:Jp,name:"Listbox.Option"})}let eh=p.Fragment;function th(e,t){let{options:n,placeholder:r,...o}=e,i={ref:ue(t)},s=Vt("ListboxSelectedOption"),l=ye({}),a=s.value===void 0||s.value===null||s.mode===Ge.Multi&&Array.isArray(s.value)&&s.value.length===0,c=ie();return p.createElement(Rl.Provider,{value:!0},c({ourProps:i,theirProps:{...o,children:p.createElement(p.Fragment,null,r&&a?r:n)},slot:l,defaultTag:eh,name:"ListboxSelectedOption"}))}let nh=oe(qp),Sl=oe(Kp),rh=kd,kl=oe(Zp),$l=oe(Qp),oh=oe(th),ih=Object.assign(nh,{Button:Sl,Label:rh,Options:kl,Option:$l,SelectedOption:oh});function Pl({children:e,className:t,disabled:n=!1,intent:r="primary",...o}){return E.jsx(td,{className:re("rounded-md font-bold cursor-pointer px-2",sh(r,!!n),{"opacity-50 cursor-default":n},t),"data-focus":!0,disabled:n,...o,children:e})}function sh(e,t){switch(e){case"danger":return re("bg-red-400 text-red-950 focus:text-black",{"hover:bg-red-500 focus:text-black":!t});case"none":return re("bg-white/20 text-slate-300 focus:text-white",{"hover:bg-white/10 focus:text-white":!t});case"success":return re("bg-emerald-400 text-emerald-950 focus:text-black",{"hover:bg-emerald-500 focus:text-black":!t});case"primary":return re("bg-sky-400 text-sky-950 focus:text-black",{"hover:bg-sky-500 focus:text-black":!t});case"warning":return re("bg-amber-400 text-amber-950 focus:text-black",{"hover:bg-amber-500 focus:text-black":!t})}}function so({children:e}){return E.jsx(gu,{FallbackComponent:lh,children:e})}function lh({error:e,resetErrorBoundary:t}){return E.jsx(Fr,{intent:"danger",children:E.jsxs(he,{align:"start",direction:"column",gap:2,children:[E.jsx("div",{className:"font-bold",children:"Something went wrong!"}),E.jsx("pre",{className:"text-sm font-monospace text-red-300",children:e.message}),E.jsx(Pl,{intent:"danger",onClick:t,children:"Retry"})]})})}function Wt({children:e,onClick:t,to:n,...r}){const o=!!Pa(n),[i,s]=p.useTransition(),l=Mi();return E.jsx("a",{children:typeof e=="function"?e({isActive:o,isPending:i}):e,"data-link":n,onClick:a=>{t?.(a),s(()=>{l(n)})},...r})}function ah(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ch(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function uh(){return/apple/i.test(navigator.vendor)}function dh(){return ah().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function fh(){return ch().includes("jsdom/")}const mh="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ui(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ft(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&wr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ut(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qn(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 ph(e){return e.matches("html,body")}function et(e){return e?.ownerDocument||document}function hh(e){return ge(e)&&e.matches(mh)}function gh(e){if(!e||fh())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ln(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...ln(e,o.id,n)])}function vh(e){return"nativeEvent"in e}function Rr(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var bh=typeof document<"u",xh=function(){},Ie=bh?p.useLayoutEffect:xh;const wh={...m};function en(e){const t=m.useRef(e);return Ie(()=>{t.current=e}),t}const yh=wh.useInsertionEffect,Eh=yh||(e=>e());function ke(e){const t=m.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Eh(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Ch="data-floating-ui-focusable",di="active",fi="selected",Rh={...m};let mi=!1,Sh=0;const pi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Sh++;function kh(){const[e,t]=m.useState(()=>mi?pi():void 0);return Ie(()=>{e==null&&t(pi())},[]),m.useEffect(()=>{mi=!0},[]),e}const $h=Rh.useId,Tl=$h||kh;let Sr;process.env.NODE_ENV!=="production"&&(Sr=new Set);function Ph(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Sr)!=null&&e.has(o))){var i;(i=Sr)==null||i.add(o),console.error(o)}}function Th(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const Oh=m.createContext(null),Lh=m.createContext(null),Ol=()=>{var e;return((e=m.useContext(Oh))==null?void 0:e.id)||null},lo=()=>m.useContext(Lh);function Fn(e){return"data-floating-ui-"+e}function xe(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const hi=Fn("safe-polygon");function er(e,t,n){if(n&&!Rr(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function tr(e){return typeof e=="function"?e():e}function Mh(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:l=!0,delay:a=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:h=!0}=t,d=lo(),g=Ol(),v=en(c),b=en(a),x=en(n),y=en(f),w=m.useRef(),S=m.useRef(-1),R=m.useRef(),P=m.useRef(-1),T=m.useRef(!0),$=m.useRef(!1),F=m.useRef(()=>{}),k=m.useRef(!1),D=ke(()=>{var L;const C=(L=o.current.openEvent)==null?void 0:L.type;return C?.includes("mouse")&&C!=="mousedown"});m.useEffect(()=>{if(!l)return;function L(C){let{open:M}=C;M||(xe(S),xe(P),T.current=!0,k.current=!1)}return i.on("openchange",L),()=>{i.off("openchange",L)}},[l,i]),m.useEffect(()=>{if(!l||!v.current||!n)return;function L(M){D()&&r(!1,M,"hover")}const C=et(s.floating).documentElement;return C.addEventListener("mouseleave",L),()=>{C.removeEventListener("mouseleave",L)}},[s.floating,n,r,l,v,D]);const W=m.useCallback(function(L,C,M){C===void 0&&(C=!0),M===void 0&&(M="hover");const V=er(b.current,"close",w.current);V&&!R.current?(xe(S),S.current=window.setTimeout(()=>r(!1,L,M),V)):C&&(xe(S),r(!1,L,M))},[b,r]),z=ke(()=>{F.current(),R.current=void 0}),O=ke(()=>{if($.current){const L=et(s.floating).body;L.style.pointerEvents="",L.removeAttribute(hi),$.current=!1}}),A=ke(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);m.useEffect(()=>{if(!l)return;function L(B){if(xe(S),T.current=!1,u&&!Rr(w.current)||tr(y.current)>0&&!er(b.current,"open"))return;const j=er(b.current,"open",w.current);j?S.current=window.setTimeout(()=>{x.current||r(!0,B,"hover")},j):n||r(!0,B,"hover")}function C(B){if(A()){O();return}F.current();const j=et(s.floating);if(xe(P),k.current=!1,v.current&&o.current.floatingContext){n||xe(S),R.current=v.current({...o.current.floatingContext,tree:d,x:B.clientX,y:B.clientY,onClose(){O(),z(),A()||W(B,!0,"safe-polygon")}});const Y=R.current;j.addEventListener("mousemove",Y),F.current=()=>{j.removeEventListener("mousemove",Y)};return}(w.current!=="touch"||!Ft(s.floating,B.relatedTarget))&&W(B)}function M(B){A()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:d,x:B.clientX,y:B.clientY,onClose(){O(),z(),A()||W(B)}})(B))}function V(){xe(S)}function X(B){A()||W(B,!1)}if(K(s.domReference)){const B=s.domReference,j=s.floating;return n&&B.addEventListener("mouseleave",M),h&&B.addEventListener("mousemove",L,{once:!0}),B.addEventListener("mouseenter",L),B.addEventListener("mouseleave",C),j&&(j.addEventListener("mouseleave",M),j.addEventListener("mouseenter",V),j.addEventListener("mouseleave",X)),()=>{n&&B.removeEventListener("mouseleave",M),h&&B.removeEventListener("mousemove",L),B.removeEventListener("mouseenter",L),B.removeEventListener("mouseleave",C),j&&(j.removeEventListener("mouseleave",M),j.removeEventListener("mouseenter",V),j.removeEventListener("mouseleave",X))}}},[s,l,e,u,h,W,z,O,r,n,x,d,b,v,o,A,y]),Ie(()=>{var L;if(l&&n&&(L=v.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&D()){$.current=!0;const M=s.floating;if(K(s.domReference)&&M){var C;const V=et(s.floating).body;V.setAttribute(hi,"");const X=s.domReference,B=d==null||(C=d.nodesRef.current.find(j=>j.id===g))==null||(C=C.context)==null?void 0:C.elements.floating;return B&&(B.style.pointerEvents=""),V.style.pointerEvents="none",X.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{V.style.pointerEvents="",X.style.pointerEvents="",M.style.pointerEvents=""}}}},[l,n,g,s,d,v,D]),Ie(()=>{n||(w.current=void 0,k.current=!1,z(),O())},[n,z,O]),m.useEffect(()=>()=>{z(),xe(S),xe(P),O()},[l,s.domReference,z,O]);const _=m.useMemo(()=>{function L(C){w.current=C.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(C){const{nativeEvent:M}=C;function V(){!T.current&&!x.current&&r(!0,M,"hover")}u&&!Rr(w.current)||n||tr(y.current)===0||k.current&&C.movementX**2+C.movementY**2<2||(xe(P),w.current==="touch"?V():(k.current=!0,P.current=window.setTimeout(V,tr(y.current))))}}},[u,r,n,x,y]);return m.useMemo(()=>l?{reference:_}:{},[l,_])}const Ah=m.createContext(null),gi=Fn("portal");function Fh(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Tl(),o=Nh(),[i,s]=m.useState(null),l=m.useRef(null);return Ie(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Ie(()=>{if(!r||l.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(gi,""),a.appendChild(c),l.current=c,s(c)},[t,r]),Ie(()=>{if(n===null||!r||l.current)return;let a=n||o?.portalNode;a&&!Kr(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(gi,""),a=c||a,a.appendChild(u),l.current=u,s(u)},[t,n,r,o]),i}const Nh=()=>m.useContext(Ah),Ih={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Dh={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},vi=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function jh(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:a=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:g}=t,v=lo(),b=ke(typeof a=="function"?a:()=>!1),x=typeof a=="function"?b:a,y=m.useRef(!1),{escapeKey:w,outsidePress:S}=vi(d),{escapeKey:R,outsidePress:P}=vi(g),T=m.useRef(!1),$=ke(O=>{var A;if(!n||!s||!l||O.key!=="Escape"||T.current)return;const _=(A=i.current.floatingContext)==null?void 0:A.nodeId,L=v?ln(v.nodesRef.current,_):[];if(!w&&(O.stopPropagation(),L.length>0)){let C=!0;if(L.forEach(M=>{var V;if((V=M.context)!=null&&V.open&&!M.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}r(!1,vh(O)?O.nativeEvent:O,"escape-key")}),F=ke(O=>{var A;const _=()=>{var L;$(O),(L=ut(O))==null||L.removeEventListener("keydown",_)};(A=ut(O))==null||A.addEventListener("keydown",_)}),k=ke(O=>{var A;const _=i.current.insideReactTree;i.current.insideReactTree=!1;const L=y.current;if(y.current=!1,c==="click"&&L||_||typeof x=="function"&&!x(O))return;const C=ut(O),M="["+Fn("inert")+"]",V=et(o.floating).querySelectorAll(M);let X=K(C)?C:null;for(;X&&!Ne(X);){const Y=je(X);if(Ne(Y)||!K(Y))break;X=Y}if(V.length&&K(C)&&!ph(C)&&!Ft(C,o.floating)&&Array.from(V).every(Y=>!Ft(X,Y)))return;if(ge(C)&&z){const Y=Ne(C),H=Ee(C),G=/auto|scroll/,pe=Y||G.test(H.overflowX),de=Y||G.test(H.overflowY),lt=pe&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,Et=de&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,at=H.direction==="rtl",Al=Et&&(at?O.offsetX<=C.offsetWidth-C.clientWidth:O.offsetX>C.clientWidth),Fl=lt&&O.offsetY>C.clientHeight;if(Al||Fl)return}const B=(A=i.current.floatingContext)==null?void 0:A.nodeId,j=v&&ln(v.nodesRef.current,B).some(Y=>{var H;return Qn(O,(H=Y.context)==null?void 0:H.elements.floating)});if(Qn(O,o.floating)||Qn(O,o.domReference)||j)return;const ee=v?ln(v.nodesRef.current,B):[];if(ee.length>0){let Y=!0;if(ee.forEach(H=>{var G;if((G=H.context)!=null&&G.open&&!H.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}r(!1,O,"outside-press")}),D=ke(O=>{var A;const _=()=>{var L;k(O),(L=ut(O))==null||L.removeEventListener(c,_)};(A=ut(O))==null||A.addEventListener(c,_)});m.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=w,i.current.__outsidePressBubbles=S;let O=-1;function A(V){r(!1,V,"ancestor-scroll")}function _(){window.clearTimeout(O),T.current=!0}function L(){O=window.setTimeout(()=>{T.current=!1},Sn()?5:0)}const C=et(o.floating);l&&(C.addEventListener("keydown",R?F:$,R),C.addEventListener("compositionstart",_),C.addEventListener("compositionend",L)),x&&C.addEventListener(c,P?D:k,P);let M=[];return h&&(K(o.domReference)&&(M=Ke(o.domReference)),K(o.floating)&&(M=M.concat(Ke(o.floating))),!K(o.reference)&&o.reference&&o.reference.contextElement&&(M=M.concat(Ke(o.reference.contextElement)))),M=M.filter(V=>{var X;return V!==((X=C.defaultView)==null?void 0:X.visualViewport)}),M.forEach(V=>{V.addEventListener("scroll",A,{passive:!0})}),()=>{l&&(C.removeEventListener("keydown",R?F:$,R),C.removeEventListener("compositionstart",_),C.removeEventListener("compositionend",L)),x&&C.removeEventListener(c,P?D:k,P),M.forEach(V=>{V.removeEventListener("scroll",A)}),window.clearTimeout(O)}},[i,o,l,x,c,n,r,h,s,w,S,$,R,F,k,P,D]),m.useEffect(()=>{i.current.insideReactTree=!1},[i,x,c]);const W=m.useMemo(()=>({onKeyDown:$,...u&&{[Ih[f]]:O=>{r(!1,O.nativeEvent,"reference-press")},...f!=="click"&&{onClick(O){r(!1,O.nativeEvent,"reference-press")}}}}),[$,r,u,f]),z=m.useMemo(()=>({onKeyDown:$,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[Dh[c]]:()=>{i.current.insideReactTree=!0}}),[$,c,i]);return m.useMemo(()=>s?{reference:W,floating:z}:{},[s,W,z])}function _h(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Tl(),i=m.useRef({}),[s]=m.useState(()=>Th()),l=Ol()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!K(d)&&Ph("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=m.useState(r.reference),u=ke((d,g,v)=>{i.current.openEvent=d?g:void 0,s.emit("openchange",{open:d,event:g,reason:v,nested:l}),n?.(d,g,v)}),f=m.useMemo(()=>({setPositionReference:c}),[]),h=m.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return m.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:f}),[t,u,h,s,o,f])}function Bh(e){e===void 0&&(e={});const{nodeId:t}=e,n=_h({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=m.useState(null),[l,a]=m.useState(null),u=o?.domReference||i,f=m.useRef(null),h=lo();Ie(()=>{u&&(f.current=u)},[u]);const d=nl({...e,elements:{...o,...l&&{reference:l}}}),g=m.useCallback(w=>{const S=K(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;a(S),d.refs.setReference(S)},[d.refs]),v=m.useCallback(w=>{(K(w)||w===null)&&(f.current=w,s(w)),(K(d.refs.reference.current)||d.refs.reference.current===null||w!==null&&!K(w))&&d.refs.setReference(w)},[d.refs]),b=m.useMemo(()=>({...d.refs,setReference:v,setPositionReference:g,domReference:f}),[d.refs,v,g]),x=m.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),y=m.useMemo(()=>({...d,...r,refs:b,elements:x,nodeId:t}),[d,b,x,t,r]);return Ie(()=>{r.dataRef.current.floatingContext=y;const w=h?.nodesRef.current.find(S=>S.id===t);w&&(w.context=y)}),m.useMemo(()=>({...d,context:y,refs:b,elements:x}),[d,b,x,y])}function nr(){return dh()&&uh()}function Hh(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:l=!0,visibleOnly:a=!0}=t,c=m.useRef(!1),u=m.useRef(-1),f=m.useRef(!0);m.useEffect(()=>{if(!l)return;const d=me(s.domReference);function g(){!n&&ge(s.domReference)&&s.domReference===ui(et(s.domReference))&&(c.current=!0)}function v(){f.current=!0}function b(){f.current=!1}return d.addEventListener("blur",g),nr()&&(d.addEventListener("keydown",v,!0),d.addEventListener("pointerdown",b,!0)),()=>{d.removeEventListener("blur",g),nr()&&(d.removeEventListener("keydown",v,!0),d.removeEventListener("pointerdown",b,!0))}},[s.domReference,n,l]),m.useEffect(()=>{if(!l)return;function d(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(c.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,l]),m.useEffect(()=>()=>{xe(u)},[]);const h=m.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(d){if(c.current)return;const g=ut(d.nativeEvent);if(a&&K(g)){if(nr()&&!d.relatedTarget){if(!f.current&&!hh(g))return}else if(!gh(g))return}r(!0,d.nativeEvent,"focus")},onBlur(d){c.current=!1;const g=d.relatedTarget,v=d.nativeEvent,b=K(g)&&g.hasAttribute(Fn("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var x;const y=ui(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Ft((x=i.current.floatingContext)==null?void 0:x.refs.floating.current,y)||Ft(s.domReference,y)||b||r(!1,v,"focus")})}}),[i,s.domReference,r,a]);return m.useMemo(()=>l?{reference:h}:{},[l,h])}function rr(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[di]:s,[fi]:l,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[Ch]:""},...i,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[di,fi].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var h,d=arguments.length,g=new Array(d),v=0;v<d;v++)g[v]=arguments[v];return(h=r.get(c))==null?void 0:h.map(b=>b(...g)).find(b=>b!==void 0)}}}else s[c]=u}),s),{})}}function Vh(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=m.useCallback(l=>rr(l,e,"reference"),t),i=m.useCallback(l=>rr(l,e,"floating"),n),s=m.useCallback(l=>rr(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function ao({children:e,className:t,content:n,positions:r,showOnFocus:o=!1,showOnHover:i=!0,usePortal:s}){const[l,a]=p.useState(!1),c=Fh({root:document.body}),{refs:u,floatingStyles:f,context:h}=Bh({onOpenChange:a,open:l,middleware:[Zr(4),rl(),km(r?{allowedPlacements:r}:{})]}),d=Mh(h,{enabled:i}),g=Hh(h,{enabled:o}),v=jh(h),{getReferenceProps:b,getFloatingProps:x}=Vh([v,g,d]),y=S=>{if(o)switch(S.key){case"Escape":{a(!1);break}case"Enter":{a(!0);break}}};let w=null;return l&&(w=E.jsx("div",{className:re("bg-white/80 text-black rounded-md px-2 py-1 shadow-md whitespace-nowrap z-40",t),ref:u.setFloating,style:f,...x(),children:n}),s&&c&&(w=Ye.createPortal(w,c))),E.jsxs("div",{className:re("group relative flex justify-center",t),onKeyDown:y,children:[E.jsx("div",{ref:u.setReference,...b(),children:e}),w]})}function bi({ariaLabel:e,children:t,className:n="",onClick:r,title:o}){return E.jsx(ao,{className:n,content:o,children:E.jsx("button",{"aria-label":e||o,className:re("cursor-pointer",n),onClick:r,children:t})})}function co({children:e,className:t,href:n,target:r="_blank",...o}){return E.jsx("a",{className:t,href:n,target:r,rel:"noopener noreferrer",...o,children:e})}function or({ariaLabel:e,children:t,className:n="",title:r,...o}){const i="to"in o?E.jsx(Wt,{"aria-label":e||r,children:t,className:"text-header-icons! cursor-pointer",to:o.to}):E.jsx(co,{"aria-label":e||r,children:t,className:"text-header-icons! cursor-pointer",href:o.href});return E.jsx(ao,{className:n,content:r,children:i})}function Wh({children:e}){return E.jsx("div",{className:"w-full shrink-0 flex flex-col gap-4 py-4 overflow-y-auto",children:e})}function Ll({children:e,commonQuestions:t,overview:n,packageDescription:r,packageName:o,repositoryUrl:i,showOpenCollectLink:s,versions:l}){const[a,c]=p.useState({isNavVisible:!1,isSiteSearchVisible:!1}),u=p.useCallback(d=>c(g=>g.isNavVisible===d?g:{...g,isNavVisible:d}),[]),f=p.useCallback(d=>c(g=>g.isSiteSearchVisible===d?g:{...g,isSiteSearchVisible:d}),[]),h=p.useMemo(()=>({commonQuestions:t,isNavVisible:a.isNavVisible,isSiteSearchVisible:a.isSiteSearchVisible,overview:n,packageDescription:r,packageName:o,repositoryUrl:i.replace(".git",""),setIsNavVisible:u,setIsSiteSearchVisible:f,showOpenCollectLink:!!s,versions:l}),[t,n,r,o,i,u,f,s,a.isNavVisible,a.isSiteSearchVisible,l]);return E.jsx(Wi.Provider,{children:e,value:h})}Ll.displayName="LibraryContextProvider";function zh(){const{setIsNavVisible:e,setIsSiteSearchVisible:t}=Dt(),{pathname:n}=Be();return p.useLayoutEffect(()=>{e(!1),t(!1);const r=document.body.querySelector("[data-main-scrollable]");if(r){const o=setTimeout(()=>{r.scrollTo(0,0)},1);return()=>{clearTimeout(o)}}},[n,e,t]),null}const Uh={"*":p.lazy(()=>Promise.resolve().then(()=>require("./PageNotFound-pPQgf0wT.cjs"))),"/":p.lazy(()=>Promise.resolve().then(()=>require("./GettingStartedRoute-Dj9vAFwF.cjs"))),"/common-questions":p.lazy(()=>Promise.resolve().then(()=>require("./CommonQuestionsRoute-DKgVI5bf.cjs"))),"/support":p.lazy(()=>Promise.resolve().then(()=>require("./SupportRoute-BbSurNA_.cjs"))),"/versions":p.lazy(()=>Promise.resolve().then(()=>require("./VersionsRoute-DpDr0_Rf.cjs")))};function qh(e,t=250){const[n,r]=p.useState(e);return p.useEffect(()=>{if(t===0)p.startTransition(()=>r(e));else{const o=setTimeout(()=>{p.startTransition(()=>r(e))},t);return()=>{clearTimeout(o)}}},[t,e]),n}let ir;function Gh(){return ir===void 0&&(ir=new Promise(e=>{Promise.all([Promise.resolve().then(()=>require("./fuse-CM2wbN_z.cjs")).then(t=>t.default),fetch("/generated/search-records.json").then(t=>t.json()),fetch("/generated/search-index.json").then(t=>t.json())]).then(([t,n,r])=>{const o=new t(n,{ignoreLocation:!0,includeMatches:!1,isCaseSensitive:!1,keys:[{name:"title",weight:5},{name:"section",weight:1},{name:"text",weight:1}],minMatchCharLength:2,threshold:0},t.parseIndex(r));e(o)})})),ir}function Kh({isActive:e,result:{item:{path:t,section:n,text:r,title:o}},searchTextDeferred:i}){const s=p.useRef(null),l=p.useMemo(()=>xi(o,i),[i,o]),a=p.useMemo(()=>r?xi(r,i,{maxLength:150,leading:25}):"",[i,r]);return p.useEffect(()=>{e&&s.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[e]),E.jsx("li",{ref:s,children:E.jsxs(Wt,{className:re("rounded px-2 py-1 text-white/80 hover:text-white hover:bg-white/10 cursor-pointer transition-colors!","flex flex-row items-center gap-2 overflow-auto",{"bg-sky-950 hover:bg-sky-950 text-white":e}),"data-active-search-result":e||void 0,to:t,children:[E.jsxs("div",{className:"grow-1 shrink-1 overflow-auto flex flex-col gap-1",children:[E.jsxs("div",{className:"grow text-lg truncate text-white",children:[n,n&&" ",l]}),a&&E.jsx("div",{className:"text-sm truncate pb-1",children:a})]}),E.jsx($r,{className:"h-4 w-4 shrink-0"})]})})}function xi(e,t,n){const{maxLength:r=250,leading:o=0}=n??{};if(t=t.toLowerCase(),r&&e.length>r){const a=e.toLowerCase().indexOf(t),c=Math.max(0,a-o),u=Math.min(e.length,c+r);e=e.substring(c,u),c>0&&(e="…"+e)}const i=[],s=e.toLowerCase().split(t);let l=0;for(let a=0;a<s.length;a++){const c=s[a];i.push(e.substring(l,l+c.length)),l+=c.length;const u=e.substring(l,l+t.length);u&&i.push(E.jsx("mark",{className:"bg-transparent text-sky-300",children:u},l)),l+=t.length}return l<e.length-1&&i.push(e.substring(l)),i}function Yh({inputRef:e,searchTextDeferred:t}){const n=p.use(Gh()),[r,o]=p.useState(0),i=p.useMemo(()=>t?n.search(t,{limit:10}):[],[n,t]);return p.useEffect(()=>{if(e){const s=l=>{switch(l.key){case"ArrowDown":{const a=r<i.length-1?r+1:0;o(a);break}case"ArrowUp":{const a=r>0?r-1:i.length-1;o(a);break}case"Enter":{const a=document.body.querySelector("[data-active-search-result]");a instanceof HTMLAnchorElement&&a.click();break}}};return e.addEventListener("keydown",s),()=>{e.removeEventListener("keydown",s)}}},[r,e,i,t]),E.jsxs("ul",{className:"border-t border-white/10 pt-3 mt-3 flex flex-col gap-1 overflow-auto",children:[t&&i.length===0&&E.jsxs("div",{children:['No results for "',t,'"']}),i.map((s,l)=>E.jsx(Kh,{isActive:r===l,result:s,searchTextDeferred:t},l))]})}function Xh(){const{isSiteSearchVisible:e,setIsSiteSearchVisible:t}=Dt(),[n,r]=p.useState(null),[o,i]=p.useState(""),s=qh(o);return p.useEffect(()=>{if(!e){const l=a=>{switch(a.key){case"K":case"k":{(a.metaKey||a.ctrlKey)&&t(!0);break}}};return document.body.addEventListener("keydown",l),()=>{document.body.removeEventListener("keydown",l)}}},[e,t]),e?E.jsx("div",{className:"fixed inset-0 backdrop-blur-md p-4 flex flex-col items-center animate duration-500 animate-fade-in",onClick:()=>{i(""),t(!1)},children:E.jsxs("div",{className:"shadow-background-gradient-2/20 shadow-md bg-black/80 rounded-lg py-3 pl-4 pr-3 max-w-full w-200 max-h-full overflow-auto flex flex-col",children:[E.jsxs("div",{className:"flex items-center gap-3 shrink-0",onClick:l=>l.stopPropagation(),children:[E.jsx(yi,{className:"w-4 h-4"}),E.jsx("input",{autoFocus:!0,className:"grow text-lg md:tex-md",onKeyDown:l=>{l.key==="Escape"&&(i(""),t(!1))},onChange:l=>{i(l.currentTarget.value)},ref:r,placeholder:"Search documentation",value:o}),E.jsx("div",{className:"border border-white/20 rounded text-sm px-1 cursor-pointer",onClick:()=>t(!1),children:"esc"})]}),s&&E.jsx(Yh,{inputRef:n,searchTextDeferred:s},s)]})}):null}const Zh=navigator.userAgent.indexOf("Win")>=0?"^K":"⌘K";function Jh({enableSiteSearch:e,navLinks:t,routes:n,...r}){return E.jsx(Ll,{...r,children:E.jsx(Qh,{enableSiteSearch:e,navLinks:t,routes:n})})}function Qh({enableSiteSearch:e,navLinks:t,routes:n}){const{isNavVisible:r,isSiteSearchVisible:o,packageDescription:i,packageName:s,setIsNavVisible:l,setIsSiteSearchVisible:a,versions:c}=Dt();return E.jsxs(mc,{children:[E.jsx(zh,{}),E.jsxs("div",{className:"h-full w-full max-w-350 mx-auto flex flex-col",children:[E.jsxs(he,{align:"center",className:"h-12 w-full p-4",direction:"row",gap:4,children:[E.jsx(Sc,{className:"shrink-0 w-8 h-8"}),E.jsxs(he,{className:"overflow-hidden",align:"center",direction:"row",gap:4,children:[E.jsx(Wt,{children:s,className:"text-xl text-header-package-name! font-bold cursor-pointer truncate",to:"/"}),E.jsx("div",{className:"hidden md:block text-header-package-description",children:i})]}),E.jsx("div",{className:"grow"}),E.jsxs(he,{align:"center",direction:"row",gap:4,children:[e&&E.jsx(bi,{isActive:o,onClick:()=>a(!o),title:"Site search",children:E.jsxs("div",{className:"h-8 flex items-center justify-center gap-1 px-2 rounded-full text-sm bg-black/40 hover:bg-black/60 transition-colors!",children:[E.jsx(yi,{className:"w-4 h-4"}),Zh]})}),c!==void 0&&E.jsx(or,{ariaLabel:"Documentation for other versions",children:E.jsx(Vi,{className:"w-6 h-6"}),title:"Previous versions",to:"/versions"}),E.jsx(or,{ariaLabel:"NPM project page",children:E.jsx(Rc,{className:"w-8 h-8"}),className:"hidden sm:block",href:`https://www.npmjs.com/package/${s}`,title:"NPM package"}),E.jsx(or,{ariaLabel:"GitHub project page",children:E.jsx(Cc,{className:"w-6 h-6"}),className:"hidden sm:block",href:`https://github.com/bvaughn/${s}`,title:"Source code"}),E.jsx(bi,{ariaLabel:"Site navigation menu",className:"block md:hidden",isActive:r,onClick:()=>l(!r),title:r?"Hide menu":"Show menu",children:r?E.jsx(Jl,{className:"w-6 h-6 fill-current drop-shadow-black/20 drop-shadow-xs"}):E.jsx(Bl,{className:"w-6 h-6 fill-current drop-shadow-black/20 drop-shadow-xs"})})]})]}),E.jsxs("div",{className:"grow shrink flex flex-row shadow-lg mx-2 rounded-t-3xl overflow-hidden",children:[E.jsx("section",{className:re("w-full bg-black/90 md:block md:w-80 md:bg-black/80 overflow-auto",{hidden:!r}),children:E.jsx(Wh,{children:t})}),E.jsx("main",{className:re("w-full bg-black/90 relative overflow-auto",{hidden:r}),children:E.jsx("div",{className:"h-full p-4 py-4 overflow-auto [mask-image:linear-gradient(to_bottom,transparent,black_1.5rem)]","data-main-scrollable":!0,children:E.jsx(za,{children:Object.entries({...Uh,...n}).map(([u,f])=>E.jsx(Ni,{element:E.jsx(so,{children:E.jsx(f,{})},u),path:u},u))})})})]})]}),e&&E.jsx(Xh,{})]})}function eg({children:e,className:t,...n}){return E.jsx(so,{children:E.jsx("div",{className:`border-lg bg-black/30 text-slate-300 rounded-lg p-2 ${t}`,...n,children:e})})}const tg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"m424-424-86-86q-11-11-28-11t-28 11q-11 11-11 28t11 28l114 114q12 12 28 12t28-12l226-226q11-11 11-28t-11-28q-11-11-28-11t-28 11L424-424ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})),ng=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"M320-440h320q17 0 28.5-11.5T680-480q0-17-11.5-28.5T640-520H320q-17 0-28.5 11.5T280-480q0 17 11.5 28.5T320-440ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})),rg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"}));function og({checked:e,children:t,className:n,indeterminate:r,onChange:o,...i}){let s,l;return r?(s=ng,l="fill-white"):e?(s=tg,l="fill-blue-600"):(s=rg,l="fill-slate-600"),E.jsxs("label",{className:`cursor-pointer rounded-lg flex flex-row items-center outline-none group ${n}`,"data-focus-within":!0,...i,children:[E.jsx("input",{checked:e,className:"w-0 h-0",onChange:a=>{o(a.currentTarget.checked)},type:"checkbox"}),E.jsx(s,{className:l}),t&&E.jsxs(E.Fragment,{children:[" ",t]})]})}function uo({className:e="",html:t}){return E.jsx("div",{className:"relative",children:E.jsx("code",{className:re("text-sm md:text-base block text-left whitespace-pre-wrap break-normal text-white! rounded-md p-3 bg-black","flex flex-col",e),dangerouslySetInnerHTML:{__html:t}})})}function zt({className:e,sections:t}){return E.jsx(he,{className:e,direction:"column",gap:2,children:t.map(({content:n,intent:r},o)=>r?E.jsx(Fr,{html:!0,inline:!0,intent:r,minimal:!0,children:n},o):E.jsx("div",{dangerouslySetInnerHTML:{__html:n.replaceAll("<ul>",'<ul class="list-disc pl-4">')}},o))})}function fo({section:e,sourceCodePath:t,title:n}){const{repositoryUrl:r}=Dt();return E.jsxs(E.Fragment,{children:[E.jsxs("header",{className:"text-xl",children:[e&&E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"text-xl whitespace-nowrap","data-section":!0,children:e})," ",E.jsx($r,{className:"size-4 text-slate-400 inline"})," "]}),E.jsx("span",{className:"text-xl","data-title":!0,children:n}),t&&E.jsx(co,{className:"text-sm text-emerald-300 hover:text-white",href:`${r}/blob/main/${t}`,children:E.jsx(jl,{className:"inline-block size-4 fill-current ml-2 mb-1"})})]}),E.jsx("title",{children:e?`${e}: ${n}`:n})]})}function ig({method:e}){return E.jsxs(E.Fragment,{children:[E.jsx("dd",{className:"[&_code]:text-sky-300 text-lg font-bold",children:e.name}),E.jsxs("dt",{className:"mb-2",children:[E.jsx(zt,{sections:e.description}),E.jsx(uo,{className:"mt-2 p-2 flex flex-col",html:e.html})]})]})}function sg({json:e,section:t}){return E.jsxs(he,{direction:"column",gap:4,children:[E.jsx(fo,{section:t,sourceCodePath:e.filePath,title:`${e.name}`}),E.jsx(zt,{sections:e.description}),E.jsx(he,{direction:"column",children:E.jsx("dl",{className:"flex flex-col gap-2",children:e.methods.map((n,r)=>E.jsx(ig,{method:n},r))})})]})}function lg({children:e,className:t,onChange:n,value:r,...o}){return E.jsx("input",{className:`rounded-md bg-black/30 border border-2 border-transparent py-1 px-2 outline-none focus:border-emerald-300 ${t}`,"data-focus":!0,onChange:i=>{n(i.currentTarget.value)},value:r,...o,children:e})}function ag(){return E.jsxs(he,{align:"center",className:"text-slate-300",direction:"row",gap:2,children:[E.jsx(Il,{className:"size-4 animate-spin"}),"Loading..."]})}function Ml({children:e,className:t,disabled:n}){return E.jsx(he,{align:"center",className:re("px-4 h-8 cursor-pointer text-white/90 hover:text-white focus:bg-white/10 focus-within:bg-white/10",{"pointer-events-none text-white/50":n},t),direction:"row",gap:1,children:e})}function cg({children:e,className:t,path:n}){return E.jsx(Wt,{to:n,children:({isActive:r,isPending:o})=>E.jsx(Ml,{className:re("px-4 cursor-pointer",{"font-bold text-nav-active hover:text-nav-hover":r,"opacity-50 pointer-events-none":o},t),children:E.jsx(he,{align:"center",direction:"row",gap:2,children:e})})})}function ug({children:e,label:t}){return E.jsxs(_p,{as:"section",defaultOpen:!0,children:[E.jsx(xl,{className:"w-full group border-none! data-focus:bg-white/10",children:E.jsxs(Ml,{children:[E.jsx("div",{className:"uppercase text-sm font-bold text-white/50",children:t}),E.jsx("div",{className:"grow"}),E.jsx($r,{className:"size-4 fill-white/60 group-data-hover:fill-white/50 group-data-open:rotate-90"})]})}),E.jsx(wl,{className:"pl-4",children:e})]})}function dg(e){const t=[],n=[];return Object.values(e.props).forEach(r=>{r.required?n.push(r):t.push(r)}),t.sort((r,o)=>r.name.localeCompare(o.name)),n.sort((r,o)=>r.name.localeCompare(o.name)),{optionalProps:t,requiredProps:n}}function fg({prop:e}){return E.jsxs(E.Fragment,{children:[E.jsx("dt",{className:"mt-6 pl-8 indent-[-1rem]",children:E.jsx(uo,{className:"bg-transparent inline-flex flex-col p-0",html:e.html})}),E.jsx("dd",{className:"mt-2 pl-4 [&_code]:text-sky-300",children:E.jsx(zt,{sections:e.description})})]})}function kr({header:e,props:t}){return t.length===0?null:E.jsxs(he,{direction:"column",children:[E.jsx("div",{className:"text-lg font-bold",children:e}),E.jsx("dl",{children:t.map(n=>E.jsx(fg,{prop:n},n.name))})]})}function mg({json:e,section:t}){const{optionalProps:n,requiredProps:r}=p.useMemo(()=>dg(e),[e]);return E.jsxs(he,{direction:"column",gap:4,children:[E.jsx(fo,{section:t,sourceCodePath:e.filePath,title:`${e.name} component`}),E.jsx(zt,{sections:e.description}),E.jsx(kr,{header:"Required props",props:r}),E.jsx(kr,{header:"Optional props",props:n})]})}const pg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"m424-408-86-86q-11-11-28-11t-28 11q-11 11-11 28t11 28l114 114q12 12 28 12t28-12l226-226q11-11 11-28t-11-28q-11-11-28-11t-28 11L424-408Zm56 328q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"})),hg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"}));function gg({checked:e,children:t,className:n,name:r,onChange:o,value:i,...s}){let l,a;return e?(l=pg,a="fill-blue-600"):(l=hg,a="fill-slate-600"),E.jsxs("label",{className:`cursor-pointer rounded-full flex flex-row items-center outline-none group ${n}`,"data-focus-within":!0,...s,children:[E.jsx("input",{checked:e,className:"w-0 h-0",name:r,onChange:()=>{o(i)},type:"radio",value:i}),E.jsx(l,{className:a}),t&&E.jsxs(E.Fragment,{children:[" ",t]})]})}function vg({className:e,defaultValue:t,onChange:n,options:r,placeholder:o="",value:i}){return E.jsx(ih,{value:i??t,onChange:n,children:E.jsxs("div",{className:`relative ${e}`,children:[E.jsxs(Sl,{className:"w-full h-9 text-left rounded-md bg-black/30 border border-2 border-transparent py-1 px-2 outline-none focus:border-teal-300","data-focus":!0,children:[i?.label?E.jsx("span",{className:"block truncate",children:i.label}):E.jsx("span",{className:"block truncate text-slate-500",children:o}),E.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:E.jsx(Ul,{className:"h-4 w-4 text-gray-400","aria-hidden":"true"})})]}),E.jsx(Rp,{as:p.Fragment,leaveFrom:"opacity-100",leaveTo:"opacity-0",children:E.jsx(kl,{className:"absolute z-10 mt-1 max-h-50 w-full overflow-auto rounded-md py-1 bg-black/90","data-focus":!0,children:r.map((s,l)=>E.jsx($l,{className:re("relative cursor-pointer select-none h-7 py-1 px-2 text-slate-300 border-none!","data-focus:text-teal-300 data-focus:bg-black","data-active:text-teal-300 data-active:bg-black","data-selected:text-teal-300 data-selected:font-bold"),value:s,children:s.label},l))})})]})})}function bg(e,t){switch(e){case"danger":return t?"bg-red-950 text-red-300 [&_svg]:text-red-500":"bg-black/10 bg-border border-2 border-red-500 text-white [&_svg]:text-red-500 [&_a]:text-red-400!";case"none":return t?"bg-white/10 text-slate-300 [&_svg]:text-slate-400":"bg-black/10 bg-border border-2 border-white/40 text-white [&_svg]:text-white/60";case"primary":return t?"bg-sky-950 text-sky-300 [&_svg]:text-sky-400":"bg-black/10 bg-border border-2 border-sky-400 text-white [&_svg]:text-sky-400";case"success":return t?"bg-emerald-950 text-emerald-300 [&_svg]:text-emerald-400":"bg-black/10 bg-border border-2 border-emerald-400 text-white [&_svg]:text-emerald-400";case"warning":return t?"bg-amber-950/65 text-amber-200 [&_svg]:text-amber-300":"bg-black/10 bg-border border-2 border-amber-400 text-white [&_svg]:text-amber-400 [&_a]:text-amber-400!"}}exports.AppRoot=Jh;exports.Block=eg;exports.Box=he;exports.Button=Pl;exports.Callout=Fr;exports.Checkbox=og;exports.Code=uo;exports.ComponentProps=mg;exports.ComponentPropsSection=kr;exports.DocsSection=zt;exports.ErrorBoundary=so;exports.ExternalLink=co;exports.Header=fo;exports.ImperativeHandle=sg;exports.Input=lg;exports.Link=Wt;exports.LoadingSpinner=ag;exports.NavLink=cg;exports.NavSection=ug;exports.Radio=gg;exports.Select=vg;exports.SvgTags=Vi;exports.Tooltip=ao;exports.assert=zi;exports.cn=re;exports.getIntentClassNames=bg;exports.useLibraryContext=Dt;
8
- //# sourceMappingURL=index-BWhTJgvX.cjs.map
7
+ `)),[]});var bf=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(bf||{});function qr(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Gr(e,t,n,r){let[o,i]=p.useState(n),{hasFlag:s,addFlag:l,removeFlag:a}=vf(e&&o?3:0),c=p.useRef(!1),u=p.useRef(!1),f=ot();return te(()=>{var h;if(e){if(n&&i(!0),!t){n&&l(3);return}return(h=r?.start)==null||h.call(r,n),xf(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(l(3),a(4)):(l(4),a(2)))},run(){u.current?n?(a(3),l(4)):(a(4),l(3)):n?a(1):l(1)},done(){var d;u.current&&Ef(t)||(c.current=!1,a(7),n||i(!1),(d=r?.end)==null||d.call(r,n))}})}},[e,n,t,f]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function xf(e,{prepare:t,run:n,done:r,inFlight:o}){let i=ve();return yf(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(wf(e,r))})}),i.dispose}function wf(e,t){var n,r;let o=ve();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(l=>l.finished)).then(()=>{i||t()}),o.dispose)}function yf(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Ef(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function Cn(){return typeof window<"u"}function wt(e){return Kr(e)?(e.nodeName||"").toLowerCase():"#document"}function me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Le(e){var t;return(t=(Kr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kr(e){return Cn()?e instanceof Node||e instanceof me(e).Node:!1}function K(e){return Cn()?e instanceof Element||e instanceof me(e).Element:!1}function ge(e){return Cn()?e instanceof HTMLElement||e instanceof me(e).HTMLElement:!1}function wr(e){return!Cn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof me(e).ShadowRoot}const Cf=new Set(["inline","contents"]);function Bt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Cf.has(o)}const Rf=new Set(["table","td","th"]);function Sf(e){return Rf.has(wt(e))}const kf=[":popover-open",":modal"];function Rn(e){return kf.some(t=>{try{return e.matches(t)}catch{return!1}})}const $f=["transform","translate","scale","rotate","perspective"],Pf=["transform","translate","scale","rotate","perspective","filter"],Tf=["paint","layout","strict","content"];function Yr(e){const t=Sn(),n=K(e)?Ee(e):e;return $f.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Pf.some(r=>(n.willChange||"").includes(r))||Tf.some(r=>(n.contain||"").includes(r))}function Of(e){let t=je(e);for(;ge(t)&&!Ne(t);){if(Yr(t))return t;if(Rn(t))return null;t=je(t)}return null}function Sn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Lf=new Set(["html","body","#document"]);function Ne(e){return Lf.has(wt(e))}function Ee(e){return me(e).getComputedStyle(e)}function kn(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wr(e)&&e.host||Le(e);return wr(t)?t.host:t}function zs(e){const t=je(e);return Ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&Bt(t)?t:zs(t)}function Ke(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=zs(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=me(o);if(i){const l=yr(s);return t.concat(s,s.visualViewport||[],Bt(o)?o:[],l&&n?Ke(l):[])}return t.concat(o,Ke(o,[],n))}function yr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mf(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const Af=["top","right","bottom","left"],Vo=["start","end"],Wo=Af.reduce((e,t)=>e.concat(t,t+"-"+Vo[0],t+"-"+Vo[1]),[]),nt=Math.min,se=Math.max,Mt=Math.round,Jt=Math.floor,Pe=e=>({x:e,y:e}),Ff={left:"right",right:"left",bottom:"top",top:"bottom"},Nf={start:"end",end:"start"};function zo(e,t,n){return se(e,nt(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function Oe(e){return e.split("-")[0]}function Te(e){return e.split("-")[1]}function Us(e){return e==="x"?"y":"x"}function qs(e){return e==="y"?"height":"width"}const If=new Set(["top","bottom"]);function Ae(e){return If.has(Oe(e))?"y":"x"}function Gs(e){return Us(Ae(e))}function Ks(e,t,n){n===void 0&&(n=!1);const r=Te(e),o=Gs(e),i=qs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pn(s)),[s,pn(s)]}function Df(e){const t=pn(e);return[mn(e),t,mn(t)]}function mn(e){return e.replace(/start|end/g,t=>Nf[t])}const Uo=["left","right"],qo=["right","left"],jf=["top","bottom"],_f=["bottom","top"];function Bf(e,t,n){switch(e){case"top":case"bottom":return n?t?qo:Uo:t?Uo:qo;case"left":case"right":return t?jf:_f;default:return[]}}function Hf(e,t,n,r){const o=Te(e);let i=Bf(Oe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(mn)))),i}function pn(e){return e.replace(/left|right|bottom|top/g,t=>Ff[t])}function Vf(e){return{top:0,right:0,bottom:0,left:0,...e}}function Wf(e){return typeof e!="number"?Vf(e):{top:e,right:e,bottom:e,left:e}}function hn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Go(e,t,n){let{reference:r,floating:o}=e;const i=Ae(t),s=Gs(t),l=qs(s),a=Oe(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let d;switch(a){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Te(t)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1);break}return d}const zf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Go(c,r,a),h=r,d={},g=0;for(let v=0;v<l.length;v++){const{name:b,fn:x}=l[v],{x:y,y:w,data:S,reset:R}=await x({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:d,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=w??f,d={...d,[b]:{...d[b],...S}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(c=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:u,y:f}=Go(c,h,a)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:d}};async function Ht(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=st(t,e),g=Wf(d),b=l[h?f==="floating"?"reference":"floating":f],x=hn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},R=hn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(x.top-R.top+g.top)/S.y,bottom:(R.bottom-x.bottom+g.bottom)/S.y,left:(x.left-R.left+g.left)/S.x,right:(R.right-x.right+g.right)/S.x}}function Uf(e,t,n){return(e?[...n.filter(o=>Te(o)===e),...n.filter(o=>Te(o)!==e)]:n.filter(o=>Oe(o)===o)).filter(o=>e?Te(o)===e||(t?mn(o)!==o:!1):!0)}const qf=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:s,placement:l,platform:a,elements:c}=t,{crossAxis:u=!1,alignment:f,allowedPlacements:h=Wo,autoAlignment:d=!0,...g}=st(e,t),v=f!==void 0||h===Wo?Uf(f||null,d,h):h,b=await Ht(t,g),x=((n=s.autoPlacement)==null?void 0:n.index)||0,y=v[x];if(y==null)return{};const w=Ks(y,i,await(a.isRTL==null?void 0:a.isRTL(c.floating)));if(l!==y)return{reset:{placement:v[0]}};const S=[b[Oe(y)],b[w[0]],b[w[1]]],R=[...((r=s.autoPlacement)==null?void 0:r.overflows)||[],{placement:y,overflows:S}],P=v[x+1];if(P)return{data:{index:x+1,overflows:R},reset:{placement:P}};const T=R.map(k=>{const D=Te(k.placement);return[k.placement,D&&u?k.overflows.slice(0,2).reduce((W,z)=>W+z,0):k.overflows[0],k.overflows]}).sort((k,D)=>k[1]-D[1]),F=((o=T.filter(k=>k[2].slice(0,Te(k[0])?2:3).every(D=>D<=0))[0])==null?void 0:o[0])||T[0][0];return F!==l?{data:{index:x+1,overflows:R},reset:{placement:F}}:{}}}},Gf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...b}=st(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Oe(o),y=Ae(l),w=Oe(l)===l,S=await(a.isRTL==null?void 0:a.isRTL(c.floating)),R=h||(w||!v?[pn(l)]:Df(l)),P=g!=="none";!h&&P&&R.push(...Hf(l,v,g,S));const T=[l,...R],$=await Ht(t,b),F=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&F.push($[x]),f){const O=Ks(o,s,S);F.push($[O[0]],$[O[1]])}if(k=[...k,{placement:o,overflows:F}],!F.every(O=>O<=0)){var D,W;const O=(((D=i.flip)==null?void 0:D.index)||0)+1,A=T[O];if(A&&(!(f==="alignment"?y!==Ae(A):!1)||k.every(C=>Ae(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:O,overflows:k},reset:{placement:A}};let _=(W=k.filter(L=>L.overflows[0]<=0).sort((L,C)=>L.overflows[1]-C.overflows[1])[0])==null?void 0:W.placement;if(!_)switch(d){case"bestFit":{var z;const L=(z=k.filter(C=>{if(P){const M=Ae(C.placement);return M===y||M==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(M=>M>0).reduce((M,V)=>M+V,0)]).sort((C,M)=>C[1]-M[1])[0])==null?void 0:z[0];L&&(_=L);break}case"initialPlacement":_=l;break}if(o!==_)return{reset:{placement:_}}}return{}}}},Kf=new Set(["left","top"]);async function Yf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Oe(n),l=Te(n),a=Ae(n)==="y",c=Kf.has(s)?-1:1,u=i&&a?-1:1,f=st(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(d=l==="end"?g*-1:g),a?{x:d*u,y:h*c}:{x:h*c,y:d*u}}const Xf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,a=await Yf(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:s}}}}},Zf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y}=b;return{x,y}}},...a}=st(e,t),c={x:n,y:r},u=await Ht(t,a),f=Ae(Oe(o)),h=Us(f);let d=c[h],g=c[f];if(i){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=d+u[b],w=d-u[x];d=zo(y,d,w)}if(s){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+u[b],w=g-u[x];g=zo(y,g,w)}const v=l.fn({...t,[h]:d,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[f]:s}}}}}},Jf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:a=()=>{},...c}=st(e,t),u=await Ht(t,c),f=Oe(o),h=Te(o),d=Ae(o)==="y",{width:g,height:v}=i.floating;let b,x;f==="top"||f==="bottom"?(b=f,x=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,b=h==="end"?"top":"bottom");const y=v-u.top-u.bottom,w=g-u.left-u.right,S=nt(v-u[b],y),R=nt(g-u[x],w),P=!t.middlewareData.shift;let T=S,$=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=y),P&&!h){const k=se(u.left,0),D=se(u.right,0),W=se(u.top,0),z=se(u.bottom,0);d?$=g-2*(k!==0||D!==0?k+D:se(u.left,u.right)):T=v-2*(W!==0||z!==0?W+z:se(u.top,u.bottom))}await a({...t,availableWidth:$,availableHeight:T});const F=await s.getDimensions(l.floating);return g!==F.width||v!==F.height?{reset:{rects:!0}}:{}}}};function Ys(e){const t=Ee(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ge(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=Mt(n)!==i||Mt(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Xr(e){return K(e)?e:e.contextElement}function mt(e){const t=Xr(e);if(!ge(t))return Pe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ys(t);let s=(i?Mt(n.width):n.width)/r,l=(i?Mt(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Qf=Pe(0);function Xs(e){const t=me(e);return!Sn()||!t.visualViewport?Qf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function em(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==me(e)?!1:t}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Xr(e);let s=Pe(1);t&&(r?K(r)&&(s=mt(r)):s=mt(e));const l=em(i,n,r)?Xs(i):Pe(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=me(i),d=r&&K(r)?me(r):r;let g=h,v=yr(g);for(;v&&r&&d!==g;){const b=mt(v),x=v.getBoundingClientRect(),y=Ee(v),w=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,f*=b.y,a+=w,c+=S,g=me(v),v=yr(g)}}return hn({width:u,height:f,x:a,y:c})}function $n(e,t){const n=kn(e).scrollLeft;return t?t.left+n:rt(Le(e)).left+n}function Zs(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$n(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function tm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Le(r),l=t?Rn(t.floating):!1;if(r===s||l&&i)return n;let a={scrollLeft:0,scrollTop:0},c=Pe(1);const u=Pe(0),f=ge(r);if((f||!f&&!i)&&((wt(r)!=="body"||Bt(s))&&(a=kn(r)),ge(r))){const d=rt(r);c=mt(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const h=s&&!f&&!i?Zs(s,a):Pe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-a.scrollTop*c.y+u.y+h.y}}function nm(e){return Array.from(e.getClientRects())}function rm(e){const t=Le(e),n=kn(e),r=e.ownerDocument.body,o=se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+$n(e);const l=-n.scrollTop;return Ee(r).direction==="rtl"&&(s+=se(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ko=25;function om(e,t){const n=me(e),r=Le(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;const u=Sn();(!u||u&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}const c=$n(r);if(c<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-d);g<=Ko&&(i-=g)}else c<=Ko&&(i+=c);return{width:i,height:s,x:l,y:a}}const im=new Set(["absolute","fixed"]);function sm(e,t){const n=rt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ge(e)?mt(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,a=o*i.x,c=r*i.y;return{width:s,height:l,x:a,y:c}}function Yo(e,t,n){let r;if(t==="viewport")r=om(e,n);else if(t==="document")r=rm(Le(e));else if(K(t))r=sm(t,n);else{const o=Xs(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return hn(r)}function Js(e,t){const n=je(e);return n===t||!K(n)||Ne(n)?!1:Ee(n).position==="fixed"||Js(n,t)}function lm(e,t){const n=t.get(e);if(n)return n;let r=Ke(e,[],!1).filter(l=>K(l)&&wt(l)!=="body"),o=null;const i=Ee(e).position==="fixed";let s=i?je(e):e;for(;K(s)&&!Ne(s);){const l=Ee(s),a=Yr(s);!a&&l.position==="fixed"&&(o=null),(i?!a&&!o:!a&&l.position==="static"&&!!o&&im.has(o.position)||Bt(s)&&!a&&Js(e,s))?r=r.filter(u=>u!==s):o=l,s=je(s)}return t.set(e,r),r}function am(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Rn(t)?[]:lm(t,this._c):[].concat(n),r],l=s[0],a=s.reduce((c,u)=>{const f=Yo(t,u,o);return c.top=se(f.top,c.top),c.right=nt(f.right,c.right),c.bottom=nt(f.bottom,c.bottom),c.left=se(f.left,c.left),c},Yo(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function cm(e){const{width:t,height:n}=Ys(e);return{width:t,height:n}}function um(e,t,n){const r=ge(t),o=Le(t),i=n==="fixed",s=rt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const a=Pe(0);function c(){a.x=$n(o)}if(r||!r&&!i)if((wt(t)!=="body"||Bt(o))&&(l=kn(t)),r){const d=rt(t,!0,i,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?Zs(o,l):Pe(0),f=s.left+l.scrollLeft-a.x-u.x,h=s.top+l.scrollTop-a.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function Kn(e){return Ee(e).position==="static"}function Xo(e,t){if(!ge(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Le(e)===n&&(n=n.ownerDocument.body),n}function Qs(e,t){const n=me(e);if(Rn(e))return n;if(!ge(e)){let o=je(e);for(;o&&!Ne(o);){if(K(o)&&!Kn(o))return o;o=je(o)}return n}let r=Xo(e,t);for(;r&&Sf(r)&&Kn(r);)r=Xo(r,t);return r&&Ne(r)&&Kn(r)&&!Yr(r)?n:r||Of(e)||n}const dm=async function(e){const t=this.getOffsetParent||Qs,n=this.getDimensions,r=await n(e.floating);return{reference:um(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fm(e){return Ee(e).direction==="rtl"}const mm={convertOffsetParentRelativeRectToViewportRelativeRect:tm,getDocumentElement:Le,getClippingRect:am,getOffsetParent:Qs,getElementRects:dm,getClientRects:nm,getDimensions:cm,getScale:mt,isElement:K,isRTL:fm};function el(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pm(e,t){let n=null,r;const o=Le(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:h,height:d}=c;if(l||t(),!h||!d)return;const g=Jt(f),v=Jt(o.clientWidth-(u+h)),b=Jt(o.clientHeight-(f+d)),x=Jt(u),w={rootMargin:-g+"px "+-v+"px "+-b+"px "+-x+"px",threshold:se(0,nt(1,a))||1};let S=!0;function R(P){const T=P[0].intersectionRatio;if(T!==a){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!el(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(R,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,w)}n.observe(e)}return s(!0),i}function hm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Xr(e),u=o||i?[...c?Ke(c):[],...Ke(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&l?pm(c,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),c&&!a&&d.observe(c),d.observe(t));let g,v=a?rt(e):null;a&&b();function b(){const x=rt(e);v&&!el(v,x)&&n(),v=x,g=requestAnimationFrame(b)}return n(),()=>{var x;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(x=d)==null||x.disconnect(),d=null,a&&cancelAnimationFrame(g)}}const Yn=Ht,gm=Xf,vm=qf,bm=Zf,xm=Gf,wm=Jf,ym=(e,t,n)=>{const r=new Map,o={platform:mm,...n},i={...o.platform,_c:r};return zf(e,t,{...o,platform:i})};var Em=typeof document<"u",Cm=function(){},rn=Em?p.useLayoutEffect:Cm;function gn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!gn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function tl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zo(e,t){const n=tl(e);return Math.round(t*n)/n}function Xn(e){const t=m.useRef(e);return rn(()=>{t.current=e}),t}function nl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=m.useState(r);gn(h,r)||d(r);const[g,v]=m.useState(null),[b,x]=m.useState(null),y=m.useCallback(C=>{C!==P.current&&(P.current=C,v(C))},[]),w=m.useCallback(C=>{C!==T.current&&(T.current=C,x(C))},[]),S=i||g,R=s||b,P=m.useRef(null),T=m.useRef(null),$=m.useRef(u),F=a!=null,k=Xn(a),D=Xn(o),W=Xn(c),z=m.useCallback(()=>{if(!P.current||!T.current)return;const C={placement:t,strategy:n,middleware:h};D.current&&(C.platform=D.current),ym(P.current,T.current,C).then(M=>{const V={...M,isPositioned:W.current!==!1};O.current&&!gn($.current,V)&&($.current=V,an.flushSync(()=>{f(V)}))})},[h,t,n,D,W]);rn(()=>{c===!1&&$.current.isPositioned&&($.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[c]);const O=m.useRef(!1);rn(()=>(O.current=!0,()=>{O.current=!1}),[]),rn(()=>{if(S&&(P.current=S),R&&(T.current=R),S&&R){if(k.current)return k.current(S,R,z);z()}},[S,R,z,k,F]);const A=m.useMemo(()=>({reference:P,floating:T,setReference:y,setFloating:w}),[y,w]),_=m.useMemo(()=>({reference:S,floating:R}),[S,R]),L=m.useMemo(()=>{const C={position:n,left:0,top:0};if(!_.floating)return C;const M=Zo(_.floating,u.x),V=Zo(_.floating,u.y);return l?{...C,transform:"translate("+M+"px, "+V+"px)",...tl(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:V}},[n,l,_.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:z,refs:A,elements:_,floatingStyles:L}),[u,z,A,_,L])}const Zr=(e,t)=>({...gm(e),options:[e,t]}),rl=(e,t)=>({...bm(e),options:[e,t]}),Rm=(e,t)=>({...xm(e),options:[e,t]}),Sm=(e,t)=>({...wm(e),options:[e,t]}),km=(e,t)=>({...vm(e),options:[e,t]}),ol={...m},$m=ol.useInsertionEffect,Pm=$m||(e=>e());function il(e){const t=m.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Pm(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Er=typeof document<"u"?p.useLayoutEffect:p.useEffect;let Jo=!1,Tm=0;const Qo=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Tm++;function Om(){const[e,t]=m.useState(()=>Jo?Qo():void 0);return Er(()=>{e==null&&t(Qo())},[]),m.useEffect(()=>{Jo=!0},[]),e}const Lm=ol.useId,Mm=Lm||Om;let At;process.env.NODE_ENV!=="production"&&(At=new Set);function Am(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=At)!=null&&e.has(o))){var i;(i=At)==null||i.add(o),console.warn(o)}}function Fm(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=At)!=null&&e.has(o))){var i;(i=At)==null||i.add(o),console.error(o)}}function Nm(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Im=m.createContext(null),Dm=m.createContext(null),jm=()=>{var e;return((e=m.useContext(Im))==null?void 0:e.id)||null},_m=()=>m.useContext(Dm),Bm="data-floating-ui-focusable";function Hm(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Mm(),i=m.useRef({}),[s]=m.useState(()=>Nm()),l=jm()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!K(d)&&Fm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=m.useState(r.reference),u=il((d,g,v)=>{i.current.openEvent=d?g:void 0,s.emit("openchange",{open:d,event:g,reason:v,nested:l}),n?.(d,g,v)}),f=m.useMemo(()=>({setPositionReference:c}),[]),h=m.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return m.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:f}),[t,u,h,s,o,f])}function Vm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Hm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=m.useState(null),[l,a]=m.useState(null),u=o?.domReference||i,f=m.useRef(null),h=_m();Er(()=>{u&&(f.current=u)},[u]);const d=nl({...e,elements:{...o,...l&&{reference:l}}}),g=m.useCallback(w=>{const S=K(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;a(S),d.refs.setReference(S)},[d.refs]),v=m.useCallback(w=>{(K(w)||w===null)&&(f.current=w,s(w)),(K(d.refs.reference.current)||d.refs.reference.current===null||w!==null&&!K(w))&&d.refs.setReference(w)},[d.refs]),b=m.useMemo(()=>({...d.refs,setReference:v,setPositionReference:g,domReference:f}),[d.refs,v,g]),x=m.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),y=m.useMemo(()=>({...d,...r,refs:b,elements:x,nodeId:t}),[d,b,x,t,r]);return Er(()=>{r.dataRef.current.floatingContext=y;const w=h?.nodesRef.current.find(S=>S.id===t);w&&(w.context=y)}),m.useMemo(()=>({...d,context:y,refs:b,elements:x}),[d,b,x,y])}const ei="active",ti="selected";function Zn(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[ei]:s,[ti]:l,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[Bm]:""},...i,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[ei,ti].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var h,d=arguments.length,g=new Array(d),v=0;v<d;v++)g[v]=arguments[v];return(h=r.get(c))==null?void 0:h.map(b=>b(...g)).find(b=>b!==void 0)}}}else s[c]=u}),s),{})}}function Wm(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=m.useCallback(l=>Zn(l,e,"reference"),t),i=m.useCallback(l=>Zn(l,e,"floating"),n),s=m.useCallback(l=>Zn(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function ni(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const zm=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:l=4,referenceOverflowThreshold:a=0,scrollRef:c,...u}=st(e,t),{rects:f,elements:{floating:h}}=t,d=n.current[s],g=c?.current||h,v=h.clientTop||g.clientTop,b=h.clientTop!==0,x=g.clientTop!==0,y=h===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Am('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const w={...t,...await Zr(-d.offsetTop-h.clientTop-f.reference.height/2-d.offsetHeight/2-i).fn(t)},S=await Yn(ni(w,g.scrollHeight+v+h.clientTop),u),R=await Yn(w,{...u,elementContext:"reference"}),P=se(0,S.top),T=w.y+P,k=(g.scrollHeight>g.clientHeight?D=>D:Mt)(se(0,g.scrollHeight+(b&&y||x?v*2:0)-P-se(0,S.bottom)));if(g.style.maxHeight=k+"px",g.scrollTop=P,o){const D=g.offsetHeight<d.offsetHeight*nt(l,n.current.length)-1||R.top>=-a||R.bottom>=-a;an.flushSync(()=>o(D))}return r&&(r.current=await Yn(ni({...w,y:T},g.offsetHeight+v+h.clientTop),u)),{y:T}}});function Um(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:l}=t,a=il(l),c=m.useRef(!1),u=m.useRef(null),f=m.useRef(null);m.useEffect(()=>{if(!o)return;function d(v){if(v.ctrlKey||!g||i.current==null)return;const b=v.deltaY,x=i.current.top>=-.5,y=i.current.bottom>=-.5,w=g.scrollHeight-g.clientHeight,S=b<0?-1:1,R=b<0?"max":"min";g.scrollHeight<=g.clientHeight||(!x&&b>0||!y&&b<0?(v.preventDefault(),an.flushSync(()=>{a(P=>P+Math[R](b,w*S))})):/firefox/i.test(Mf())&&(g.scrollTop+=b))}const g=s?.current||r.floating;if(n&&g)return g.addEventListener("wheel",d),requestAnimationFrame(()=>{u.current=g.scrollTop,i.current!=null&&(f.current={...i.current})}),()=>{u.current=null,f.current=null,g.removeEventListener("wheel",d)}},[o,n,r.floating,i,s,a]);const h=m.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const d=s?.current||r.floating;if(!(!i.current||!d||!c.current)){if(u.current!==null){const g=d.scrollTop-u.current;(i.current.bottom<-.5&&g<-1||i.current.top<-.5&&g>1)&&an.flushSync(()=>a(v=>v+g))}requestAnimationFrame(()=>{u.current=d.scrollTop})}}}),[r.floating,a,i,s]);return m.useMemo(()=>o?{floating:h}:{},[o,h])}let yt=p.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});yt.displayName="FloatingContext";let Jr=p.createContext(null);Jr.displayName="PlacementContext";function qm(e){return p.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Gm(){return p.useContext(yt).setReference}function Km(){return p.useContext(yt).getReferenceProps}function Ym(){let{getFloatingProps:e,slot:t}=p.useContext(yt);return p.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Xm(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=p.useContext(Jr),n=p.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i?.outerHTML)!=null?s:i})]);te(()=>{t?.(n??null)},[t,n]);let r=p.useContext(yt);return p.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let ri=4;function Zm({children:e,enabled:t=!0}){let[n,r]=p.useState(null),[o,i]=p.useState(0),s=p.useRef(null),[l,a]=p.useState(null);Jm(l);let c=t&&n!==null&&l!==null,{to:u="bottom",gap:f=0,offset:h=0,padding:d=0,inner:g}=Qm(n,l),[v,b="center"]=u.split(" ");te(()=>{c&&i(0)},[c]);let{refs:x,floatingStyles:y,context:w}=Vm({open:c,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[Zr({mainAxis:v==="selection"?0:f,crossAxis:h}),rl({padding:d}),v!=="selection"&&Rm({padding:d}),v==="selection"&&g?zm({...g,padding:d,overflowRef:s,offset:o,minItemsVisible:ri,referenceOverflowThreshold:d,onFallbackChange(D){var W,z;if(!D)return;let O=w.elements.floating;if(!O)return;let A=parseFloat(getComputedStyle(O).scrollPaddingBottom)||0,_=Math.min(ri,O.childElementCount),L=0,C=0;for(let M of(z=(W=w.elements.floating)==null?void 0:W.childNodes)!=null?z:[])if(Ve(M)){let V=M.offsetTop,X=V+M.clientHeight+A,B=O.scrollTop,j=B+O.clientHeight;if(V>=B&&X<=j)_--;else{C=Math.max(0,Math.min(X,j)-Math.max(V,B)),L=M.clientHeight;break}}_>=1&&i(M=>{let V=L*_-C+A;return M>=V?M:V})}}):null,Sm({padding:d,apply({availableWidth:D,availableHeight:W,elements:z}){Object.assign(z.floating.style,{overflow:"auto",maxWidth:`${D}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${W}px)`})}})].filter(Boolean),whileElementsMounted:hm}),[S=v,R=b]=w.placement.split("-");v==="selection"&&(S="selection");let P=p.useMemo(()=>({anchor:[S,R].filter(Boolean).join(" ")}),[S,R]),T=Um(w,{overflowRef:s,onChange:i}),{getReferenceProps:$,getFloatingProps:F}=Wm([T]),k=q(D=>{a(D),x.setFloating(D)});return m.createElement(Jr.Provider,{value:r},m.createElement(yt.Provider,{value:{setFloating:k,setReference:x.setReference,styles:y,getReferenceProps:$,getFloatingProps:F,slot:P}},e))}function Jm(e){te(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Qm(e,t){var n,r,o;let i=Jn((n=e?.gap)!=null?n:"var(--anchor-gap, 0)",t),s=Jn((r=e?.offset)!=null?r:"var(--anchor-offset, 0)",t),l=Jn((o=e?.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:l}}function Jn(e,t,n=void 0){let r=ot(),o=q((a,c)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!c)return[n,null];let u=oi(a,c);return[u,f=>{let h=sl(a);{let d=h.map(g=>window.getComputedStyle(c).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[x,y]of h.entries()){let w=window.getComputedStyle(c).getPropertyValue(y);if(d[x]!==w){d[x]=w,v=!0;break}}if(!v)return;let b=oi(a,c);u!==b&&(f(b),u=b)})}return r.dispose}]}return[n,null]}),i=p.useMemo(()=>o(e,t)[0],[e,t]),[s=i,l]=p.useState();return te(()=>{let[a,c]=o(e,t);if(l(a),!!c)return c(l)},[e,t]),s}function sl(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...sl(o)]:[r]}return[]}function oi(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function ep({children:e,freeze:t},n){let r=ll(t,e);return p.isValidElement(r)?p.cloneElement(r,{ref:n}):p.createElement(p.Fragment,null,r)}p.forwardRef(ep);function ll(e,t){let[n,r]=p.useState(t);return!e&&n!==t&&r(t),e?n:t}let Pn=p.createContext(null);Pn.displayName="OpenClosedContext";var ae=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ae||{});function Tn(){return p.useContext(Pn)}function Qr({value:e,children:t}){return p.createElement(Pn.Provider,{value:e},t)}function tp({children:e}){return p.createElement(Pn.Provider,{value:null},e)}function np(e){throw new Error("Unexpected object: "+e)}var Q=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Q||{});function Qt(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:np(e)}}function al(e){let t=q(e),n=p.useRef(!1);p.useEffect(()=>(n.current=!1,()=>{n.current=!0,gs(()=>{n.current&&t()})}),[t])}let rp=p.createContext(!1);function op(){return p.useContext(rp)}function ip(e){let t=op(),n=p.useContext(ul),[r,o]=p.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if($e.isServer)return null;let s=e?.getElementById("headlessui-portal-root");if(s)return s;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return p.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),p.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let cl=p.Fragment,sp=oe(function(e,t){let{ownerDocument:n=null,...r}=e,o=p.useRef(null),i=ue($s(h=>{o.current=h}),t),s=xr(o.current),l=n??s,a=ip(l),c=p.useContext(up),u=ot(),f=ie();return al(()=>{var h;a&&a.childNodes.length<=0&&((h=a.parentElement)==null||h.removeChild(a))}),a?Ye.createPortal(p.createElement("div",{"data-headlessui-portal":"",ref:h=>{u.dispose(),c&&h&&u.add(c.register(h))}},f({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:cl,name:"Portal"})),a):null});function lp(e,t){let n=ue(t),{enabled:r=!0,ownerDocument:o,...i}=e,s=ie();return r?p.createElement(sp,{...i,ownerDocument:o,ref:n}):s({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:cl,name:"Portal"})}let ap=p.Fragment,ul=p.createContext(null);function cp(e,t){let{target:n,...r}=e,o={ref:ue(t)},i=ie();return p.createElement(ul.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:ap,name:"Popover.Group"}))}let up=p.createContext(null),dp=oe(lp),fp=oe(cp),mp=Object.assign(dp,{Group:fp});const on={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function dl(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function pp(e,t,n){let r=ve();if(t.kind==="Tracked"){let o=function(){i!==dl(e)&&(r.dispose(),n())},{position:i}=t,s=new ResizeObserver(o);s.observe(e),r.add(()=>s.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function hp(){let e=typeof document>"u";return"useSyncExternalStore"in m?(t=>t.useSyncExternalStore)(m)(()=>()=>{},()=>!1,()=>!e):!1}function fl(){let e=hp(),[t,n]=m.useState($e.isHandoffComplete);return t&&$e.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>$e.handoff(),[]),e?!1:t}function gp(){let e=p.useRef(!1);return te(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ml(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!ft((t=e.as)!=null?t:hl)||p.Children.count(e.children)===1}let On=p.createContext(null);On.displayName="TransitionContext";var vp=(e=>(e.Visible="visible",e.Hidden="hidden",e))(vp||{});function bp(){let e=p.useContext(On);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function xp(){let e=p.useContext(Ln);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ln=p.createContext(null);Ln.displayName="NestingContext";function Mn(e){return"children"in e?Mn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function pl(e,t){let n=it(e),r=p.useRef([]),o=gp(),i=ot(),s=q((d,g=Ue.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===d);v!==-1&&(ce(g,{[Ue.Unmount](){r.current.splice(v,1)},[Ue.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var b;!Mn(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),l=q(d=>{let g=r.current.find(({el:v})=>v===d);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:d,state:"visible"}),()=>s(d,Ue.Unmount)}),a=p.useRef([]),c=p.useRef(Promise.resolve()),u=p.useRef({enter:[],leave:[]}),f=q((d,g,v)=>{a.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([b])=>b!==d)),t?.chains.current[g].push([d,new Promise(b=>{a.current.push(b)})]),t?.chains.current[g].push([d,new Promise(b=>{Promise.all(u.current[g].map(([x,y])=>y)).then(()=>b())})]),g==="enter"?c.current=c.current.then(()=>t?.wait.current).then(()=>v(g)):v(g)}),h=q((d,g,v)=>{Promise.all(u.current[g].splice(0).map(([b,x])=>x)).then(()=>{var b;(b=a.current.shift())==null||b()}).then(()=>v(g))});return p.useMemo(()=>({children:r,register:l,unregister:s,onStart:f,onStop:h,wait:c,chains:u}),[l,s,r,f,h,u,c])}let hl=p.Fragment,gl=pt.RenderStrategy;function wp(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:l,afterLeave:a,enter:c,enterFrom:u,enterTo:f,entered:h,leave:d,leaveFrom:g,leaveTo:v,...b}=e,[x,y]=p.useState(null),w=p.useRef(null),S=ml(e),R=ue(...S?[w,t,y]:t===null?[]:[t]),P=(n=b.unmount)==null||n?Ue.Unmount:Ue.Hidden,{show:T,appear:$,initial:F}=bp(),[k,D]=p.useState(T?"visible":"hidden"),W=xp(),{register:z,unregister:O}=W;te(()=>z(w),[z,w]),te(()=>{if(P===Ue.Hidden&&w.current){if(T&&k!=="visible"){D("visible");return}return ce(k,{hidden:()=>O(w),visible:()=>z(w)})}},[k,w,z,O,T,P]);let A=fl();te(()=>{if(S&&A&&k==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,k,A,S]);let _=F&&!$,L=$&&T&&F,C=p.useRef(!1),M=pl(()=>{C.current||(D("hidden"),O(w))},W),V=q(G=>{C.current=!0;let pe=G?"enter":"leave";M.onStart(w,pe,de=>{de==="enter"?i?.():de==="leave"&&l?.()})}),X=q(G=>{let pe=G?"enter":"leave";C.current=!1,M.onStop(w,pe,de=>{de==="enter"?s?.():de==="leave"&&a?.()}),pe==="leave"&&!Mn(M)&&(D("hidden"),O(w))});p.useEffect(()=>{S&&o||(V(T),X(T))},[T,S,o]);let B=!(!o||!S||!A||_),[,j]=Gr(B,x,T,{start:V,end:X}),ee=ze({ref:R,className:((r=pr(b.className,L&&c,L&&u,j.enter&&c,j.enter&&j.closed&&u,j.enter&&!j.closed&&f,j.leave&&d,j.leave&&!j.closed&&g,j.leave&&j.closed&&v,!j.transition&&T&&h))==null?void 0:r.trim())||void 0,...qr(j)}),Y=0;k==="visible"&&(Y|=ae.Open),k==="hidden"&&(Y|=ae.Closed),T&&k==="hidden"&&(Y|=ae.Opening),!T&&k==="visible"&&(Y|=ae.Closing);let H=ie();return p.createElement(Ln.Provider,{value:M},p.createElement(Qr,{value:Y},H({ourProps:ee,theirProps:b,defaultTag:hl,features:gl,visible:k==="visible",name:"Transition.Child"})))}function yp(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=p.useRef(null),l=ml(e),a=ue(...l?[s,t]:t===null?[]:[t]);fl();let c=Tn();if(n===void 0&&c!==null&&(n=(c&ae.Open)===ae.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=p.useState(n?"visible":"hidden"),h=pl(()=>{n||f("hidden")}),[d,g]=p.useState(!0),v=p.useRef([n]);te(()=>{d!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let b=p.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);te(()=>{n?f("visible"):!Mn(h)&&s.current!==null&&f("hidden")},[n,h]);let x={unmount:o},y=q(()=>{var R;d&&g(!1),(R=e.beforeEnter)==null||R.call(e)}),w=q(()=>{var R;d&&g(!1),(R=e.beforeLeave)==null||R.call(e)}),S=ie();return p.createElement(Ln.Provider,{value:h},p.createElement(On.Provider,{value:b},S({ourProps:{...x,as:p.Fragment,children:p.createElement(vl,{ref:a,...x,...i,beforeEnter:y,beforeLeave:w})},theirProps:{},defaultTag:p.Fragment,features:gl,visible:u==="visible",name:"Transition"})))}function Ep(e,t){let n=p.useContext(On)!==null,r=Tn()!==null;return p.createElement(p.Fragment,null,!n&&r?p.createElement(Cr,{ref:t,...e}):p.createElement(vl,{ref:t,...e}))}let Cr=oe(yp),vl=oe(wp),Cp=oe(Ep),Rp=Object.assign(Cr,{Child:Cp,Root:Cr});var ii;let Sp=(ii=p.startTransition)!=null?ii:function(e){e()};var kp=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(kp||{}),$p=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))($p||{});let Pp={0:e=>({...e,disclosureState:ce(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},eo=p.createContext(null);eo.displayName="DisclosureContext";function to(e){let t=p.useContext(eo);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,to),n}return t}let no=p.createContext(null);no.displayName="DisclosureAPIContext";function bl(e){let t=p.useContext(no);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,bl),n}return t}let ro=p.createContext(null);ro.displayName="DisclosurePanelContext";function Tp(){return p.useContext(ro)}function Op(e,t){return ce(t.type,Pp,e,t)}let Lp=p.Fragment;function Mp(e,t){let{defaultOpen:n=!1,...r}=e,o=p.useRef(null),i=ue(t,$s(v=>{o.current=v},e.as===void 0||ft(e.as))),s=p.useReducer(Op,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:a},c]=s,u=q(v=>{c({type:1});let b=_t(o.current);if(!b||!a)return;let x=v?qe(v)?v:"current"in v&&qe(v.current)?v.current:b.getElementById(a):b.getElementById(a);x?.focus()}),f=p.useMemo(()=>({close:u}),[u]),h=ye({open:l===0,close:u}),d={ref:i},g=ie();return p.createElement(eo.Provider,{value:s},p.createElement(no.Provider,{value:f},p.createElement(Pd,{value:u},p.createElement(Qr,{value:ce(l,{0:ae.Open,1:ae.Closed})},g({ourProps:d,theirProps:r,slot:h,defaultTag:Lp,name:"Disclosure"})))))}let Ap="button";function Fp(e,t){let n=p.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:o=!1,autoFocus:i=!1,...s}=e,[l,a]=to("Disclosure.Button"),c=Tp(),u=c===null?!1:c===l.panelId,f=p.useRef(null),h=ue(f,t,q(F=>{if(!u)return a({type:4,element:F})}));p.useEffect(()=>{if(!u)return a({type:2,buttonId:r}),()=>{a({type:2,buttonId:null})}},[r,a,u]);let d=q(F=>{var k;if(u){if(l.disclosureState===1)return;switch(F.key){case J.Space:case J.Enter:F.preventDefault(),F.stopPropagation(),a({type:0}),(k=l.buttonElement)==null||k.focus();break}}else switch(F.key){case J.Space:case J.Enter:F.preventDefault(),F.stopPropagation(),a({type:0});break}}),g=q(F=>{F.key===J.Space&&F.preventDefault()}),v=q(F=>{var k;hr(F.currentTarget)||o||(u?(a({type:0}),(k=l.buttonElement)==null||k.focus()):a({type:0}))}),{isFocusVisible:b,focusProps:x}=Br({autoFocus:i}),{isHovered:y,hoverProps:w}=_r({isDisabled:o}),{pressed:S,pressProps:R}=Hr({disabled:o}),P=ye({open:l.disclosureState===0,hover:y,active:S,disabled:o,focus:b,autofocus:i}),T=Ws(e,l.buttonElement),$=Lt(u?{ref:h,type:T,disabled:o||void 0,autoFocus:i,onKeyDown:d,onClick:v}:{ref:h,id:r,type:T,"aria-expanded":l.disclosureState===0,"aria-controls":l.panelElement?l.panelId:void 0,disabled:o||void 0,autoFocus:i,onKeyDown:d,onKeyUp:g,onClick:v},x,w,R);return ie()({ourProps:$,theirProps:s,slot:P,defaultTag:Ap,name:"Disclosure.Button"})}let Np="div",Ip=pt.RenderStrategy|pt.Static;function Dp(e,t){let n=p.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:o=!1,...i}=e,[s,l]=to("Disclosure.Panel"),{close:a}=bl("Disclosure.Panel"),[c,u]=p.useState(null),f=ue(t,q(y=>{Sp(()=>l({type:5,element:y}))}),u);p.useEffect(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let h=Tn(),[d,g]=Gr(o,c,h!==null?(h&ae.Open)===ae.Open:s.disclosureState===0),v=ye({open:s.disclosureState===0,close:a}),b={ref:f,id:r,...qr(g)},x=ie();return p.createElement(tp,null,p.createElement(ro.Provider,{value:s.panelId},x({ourProps:b,theirProps:i,slot:v,defaultTag:Np,features:Ip,visible:d,name:"Disclosure.Panel"})))}let jp=oe(Mp),xl=oe(Fp),wl=oe(Dp),_p=Object.assign(jp,{Button:xl,Panel:wl}),si=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function li(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!Ve(o))return r;let i=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),i=!0;let s=i?(n=o.innerText)!=null?n:"":r;return si.test(s)&&(s=s.replace(si,"")),s}function Bp(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let i=document.getElementById(o);if(i){let s=i.getAttribute("aria-label");return typeof s=="string"?s.trim():li(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return li(e).trim()}function Hp(e){let t=p.useRef(""),n=p.useRef("");return q(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Bp(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Vp=Object.defineProperty,Wp=(e,t,n)=>t in e?Vp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ai=(e,t,n)=>(Wp(e,typeof t!="symbol"?t+"":t,n),n),le=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(le||{}),Ge=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Ge||{}),sn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(sn||{}),yl=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(yl||{});function ci(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Hs(t(e.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let zp={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?on.Tracked(dl(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:Q.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:on.Idle}},2(e,t){var n,r,o,i,s;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Q.Nothing)return{...l,activeOptionIndex:null};if(t.focus===Q.Specific)return{...l,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===Q.Previous){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,h=Qt(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(h!==null){let d=e.options[h].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===d.current||((o=d.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:h}}}}else if(t.focus===Q.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,h=Qt(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(h!==null){let d=e.options[h].dataRef.current.domRef;if(((i=f.current)==null?void 0:i.nextElementSibling)===d.current||((s=d.current)==null?void 0:s.nextElementSibling)===null)return{...l,activeOptionIndex:h}}}}let a=ci(e),c=Qt(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...l,...a,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(s=>{var l;return!s.dataRef.current.disabled&&((l=s.dataRef.current.textValue)==null?void 0:l.startsWith(r))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==Q.Nothing&&(r=Qt(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let i=n.findIndex(s=>o?.(s.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:Q.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,s]of n.entries())if(o.has(s.id)&&(r.push(i),o.delete(s.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...ci(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:on.Moved}}};class oo extends Fs{constructor(t){super(t),ai(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:s}=this.state.dataRef.current;return ce(i,{0:()=>r?.(n),1:()=>{let l=s.slice(),a=l.findIndex(c=>o(c,n));return a===-1?l.push(n):l.splice(a,1),r?.(l)}})},registerOption:Un(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Un(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Un(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),ai(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,s=n.options;return i!==null?((o=s[i])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=zr.get(null);this.disposables.add(r.on(Is.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(pp(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new oo({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:Q.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:on.Idle})}reduce(t,n){return ce(n.type,zp,t,n)}}const El=p.createContext(null);function io(e){let t=p.useContext(El);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Cl),n}return t}function Cl({id:e,__demoMode:t=!1}){let n=p.useMemo(()=>oo.new({id:e,__demoMode:t}),[]);return al(()=>n.dispose()),n}let An=p.createContext(null);An.displayName="ListboxDataContext";function Vt(e){let t=p.useContext(An);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Vt),n}return t}let Up=p.Fragment;function qp(e,t){let n=p.useId(),r=wn(),{value:o,defaultValue:i,form:s,name:l,onChange:a,by:c,invalid:u=!1,disabled:f=r||!1,horizontal:h=!1,multiple:d=!1,__demoMode:g=!1,...v}=e;const b=h?"horizontal":"vertical";let x=ue(t),y=rd(i),[w=d?[]:void 0,S]=nd(o,a,y),R=Cl({id:n,__demoMode:g}),P=p.useRef({static:!1,hold:!1}),T=p.useRef(new Map),$=Od(c),F=p.useCallback(B=>ce(k.mode,{[Ge.Multi]:()=>w.some(j=>$(j,B)),[Ge.Single]:()=>$(w,B)}),[w]),k=ye({value:w,disabled:f,invalid:u,mode:d?Ge.Multi:Ge.Single,orientation:b,onChange:S,compare:$,isSelected:F,optionsPropsRef:P,listRef:T});te(()=>{R.state.dataRef.current=k},[k]);let D=fe(R,B=>B.listboxState),W=zr.get(null),z=fe(W,p.useCallback(B=>W.selectors.isTop(B,n),[W,n])),[O,A]=fe(R,B=>[B.buttonElement,B.optionsElement]);of(z,[O,A],(B,j)=>{R.send({type:yl.CloseListbox}),Bs(j,Ur.Loose)||(B.preventDefault(),O?.focus())});let _=ye({open:D===le.Open,disabled:f,invalid:u,value:w}),[L,C]=Ed({inherit:!0}),M={ref:x},V=p.useCallback(()=>{if(y!==void 0)return S?.(y)},[S,y]),X=ie();return p.createElement(C,{value:L,props:{htmlFor:O?.id},slot:{open:D===le.Open,disabled:f}},p.createElement(Zm,null,p.createElement(El.Provider,{value:R},p.createElement(An.Provider,{value:k},p.createElement(Qr,{value:ce(D,{[le.Open]:ae.Open,[le.Closed]:ae.Closed})},l!=null&&w!=null&&p.createElement(ud,{disabled:f,data:{[l]:w},form:s,onReset:V}),X({ourProps:M,theirProps:v,slot:_,defaultTag:Up,name:"Listbox"}))))))}let Gp="button";function Kp(e,t){let n=p.useId(),r=Es(),o=Vt("Listbox.Button"),i=io("Listbox.Button"),{id:s=r||`headlessui-listbox-button-${n}`,disabled:l=o.disabled||!1,autoFocus:a=!1,...c}=e,u=ue(t,Gm(),i.actions.setButtonElement),f=Km(),[h,d,g]=fe(i,A=>[A.listboxState,A.buttonElement,A.optionsElement]),v=h===le.Open;af(v,{trigger:d,action:p.useCallback(A=>{if(d!=null&&d.contains(A.target))return Zt.Ignore;let _=A.target.closest('[role="option"]:not([data-disabled])');return Ve(_)?Zt.Select(_):g!=null&&g.contains(A.target)?Zt.Ignore:Zt.Close},[d,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let b=q(A=>{switch(A.key){case J.Enter:od(A.currentTarget);break;case J.Space:case J.ArrowDown:A.preventDefault(),i.actions.openListbox({focus:o.value?Q.Nothing:Q.First});break;case J.ArrowUp:A.preventDefault(),i.actions.openListbox({focus:o.value?Q.Nothing:Q.Last});break}}),x=q(A=>{A.key===J.Space&&A.preventDefault()}),y=Md(A=>{var _;i.state.listboxState===le.Open?(Ye.flushSync(()=>i.actions.closeListbox()),(_=i.state.buttonElement)==null||_.focus({preventScroll:!0})):(A.preventDefault(),i.actions.openListbox({focus:Q.Nothing}))}),w=q(A=>A.preventDefault()),S=Os([s]),R=bd(),{isFocusVisible:P,focusProps:T}=Br({autoFocus:a}),{isHovered:$,hoverProps:F}=_r({isDisabled:l}),{pressed:k,pressProps:D}=Hr({disabled:l}),W=ye({open:h===le.Open,active:k||h===le.Open,disabled:l,invalid:o.invalid,value:o.value,hover:$,focus:P,autofocus:a}),z=fe(i,A=>A.listboxState===le.Open),O=Lt(f(),{ref:u,id:s,type:Ws(e,d),"aria-haspopup":"listbox","aria-controls":g?.id,"aria-expanded":z,"aria-labelledby":S,"aria-describedby":R,disabled:l||void 0,autoFocus:a,onKeyDown:b,onKeyUp:x,onKeyPress:w},y,T,F,D);return ie()({ourProps:O,theirProps:c,slot:W,defaultTag:Gp,name:"Listbox.Button"})}let Rl=p.createContext(!1),Yp="div",Xp=pt.RenderStrategy|pt.Static;function Zp(e,t){let n=p.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:s=!0,transition:l=!1,...a}=e,c=qm(o),[u,f]=p.useState(null);c&&(i=!0);let h=Vt("Listbox.Options"),d=io("Listbox.Options"),[g,v,b,x]=fe(d,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),y=xr(v),w=xr(b),S=Tn(),[R,P]=Gr(l,u,S!==null?(S&ae.Open)===ae.Open:g===le.Open);qd(R,v,d.actions.closeListbox);let T=x?!1:s&&g===le.Open;hf(T,w);let $=x?!1:s&&g===le.Open;Ud($,{allowed:p.useCallback(()=>[v,b],[v,b])});let F=fe(d,d.selectors.didButtonMove)?!1:R,k=fe(d,d.selectors.hasFrozenValue)&&!e.static,D=ll(k,h.value),W=p.useCallback(H=>h.compare(D,H),[h.compare,D]),z=fe(d,H=>{var G;if(c==null||!((G=c?.to)!=null&&G.includes("selection")))return null;let pe=H.options.findIndex(de=>W(de.dataRef.current.value));return pe===-1&&(pe=0),pe}),O=(()=>{if(c==null)return;if(z===null)return{...c,inner:void 0};let H=Array.from(h.listRef.current.values());return{...c,inner:{listRef:{current:H},index:z}}})(),[A,_]=Xm(O),L=Ym(),C=ue(t,c?A:null,d.actions.setOptionsElement,f),M=ot();p.useEffect(()=>{let H=b;H&&g===le.Open&&(zu(H)||H==null||H.focus({preventScroll:!0}))},[g,b]);let V=q(H=>{var G;switch(M.dispose(),H.key){case J.Space:if(d.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),d.actions.search(H.key);case J.Enter:H.preventDefault(),H.stopPropagation(),d.actions.selectActiveOption();break;case ce(h.orientation,{vertical:J.ArrowDown,horizontal:J.ArrowRight}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.Next});case ce(h.orientation,{vertical:J.ArrowUp,horizontal:J.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.Previous});case J.Home:case J.PageUp:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.First});case J.End:case J.PageDown:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:Q.Last});case J.Escape:H.preventDefault(),H.stopPropagation(),Ye.flushSync(()=>d.actions.closeListbox()),(G=d.state.buttonElement)==null||G.focus({preventScroll:!0});return;case J.Tab:H.preventDefault(),H.stopPropagation(),Ye.flushSync(()=>d.actions.closeListbox()),ef(d.state.buttonElement,H.shiftKey?br.Previous:br.Next);break;default:H.key.length===1&&(d.actions.search(H.key),M.setTimeout(()=>d.actions.clearSearch(),350));break}}),X=fe(d,H=>{var G;return(G=H.buttonElement)==null?void 0:G.id}),B=ye({open:g===le.Open}),j=Lt(c?L():{},{id:r,ref:C,"aria-activedescendant":fe(d,d.selectors.activeDescendantId),"aria-multiselectable":h.mode===Ge.Multi?!0:void 0,"aria-labelledby":X,"aria-orientation":h.orientation,onKeyDown:V,role:"listbox",tabIndex:g===le.Open?0:void 0,style:{...a.style,..._,"--button-width":Ld(R,v,!0).width},...qr(P)}),ee=ie(),Y=p.useMemo(()=>h.mode===Ge.Multi?h:{...h,isSelected:W},[h,W]);return p.createElement(mp,{enabled:i?e.static||R:!1,ownerDocument:y},p.createElement(An.Provider,{value:Y},ee({ourProps:j,theirProps:a,slot:B,defaultTag:Yp,features:Xp,visible:F,name:"Listbox.Options"})))}let Jp="div";function Qp(e,t){let n=p.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...s}=e,l=p.useContext(Rl)===!0,a=Vt("Listbox.Option"),c=io("Listbox.Option"),u=fe(c,k=>c.selectors.isActive(k,r)),f=a.isSelected(i),h=p.useRef(null),d=Hp(h),g=it({disabled:o,value:i,domRef:h,get textValue(){return d()}}),v=ue(t,h,k=>{k?a.listRef.current.set(r,k):a.listRef.current.delete(r)}),b=fe(c,k=>c.selectors.shouldScrollIntoView(k,r));te(()=>{if(b)return ve().requestAnimationFrame(()=>{var k,D;(D=(k=h.current)==null?void 0:k.scrollIntoView)==null||D.call(k,{block:"nearest"})})},[b,h]),te(()=>{if(!l)return c.actions.registerOption(r,g),()=>c.actions.unregisterOption(r)},[g,r,l]);let x=q(k=>{if(o)return k.preventDefault();c.actions.selectOption(i)}),y=q(()=>{if(o)return c.actions.goToOption({focus:Q.Nothing});c.actions.goToOption({focus:Q.Specific,id:r})}),w=gf(),S=q(k=>w.update(k)),R=q(k=>{w.wasMoved(k)&&(o||u&&c.state.activationTrigger===sn.Pointer||c.actions.goToOption({focus:Q.Specific,id:r},sn.Pointer))}),P=q(k=>{w.wasMoved(k)&&(o||u&&c.state.activationTrigger===sn.Pointer&&c.actions.goToOption({focus:Q.Nothing}))}),T=ye({active:u,focus:u,selected:f,disabled:o,selectedOption:f&&l}),$=l?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:x,onFocus:y,onPointerEnter:S,onMouseEnter:S,onPointerMove:R,onMouseMove:R,onPointerLeave:P,onMouseLeave:P},F=ie();return!f&&l?null:F({ourProps:$,theirProps:s,slot:T,defaultTag:Jp,name:"Listbox.Option"})}let eh=p.Fragment;function th(e,t){let{options:n,placeholder:r,...o}=e,i={ref:ue(t)},s=Vt("ListboxSelectedOption"),l=ye({}),a=s.value===void 0||s.value===null||s.mode===Ge.Multi&&Array.isArray(s.value)&&s.value.length===0,c=ie();return p.createElement(Rl.Provider,{value:!0},c({ourProps:i,theirProps:{...o,children:p.createElement(p.Fragment,null,r&&a?r:n)},slot:l,defaultTag:eh,name:"ListboxSelectedOption"}))}let nh=oe(qp),Sl=oe(Kp),rh=kd,kl=oe(Zp),$l=oe(Qp),oh=oe(th),ih=Object.assign(nh,{Button:Sl,Label:rh,Options:kl,Option:$l,SelectedOption:oh});function Pl({children:e,className:t,disabled:n=!1,intent:r="primary",...o}){return E.jsx(td,{className:re("rounded-md font-bold cursor-pointer px-2",sh(r,!!n),{"opacity-50 cursor-default":n},t),"data-focus":!0,disabled:n,...o,children:e})}function sh(e,t){switch(e){case"danger":return re("bg-red-400 text-red-950 focus:text-black",{"hover:bg-red-500 focus:text-black":!t});case"none":return re("bg-white/20 text-slate-300 focus:text-white",{"hover:bg-white/10 focus:text-white":!t});case"success":return re("bg-emerald-400 text-emerald-950 focus:text-black",{"hover:bg-emerald-500 focus:text-black":!t});case"primary":return re("bg-sky-400 text-sky-950 focus:text-black",{"hover:bg-sky-500 focus:text-black":!t});case"warning":return re("bg-amber-400 text-amber-950 focus:text-black",{"hover:bg-amber-500 focus:text-black":!t})}}function so({children:e}){return E.jsx(gu,{FallbackComponent:lh,children:e})}function lh({error:e,resetErrorBoundary:t}){return E.jsx(Fr,{intent:"danger",children:E.jsxs(he,{align:"start",direction:"column",gap:2,children:[E.jsx("div",{className:"font-bold",children:"Something went wrong!"}),E.jsx("pre",{className:"text-sm font-monospace text-red-300",children:e.message}),E.jsx(Pl,{intent:"danger",onClick:t,children:"Retry"})]})})}function Wt({children:e,onClick:t,to:n,...r}){const o=!!Pa(n),[i,s]=p.useTransition(),l=Mi();return E.jsx("a",{children:typeof e=="function"?e({isActive:o,isPending:i}):e,"data-link":n,onClick:a=>{t?.(a),s(()=>{l(n)})},...r})}function ah(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ch(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function uh(){return/apple/i.test(navigator.vendor)}function dh(){return ah().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function fh(){return ch().includes("jsdom/")}const mh="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ui(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ft(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&wr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ut(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qn(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 ph(e){return e.matches("html,body")}function et(e){return e?.ownerDocument||document}function hh(e){return ge(e)&&e.matches(mh)}function gh(e){if(!e||fh())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ln(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...ln(e,o.id,n)])}function vh(e){return"nativeEvent"in e}function Rr(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var bh=typeof document<"u",xh=function(){},Ie=bh?p.useLayoutEffect:xh;const wh={...m};function en(e){const t=m.useRef(e);return Ie(()=>{t.current=e}),t}const yh=wh.useInsertionEffect,Eh=yh||(e=>e());function ke(e){const t=m.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Eh(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Ch="data-floating-ui-focusable",di="active",fi="selected",Rh={...m};let mi=!1,Sh=0;const pi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Sh++;function kh(){const[e,t]=m.useState(()=>mi?pi():void 0);return Ie(()=>{e==null&&t(pi())},[]),m.useEffect(()=>{mi=!0},[]),e}const $h=Rh.useId,Tl=$h||kh;let Sr;process.env.NODE_ENV!=="production"&&(Sr=new Set);function Ph(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Sr)!=null&&e.has(o))){var i;(i=Sr)==null||i.add(o),console.error(o)}}function Th(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const Oh=m.createContext(null),Lh=m.createContext(null),Ol=()=>{var e;return((e=m.useContext(Oh))==null?void 0:e.id)||null},lo=()=>m.useContext(Lh);function Fn(e){return"data-floating-ui-"+e}function xe(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const hi=Fn("safe-polygon");function er(e,t,n){if(n&&!Rr(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function tr(e){return typeof e=="function"?e():e}function Mh(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:l=!0,delay:a=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:h=!0}=t,d=lo(),g=Ol(),v=en(c),b=en(a),x=en(n),y=en(f),w=m.useRef(),S=m.useRef(-1),R=m.useRef(),P=m.useRef(-1),T=m.useRef(!0),$=m.useRef(!1),F=m.useRef(()=>{}),k=m.useRef(!1),D=ke(()=>{var L;const C=(L=o.current.openEvent)==null?void 0:L.type;return C?.includes("mouse")&&C!=="mousedown"});m.useEffect(()=>{if(!l)return;function L(C){let{open:M}=C;M||(xe(S),xe(P),T.current=!0,k.current=!1)}return i.on("openchange",L),()=>{i.off("openchange",L)}},[l,i]),m.useEffect(()=>{if(!l||!v.current||!n)return;function L(M){D()&&r(!1,M,"hover")}const C=et(s.floating).documentElement;return C.addEventListener("mouseleave",L),()=>{C.removeEventListener("mouseleave",L)}},[s.floating,n,r,l,v,D]);const W=m.useCallback(function(L,C,M){C===void 0&&(C=!0),M===void 0&&(M="hover");const V=er(b.current,"close",w.current);V&&!R.current?(xe(S),S.current=window.setTimeout(()=>r(!1,L,M),V)):C&&(xe(S),r(!1,L,M))},[b,r]),z=ke(()=>{F.current(),R.current=void 0}),O=ke(()=>{if($.current){const L=et(s.floating).body;L.style.pointerEvents="",L.removeAttribute(hi),$.current=!1}}),A=ke(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);m.useEffect(()=>{if(!l)return;function L(B){if(xe(S),T.current=!1,u&&!Rr(w.current)||tr(y.current)>0&&!er(b.current,"open"))return;const j=er(b.current,"open",w.current);j?S.current=window.setTimeout(()=>{x.current||r(!0,B,"hover")},j):n||r(!0,B,"hover")}function C(B){if(A()){O();return}F.current();const j=et(s.floating);if(xe(P),k.current=!1,v.current&&o.current.floatingContext){n||xe(S),R.current=v.current({...o.current.floatingContext,tree:d,x:B.clientX,y:B.clientY,onClose(){O(),z(),A()||W(B,!0,"safe-polygon")}});const Y=R.current;j.addEventListener("mousemove",Y),F.current=()=>{j.removeEventListener("mousemove",Y)};return}(w.current!=="touch"||!Ft(s.floating,B.relatedTarget))&&W(B)}function M(B){A()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:d,x:B.clientX,y:B.clientY,onClose(){O(),z(),A()||W(B)}})(B))}function V(){xe(S)}function X(B){A()||W(B,!1)}if(K(s.domReference)){const B=s.domReference,j=s.floating;return n&&B.addEventListener("mouseleave",M),h&&B.addEventListener("mousemove",L,{once:!0}),B.addEventListener("mouseenter",L),B.addEventListener("mouseleave",C),j&&(j.addEventListener("mouseleave",M),j.addEventListener("mouseenter",V),j.addEventListener("mouseleave",X)),()=>{n&&B.removeEventListener("mouseleave",M),h&&B.removeEventListener("mousemove",L),B.removeEventListener("mouseenter",L),B.removeEventListener("mouseleave",C),j&&(j.removeEventListener("mouseleave",M),j.removeEventListener("mouseenter",V),j.removeEventListener("mouseleave",X))}}},[s,l,e,u,h,W,z,O,r,n,x,d,b,v,o,A,y]),Ie(()=>{var L;if(l&&n&&(L=v.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&D()){$.current=!0;const M=s.floating;if(K(s.domReference)&&M){var C;const V=et(s.floating).body;V.setAttribute(hi,"");const X=s.domReference,B=d==null||(C=d.nodesRef.current.find(j=>j.id===g))==null||(C=C.context)==null?void 0:C.elements.floating;return B&&(B.style.pointerEvents=""),V.style.pointerEvents="none",X.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{V.style.pointerEvents="",X.style.pointerEvents="",M.style.pointerEvents=""}}}},[l,n,g,s,d,v,D]),Ie(()=>{n||(w.current=void 0,k.current=!1,z(),O())},[n,z,O]),m.useEffect(()=>()=>{z(),xe(S),xe(P),O()},[l,s.domReference,z,O]);const _=m.useMemo(()=>{function L(C){w.current=C.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(C){const{nativeEvent:M}=C;function V(){!T.current&&!x.current&&r(!0,M,"hover")}u&&!Rr(w.current)||n||tr(y.current)===0||k.current&&C.movementX**2+C.movementY**2<2||(xe(P),w.current==="touch"?V():(k.current=!0,P.current=window.setTimeout(V,tr(y.current))))}}},[u,r,n,x,y]);return m.useMemo(()=>l?{reference:_}:{},[l,_])}const Ah=m.createContext(null),gi=Fn("portal");function Fh(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Tl(),o=Nh(),[i,s]=m.useState(null),l=m.useRef(null);return Ie(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Ie(()=>{if(!r||l.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(gi,""),a.appendChild(c),l.current=c,s(c)},[t,r]),Ie(()=>{if(n===null||!r||l.current)return;let a=n||o?.portalNode;a&&!Kr(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(gi,""),a=c||a,a.appendChild(u),l.current=u,s(u)},[t,n,r,o]),i}const Nh=()=>m.useContext(Ah),Ih={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Dh={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},vi=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function jh(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:a=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:g}=t,v=lo(),b=ke(typeof a=="function"?a:()=>!1),x=typeof a=="function"?b:a,y=m.useRef(!1),{escapeKey:w,outsidePress:S}=vi(d),{escapeKey:R,outsidePress:P}=vi(g),T=m.useRef(!1),$=ke(O=>{var A;if(!n||!s||!l||O.key!=="Escape"||T.current)return;const _=(A=i.current.floatingContext)==null?void 0:A.nodeId,L=v?ln(v.nodesRef.current,_):[];if(!w&&(O.stopPropagation(),L.length>0)){let C=!0;if(L.forEach(M=>{var V;if((V=M.context)!=null&&V.open&&!M.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}r(!1,vh(O)?O.nativeEvent:O,"escape-key")}),F=ke(O=>{var A;const _=()=>{var L;$(O),(L=ut(O))==null||L.removeEventListener("keydown",_)};(A=ut(O))==null||A.addEventListener("keydown",_)}),k=ke(O=>{var A;const _=i.current.insideReactTree;i.current.insideReactTree=!1;const L=y.current;if(y.current=!1,c==="click"&&L||_||typeof x=="function"&&!x(O))return;const C=ut(O),M="["+Fn("inert")+"]",V=et(o.floating).querySelectorAll(M);let X=K(C)?C:null;for(;X&&!Ne(X);){const Y=je(X);if(Ne(Y)||!K(Y))break;X=Y}if(V.length&&K(C)&&!ph(C)&&!Ft(C,o.floating)&&Array.from(V).every(Y=>!Ft(X,Y)))return;if(ge(C)&&z){const Y=Ne(C),H=Ee(C),G=/auto|scroll/,pe=Y||G.test(H.overflowX),de=Y||G.test(H.overflowY),lt=pe&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,Et=de&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,at=H.direction==="rtl",Al=Et&&(at?O.offsetX<=C.offsetWidth-C.clientWidth:O.offsetX>C.clientWidth),Fl=lt&&O.offsetY>C.clientHeight;if(Al||Fl)return}const B=(A=i.current.floatingContext)==null?void 0:A.nodeId,j=v&&ln(v.nodesRef.current,B).some(Y=>{var H;return Qn(O,(H=Y.context)==null?void 0:H.elements.floating)});if(Qn(O,o.floating)||Qn(O,o.domReference)||j)return;const ee=v?ln(v.nodesRef.current,B):[];if(ee.length>0){let Y=!0;if(ee.forEach(H=>{var G;if((G=H.context)!=null&&G.open&&!H.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}r(!1,O,"outside-press")}),D=ke(O=>{var A;const _=()=>{var L;k(O),(L=ut(O))==null||L.removeEventListener(c,_)};(A=ut(O))==null||A.addEventListener(c,_)});m.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=w,i.current.__outsidePressBubbles=S;let O=-1;function A(V){r(!1,V,"ancestor-scroll")}function _(){window.clearTimeout(O),T.current=!0}function L(){O=window.setTimeout(()=>{T.current=!1},Sn()?5:0)}const C=et(o.floating);l&&(C.addEventListener("keydown",R?F:$,R),C.addEventListener("compositionstart",_),C.addEventListener("compositionend",L)),x&&C.addEventListener(c,P?D:k,P);let M=[];return h&&(K(o.domReference)&&(M=Ke(o.domReference)),K(o.floating)&&(M=M.concat(Ke(o.floating))),!K(o.reference)&&o.reference&&o.reference.contextElement&&(M=M.concat(Ke(o.reference.contextElement)))),M=M.filter(V=>{var X;return V!==((X=C.defaultView)==null?void 0:X.visualViewport)}),M.forEach(V=>{V.addEventListener("scroll",A,{passive:!0})}),()=>{l&&(C.removeEventListener("keydown",R?F:$,R),C.removeEventListener("compositionstart",_),C.removeEventListener("compositionend",L)),x&&C.removeEventListener(c,P?D:k,P),M.forEach(V=>{V.removeEventListener("scroll",A)}),window.clearTimeout(O)}},[i,o,l,x,c,n,r,h,s,w,S,$,R,F,k,P,D]),m.useEffect(()=>{i.current.insideReactTree=!1},[i,x,c]);const W=m.useMemo(()=>({onKeyDown:$,...u&&{[Ih[f]]:O=>{r(!1,O.nativeEvent,"reference-press")},...f!=="click"&&{onClick(O){r(!1,O.nativeEvent,"reference-press")}}}}),[$,r,u,f]),z=m.useMemo(()=>({onKeyDown:$,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[Dh[c]]:()=>{i.current.insideReactTree=!0}}),[$,c,i]);return m.useMemo(()=>s?{reference:W,floating:z}:{},[s,W,z])}function _h(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Tl(),i=m.useRef({}),[s]=m.useState(()=>Th()),l=Ol()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!K(d)&&Ph("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=m.useState(r.reference),u=ke((d,g,v)=>{i.current.openEvent=d?g:void 0,s.emit("openchange",{open:d,event:g,reason:v,nested:l}),n?.(d,g,v)}),f=m.useMemo(()=>({setPositionReference:c}),[]),h=m.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return m.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:f}),[t,u,h,s,o,f])}function Bh(e){e===void 0&&(e={});const{nodeId:t}=e,n=_h({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=m.useState(null),[l,a]=m.useState(null),u=o?.domReference||i,f=m.useRef(null),h=lo();Ie(()=>{u&&(f.current=u)},[u]);const d=nl({...e,elements:{...o,...l&&{reference:l}}}),g=m.useCallback(w=>{const S=K(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;a(S),d.refs.setReference(S)},[d.refs]),v=m.useCallback(w=>{(K(w)||w===null)&&(f.current=w,s(w)),(K(d.refs.reference.current)||d.refs.reference.current===null||w!==null&&!K(w))&&d.refs.setReference(w)},[d.refs]),b=m.useMemo(()=>({...d.refs,setReference:v,setPositionReference:g,domReference:f}),[d.refs,v,g]),x=m.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),y=m.useMemo(()=>({...d,...r,refs:b,elements:x,nodeId:t}),[d,b,x,t,r]);return Ie(()=>{r.dataRef.current.floatingContext=y;const w=h?.nodesRef.current.find(S=>S.id===t);w&&(w.context=y)}),m.useMemo(()=>({...d,context:y,refs:b,elements:x}),[d,b,x,y])}function nr(){return dh()&&uh()}function Hh(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:l=!0,visibleOnly:a=!0}=t,c=m.useRef(!1),u=m.useRef(-1),f=m.useRef(!0);m.useEffect(()=>{if(!l)return;const d=me(s.domReference);function g(){!n&&ge(s.domReference)&&s.domReference===ui(et(s.domReference))&&(c.current=!0)}function v(){f.current=!0}function b(){f.current=!1}return d.addEventListener("blur",g),nr()&&(d.addEventListener("keydown",v,!0),d.addEventListener("pointerdown",b,!0)),()=>{d.removeEventListener("blur",g),nr()&&(d.removeEventListener("keydown",v,!0),d.removeEventListener("pointerdown",b,!0))}},[s.domReference,n,l]),m.useEffect(()=>{if(!l)return;function d(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(c.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,l]),m.useEffect(()=>()=>{xe(u)},[]);const h=m.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(d){if(c.current)return;const g=ut(d.nativeEvent);if(a&&K(g)){if(nr()&&!d.relatedTarget){if(!f.current&&!hh(g))return}else if(!gh(g))return}r(!0,d.nativeEvent,"focus")},onBlur(d){c.current=!1;const g=d.relatedTarget,v=d.nativeEvent,b=K(g)&&g.hasAttribute(Fn("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var x;const y=ui(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Ft((x=i.current.floatingContext)==null?void 0:x.refs.floating.current,y)||Ft(s.domReference,y)||b||r(!1,v,"focus")})}}),[i,s.domReference,r,a]);return m.useMemo(()=>l?{reference:h}:{},[l,h])}function rr(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[di]:s,[fi]:l,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[Ch]:""},...i,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[di,fi].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var h,d=arguments.length,g=new Array(d),v=0;v<d;v++)g[v]=arguments[v];return(h=r.get(c))==null?void 0:h.map(b=>b(...g)).find(b=>b!==void 0)}}}else s[c]=u}),s),{})}}function Vh(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=m.useCallback(l=>rr(l,e,"reference"),t),i=m.useCallback(l=>rr(l,e,"floating"),n),s=m.useCallback(l=>rr(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function ao({children:e,className:t,content:n,positions:r,showOnFocus:o=!1,showOnHover:i=!0,usePortal:s}){const[l,a]=p.useState(!1),c=Fh({root:document.body}),{refs:u,floatingStyles:f,context:h}=Bh({onOpenChange:a,open:l,middleware:[Zr(4),rl(),km(r?{allowedPlacements:r}:{})]}),d=Mh(h,{enabled:i}),g=Hh(h,{enabled:o}),v=jh(h),{getReferenceProps:b,getFloatingProps:x}=Vh([v,g,d]),y=S=>{if(o)switch(S.key){case"Escape":{a(!1);break}case"Enter":{a(!0);break}}};let w=null;return l&&(w=E.jsx("div",{className:re("bg-white/80 text-black rounded-md px-2 py-1 shadow-md whitespace-nowrap z-40",t),ref:u.setFloating,style:f,...x(),children:n}),s&&c&&(w=Ye.createPortal(w,c))),E.jsxs("div",{className:re("group relative flex justify-center",t),onKeyDown:y,children:[E.jsx("div",{ref:u.setReference,...b(),children:e}),w]})}function bi({ariaLabel:e,children:t,className:n="",onClick:r,title:o}){return E.jsx(ao,{className:n,content:o,children:E.jsx("button",{"aria-label":e||o,className:re("cursor-pointer",n),onClick:r,children:t})})}function co({children:e,className:t,href:n,target:r="_blank",...o}){return E.jsx("a",{className:t,href:n,target:r,rel:"noopener noreferrer",...o,children:e})}function or({ariaLabel:e,children:t,className:n="",title:r,...o}){const i="to"in o?E.jsx(Wt,{"aria-label":e||r,children:t,className:"text-header-icons! cursor-pointer",to:o.to}):E.jsx(co,{"aria-label":e||r,children:t,className:"text-header-icons! cursor-pointer",href:o.href});return E.jsx(ao,{className:n,content:r,children:i})}function Wh({children:e}){return E.jsx("div",{className:"w-full shrink-0 flex flex-col gap-4 py-4 overflow-y-auto",children:e})}function Ll({children:e,commonQuestions:t,overview:n,packageDescription:r,packageName:o,repositoryUrl:i,showOpenCollectLink:s,versions:l}){const[a,c]=p.useState({isNavVisible:!1,isSiteSearchVisible:!1}),u=p.useCallback(d=>c(g=>g.isNavVisible===d?g:{...g,isNavVisible:d}),[]),f=p.useCallback(d=>c(g=>g.isSiteSearchVisible===d?g:{...g,isSiteSearchVisible:d}),[]),h=p.useMemo(()=>({commonQuestions:t,isNavVisible:a.isNavVisible,isSiteSearchVisible:a.isSiteSearchVisible,overview:n,packageDescription:r,packageName:o,repositoryUrl:i.replace(".git",""),setIsNavVisible:u,setIsSiteSearchVisible:f,showOpenCollectLink:!!s,versions:l}),[t,n,r,o,i,u,f,s,a.isNavVisible,a.isSiteSearchVisible,l]);return E.jsx(Wi.Provider,{children:e,value:h})}Ll.displayName="LibraryContextProvider";function zh(){const{setIsNavVisible:e,setIsSiteSearchVisible:t}=Dt(),{pathname:n}=Be();return p.useLayoutEffect(()=>{e(!1),t(!1);const r=document.body.querySelector("[data-main-scrollable]");if(r){const o=setTimeout(()=>{r.scrollTo(0,0)},1);return()=>{clearTimeout(o)}}},[n,e,t]),null}const Uh={"*":p.lazy(()=>Promise.resolve().then(()=>require("./PageNotFound-7zWg_AHz.cjs"))),"/":p.lazy(()=>Promise.resolve().then(()=>require("./GettingStartedRoute-Caqc6Q58.cjs"))),"/common-questions":p.lazy(()=>Promise.resolve().then(()=>require("./CommonQuestionsRoute-BaUo7C5J.cjs"))),"/support":p.lazy(()=>Promise.resolve().then(()=>require("./SupportRoute-CIsa-DtE.cjs"))),"/versions":p.lazy(()=>Promise.resolve().then(()=>require("./VersionsRoute-5s8sUTHm.cjs")))};function qh(e,t=250){const[n,r]=p.useState(e);return p.useEffect(()=>{if(t===0)p.startTransition(()=>r(e));else{const o=setTimeout(()=>{p.startTransition(()=>r(e))},t);return()=>{clearTimeout(o)}}},[t,e]),n}let ir;function Gh(){return ir===void 0&&(ir=new Promise(e=>{Promise.all([Promise.resolve().then(()=>require("./fuse-CM2wbN_z.cjs")).then(t=>t.default),fetch("/generated/search-records.json").then(t=>t.json()),fetch("/generated/search-index.json").then(t=>t.json())]).then(([t,n,r])=>{const o=new t(n,{ignoreLocation:!0,includeMatches:!1,isCaseSensitive:!1,keys:[{name:"title",weight:5},{name:"section",weight:1},{name:"text",weight:1}],minMatchCharLength:2,threshold:0},t.parseIndex(r));e(o)})})),ir}function Kh({isActive:e,result:{item:{path:t,section:n,text:r,title:o}},searchTextDeferred:i}){const s=p.useRef(null),l=p.useMemo(()=>xi(o,i),[i,o]),a=p.useMemo(()=>r?xi(r,i,{maxLength:150,leading:25}):"",[i,r]);return p.useEffect(()=>{e&&s.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[e]),E.jsx("li",{ref:s,children:E.jsxs(Wt,{className:re("rounded px-2 py-1 text-white/80 hover:text-white hover:bg-white/10 cursor-pointer transition-colors!","flex flex-row items-center gap-2 overflow-auto",{"bg-sky-950 hover:bg-sky-950 text-white":e}),"data-active-search-result":e||void 0,to:t,children:[E.jsxs("div",{className:"grow-1 shrink-1 overflow-auto flex flex-col gap-1",children:[E.jsxs("div",{className:"grow text-lg truncate text-white",children:[n,n&&" ",l]}),a&&E.jsx("div",{className:"text-sm truncate pb-1",children:a})]}),E.jsx($r,{className:"h-4 w-4 shrink-0"})]})})}function xi(e,t,n){const{maxLength:r=250,leading:o=0}=n??{};if(t=t.toLowerCase(),r&&e.length>r){const a=e.toLowerCase().indexOf(t),c=Math.max(0,a-o),u=Math.min(e.length,c+r);e=e.substring(c,u),c>0&&(e="…"+e)}const i=[],s=e.toLowerCase().split(t);let l=0;for(let a=0;a<s.length;a++){const c=s[a];i.push(e.substring(l,l+c.length)),l+=c.length;const u=e.substring(l,l+t.length);u&&i.push(E.jsx("mark",{className:"bg-transparent text-sky-300",children:u},l)),l+=t.length}return l<e.length-1&&i.push(e.substring(l)),i}function Yh({inputRef:e,searchTextDeferred:t}){const n=p.use(Gh()),[r,o]=p.useState(0),i=p.useMemo(()=>t?n.search(t,{limit:10}):[],[n,t]);return p.useEffect(()=>{if(e){const s=l=>{switch(l.key){case"ArrowDown":{const a=r<i.length-1?r+1:0;o(a);break}case"ArrowUp":{const a=r>0?r-1:i.length-1;o(a);break}case"Enter":{const a=document.body.querySelector("[data-active-search-result]");a instanceof HTMLAnchorElement&&a.click();break}}};return e.addEventListener("keydown",s),()=>{e.removeEventListener("keydown",s)}}},[r,e,i,t]),E.jsxs("ul",{className:"border-t border-white/10 pt-3 mt-3 flex flex-col gap-1 overflow-auto",children:[t&&i.length===0&&E.jsxs("div",{children:['No results for "',t,'"']}),i.map((s,l)=>E.jsx(Kh,{isActive:r===l,result:s,searchTextDeferred:t},l))]})}function Xh(){const{isSiteSearchVisible:e,setIsSiteSearchVisible:t}=Dt(),[n,r]=p.useState(null),[o,i]=p.useState(""),s=qh(o);return p.useEffect(()=>{if(!e){const l=a=>{switch(a.key){case"K":case"k":{(a.metaKey||a.ctrlKey)&&t(!0);break}}};return document.body.addEventListener("keydown",l),()=>{document.body.removeEventListener("keydown",l)}}},[e,t]),e?E.jsx("div",{className:"fixed inset-0 backdrop-blur-md p-4 flex flex-col items-center animate duration-500 animate-fade-in",onClick:()=>{i(""),t(!1)},children:E.jsxs("div",{className:"shadow-background-gradient-2/20 shadow-md bg-black/80 rounded-lg py-3 pl-4 pr-3 max-w-full w-200 max-h-full overflow-auto flex flex-col",children:[E.jsxs("div",{className:"flex items-center gap-3 shrink-0",onClick:l=>l.stopPropagation(),children:[E.jsx(yi,{className:"w-4 h-4"}),E.jsx("input",{autoFocus:!0,className:"grow text-lg md:tex-md",onKeyDown:l=>{l.key==="Escape"&&(i(""),t(!1))},onChange:l=>{i(l.currentTarget.value)},ref:r,placeholder:"Search documentation",value:o}),E.jsx("div",{className:"border border-white/20 rounded text-sm px-1 cursor-pointer",onClick:()=>t(!1),children:"esc"})]}),s&&E.jsx(Yh,{inputRef:n,searchTextDeferred:s},s)]})}):null}const Zh=typeof navigator<"u"&&navigator.userAgent.indexOf("Win")>=0?"^K":"⌘K";function Jh({enableSiteSearch:e,navLinks:t,routes:n,...r}){return E.jsx(Ll,{...r,children:E.jsx(Qh,{enableSiteSearch:e,navLinks:t,routes:n})})}function Qh({enableSiteSearch:e,navLinks:t,routes:n}){const{isNavVisible:r,isSiteSearchVisible:o,packageDescription:i,packageName:s,setIsNavVisible:l,setIsSiteSearchVisible:a,versions:c}=Dt();return E.jsxs(mc,{children:[E.jsx(zh,{}),E.jsxs("div",{className:"h-full w-full max-w-350 mx-auto flex flex-col",children:[E.jsxs(he,{align:"center",className:"h-12 w-full p-4",direction:"row",gap:4,children:[E.jsx(Sc,{className:"shrink-0 w-8 h-8"}),E.jsxs(he,{className:"overflow-hidden",align:"center",direction:"row",gap:4,children:[E.jsx(Wt,{children:s,className:"text-xl text-header-package-name! font-bold cursor-pointer truncate",to:"/"}),E.jsx("div",{className:"hidden md:block text-header-package-description",children:i})]}),E.jsx("div",{className:"grow"}),E.jsxs(he,{align:"center",direction:"row",gap:4,children:[e&&E.jsx(bi,{isActive:o,onClick:()=>a(!o),title:"Site search",children:E.jsxs("div",{className:"h-8 flex items-center justify-center gap-1 px-2 rounded-full text-sm bg-black/40 hover:bg-black/60 transition-colors!",children:[E.jsx(yi,{className:"w-4 h-4"}),Zh]})}),c!==void 0&&E.jsx(or,{ariaLabel:"Documentation for other versions",children:E.jsx(Vi,{className:"w-6 h-6"}),title:"Previous versions",to:"/versions"}),E.jsx(or,{ariaLabel:"NPM project page",children:E.jsx(Rc,{className:"w-8 h-8"}),className:"hidden sm:block",href:`https://www.npmjs.com/package/${s}`,title:"NPM package"}),E.jsx(or,{ariaLabel:"GitHub project page",children:E.jsx(Cc,{className:"w-6 h-6"}),className:"hidden sm:block",href:`https://github.com/bvaughn/${s}`,title:"Source code"}),E.jsx(bi,{ariaLabel:"Site navigation menu",className:"block md:hidden",isActive:r,onClick:()=>l(!r),title:r?"Hide menu":"Show menu",children:r?E.jsx(Jl,{className:"w-6 h-6 fill-current drop-shadow-black/20 drop-shadow-xs"}):E.jsx(Bl,{className:"w-6 h-6 fill-current drop-shadow-black/20 drop-shadow-xs"})})]})]}),E.jsxs("div",{className:"grow shrink flex flex-row shadow-lg mx-2 rounded-t-3xl overflow-hidden",children:[E.jsx("section",{className:re("w-full bg-black/90 md:block md:w-80 md:bg-black/80 overflow-auto",{hidden:!r}),children:E.jsx(Wh,{children:t})}),E.jsx("main",{className:re("w-full bg-black/90 relative overflow-auto",{hidden:r}),children:E.jsx("div",{className:"h-full p-4 py-4 overflow-auto [mask-image:linear-gradient(to_bottom,transparent,black_1.5rem)]","data-main-scrollable":!0,children:E.jsx(za,{children:Object.entries({...Uh,...n}).map(([u,f])=>E.jsx(Ni,{element:E.jsx(so,{children:E.jsx(f,{})},u),path:u},u))})})})]})]}),e&&E.jsx(Xh,{})]})}function eg({children:e,className:t,...n}){return E.jsx(so,{children:E.jsx("div",{className:`border-lg bg-black/30 text-slate-300 rounded-lg p-2 ${t}`,...n,children:e})})}const tg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"m424-424-86-86q-11-11-28-11t-28 11q-11 11-11 28t11 28l114 114q12 12 28 12t28-12l226-226q11-11 11-28t-11-28q-11-11-28-11t-28 11L424-424ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})),ng=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"M320-440h320q17 0 28.5-11.5T680-480q0-17-11.5-28.5T640-520H320q-17 0-28.5 11.5T280-480q0 17 11.5 28.5T320-440ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})),rg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"}));function og({checked:e,children:t,className:n,indeterminate:r,onChange:o,...i}){let s,l;return r?(s=ng,l="fill-white"):e?(s=tg,l="fill-blue-600"):(s=rg,l="fill-slate-600"),E.jsxs("label",{className:`cursor-pointer rounded-lg flex flex-row items-center outline-none group ${n}`,"data-focus-within":!0,...i,children:[E.jsx("input",{checked:e,className:"w-0 h-0",onChange:a=>{o(a.currentTarget.checked)},type:"checkbox"}),E.jsx(s,{className:l}),t&&E.jsxs(E.Fragment,{children:[" ",t]})]})}function uo({className:e="",html:t}){return E.jsx("div",{className:"relative",children:E.jsx("code",{className:re("text-sm md:text-base block text-left whitespace-pre-wrap break-normal text-white! rounded-md p-3 bg-black","flex flex-col",e),dangerouslySetInnerHTML:{__html:t}})})}function zt({className:e,sections:t}){return E.jsx(he,{className:e,direction:"column",gap:2,children:t.map(({content:n,intent:r},o)=>r?E.jsx(Fr,{html:!0,inline:!0,intent:r,minimal:!0,children:n},o):E.jsx("div",{dangerouslySetInnerHTML:{__html:n.replaceAll("<ul>",'<ul class="list-disc pl-4">')}},o))})}function fo({section:e,sourceCodePath:t,title:n}){const{repositoryUrl:r}=Dt();return E.jsxs(E.Fragment,{children:[E.jsxs("header",{className:"text-xl",children:[e&&E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"text-xl whitespace-nowrap","data-section":!0,children:e})," ",E.jsx($r,{className:"size-4 text-slate-400 inline"})," "]}),E.jsx("span",{className:"text-xl","data-title":!0,children:n}),t&&E.jsx(co,{className:"text-sm text-emerald-300 hover:text-white",href:`${r}/blob/main/${t}`,children:E.jsx(jl,{className:"inline-block size-4 fill-current ml-2 mb-1"})})]}),E.jsx("title",{children:e?`${e}: ${n}`:n})]})}function ig({method:e}){return E.jsxs(E.Fragment,{children:[E.jsx("dd",{className:"[&_code]:text-sky-300 text-lg font-bold",children:e.name}),E.jsxs("dt",{className:"mb-2",children:[E.jsx(zt,{sections:e.description}),E.jsx(uo,{className:"mt-2 p-2 flex flex-col",html:e.html})]})]})}function sg({json:e,section:t}){return E.jsxs(he,{direction:"column",gap:4,children:[E.jsx(fo,{section:t,sourceCodePath:e.filePath,title:`${e.name}`}),E.jsx(zt,{sections:e.description}),E.jsx(he,{direction:"column",children:E.jsx("dl",{className:"flex flex-col gap-2",children:e.methods.map((n,r)=>E.jsx(ig,{method:n},r))})})]})}function lg({children:e,className:t,onChange:n,value:r,...o}){return E.jsx("input",{className:`rounded-md bg-black/30 border border-2 border-transparent py-1 px-2 outline-none focus:border-emerald-300 ${t}`,"data-focus":!0,onChange:i=>{n(i.currentTarget.value)},value:r,...o,children:e})}function ag(){return E.jsxs(he,{align:"center",className:"text-slate-300",direction:"row",gap:2,children:[E.jsx(Il,{className:"size-4 animate-spin"}),"Loading..."]})}function Ml({children:e,className:t,disabled:n}){return E.jsx(he,{align:"center",className:re("px-4 h-8 cursor-pointer text-white/90 hover:text-white focus:bg-white/10 focus-within:bg-white/10",{"pointer-events-none text-white/50":n},t),direction:"row",gap:1,children:e})}function cg({children:e,className:t,path:n}){return E.jsx(Wt,{to:n,children:({isActive:r,isPending:o})=>E.jsx(Ml,{className:re("px-4 cursor-pointer",{"font-bold text-nav-active hover:text-nav-hover":r,"opacity-50 pointer-events-none":o},t),children:E.jsx(he,{align:"center",direction:"row",gap:2,children:e})})})}function ug({children:e,label:t}){return E.jsxs(_p,{as:"section",defaultOpen:!0,children:[E.jsx(xl,{className:"w-full group border-none! data-focus:bg-white/10",children:E.jsxs(Ml,{children:[E.jsx("div",{className:"uppercase text-sm font-bold text-white/50",children:t}),E.jsx("div",{className:"grow"}),E.jsx($r,{className:"size-4 fill-white/60 group-data-hover:fill-white/50 group-data-open:rotate-90"})]})}),E.jsx(wl,{className:"pl-4",children:e})]})}function dg(e){const t=[],n=[];return Object.values(e.props).forEach(r=>{r.required?n.push(r):t.push(r)}),t.sort((r,o)=>r.name.localeCompare(o.name)),n.sort((r,o)=>r.name.localeCompare(o.name)),{optionalProps:t,requiredProps:n}}function fg({prop:e}){return E.jsxs(E.Fragment,{children:[E.jsx("dt",{className:"mt-6 pl-8 indent-[-1rem]",children:E.jsx(uo,{className:"bg-transparent inline-flex flex-col p-0",html:e.html})}),E.jsx("dd",{className:"mt-2 pl-4 [&_code]:text-sky-300",children:E.jsx(zt,{sections:e.description})})]})}function kr({header:e,props:t}){return t.length===0?null:E.jsxs(he,{direction:"column",children:[E.jsx("div",{className:"text-lg font-bold",children:e}),E.jsx("dl",{children:t.map(n=>E.jsx(fg,{prop:n},n.name))})]})}function mg({json:e,section:t}){const{optionalProps:n,requiredProps:r}=p.useMemo(()=>dg(e),[e]);return E.jsxs(he,{direction:"column",gap:4,children:[E.jsx(fo,{section:t,sourceCodePath:e.filePath,title:`${e.name} component`}),E.jsx(zt,{sections:e.description}),E.jsx(kr,{header:"Required props",props:r}),E.jsx(kr,{header:"Optional props",props:n})]})}const pg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"m424-408-86-86q-11-11-28-11t-28 11q-11 11-11 28t11 28l114 114q12 12 28 12t28-12l226-226q11-11 11-28t-11-28q-11-11-28-11t-28 11L424-408Zm56 328q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"})),hg=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",...e},m.createElement("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"}));function gg({checked:e,children:t,className:n,name:r,onChange:o,value:i,...s}){let l,a;return e?(l=pg,a="fill-blue-600"):(l=hg,a="fill-slate-600"),E.jsxs("label",{className:`cursor-pointer rounded-full flex flex-row items-center outline-none group ${n}`,"data-focus-within":!0,...s,children:[E.jsx("input",{checked:e,className:"w-0 h-0",name:r,onChange:()=>{o(i)},type:"radio",value:i}),E.jsx(l,{className:a}),t&&E.jsxs(E.Fragment,{children:[" ",t]})]})}function vg({className:e,defaultValue:t,onChange:n,options:r,placeholder:o="",value:i}){return E.jsx(ih,{value:i??t,onChange:n,children:E.jsxs("div",{className:`relative ${e}`,children:[E.jsxs(Sl,{className:"w-full h-9 text-left rounded-md bg-black/30 border border-2 border-transparent py-1 px-2 outline-none focus:border-teal-300","data-focus":!0,children:[i?.label?E.jsx("span",{className:"block truncate",children:i.label}):E.jsx("span",{className:"block truncate text-slate-500",children:o}),E.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:E.jsx(Ul,{className:"h-4 w-4 text-gray-400","aria-hidden":"true"})})]}),E.jsx(Rp,{as:p.Fragment,leaveFrom:"opacity-100",leaveTo:"opacity-0",children:E.jsx(kl,{className:"absolute z-10 mt-1 max-h-50 w-full overflow-auto rounded-md py-1 bg-black/90","data-focus":!0,children:r.map((s,l)=>E.jsx($l,{className:re("relative cursor-pointer select-none h-7 py-1 px-2 text-slate-300 border-none!","data-focus:text-teal-300 data-focus:bg-black","data-active:text-teal-300 data-active:bg-black","data-selected:text-teal-300 data-selected:font-bold"),value:s,children:s.label},l))})})]})})}function bg(e,t){switch(e){case"danger":return t?"bg-red-950 text-red-300 [&_svg]:text-red-500":"bg-black/10 bg-border border-2 border-red-500 text-white [&_svg]:text-red-500 [&_a]:text-red-400!";case"none":return t?"bg-white/10 text-slate-300 [&_svg]:text-slate-400":"bg-black/10 bg-border border-2 border-white/40 text-white [&_svg]:text-white/60";case"primary":return t?"bg-sky-950 text-sky-300 [&_svg]:text-sky-400":"bg-black/10 bg-border border-2 border-sky-400 text-white [&_svg]:text-sky-400";case"success":return t?"bg-emerald-950 text-emerald-300 [&_svg]:text-emerald-400":"bg-black/10 bg-border border-2 border-emerald-400 text-white [&_svg]:text-emerald-400";case"warning":return t?"bg-amber-950/65 text-amber-200 [&_svg]:text-amber-300":"bg-black/10 bg-border border-2 border-amber-400 text-white [&_svg]:text-amber-400 [&_a]:text-amber-400!"}}exports.AppRoot=Jh;exports.Block=eg;exports.Box=he;exports.Button=Pl;exports.Callout=Fr;exports.Checkbox=og;exports.Code=uo;exports.ComponentProps=mg;exports.ComponentPropsSection=kr;exports.DocsSection=zt;exports.ErrorBoundary=so;exports.ExternalLink=co;exports.Header=fo;exports.ImperativeHandle=sg;exports.Input=lg;exports.Link=Wt;exports.LoadingSpinner=ag;exports.NavLink=cg;exports.NavSection=ug;exports.Radio=gg;exports.Select=vg;exports.SvgTags=Vi;exports.Tooltip=ao;exports.assert=zi;exports.cn=re;exports.getIntentClassNames=bg;exports.useLibraryContext=Dt;
8
+ //# sourceMappingURL=index-rOOr2GGh.cjs.map