blowfish/node_modules/@headlessui/react/dist/headlessui.prod.cjs
2023-01-29 22:30:24 +00:00

4 lines
88 KiB
JavaScript

var bn=Object.create;var Tt=Object.defineProperty;var gn=Object.getOwnPropertyDescriptor;var yn=Object.getOwnPropertyNames;var vn=Object.getPrototypeOf,Pn=Object.prototype.hasOwnProperty;var En=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},br=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yn(t))!Pn.call(e,i)&&i!==r&&Tt(e,i,{get:()=>t[i],enumerable:!(n=gn(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?bn(vn(e)):{},br(t||!e||!e.__esModule?Tt(r,"default",{value:e,enumerable:!0}):r,e)),xn=e=>br(Tt({},"__esModule",{value:!0}),e);var rl={};En(rl,{Combobox:()=>$n,Dialog:()=>Po,Disclosure:()=>Mo,FocusTrap:()=>Be,Listbox:()=>Ko,Menu:()=>ni,Popover:()=>vi,Portal:()=>pt,RadioGroup:()=>hi,Switch:()=>Di,Tab:()=>$i,Transition:()=>tl});module.exports=xn(rl);var j=pe(require("react"),1);var yr=require("react");var bt=require("react");var De=typeof window=="undefined"||typeof document=="undefined";var H=De?bt.useEffect:bt.useLayoutEffect;var gr=require("react");function J(e){let t=(0,gr.useRef)(e);return H(()=>{t.current=e},[e]),t}function Fe(e,t){let[r,n]=(0,yr.useState)(e),i=J(e);return H(()=>n(i.current),[i,n,...t]),r}var gt=require("react");function he(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ie(){let e=[],t=[],r={enqueue(n){t.push(n)},addEventListener(n,i,a,o){return n.addEventListener(i,a,o),r.add(()=>n.removeEventListener(i,a,o))},requestAnimationFrame(...n){let i=requestAnimationFrame(...n);return r.add(()=>cancelAnimationFrame(i))},nextFrame(...n){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...n))},setTimeout(...n){let i=setTimeout(...n);return r.add(()=>clearTimeout(i))},microTask(...n){let i={current:!0};return he(()=>{i.current&&n[0]()}),r.add(()=>{i.current=!1})},add(n){return e.push(n),()=>{let i=e.indexOf(n);if(i>=0){let[a]=e.splice(i,1);a()}}},dispose(){for(let n of e.splice(0))n()},async workQueue(){for(let n of t.splice(0))await n()}};return r}function le(){let[e]=(0,gt.useState)(ie);return(0,gt.useEffect)(()=>()=>e.dispose(),[e]),e}var vr=pe(require("react"),1);var b=function(t){let r=J(t);return vr.default.useCallback((...n)=>r.current(...n),[r])};var wt=pe(require("react"),1);var nt=require("react"),Ft={serverHandoffComplete:!1};function xe(){let[e,t]=(0,nt.useState)(Ft.serverHandoffComplete);return(0,nt.useEffect)(()=>{e!==!0&&t(!0)},[e]),(0,nt.useEffect)(()=>{Ft.serverHandoffComplete===!1&&(Ft.serverHandoffComplete=!0)},[]),e}var Rn=0;function Pr(){return++Rn}var Er,V=(Er=wt.default.useId)!=null?Er:function(){let t=xe(),[r,n]=wt.default.useState(t?Pr:null);return H(()=>{r===null&&n(Pr())},[r]),r!=null?""+r:void 0};var it=require("react");function M(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,M),n}function de(e){return De?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}var kt=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");function ot(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(kt)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ce(e,t=0){var r;return e===((r=de(e))==null?void 0:r.body)?!1:M(t,{[0](){return e.matches(kt)},[1](){let n=e;for(;n!==null;){if(n.matches(kt))return!0;n=n.parentElement}return!1}})}function Ht(e){let t=de(e);ie().nextFrame(()=>{t&&!Ce(t.activeElement,0)&&Le(e)})}function Le(e){e==null||e.focus({preventScroll:!0})}var Sn=["textarea","input"].join(",");function On(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Sn))!=null?r:!1}function ve(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function xr(e,t){return oe(ot(),t,{relativeTo:e})}function oe(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?ve(e):e:ot(e);i.length>0&&(o=o.filter(v=>!i.includes(v))),n=n!=null?n:a.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")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=t&32?{preventScroll:!0}:{},p=0,m=o.length,d;do{if(p>=m||p+m<=0)return 0;let v=u+p;if(t&16)v=(v+m)%m;else{if(v<0)return 3;if(v>=m)return 1}d=o[v],d==null||d.focus(s),p+=l}while(d!==a.activeElement);return t&6&&On(d)&&d.select(),d.hasAttribute("tabindex")||d.setAttribute("tabindex","0"),2}var Rr=require("react");function yt(e,t,r){let n=J(t);(0,Rr.useEffect)(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Oe(e,t,r=!0){let n=(0,it.useRef)(!1);(0,it.useEffect)(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(o,l){if(!n.current||o.defaultPrevented)return;let u=function p(m){return typeof m=="function"?p(m()):Array.isArray(m)||m instanceof Set?m:[m]}(e),s=l(o);if(s!==null&&!!s.getRootNode().contains(s)){for(let p of u){if(p===null)continue;let m=p instanceof HTMLElement?p:p.current;if(m!=null&&m.contains(s)||o.composed&&o.composedPath().includes(m))return}return!Ce(s,1)&&s.tabIndex!==-1&&o.preventDefault(),t(o,s)}}let a=(0,it.useRef)(null);yt("mousedown",o=>{var l,u;n.current&&(a.current=((u=(l=o.composedPath)==null?void 0:l.call(o))==null?void 0:u[0])||o.target)},!0),yt("click",o=>{!a.current||(i(o,()=>a.current),a.current=null)},!0),yt("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}var Or=require("react");function Sr(e){var r;if(e.type)return e.type;let t=(r=e.as)!=null?r:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function be(e,t){let[r,n]=(0,Or.useState)(()=>Sr(e));return H(()=>{n(Sr(e))},[e.type,e.as]),H(()=>{r||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&n("button")},[r,t]),r}var vt=require("react");var Ar=Symbol();function je(e,t=!0){return Object.assign(e,{[Ar]:t})}function D(...e){let t=(0,vt.useRef)(e);(0,vt.useEffect)(()=>{t.current=e},[e]);let r=b(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Ar]))?void 0:r}var lt=require("react");function We({container:e,accept:t,walk:r,enabled:n=!0}){let i=(0,lt.useRef)(t),a=(0,lt.useRef)(r);(0,lt.useEffect)(()=>{i.current=t,a.current=r},[t,r]),H(()=>{if(!e||!n)return;let o=de(e);if(!o)return;let l=i.current,u=a.current,s=Object.assign(m=>l(m),{acceptNode:l}),p=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;p.nextNode();)u(p.currentNode)},[e,n,i,a])}function An(e){throw new Error("Unexpected object: "+e)}function Ke(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),i=n!=null?n:-1,a=(()=>{switch(e.focus){case 0:return r.findIndex(o=>!t.resolveDisabled(o));case 1:{let o=r.slice().reverse().findIndex((l,u,s)=>i!==-1&&s.length-u-1>=i?!1:!t.resolveDisabled(l));return o===-1?o:r.length-1-o}case 2:return r.findIndex((o,l)=>l<=i?!1:!t.resolveDisabled(o));case 3:{let o=r.slice().reverse().findIndex(l=>!t.resolveDisabled(l));return o===-1?o:r.length-1-o}case 4:return r.findIndex(o=>t.resolveId(o)===e.id);case 5:return null;default:An(e)}})();return a===-1?n:a}var Pe=require("react");function C({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o}){let l=hr(t,e);if(a)return Pt(l,r,n,o);let u=i!=null?i:0;if(u&2){let{static:s=!1,...p}=l;if(s)return Pt(p,r,n,o)}if(u&1){let{unmount:s=!0,...p}=l;return M(s?0:1,{[0](){return null},[1](){return Pt({...p,hidden:!0,style:{display:"none"}},r,n,o)}})}return Pt(l,r,n,o)}function Pt(e,t={},r,n){let{as:i=r,children:a,refName:o="ref",...l}=Nt(e,["unmount","static"]),u=e.ref!==void 0?{[o]:e.ref}:{},s=typeof a=="function"?a(t):a;l.className&&typeof l.className=="function"&&(l.className=l.className(t));let p={};if(t){let m=!1,d=[];for(let[v,c]of Object.entries(t))typeof c=="boolean"&&(m=!0),c===!0&&d.push(v);m&&(p["data-headlessui-state"]=d.join(" "))}if(i===Pe.Fragment&&Object.keys(Ae(l)).length>0){if(!(0,Pe.isValidElement)(s)||Array.isArray(s)&&s.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(m=>` - ${m}`).join(`
`),"","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(m=>` - ${m}`).join(`
`)].join(`
`));return(0,Pe.cloneElement)(s,Object.assign({},hr(s.props,Ae(Nt(l,["ref"]))),p,u,hn(s.ref,u.ref)))}return(0,Pe.createElement)(i,Object.assign({},Nt(l,["ref"]),i!==Pe.Fragment&&u,i!==Pe.Fragment&&p),s)}function hn(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}}function hr(...e){var n;if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let i of e)for(let a in i)a.startsWith("on")&&typeof i[a]=="function"?((n=r[a])!=null||(r[a]=[]),r[a].push(i[a])):t[a]=i[a];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(i=>[i,void 0])));for(let i in r)Object.assign(t,{[i](a,...o){let l=r[i];for(let u of l){if((a instanceof Event||(a==null?void 0:a.nativeEvent)instanceof Event)&&a.defaultPrevented)return;u(a,...o)}}});return t}function L(e){var t;return Object.assign((0,Pe.forwardRef)(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ae(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Nt(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function fe(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&Cn(r)?!1:n}function Cn(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function we(e={},t=null,r=[]){for(let[n,i]of Object.entries(e))Lr(r,Cr(t,n),i);return r}function Cr(e,t){return e?e+"["+t+"]":t}function Lr(e,t,r){if(Array.isArray(r))for(let[n,i]of r.entries())Lr(e,Cr(t,n.toString()),i);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):we(r,t,e)}function Et(e){var r;let t=(r=e==null?void 0:e.form)!=null?r:e.closest("form");if(!!t){for(let n of t.elements)if(n.tagName==="INPUT"&&n.type==="submit"||n.tagName==="BUTTON"&&n.type==="submit"||n.nodeName==="INPUT"&&n.type==="image"){n.click();return}}}var Ln="div";var se=L(function(t,r){let{features:n=1,...i}=t,a={ref:r,"aria-hidden":(n&2)===2?!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",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return C({ourProps:a,theirProps:i,slot:{},defaultTag:Ln,name:"Hidden"})});var $e=pe(require("react"),1),Bt=(0,$e.createContext)(null);Bt.displayName="OpenClosedContext";function Te(){return(0,$e.useContext)(Bt)}function Ee({value:e,children:t}){return $e.default.createElement(Bt.Provider,{value:e},t)}var qe=require("react");function Ie(e,t,r){let[n,i]=(0,qe.useState)(r),a=e!==void 0,o=(0,qe.useRef)(a),l=(0,qe.useRef)(!1),u=(0,qe.useRef)(!1);return a&&!o.current&&!l.current?(l.current=!0,o.current=a,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.")):!a&&o.current&&!u.current&&(u.current=!0,o.current=a,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.")),[a?e:n,b(s=>(a||i(s),t==null?void 0:t(s)))]}var xt=require("react");function at(e,t){let r=(0,xt.useRef)([]),n=b(e);(0,xt.useEffect)(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let l=n(t,i);return r.current=t,l}},[n,...t])}var Mr=require("react");function Ir(e){return[e.screenX,e.screenY]}function Qe(){let e=(0,Mr.useRef)([-1,-1]);return{wasMoved(t){let r=Ir(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=Ir(t)}}}function Ut(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=ve(t(e.options.slice()),a=>a.dataRef.current.domRef.current),i=r?n.indexOf(r):null;return i===-1&&(i=null),{options:n,activeOptionIndex:i}}var In={[1](e){return e.dataRef.current.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},[0](e){if(e.dataRef.current.disabled||e.comboboxState===0)return e;let t=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,n=e.options.findIndex(i=>r(i.dataRef.current.value));return n!==-1&&(t=n),{...e,comboboxState:0,activeOptionIndex:t}},[2](e,t){var i;if(e.dataRef.current.disabled||e.dataRef.current.optionsRef.current&&!e.dataRef.current.optionsPropsRef.current.static&&e.comboboxState===1)return e;let r=Ut(e);if(r.activeOptionIndex===null){let a=r.options.findIndex(o=>!o.dataRef.current.disabled);a!==-1&&(r.activeOptionIndex=a)}let n=Ke(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...e,...r,activeOptionIndex:n,activationTrigger:(i=t.trigger)!=null?i:1}},[3]:(e,t)=>{let r={id:t.id,dataRef:t.dataRef},n=Ut(e,a=>[...a,r]);e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(n.activeOptionIndex=n.options.indexOf(r));let i={...e,...n,activationTrigger:1};return e.dataRef.current.__demoMode&&e.dataRef.current.value===void 0&&(i.activeOptionIndex=0),i},[4]:(e,t)=>{let r=Ut(e,n=>{let i=n.findIndex(a=>a.id===t.id);return i!==-1&&n.splice(i,1),n});return{...e,...r,activationTrigger:1}},[5]:(e,t)=>({...e,labelId:t.id})},Gt=(0,j.createContext)(null);Gt.displayName="ComboboxActionsContext";function st(e){let t=(0,j.useContext)(Gt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,st),r}return t}var Vt=(0,j.createContext)(null);Vt.displayName="ComboboxDataContext";function Ye(e){let t=(0,j.useContext)(Vt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ye),r}return t}function Mn(e,t){return M(t.type,In,e,t)}var Dn=j.Fragment;function Fn(e,t){let{value:r,defaultValue:n,onChange:i,name:a,by:o=(A,B)=>A===B,disabled:l=!1,__demoMode:u=!1,nullable:s=!1,multiple:p=!1,...m}=e,[d=p?[]:void 0,v]=Ie(r,i,n),[c,f]=(0,j.useReducer)(Mn,{dataRef:(0,j.createRef)(),comboboxState:u?0:1,options:[],activeOptionIndex:null,activationTrigger:1,labelId:null}),g=(0,j.useRef)(!1),y=(0,j.useRef)({static:!1,hold:!1}),P=(0,j.useRef)(null),E=(0,j.useRef)(null),h=(0,j.useRef)(null),F=(0,j.useRef)(null),R=b(typeof o=="string"?(A,B)=>{let k=o;return(A==null?void 0:A[k])===(B==null?void 0:B[k])}:o),S=(0,j.useCallback)(A=>M(x.mode,{[1]:()=>d.some(B=>R(B,A)),[0]:()=>R(d,A)}),[d]),x=(0,j.useMemo)(()=>({...c,optionsPropsRef:y,labelRef:P,inputRef:E,buttonRef:h,optionsRef:F,value:d,defaultValue:n,disabled:l,mode:p?1:0,get activeOptionIndex(){if(g.current&&c.activeOptionIndex===null&&c.options.length>0){let A=c.options.findIndex(B=>!B.dataRef.current.disabled);if(A!==-1)return A}return c.activeOptionIndex},compare:R,isSelected:S,nullable:s,__demoMode:u}),[d,n,l,p,s,u,c]);H(()=>{c.dataRef.current=x},[x]),Oe([x.buttonRef,x.inputRef,x.optionsRef],()=>te.closeCombobox(),x.comboboxState===0);let N=(0,j.useMemo)(()=>({open:x.comboboxState===0,disabled:l,activeIndex:x.activeOptionIndex,activeOption:x.activeOptionIndex===null?null:x.options[x.activeOptionIndex].dataRef.current.value,value:d}),[x,l,d]),I=b(A=>{let B=x.options.find(k=>k.id===A);!B||re(B.dataRef.current.value)}),w=b(()=>{if(x.activeOptionIndex!==null){let{dataRef:A,id:B}=x.options[x.activeOptionIndex];re(A.current.value),te.goToOption(4,B)}}),T=b(()=>{f({type:0}),g.current=!0}),O=b(()=>{f({type:1}),g.current=!1}),W=b((A,B,k)=>(g.current=!1,A===4?f({type:2,focus:4,id:B,trigger:k}):f({type:2,focus:A,trigger:k}))),Y=b((A,B)=>(f({type:3,id:A,dataRef:B}),()=>f({type:4,id:A}))),ue=b(A=>(f({type:5,id:A}),()=>f({type:5,id:null}))),re=b(A=>M(x.mode,{[0](){return v==null?void 0:v(A)},[1](){let B=x.value.slice(),k=B.findIndex(Q=>R(Q,A));return k===-1?B.push(A):B.splice(k,1),v==null?void 0:v(B)}})),te=(0,j.useMemo)(()=>({onChange:re,registerOption:Y,registerLabel:ue,goToOption:W,closeCombobox:O,openCombobox:T,selectActiveOption:w,selectOption:I}),[]),U=t===null?{}:{ref:t},$=(0,j.useRef)(null),Z=le();return(0,j.useEffect)(()=>{!$.current||n!==void 0&&Z.addEventListener($.current,"reset",()=>{re(n)})},[$,re]),j.default.createElement(Gt.Provider,{value:te},j.default.createElement(Vt.Provider,{value:x},j.default.createElement(Ee,{value:M(x.comboboxState,{[0]:0,[1]:1})},a!=null&&d!=null&&we({[a]:d}).map(([A,B],k)=>j.default.createElement(se,{features:4,ref:k===0?Q=>{var ce;$.current=(ce=Q==null?void 0:Q.closest("form"))!=null?ce:null}:void 0,...Ae({key:A,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:A,value:B})})),C({ourProps:U,theirProps:m,slot:N,defaultTag:Dn,name:"Combobox"}))))}var wn=L(Fn),kn="input",Hn=L(function(t,r){var x,N,I,w;let n=V(),{id:i=`headlessui-combobox-input-${n}`,onChange:a,displayValue:o,type:l="text",...u}=t,s=Ye("Combobox.Input"),p=st("Combobox.Input"),m=D(s.inputRef,r),d=(0,j.useRef)(!1),v=le(),c=function(){var T;return typeof o=="function"&&s.value!==void 0?(T=o(s.value))!=null?T:"":typeof s.value=="string"?s.value:""}();at(([T,O],[W,Y])=>{d.current||!s.inputRef.current||(Y===0&&O===1||T!==W)&&(s.inputRef.current.value=T)},[c,s.comboboxState]);let f=(0,j.useRef)(!1),g=b(()=>{f.current=!0}),y=b(()=>{setTimeout(()=>{f.current=!1})}),P=b(T=>{switch(d.current=!0,T.key){case"Backspace":case"Delete":if(s.mode!==0||!s.nullable)return;let O=T.currentTarget;v.requestAnimationFrame(()=>{O.value===""&&(p.onChange(null),s.optionsRef.current&&(s.optionsRef.current.scrollTop=0),p.goToOption(5))});break;case"Enter":if(d.current=!1,s.comboboxState!==0||f.current)return;if(T.preventDefault(),T.stopPropagation(),s.activeOptionIndex===null){p.closeCombobox();return}p.selectActiveOption(),s.mode===0&&p.closeCombobox();break;case"ArrowDown":return d.current=!1,T.preventDefault(),T.stopPropagation(),M(s.comboboxState,{[0]:()=>{p.goToOption(2)},[1]:()=>{p.openCombobox()}});case"ArrowUp":return d.current=!1,T.preventDefault(),T.stopPropagation(),M(s.comboboxState,{[0]:()=>{p.goToOption(1)},[1]:()=>{p.openCombobox(),v.nextFrame(()=>{s.value||p.goToOption(3)})}});case"Home":if(T.shiftKey)break;return d.current=!1,T.preventDefault(),T.stopPropagation(),p.goToOption(0);case"PageUp":return d.current=!1,T.preventDefault(),T.stopPropagation(),p.goToOption(0);case"End":if(T.shiftKey)break;return d.current=!1,T.preventDefault(),T.stopPropagation(),p.goToOption(3);case"PageDown":return d.current=!1,T.preventDefault(),T.stopPropagation(),p.goToOption(3);case"Escape":return d.current=!1,s.comboboxState!==0?void 0:(T.preventDefault(),s.optionsRef.current&&!s.optionsPropsRef.current.static&&T.stopPropagation(),p.closeCombobox());case"Tab":if(d.current=!1,s.comboboxState!==0)return;s.mode===0&&p.selectActiveOption(),p.closeCombobox();break}}),E=b(T=>{p.openCombobox(),a==null||a(T)}),h=b(()=>{d.current=!1}),F=Fe(()=>{if(!!s.labelId)return[s.labelId].join(" ")},[s.labelId]),R=(0,j.useMemo)(()=>({open:s.comboboxState===0,disabled:s.disabled}),[s]),S={ref:m,id:i,role:"combobox",type:l,"aria-controls":(x=s.optionsRef.current)==null?void 0:x.id,"aria-expanded":s.disabled?void 0:s.comboboxState===0,"aria-activedescendant":s.activeOptionIndex===null||(N=s.options[s.activeOptionIndex])==null?void 0:N.id,"aria-multiselectable":s.mode===1?!0:void 0,"aria-labelledby":F,defaultValue:(w=(I=t.defaultValue)!=null?I:s.defaultValue!==void 0?o==null?void 0:o(s.defaultValue):null)!=null?w:s.defaultValue,disabled:s.disabled,onCompositionStart:g,onCompositionEnd:y,onKeyDown:P,onChange:E,onBlur:h};return C({ourProps:S,theirProps:u,slot:R,defaultTag:kn,name:"Combobox.Input"})}),_n="button",Nn=L(function(t,r){var f;let n=Ye("Combobox.Button"),i=st("Combobox.Button"),a=D(n.buttonRef,r),o=V(),{id:l=`headlessui-combobox-button-${o}`,...u}=t,s=le(),p=b(g=>{switch(g.key){case"ArrowDown":return g.preventDefault(),g.stopPropagation(),n.comboboxState===1&&i.openCombobox(),s.nextFrame(()=>{var y;return(y=n.inputRef.current)==null?void 0:y.focus({preventScroll:!0})});case"ArrowUp":return g.preventDefault(),g.stopPropagation(),n.comboboxState===1&&(i.openCombobox(),s.nextFrame(()=>{n.value||i.goToOption(3)})),s.nextFrame(()=>{var y;return(y=n.inputRef.current)==null?void 0:y.focus({preventScroll:!0})});case"Escape":return n.comboboxState!==0?void 0:(g.preventDefault(),n.optionsRef.current&&!n.optionsPropsRef.current.static&&g.stopPropagation(),i.closeCombobox(),s.nextFrame(()=>{var y;return(y=n.inputRef.current)==null?void 0:y.focus({preventScroll:!0})}));default:return}}),m=b(g=>{if(fe(g.currentTarget))return g.preventDefault();n.comboboxState===0?i.closeCombobox():(g.preventDefault(),i.openCombobox()),s.nextFrame(()=>{var y;return(y=n.inputRef.current)==null?void 0:y.focus({preventScroll:!0})})}),d=Fe(()=>{if(!!n.labelId)return[n.labelId,l].join(" ")},[n.labelId,l]),v=(0,j.useMemo)(()=>({open:n.comboboxState===0,disabled:n.disabled,value:n.value}),[n]),c={ref:a,id:l,type:be(t,n.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(f=n.optionsRef.current)==null?void 0:f.id,"aria-expanded":n.disabled?void 0:n.comboboxState===0,"aria-labelledby":d,disabled:n.disabled,onClick:m,onKeyDown:p};return C({ourProps:c,theirProps:u,slot:v,defaultTag:_n,name:"Combobox.Button"})}),Bn="label",Un=L(function(t,r){let n=V(),{id:i=`headlessui-combobox-label-${n}`,...a}=t,o=Ye("Combobox.Label"),l=st("Combobox.Label"),u=D(o.labelRef,r);H(()=>l.registerLabel(i),[i]);let s=b(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),p=(0,j.useMemo)(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return C({ourProps:{ref:u,id:i,onClick:s},theirProps:a,slot:p,defaultTag:Bn,name:"Combobox.Label"})}),Gn="ul",Vn=3,jn=L(function(t,r){var c;let n=V(),{id:i=`headlessui-combobox-options-${n}`,hold:a=!1,...o}=t,l=Ye("Combobox.Options"),u=D(l.optionsRef,r),s=Te(),p=(()=>s!==null?s===0:l.comboboxState===0)();H(()=>{var f;l.optionsPropsRef.current.static=(f=t.static)!=null?f:!1},[l.optionsPropsRef,t.static]),H(()=>{l.optionsPropsRef.current.hold=a},[l.optionsPropsRef,a]),We({container:l.optionsRef.current,enabled:l.comboboxState===0,accept(f){return f.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let m=Fe(()=>{var f,g;return(g=l.labelId)!=null?g:(f=l.buttonRef.current)==null?void 0:f.id},[l.labelId,l.buttonRef.current]),d=(0,j.useMemo)(()=>({open:l.comboboxState===0}),[l]),v={"aria-activedescendant":l.activeOptionIndex===null||(c=l.options[l.activeOptionIndex])==null?void 0:c.id,"aria-labelledby":m,role:"listbox",id:i,ref:u};return C({ourProps:v,theirProps:o,slot:d,defaultTag:Gn,features:Vn,visible:p,name:"Combobox.Options"})}),Wn="li",Kn=L(function(t,r){var N,I;let n=V(),{id:i=`headlessui-combobox-option-${n}`,disabled:a=!1,value:o,...l}=t,u=Ye("Combobox.Option"),s=st("Combobox.Option"),p=u.activeOptionIndex!==null?u.options[u.activeOptionIndex].id===i:!1,m=u.isSelected(o),d=(0,j.useRef)(null),v=J({disabled:a,value:o,domRef:d,textValue:(I=(N=d.current)==null?void 0:N.textContent)==null?void 0:I.toLowerCase()}),c=D(r,d),f=b(()=>s.selectOption(i));H(()=>s.registerOption(i,v),[v,i]);let g=(0,j.useRef)(!u.__demoMode);H(()=>{if(!u.__demoMode)return;let w=ie();return w.requestAnimationFrame(()=>{g.current=!0}),w.dispose},[]),H(()=>{if(u.comboboxState!==0||!p||!g.current||u.activationTrigger===0)return;let w=ie();return w.requestAnimationFrame(()=>{var T,O;(O=(T=d.current)==null?void 0:T.scrollIntoView)==null||O.call(T,{block:"nearest"})}),w.dispose},[d,p,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let y=b(w=>{if(a)return w.preventDefault();f(),u.mode===0&&s.closeCombobox()}),P=b(()=>{if(a)return s.goToOption(5);s.goToOption(4,i)}),E=Qe(),h=b(w=>E.update(w)),F=b(w=>{!E.wasMoved(w)||a||p||s.goToOption(4,i,0)}),R=b(w=>{!E.wasMoved(w)||a||!p||u.optionsPropsRef.current.hold||s.goToOption(5)}),S=(0,j.useMemo)(()=>({active:p,selected:m,disabled:a}),[p,m,a]);return C({ourProps:{id:i,ref:c,role:"option",tabIndex:a===!0?void 0:-1,"aria-disabled":a===!0?!0:void 0,"aria-selected":m,disabled:void 0,onClick:y,onFocus:P,onPointerEnter:h,onMouseEnter:h,onPointerMove:F,onMouseMove:F,onPointerLeave:R,onMouseLeave:R},theirProps:l,slot:S,defaultTag:Wn,name:"Combobox.Option"})}),$n=Object.assign(wn,{Input:Hn,Button:Nn,Label:Un,Options:jn,Option:Kn});var K=pe(require("react"),1);var ye=pe(require("react"),1);var kr=require("react");var Fr=require("react");function wr(e,t,r){let n=J(t);(0,Fr.useEffect)(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function ut(){let e=(0,kr.useRef)(0);return wr("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}var Hr=require("react");function _e(){let e=(0,Hr.useRef)(!1);return H(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var _r=require("react");function ge(...e){return(0,_r.useMemo)(()=>de(...e),[...e])}var Nr=require("react");function Ne(e,t,r,n){let i=J(r);(0,Nr.useEffect)(()=>{e=e!=null?e:window;function a(o){i.current(o)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}var Qn="div",Ur=(o=>(o[o.None=1]="None",o[o.InitialFocus=2]="InitialFocus",o[o.TabLock=4]="TabLock",o[o.FocusLock=8]="FocusLock",o[o.RestoreFocus=16]="RestoreFocus",o[o.All=30]="All",o))(Ur||{}),Be=Object.assign(L(function(t,r){let n=(0,ye.useRef)(null),i=D(n,r),{initialFocus:a,containers:o,features:l=30,...u}=t;xe()||(l=1);let s=ge(n);Xn({ownerDocument:s},Boolean(l&16));let p=Yn({ownerDocument:s,container:n,initialFocus:a},Boolean(l&2));Jn({ownerDocument:s,container:n,containers:o,previousActiveElement:p},Boolean(l&8));let m=ut(),d=b(g=>{let y=n.current;if(!y)return;(E=>E())(()=>{M(m.current,{[0]:()=>oe(y,1,{skipElements:[g.relatedTarget]}),[1]:()=>oe(y,8,{skipElements:[g.relatedTarget]})})})}),v=le(),c=(0,ye.useRef)(!1),f={ref:i,onKeyDown(g){g.key=="Tab"&&(c.current=!0,v.requestAnimationFrame(()=>{c.current=!1}))},onBlur(g){let y=new Set(o==null?void 0:o.current);y.add(n);let P=g.relatedTarget;!P||P.dataset.headlessuiFocusGuard!=="true"&&(Gr(y,P)||(c.current?oe(n.current,M(m.current,{[0]:()=>4,[1]:()=>2})|16,{relativeTo:g.target}):g.target instanceof HTMLElement&&Le(g.target)))}};return ye.default.createElement(ye.default.Fragment,null,Boolean(l&4)&&ye.default.createElement(se,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:2}),C({ourProps:f,theirProps:u,defaultTag:Qn,name:"FocusTrap"}),Boolean(l&4)&&ye.default.createElement(se,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:2}))}),{features:Ur});function Xn({ownerDocument:e},t){let r=(0,ye.useRef)(null);Ne(e==null?void 0:e.defaultView,"focusout",i=>{!t||r.current||(r.current=i.target)},!0),at(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Le(r.current),r.current=null)},[t]);let n=(0,ye.useRef)(!1);(0,ye.useEffect)(()=>(n.current=!1,()=>{n.current=!0,he(()=>{!n.current||(Le(r.current),r.current=null)})}),[])}function Yn({ownerDocument:e,container:t,initialFocus:r},n){let i=(0,ye.useRef)(null),a=_e();return at(()=>{if(!n)return;let o=t.current;!o||he(()=>{if(!a.current)return;let l=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===l){i.current=l;return}}else if(o.contains(l)){i.current=l;return}r!=null&&r.current?Le(r.current):oe(o,1)===0&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function Jn({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=_e();Ne(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let l=new Set(r==null?void 0:r.current);l.add(t);let u=n.current;if(!u)return;let s=o.target;s&&s instanceof HTMLElement?Gr(l,s)?(n.current=s,Le(s)):(o.preventDefault(),o.stopPropagation(),Le(u)):Le(n.current)},!0)}function Gr(e,t){var r;for(let n of e)if((r=n.current)!=null&&r.contains(t))return!0;return!1}var Je=new Set,Me=new Map;function Vr(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function jr(e){let t=Me.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Wr(e,t=!0){H(()=>{if(!t||!e.current)return;let r=e.current,n=de(r);if(!!n){Je.add(r);for(let i of Me.keys())i.contains(r)&&(jr(i),Me.delete(i));return n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement){for(let a of Je)if(i.contains(a))return;Je.size===1&&(Me.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),Vr(i))}}),()=>{if(Je.delete(r),Je.size>0)n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement&&!Me.has(i)){for(let a of Je)if(i.contains(a))return;Me.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),Vr(i)}});else for(let i of Me.keys())jr(i),Me.delete(i)}}},[t])}var me=pe(require("react"),1),qr=require("react-dom");var ze=pe(require("react"),1),Kr=(0,ze.createContext)(!1);function $r(){return(0,ze.useContext)(Kr)}function St(e){return ze.default.createElement(Kr.Provider,{value:e.force},e.children)}function zn(e){let t=$r(),r=(0,me.useContext)(Qr),n=ge(e),[i,a]=(0,me.useState)(()=>{if(!t&&r!==null||De)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;if(n===null)return null;let l=n.createElement("div");return l.setAttribute("id","headlessui-portal-root"),n.body.appendChild(l)});return(0,me.useEffect)(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),(0,me.useEffect)(()=>{t||r!==null&&a(r.current)},[r,a,t]),i}var Zn=me.Fragment,eo=L(function(t,r){let n=t,i=(0,me.useRef)(null),a=D(je(d=>{i.current=d}),r),o=ge(i),l=zn(i),[u]=(0,me.useState)(()=>{var d;return De?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),s=xe(),p=(0,me.useRef)(!1);return H(()=>{if(p.current=!1,!(!l||!u))return l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u)),()=>{p.current=!0,he(()=>{var d;!p.current||!l||!u||(l.removeChild(u),l.childNodes.length<=0&&((d=l.parentElement)==null||d.removeChild(l)))})}},[l,u]),s?!l||!u?null:(0,qr.createPortal)(C({ourProps:{ref:a},theirProps:n,defaultTag:Zn,name:"Portal"}),u):null}),to=me.Fragment,Qr=(0,me.createContext)(null),ro=L(function(t,r){let{target:n,...i}=t,o={ref:D(r)};return me.default.createElement(Qr.Provider,{value:n},C({ourProps:o,theirProps:i,defaultTag:to,name:"Popover.Group"}))}),pt=Object.assign(eo,{Group:ro});var Re=pe(require("react"),1);var Xr=(0,Re.createContext)(null);function Yr(){let e=(0,Re.useContext)(Xr);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,Yr),t}return e}function Ue(){let[e,t]=(0,Re.useState)([]);return[e.length>0?e.join(" "):void 0,(0,Re.useMemo)(()=>function(n){let i=b(o=>(t(l=>[...l,o]),()=>t(l=>{let u=l.slice(),s=u.indexOf(o);return s!==-1&&u.splice(s,1),u}))),a=(0,Re.useMemo)(()=>({register:i,slot:n.slot,name:n.name,props:n.props}),[i,n.slot,n.name,n.props]);return Re.default.createElement(Xr.Provider,{value:a},n.children)},[t])]}var no="p",Ze=L(function(t,r){let n=V(),{id:i=`headlessui-description-${n}`,...a}=t,o=Yr(),l=D(r);H(()=>o.register(i),[i,o.register]);let u={ref:l,...o.props,id:i};return C({ourProps:u,theirProps:a,slot:o.slot||{},defaultTag:no,name:o.name||"Description"})});var et=pe(require("react"),1);var jt=(0,et.createContext)(()=>{});jt.displayName="StackContext";function oo(){return(0,et.useContext)(jt)}function Jr({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=oo(),o=b((...l)=>{t==null||t(...l),a(...l)});return H(()=>{let l=i===void 0||i===!0;return l&&o(0,r,n),()=>{l&&o(1,r,n)}},[o,r,n,i]),et.default.createElement(jt.Provider,{value:o},e)}function zr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var io={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Ot=(0,K.createContext)(null);Ot.displayName="DialogContext";function dt(e){let t=(0,K.useContext)(Ot);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,dt),r}return t}function lo(e,t,r=()=>[document.body]){(0,K.useEffect)(()=>{var s;if(!t||!e)return;let n=ie(),i=window.pageYOffset;function a(p,m,d){let v=p.style.getPropertyValue(m);return Object.assign(p.style,{[m]:d}),n.add(()=>{Object.assign(p.style,{[m]:v})})}let o=e.documentElement,u=((s=e.defaultView)!=null?s:window).innerWidth-o.clientWidth;if(a(o,"overflow","hidden"),u>0){let p=o.clientWidth-o.offsetWidth,m=u-p;a(o,"paddingRight",`${m}px`)}if(zr()){a(e.body,"marginTop",`-${i}px`),window.scrollTo(0,0);let p=null;n.addEventListener(e,"click",m=>{if(m.target instanceof HTMLElement)try{let d=m.target.closest("a");if(!d)return;let{hash:v}=new URL(d.href),c=e.querySelector(v);c&&!r().some(f=>f.contains(c))&&(p=c)}catch{}},!0),n.addEventListener(e,"touchmove",m=>{m.target instanceof HTMLElement&&!r().some(d=>d.contains(m.target))&&m.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+i),p&&p.isConnected&&(p.scrollIntoView({block:"nearest"}),p=null)})}return n.dispose},[e,t])}function ao(e,t){return M(t.type,io,e,t)}var so="div",uo=3,po=L(function(t,r){let n=V(),{id:i=`headlessui-dialog-${n}`,open:a,onClose:o,initialFocus:l,__demoMode:u=!1,...s}=t,[p,m]=(0,K.useState)(0),d=Te();a===void 0&&d!==null&&(a=M(d,{[0]:!0,[1]:!1}));let v=(0,K.useRef)(new Set),c=(0,K.useRef)(null),f=D(c,r),g=(0,K.useRef)(null),y=ge(c),P=t.hasOwnProperty("open")||d!==null,E=t.hasOwnProperty("onClose");if(!P&&!E)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!P)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!E)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof a!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${a}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let h=a?0:1,[F,R]=(0,K.useReducer)(ao,{titleId:null,descriptionId:null,panelRef:(0,K.createRef)()}),S=b(()=>o(!1)),x=b($=>R({type:0,id:$})),I=xe()?u?!1:h===0:!1,w=p>1,T=(0,K.useContext)(Ot)!==null,O=w?"parent":"leaf";Wr(c,w?I:!1);let W=b(()=>{var Z,A;return[...Array.from((Z=y==null?void 0:y.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?Z:[]).filter(B=>!(!(B instanceof HTMLElement)||B.contains(g.current)||F.panelRef.current&&B.contains(F.panelRef.current))),(A=F.panelRef.current)!=null?A:c.current]});Oe(()=>W(),S,I&&!w),Ne(y==null?void 0:y.defaultView,"keydown",$=>{$.defaultPrevented||$.key==="Escape"&&h===0&&(w||($.preventDefault(),$.stopPropagation(),S()))}),lo(y,h===0&&!T,W),(0,K.useEffect)(()=>{if(h!==0||!c.current)return;let $=new IntersectionObserver(Z=>{for(let A of Z)A.boundingClientRect.x===0&&A.boundingClientRect.y===0&&A.boundingClientRect.width===0&&A.boundingClientRect.height===0&&S()});return $.observe(c.current),()=>$.disconnect()},[h,c,S]);let[Y,ue]=Ue(),re=(0,K.useMemo)(()=>[{dialogState:h,close:S,setTitleId:x},F],[h,F,S,x]),te=(0,K.useMemo)(()=>({open:h===0}),[h]),U={ref:f,id:i,role:"dialog","aria-modal":h===0?!0:void 0,"aria-labelledby":F.titleId,"aria-describedby":Y};return K.default.createElement(Jr,{type:"Dialog",enabled:h===0,element:c,onUpdate:b(($,Z,A)=>{Z==="Dialog"&&M($,{[0](){v.current.add(A),m(B=>B+1)},[1](){v.current.add(A),m(B=>B-1)}})})},K.default.createElement(St,{force:!0},K.default.createElement(pt,null,K.default.createElement(Ot.Provider,{value:re},K.default.createElement(pt.Group,{target:c},K.default.createElement(St,{force:!1},K.default.createElement(ue,{slot:te,name:"Dialog.Description"},K.default.createElement(Be,{initialFocus:l,containers:v,features:I?M(O,{parent:Be.features.RestoreFocus,leaf:Be.features.All&~Be.features.FocusLock}):Be.features.None},C({ourProps:U,theirProps:s,slot:te,defaultTag:so,features:uo,visible:h===0,name:"Dialog"})))))))),K.default.createElement(se,{features:4,ref:g}))}),co="div",fo=L(function(t,r){let n=V(),{id:i=`headlessui-dialog-overlay-${n}`,...a}=t,[{dialogState:o,close:l}]=dt("Dialog.Overlay"),u=D(r),s=b(d=>{if(d.target===d.currentTarget){if(fe(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),l()}}),p=(0,K.useMemo)(()=>({open:o===0}),[o]);return C({ourProps:{ref:u,id:i,"aria-hidden":!0,onClick:s},theirProps:a,slot:p,defaultTag:co,name:"Dialog.Overlay"})}),mo="div",To=L(function(t,r){let n=V(),{id:i=`headlessui-dialog-backdrop-${n}`,...a}=t,[{dialogState:o},l]=dt("Dialog.Backdrop"),u=D(r);(0,K.useEffect)(()=>{if(l.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[l.panelRef]);let s=(0,K.useMemo)(()=>({open:o===0}),[o]);return K.default.createElement(St,{force:!0},K.default.createElement(pt,null,C({ourProps:{ref:u,id:i,"aria-hidden":!0},theirProps:a,slot:s,defaultTag:mo,name:"Dialog.Backdrop"})))}),bo="div",go=L(function(t,r){let n=V(),{id:i=`headlessui-dialog-panel-${n}`,...a}=t,[{dialogState:o},l]=dt("Dialog.Panel"),u=D(r,l.panelRef),s=(0,K.useMemo)(()=>({open:o===0}),[o]),p=b(d=>{d.stopPropagation()});return C({ourProps:{ref:u,id:i,onClick:p},theirProps:a,slot:s,defaultTag:bo,name:"Dialog.Panel"})}),yo="h2",vo=L(function(t,r){let n=V(),{id:i=`headlessui-dialog-title-${n}`,...a}=t,[{dialogState:o,setTitleId:l}]=dt("Dialog.Title"),u=D(r);(0,K.useEffect)(()=>(l(i),()=>l(null)),[i,l]);let s=(0,K.useMemo)(()=>({open:o===0}),[o]);return C({ourProps:{ref:u,id:i},theirProps:a,slot:s,defaultTag:yo,name:"Dialog.Title"})}),Po=Object.assign(po,{Backdrop:To,Panel:go,Overlay:fo,Title:vo,Description:Ze});var X=pe(require("react"),1);var Eo={[0]:e=>({...e,disclosureState:M(e.disclosureState,{[0]:1,[1]:0})}),[1]:e=>e.disclosureState===1?e:{...e,disclosureState:1},[4](e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},[5](e){return e.linkedPanel===!1?e:{...e,linkedPanel:!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}}},Wt=(0,X.createContext)(null);Wt.displayName="DisclosureContext";function Kt(e){let t=(0,X.useContext)(Wt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Kt),r}return t}var $t=(0,X.createContext)(null);$t.displayName="DisclosureAPIContext";function Zr(e){let t=(0,X.useContext)($t);if(t===null){let r=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Zr),r}return t}var qt=(0,X.createContext)(null);qt.displayName="DisclosurePanelContext";function xo(){return(0,X.useContext)(qt)}function Ro(e,t){return M(t.type,Eo,e,t)}var So=X.Fragment,Oo=L(function(t,r){let{defaultOpen:n=!1,...i}=t,a=(0,X.useRef)(null),o=D(r,je(y=>{a.current=y},t.as===void 0||t.as===X.Fragment)),l=(0,X.useRef)(null),u=(0,X.useRef)(null),s=(0,X.useReducer)(Ro,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:u,panelRef:l,buttonId:null,panelId:null}),[{disclosureState:p,buttonId:m},d]=s,v=b(y=>{d({type:1});let P=de(a);if(!P||!m)return;let E=(()=>y?y instanceof HTMLElement?y:y.current instanceof HTMLElement?y.current:P.getElementById(m):P.getElementById(m))();E==null||E.focus()}),c=(0,X.useMemo)(()=>({close:v}),[v]),f=(0,X.useMemo)(()=>({open:p===0,close:v}),[p,v]),g={ref:o};return X.default.createElement(Wt.Provider,{value:s},X.default.createElement($t.Provider,{value:c},X.default.createElement(Ee,{value:M(p,{[0]:0,[1]:1})},C({ourProps:g,theirProps:i,slot:f,defaultTag:So,name:"Disclosure"}))))}),Ao="button",ho=L(function(t,r){let n=V(),{id:i=`headlessui-disclosure-button-${n}`,...a}=t,[o,l]=Kt("Disclosure.Button"),u=xo(),s=u===null?!1:u===o.panelId,p=(0,X.useRef)(null),m=D(p,r,s?null:o.buttonRef);(0,X.useEffect)(()=>{if(!s)return l({type:2,buttonId:i}),()=>{l({type:2,buttonId:null})}},[i,l,s]);let d=b(P=>{var E;if(s){if(o.disclosureState===1)return;switch(P.key){case" ":case"Enter":P.preventDefault(),P.stopPropagation(),l({type:0}),(E=o.buttonRef.current)==null||E.focus();break}}else switch(P.key){case" ":case"Enter":P.preventDefault(),P.stopPropagation(),l({type:0});break}}),v=b(P=>{switch(P.key){case" ":P.preventDefault();break}}),c=b(P=>{var E;fe(P.currentTarget)||t.disabled||(s?(l({type:0}),(E=o.buttonRef.current)==null||E.focus()):l({type:0}))}),f=(0,X.useMemo)(()=>({open:o.disclosureState===0}),[o]),g=be(t,p),y=s?{ref:m,type:g,onKeyDown:d,onClick:c}:{ref:m,id:i,type:g,"aria-expanded":t.disabled?void 0:o.disclosureState===0,"aria-controls":o.linkedPanel?o.panelId:void 0,onKeyDown:d,onKeyUp:v,onClick:c};return C({ourProps:y,theirProps:a,slot:f,defaultTag:Ao,name:"Disclosure.Button"})}),Co="div",Lo=3,Io=L(function(t,r){let n=V(),{id:i=`headlessui-disclosure-panel-${n}`,...a}=t,[o,l]=Kt("Disclosure.Panel"),{close:u}=Zr("Disclosure.Panel"),s=D(r,o.panelRef,c=>{l({type:c?4:5})});(0,X.useEffect)(()=>(l({type:3,panelId:i}),()=>{l({type:3,panelId:null})}),[i,l]);let p=Te(),m=(()=>p!==null?p===0:o.disclosureState===0)(),d=(0,X.useMemo)(()=>({open:o.disclosureState===0,close:u}),[o,u]),v={ref:s,id:i};return X.default.createElement(qt.Provider,{value:o.panelId},C({ourProps:v,theirProps:a,slot:d,defaultTag:Co,features:Lo,visible:m,name:"Disclosure.Panel"}))}),Mo=Object.assign(Oo,{Button:ho,Panel:Io});var q=pe(require("react"),1);function Qt(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=ve(t(e.options.slice()),a=>a.dataRef.current.domRef.current),i=r?n.indexOf(r):null;return i===-1&&(i=null),{options:n,activeOptionIndex:i}}var Do={[1](e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},[0](e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,n=e.options.findIndex(i=>r(i.dataRef.current.value));return n!==-1&&(t=n),{...e,listboxState:0,activeOptionIndex:t}},[2](e,t){var i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=Qt(e),n=Ke(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:n,activationTrigger:(i=t.trigger)!=null?i:1}},[3]:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,i=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(u=>{var s;return!u.dataRef.current.disabled&&((s=u.dataRef.current.textValue)==null?void 0:s.startsWith(i))}),l=o?e.options.indexOf(o):-1;return l===-1||l===e.activeOptionIndex?{...e,searchQuery:i}:{...e,searchQuery:i,activeOptionIndex:l,activationTrigger:1}},[4](e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},[5]:(e,t)=>{let r={id:t.id,dataRef:t.dataRef},n=Qt(e,i=>[...i,r]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(n.activeOptionIndex=n.options.indexOf(r)),{...e,...n}},[6]:(e,t)=>{let r=Qt(e,n=>{let i=n.findIndex(a=>a.id===t.id);return i!==-1&&n.splice(i,1),n});return{...e,...r,activationTrigger:1}},[7]:(e,t)=>({...e,labelId:t.id})},Xt=(0,q.createContext)(null);Xt.displayName="ListboxActionsContext";function ct(e){let t=(0,q.useContext)(Xt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ct),r}return t}var Yt=(0,q.createContext)(null);Yt.displayName="ListboxDataContext";function ft(e){let t=(0,q.useContext)(Yt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ft),r}return t}function Fo(e,t){return M(t.type,Do,e,t)}var wo=q.Fragment,ko=L(function(t,r){let{value:n,defaultValue:i,name:a,onChange:o,by:l=(k,Q)=>k===Q,disabled:u=!1,horizontal:s=!1,multiple:p=!1,...m}=t,d=s?"horizontal":"vertical",v=D(r),[c=p?[]:void 0,f]=Ie(n,o,i),[g,y]=(0,q.useReducer)(Fo,{dataRef:(0,q.createRef)(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),P=(0,q.useRef)({static:!1,hold:!1}),E=(0,q.useRef)(null),h=(0,q.useRef)(null),F=(0,q.useRef)(null),R=b(typeof l=="string"?(k,Q)=>{let ce=l;return(k==null?void 0:k[ce])===(Q==null?void 0:Q[ce])}:l),S=(0,q.useCallback)(k=>M(x.mode,{[1]:()=>c.some(Q=>R(Q,k)),[0]:()=>R(c,k)}),[c]),x=(0,q.useMemo)(()=>({...g,value:c,disabled:u,mode:p?1:0,orientation:d,compare:R,isSelected:S,optionsPropsRef:P,labelRef:E,buttonRef:h,optionsRef:F}),[c,u,p,g]);H(()=>{g.dataRef.current=x},[x]),Oe([x.buttonRef,x.optionsRef],(k,Q)=>{var ce;y({type:1}),Ce(Q,1)||(k.preventDefault(),(ce=x.buttonRef.current)==null||ce.focus())},x.listboxState===0);let N=(0,q.useMemo)(()=>({open:x.listboxState===0,disabled:u,value:c}),[x,u,c]),I=b(k=>{let Q=x.options.find(ce=>ce.id===k);!Q||re(Q.dataRef.current.value)}),w=b(()=>{if(x.activeOptionIndex!==null){let{dataRef:k,id:Q}=x.options[x.activeOptionIndex];re(k.current.value),y({type:2,focus:4,id:Q})}}),T=b(()=>y({type:0})),O=b(()=>y({type:1})),W=b((k,Q,ce)=>k===4?y({type:2,focus:4,id:Q,trigger:ce}):y({type:2,focus:k,trigger:ce})),Y=b((k,Q)=>(y({type:5,id:k,dataRef:Q}),()=>y({type:6,id:k}))),ue=b(k=>(y({type:7,id:k}),()=>y({type:7,id:null}))),re=b(k=>M(x.mode,{[0](){return f==null?void 0:f(k)},[1](){let Q=x.value.slice(),ce=Q.findIndex(rt=>R(rt,k));return ce===-1?Q.push(k):Q.splice(ce,1),f==null?void 0:f(Q)}})),te=b(k=>y({type:3,value:k})),U=b(()=>y({type:4})),$=(0,q.useMemo)(()=>({onChange:re,registerOption:Y,registerLabel:ue,goToOption:W,closeListbox:O,openListbox:T,selectActiveOption:w,selectOption:I,search:te,clearSearch:U}),[]),Z={ref:v},A=(0,q.useRef)(null),B=le();return(0,q.useEffect)(()=>{!A.current||i!==void 0&&B.addEventListener(A.current,"reset",()=>{re(i)})},[A,re]),q.default.createElement(Xt.Provider,{value:$},q.default.createElement(Yt.Provider,{value:x},q.default.createElement(Ee,{value:M(x.listboxState,{[0]:0,[1]:1})},a!=null&&c!=null&&we({[a]:c}).map(([k,Q],ce)=>q.default.createElement(se,{features:4,ref:ce===0?rt=>{var Tr;A.current=(Tr=rt==null?void 0:rt.closest("form"))!=null?Tr:null}:void 0,...Ae({key:k,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:k,value:Q})})),C({ourProps:Z,theirProps:m,slot:N,defaultTag:wo,name:"Listbox"}))))}),Ho="button",_o=L(function(t,r){var g;let n=V(),{id:i=`headlessui-listbox-button-${n}`,...a}=t,o=ft("Listbox.Button"),l=ct("Listbox.Button"),u=D(o.buttonRef,r),s=le(),p=b(y=>{switch(y.key){case" ":case"Enter":case"ArrowDown":y.preventDefault(),l.openListbox(),s.nextFrame(()=>{o.value||l.goToOption(0)});break;case"ArrowUp":y.preventDefault(),l.openListbox(),s.nextFrame(()=>{o.value||l.goToOption(3)});break}}),m=b(y=>{switch(y.key){case" ":y.preventDefault();break}}),d=b(y=>{if(fe(y.currentTarget))return y.preventDefault();o.listboxState===0?(l.closeListbox(),s.nextFrame(()=>{var P;return(P=o.buttonRef.current)==null?void 0:P.focus({preventScroll:!0})})):(y.preventDefault(),l.openListbox())}),v=Fe(()=>{if(!!o.labelId)return[o.labelId,i].join(" ")},[o.labelId,i]),c=(0,q.useMemo)(()=>({open:o.listboxState===0,disabled:o.disabled,value:o.value}),[o]),f={ref:u,id:i,type:be(t,o.buttonRef),"aria-haspopup":"listbox","aria-controls":(g=o.optionsRef.current)==null?void 0:g.id,"aria-expanded":o.disabled?void 0:o.listboxState===0,"aria-labelledby":v,disabled:o.disabled,onKeyDown:p,onKeyUp:m,onClick:d};return C({ourProps:f,theirProps:a,slot:c,defaultTag:Ho,name:"Listbox.Button"})}),No="label",Bo=L(function(t,r){let n=V(),{id:i=`headlessui-listbox-label-${n}`,...a}=t,o=ft("Listbox.Label"),l=ct("Listbox.Label"),u=D(o.labelRef,r);H(()=>l.registerLabel(i),[i]);let s=b(()=>{var d;return(d=o.buttonRef.current)==null?void 0:d.focus({preventScroll:!0})}),p=(0,q.useMemo)(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]);return C({ourProps:{ref:u,id:i,onClick:s},theirProps:a,slot:p,defaultTag:No,name:"Listbox.Label"})}),Uo="ul",Go=3,Vo=L(function(t,r){var y;let n=V(),{id:i=`headlessui-listbox-options-${n}`,...a}=t,o=ft("Listbox.Options"),l=ct("Listbox.Options"),u=D(o.optionsRef,r),s=le(),p=le(),m=Te(),d=(()=>m!==null?m===0:o.listboxState===0)();(0,q.useEffect)(()=>{var E;let P=o.optionsRef.current;!P||o.listboxState===0&&P!==((E=de(P))==null?void 0:E.activeElement)&&P.focus({preventScroll:!0})},[o.listboxState,o.optionsRef]);let v=b(P=>{switch(p.dispose(),P.key){case" ":if(o.searchQuery!=="")return P.preventDefault(),P.stopPropagation(),l.search(P.key);case"Enter":if(P.preventDefault(),P.stopPropagation(),o.activeOptionIndex!==null){let{dataRef:E}=o.options[o.activeOptionIndex];l.onChange(E.current.value)}o.mode===0&&(l.closeListbox(),ie().nextFrame(()=>{var E;return(E=o.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})}));break;case M(o.orientation,{vertical:"ArrowDown",horizontal:"ArrowRight"}):return P.preventDefault(),P.stopPropagation(),l.goToOption(2);case M(o.orientation,{vertical:"ArrowUp",horizontal:"ArrowLeft"}):return P.preventDefault(),P.stopPropagation(),l.goToOption(1);case"Home":case"PageUp":return P.preventDefault(),P.stopPropagation(),l.goToOption(0);case"End":case"PageDown":return P.preventDefault(),P.stopPropagation(),l.goToOption(3);case"Escape":return P.preventDefault(),P.stopPropagation(),l.closeListbox(),s.nextFrame(()=>{var E;return(E=o.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})});case"Tab":P.preventDefault(),P.stopPropagation();break;default:P.key.length===1&&(l.search(P.key),p.setTimeout(()=>l.clearSearch(),350));break}}),c=Fe(()=>{var P,E,h;return(h=(P=o.labelRef.current)==null?void 0:P.id)!=null?h:(E=o.buttonRef.current)==null?void 0:E.id},[o.labelRef.current,o.buttonRef.current]),f=(0,q.useMemo)(()=>({open:o.listboxState===0}),[o]),g={"aria-activedescendant":o.activeOptionIndex===null||(y=o.options[o.activeOptionIndex])==null?void 0:y.id,"aria-multiselectable":o.mode===1?!0:void 0,"aria-labelledby":c,"aria-orientation":o.orientation,id:i,onKeyDown:v,role:"listbox",tabIndex:0,ref:u};return C({ourProps:g,theirProps:a,slot:f,defaultTag:Uo,features:Go,visible:d,name:"Listbox.Options"})}),jo="li",Wo=L(function(t,r){let n=V(),{id:i=`headlessui-listbox-option-${n}`,disabled:a=!1,value:o,...l}=t,u=ft("Listbox.Option"),s=ct("Listbox.Option"),p=u.activeOptionIndex!==null?u.options[u.activeOptionIndex].id===i:!1,m=u.isSelected(o),d=(0,q.useRef)(null),v=J({disabled:a,value:o,domRef:d,get textValue(){var S,x;return(x=(S=d.current)==null?void 0:S.textContent)==null?void 0:x.toLowerCase()}}),c=D(r,d);H(()=>{if(u.listboxState!==0||!p||u.activationTrigger===0)return;let S=ie();return S.requestAnimationFrame(()=>{var x,N;(N=(x=d.current)==null?void 0:x.scrollIntoView)==null||N.call(x,{block:"nearest"})}),S.dispose},[d,p,u.listboxState,u.activationTrigger,u.activeOptionIndex]),H(()=>s.registerOption(i,v),[v,i]);let f=b(S=>{if(a)return S.preventDefault();s.onChange(o),u.mode===0&&(s.closeListbox(),ie().nextFrame(()=>{var x;return(x=u.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})}))}),g=b(()=>{if(a)return s.goToOption(5);s.goToOption(4,i)}),y=Qe(),P=b(S=>y.update(S)),E=b(S=>{!y.wasMoved(S)||a||p||s.goToOption(4,i,0)}),h=b(S=>{!y.wasMoved(S)||a||!p||s.goToOption(5)}),F=(0,q.useMemo)(()=>({active:p,selected:m,disabled:a}),[p,m,a]);return C({ourProps:{id:i,ref:c,role:"option",tabIndex:a===!0?void 0:-1,"aria-disabled":a===!0?!0:void 0,"aria-selected":m,disabled:void 0,onClick:f,onFocus:g,onPointerEnter:P,onMouseEnter:P,onPointerMove:E,onMouseMove:E,onPointerLeave:h,onMouseLeave:h},theirProps:l,slot:F,defaultTag:jo,name:"Listbox.Option"})}),Ko=Object.assign(ko,{Button:_o,Label:Bo,Options:Vo,Option:Wo});var ne=pe(require("react"),1);function Jt(e,t=r=>r){let r=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,n=ve(t(e.items.slice()),a=>a.dataRef.current.domRef.current),i=r?n.indexOf(r):null;return i===-1&&(i=null),{items:n,activeItemIndex:i}}var $o={[1](e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},[0](e){return e.menuState===0?e:{...e,menuState:0}},[2]:(e,t)=>{var i;let r=Jt(e),n=Ke(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:n,activationTrigger:(i=t.trigger)!=null?i:1}},[3]:(e,t)=>{let n=e.searchQuery!==""?0:1,i=e.searchQuery+t.value.toLowerCase(),o=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(u=>{var s;return((s=u.dataRef.current.textValue)==null?void 0:s.startsWith(i))&&!u.dataRef.current.disabled}),l=o?e.items.indexOf(o):-1;return l===-1||l===e.activeItemIndex?{...e,searchQuery:i}:{...e,searchQuery:i,activeItemIndex:l,activationTrigger:1}},[4](e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},[5]:(e,t)=>{let r=Jt(e,n=>[...n,{id:t.id,dataRef:t.dataRef}]);return{...e,...r}},[6]:(e,t)=>{let r=Jt(e,n=>{let i=n.findIndex(a=>a.id===t.id);return i!==-1&&n.splice(i,1),n});return{...e,...r,activationTrigger:1}}},zt=(0,ne.createContext)(null);zt.displayName="MenuContext";function At(e){let t=(0,ne.useContext)(zt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,At),r}return t}function qo(e,t){return M(t.type,$o,e,t)}var Qo=ne.Fragment,Xo=L(function(t,r){let n=(0,ne.useReducer)(qo,{menuState:1,buttonRef:(0,ne.createRef)(),itemsRef:(0,ne.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:a,buttonRef:o},l]=n,u=D(r);Oe([o,a],(v,c)=>{var f;l({type:1}),Ce(c,1)||(v.preventDefault(),(f=o.current)==null||f.focus())},i===0);let s=b(()=>{l({type:1})}),p=(0,ne.useMemo)(()=>({open:i===0,close:s}),[i,s]),m=t,d={ref:u};return ne.default.createElement(zt.Provider,{value:n},ne.default.createElement(Ee,{value:M(i,{[0]:0,[1]:1})},C({ourProps:d,theirProps:m,slot:p,defaultTag:Qo,name:"Menu"})))}),Yo="button",Jo=L(function(t,r){var f;let n=V(),{id:i=`headlessui-menu-button-${n}`,...a}=t,[o,l]=At("Menu.Button"),u=D(o.buttonRef,r),s=le(),p=b(g=>{switch(g.key){case" ":case"Enter":case"ArrowDown":g.preventDefault(),g.stopPropagation(),l({type:0}),s.nextFrame(()=>l({type:2,focus:0}));break;case"ArrowUp":g.preventDefault(),g.stopPropagation(),l({type:0}),s.nextFrame(()=>l({type:2,focus:3}));break}}),m=b(g=>{switch(g.key){case" ":g.preventDefault();break}}),d=b(g=>{if(fe(g.currentTarget))return g.preventDefault();t.disabled||(o.menuState===0?(l({type:1}),s.nextFrame(()=>{var y;return(y=o.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})})):(g.preventDefault(),l({type:0})))}),v=(0,ne.useMemo)(()=>({open:o.menuState===0}),[o]),c={ref:u,id:i,type:be(t,o.buttonRef),"aria-haspopup":"menu","aria-controls":(f=o.itemsRef.current)==null?void 0:f.id,"aria-expanded":t.disabled?void 0:o.menuState===0,onKeyDown:p,onKeyUp:m,onClick:d};return C({ourProps:c,theirProps:a,slot:v,defaultTag:Yo,name:"Menu.Button"})}),zo="div",Zo=3,ei=L(function(t,r){var y,P;let n=V(),{id:i=`headlessui-menu-items-${n}`,...a}=t,[o,l]=At("Menu.Items"),u=D(o.itemsRef,r),s=ge(o.itemsRef),p=le(),m=Te(),d=(()=>m!==null?m===0:o.menuState===0)();(0,ne.useEffect)(()=>{let E=o.itemsRef.current;!E||o.menuState===0&&E!==(s==null?void 0:s.activeElement)&&E.focus({preventScroll:!0})},[o.menuState,o.itemsRef,s]),We({container:o.itemsRef.current,enabled:o.menuState===0,accept(E){return E.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:E.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(E){E.setAttribute("role","none")}});let v=b(E=>{var h,F;switch(p.dispose(),E.key){case" ":if(o.searchQuery!=="")return E.preventDefault(),E.stopPropagation(),l({type:3,value:E.key});case"Enter":if(E.preventDefault(),E.stopPropagation(),l({type:1}),o.activeItemIndex!==null){let{dataRef:R}=o.items[o.activeItemIndex];(F=(h=R.current)==null?void 0:h.domRef.current)==null||F.click()}Ht(o.buttonRef.current);break;case"ArrowDown":return E.preventDefault(),E.stopPropagation(),l({type:2,focus:2});case"ArrowUp":return E.preventDefault(),E.stopPropagation(),l({type:2,focus:1});case"Home":case"PageUp":return E.preventDefault(),E.stopPropagation(),l({type:2,focus:0});case"End":case"PageDown":return E.preventDefault(),E.stopPropagation(),l({type:2,focus:3});case"Escape":E.preventDefault(),E.stopPropagation(),l({type:1}),ie().nextFrame(()=>{var R;return(R=o.buttonRef.current)==null?void 0:R.focus({preventScroll:!0})});break;case"Tab":E.preventDefault(),E.stopPropagation(),l({type:1}),ie().nextFrame(()=>{xr(o.buttonRef.current,E.shiftKey?2:4)});break;default:E.key.length===1&&(l({type:3,value:E.key}),p.setTimeout(()=>l({type:4}),350));break}}),c=b(E=>{switch(E.key){case" ":E.preventDefault();break}}),f=(0,ne.useMemo)(()=>({open:o.menuState===0}),[o]),g={"aria-activedescendant":o.activeItemIndex===null||(y=o.items[o.activeItemIndex])==null?void 0:y.id,"aria-labelledby":(P=o.buttonRef.current)==null?void 0:P.id,id:i,onKeyDown:v,onKeyUp:c,role:"menu",tabIndex:0,ref:u};return C({ourProps:g,theirProps:a,slot:f,defaultTag:zo,features:Zo,visible:d,name:"Menu.Items"})}),ti=ne.Fragment,ri=L(function(t,r){let n=V(),{id:i=`headlessui-menu-item-${n}`,disabled:a=!1,...o}=t,[l,u]=At("Menu.Item"),s=l.activeItemIndex!==null?l.items[l.activeItemIndex].id===i:!1,p=(0,ne.useRef)(null),m=D(r,p);H(()=>{if(l.menuState!==0||!s||l.activationTrigger===0)return;let R=ie();return R.requestAnimationFrame(()=>{var S,x;(x=(S=p.current)==null?void 0:S.scrollIntoView)==null||x.call(S,{block:"nearest"})}),R.dispose},[p,s,l.menuState,l.activationTrigger,l.activeItemIndex]);let d=(0,ne.useRef)({disabled:a,domRef:p});H(()=>{d.current.disabled=a},[d,a]),H(()=>{var R,S;d.current.textValue=(S=(R=p.current)==null?void 0:R.textContent)==null?void 0:S.toLowerCase()},[d,p]),H(()=>(u({type:5,id:i,dataRef:d}),()=>u({type:6,id:i})),[d,i]);let v=b(()=>{u({type:1})}),c=b(R=>{if(a)return R.preventDefault();u({type:1}),Ht(l.buttonRef.current)}),f=b(()=>{if(a)return u({type:2,focus:5});u({type:2,focus:4,id:i})}),g=Qe(),y=b(R=>g.update(R)),P=b(R=>{!g.wasMoved(R)||a||s||u({type:2,focus:4,id:i,trigger:0})}),E=b(R=>{!g.wasMoved(R)||a||!s||u({type:2,focus:5})}),h=(0,ne.useMemo)(()=>({active:s,disabled:a,close:v}),[s,a,v]);return C({ourProps:{id:i,ref:m,role:"menuitem",tabIndex:a===!0?void 0:-1,"aria-disabled":a===!0?!0:void 0,disabled:void 0,onClick:c,onFocus:f,onPointerEnter:y,onMouseEnter:y,onPointerMove:P,onMouseMove:P,onPointerLeave:E,onMouseLeave:E},theirProps:o,slot:h,defaultTag:ti,name:"Menu.Item"})}),ni=Object.assign(Xo,{Button:Jo,Items:ei,Item:ri});var _=pe(require("react"),1);var oi={[0]:e=>({...e,popoverState:M(e.popoverState,{[0]:1,[1]:0})}),[1](e){return e.popoverState===1?e:{...e,popoverState:1}},[2](e,t){return e.button===t.button?e:{...e,button:t.button}},[3](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[4](e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},[5](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Zt=(0,_.createContext)(null);Zt.displayName="PopoverContext";function ht(e){let t=(0,_.useContext)(Zt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ht),r}return t}var er=(0,_.createContext)(null);er.displayName="PopoverAPIContext";function tr(e){let t=(0,_.useContext)(er);if(t===null){let r=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,tr),r}return t}var rr=(0,_.createContext)(null);rr.displayName="PopoverGroupContext";function en(){return(0,_.useContext)(rr)}var nr=(0,_.createContext)(null);nr.displayName="PopoverPanelContext";function ii(){return(0,_.useContext)(nr)}function li(e,t){return M(t.type,oi,e,t)}var ai="div",si=L(function(t,r){var w;let n=(0,_.useRef)(null),i=D(r,je(T=>{n.current=T})),a=(0,_.useReducer)(li,{popoverState:1,buttons:[],button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,_.createRef)(),afterPanelSentinel:(0,_.createRef)()}),[{popoverState:o,button:l,buttonId:u,panel:s,panelId:p,beforePanelSentinel:m,afterPanelSentinel:d},v]=a,c=ge((w=n.current)!=null?w:l),f=(0,_.useMemo)(()=>{if(!l||!s)return!1;for(let te of document.querySelectorAll("body > *"))if(Number(te==null?void 0:te.contains(l))^Number(te==null?void 0:te.contains(s)))return!0;let T=ot(),O=T.indexOf(l),W=(O+T.length-1)%T.length,Y=(O+1)%T.length,ue=T[W],re=T[Y];return!s.contains(ue)&&!s.contains(re)},[l,s]),g=J(u),y=J(p),P=(0,_.useMemo)(()=>({buttonId:g,panelId:y,close:()=>v({type:1})}),[g,y,v]),E=en(),h=E==null?void 0:E.registerPopover,F=b(()=>{var T;return(T=E==null?void 0:E.isFocusWithinPopoverGroup())!=null?T:(c==null?void 0:c.activeElement)&&((l==null?void 0:l.contains(c.activeElement))||(s==null?void 0:s.contains(c.activeElement)))});(0,_.useEffect)(()=>h==null?void 0:h(P),[h,P]),Ne(c==null?void 0:c.defaultView,"focus",T=>{var O,W,Y,ue;o===0&&(F()||!l||!s||T.target!==window&&((W=(O=m.current)==null?void 0:O.contains)!=null&&W.call(O,T.target)||(ue=(Y=d.current)==null?void 0:Y.contains)!=null&&ue.call(Y,T.target)||v({type:1})))},!0),Oe([l,s],(T,O)=>{v({type:1}),Ce(O,1)||(T.preventDefault(),l==null||l.focus())},o===0);let R=b(T=>{v({type:1});let O=(()=>T?T instanceof HTMLElement?T:"current"in T&&T.current instanceof HTMLElement?T.current:l:l)();O==null||O.focus()}),S=(0,_.useMemo)(()=>({close:R,isPortalled:f}),[R,f]),x=(0,_.useMemo)(()=>({open:o===0,close:R}),[o,R]),N=t,I={ref:i};return _.default.createElement(Zt.Provider,{value:a},_.default.createElement(er.Provider,{value:S},_.default.createElement(Ee,{value:M(o,{[0]:0,[1]:1})},C({ourProps:I,theirProps:N,slot:x,defaultTag:ai,name:"Popover"}))))}),ui="button",pi=L(function(t,r){let n=V(),{id:i=`headlessui-popover-button-${n}`,...a}=t,[o,l]=ht("Popover.Button"),{isPortalled:u}=tr("Popover.Button"),s=(0,_.useRef)(null),p=`headlessui-focus-sentinel-${V()}`,m=en(),d=m==null?void 0:m.closeOthers,v=ii(),c=v===null?!1:v===o.panelId;(0,_.useEffect)(()=>{if(!c)return l({type:3,buttonId:i}),()=>{l({type:3,buttonId:null})}},[i,l]);let f=D(s,r,c?null:T=>{if(T)o.buttons.push(i);else{let O=o.buttons.indexOf(i);O!==-1&&o.buttons.splice(O,1)}o.buttons.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),T&&l({type:2,button:T})}),g=D(s,r),y=ge(s),P=b(T=>{var O,W,Y;if(c){if(o.popoverState===1)return;switch(T.key){case" ":case"Enter":T.preventDefault(),(W=(O=T.target).click)==null||W.call(O),l({type:1}),(Y=o.button)==null||Y.focus();break}}else switch(T.key){case" ":case"Enter":T.preventDefault(),T.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),l({type:0});break;case"Escape":if(o.popoverState!==0)return d==null?void 0:d(o.buttonId);if(!s.current||(y==null?void 0:y.activeElement)&&!s.current.contains(y.activeElement))return;T.preventDefault(),T.stopPropagation(),l({type:1});break}}),E=b(T=>{c||T.key===" "&&T.preventDefault()}),h=b(T=>{var O,W;fe(T.currentTarget)||t.disabled||(c?(l({type:1}),(O=o.button)==null||O.focus()):(T.preventDefault(),T.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),l({type:0}),(W=o.button)==null||W.focus()))}),F=b(T=>{T.preventDefault(),T.stopPropagation()}),R=o.popoverState===0,S=(0,_.useMemo)(()=>({open:R}),[R]),x=be(t,s),N=c?{ref:g,type:x,onKeyDown:P,onClick:h}:{ref:f,id:o.buttonId,type:x,"aria-expanded":t.disabled?void 0:o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:P,onKeyUp:E,onClick:h,onMouseDown:F},I=ut(),w=b(()=>{let T=o.panel;if(!T)return;function O(){M(I.current,{[0]:()=>oe(T,1),[1]:()=>oe(T,8)})}O()});return _.default.createElement(_.default.Fragment,null,C({ourProps:N,theirProps:a,slot:S,defaultTag:ui,name:"Popover.Button"}),R&&!c&&u&&_.default.createElement(se,{id:p,features:2,as:"button",type:"button",onFocus:w}))}),di="div",ci=3,fi=L(function(t,r){let n=V(),{id:i=`headlessui-popover-overlay-${n}`,...a}=t,[{popoverState:o},l]=ht("Popover.Overlay"),u=D(r),s=Te(),p=(()=>s!==null?s===0:o===0)(),m=b(c=>{if(fe(c.currentTarget))return c.preventDefault();l({type:1})}),d=(0,_.useMemo)(()=>({open:o===0}),[o]);return C({ourProps:{ref:u,id:i,"aria-hidden":!0,onClick:m},theirProps:a,slot:d,defaultTag:di,features:ci,visible:p,name:"Popover.Overlay"})}),mi="div",Ti=3,bi=L(function(t,r){let n=V(),{id:i=`headlessui-popover-panel-${n}`,focus:a=!1,...o}=t,[l,u]=ht("Popover.Panel"),{close:s,isPortalled:p}=tr("Popover.Panel"),m=`headlessui-focus-sentinel-before-${V()}`,d=`headlessui-focus-sentinel-after-${V()}`,v=(0,_.useRef)(null),c=D(v,r,x=>{u({type:4,panel:x})}),f=ge(v);(0,_.useEffect)(()=>(u({type:5,panelId:i}),()=>{u({type:5,panelId:null})}),[i,u]);let g=Te(),y=(()=>g!==null?g===0:l.popoverState===0)(),P=b(x=>{var N;switch(x.key){case"Escape":if(l.popoverState!==0||!v.current||(f==null?void 0:f.activeElement)&&!v.current.contains(f.activeElement))return;x.preventDefault(),x.stopPropagation(),u({type:1}),(N=l.button)==null||N.focus();break}});(0,_.useEffect)(()=>{var x;t.static||l.popoverState===1&&((x=t.unmount)!=null?x:!0)&&u({type:4,panel:null})},[l.popoverState,t.unmount,t.static,u]),(0,_.useEffect)(()=>{if(!a||l.popoverState!==0||!v.current)return;let x=f==null?void 0:f.activeElement;v.current.contains(x)||oe(v.current,1)},[a,v,l.popoverState]);let E=(0,_.useMemo)(()=>({open:l.popoverState===0,close:s}),[l,s]),h={ref:c,id:l.panelId,onKeyDown:P,onBlur:a&&l.popoverState===0?x=>{var I,w,T,O,W;let N=x.relatedTarget;!N||!v.current||(I=v.current)!=null&&I.contains(N)||(u({type:1}),(((T=(w=l.beforePanelSentinel.current)==null?void 0:w.contains)==null?void 0:T.call(w,N))||((W=(O=l.afterPanelSentinel.current)==null?void 0:O.contains)==null?void 0:W.call(O,N)))&&N.focus({preventScroll:!0}))}:void 0,tabIndex:-1},F=ut(),R=b(()=>{let x=v.current;if(!x)return;function N(){M(F.current,{[0]:()=>{oe(x,1)},[1]:()=>{var I;(I=l.button)==null||I.focus({preventScroll:!0})}})}N()}),S=b(()=>{let x=v.current;if(!x)return;function N(){M(F.current,{[0]:()=>{var Y,ue,re;if(!l.button)return;let I=ot(),w=I.indexOf(l.button),T=I.slice(0,w+1),W=[...I.slice(w+1),...T];for(let te of W.slice())if(((ue=(Y=te==null?void 0:te.id)==null?void 0:Y.startsWith)==null?void 0:ue.call(Y,"headlessui-focus-sentinel-"))||((re=l.panel)==null?void 0:re.contains(te))){let U=W.indexOf(te);U!==-1&&W.splice(U,1)}oe(W,1,{sorted:!1})},[1]:()=>oe(x,8)})}N()});return _.default.createElement(nr.Provider,{value:l.panelId},y&&p&&_.default.createElement(se,{id:m,ref:l.beforePanelSentinel,features:2,as:"button",type:"button",onFocus:R}),C({ourProps:h,theirProps:o,slot:E,defaultTag:mi,features:Ti,visible:y,name:"Popover.Panel"}),y&&p&&_.default.createElement(se,{id:d,ref:l.afterPanelSentinel,features:2,as:"button",type:"button",onFocus:S}))}),gi="div",yi=L(function(t,r){let n=(0,_.useRef)(null),i=D(n,r),[a,o]=(0,_.useState)([]),l=b(f=>{o(g=>{let y=g.indexOf(f);if(y!==-1){let P=g.slice();return P.splice(y,1),P}return g})}),u=b(f=>(o(g=>[...g,f]),()=>l(f))),s=b(()=>{var y;let f=de(n);if(!f)return!1;let g=f.activeElement;return(y=n.current)!=null&&y.contains(g)?!0:a.some(P=>{var E,h;return((E=f.getElementById(P.buttonId.current))==null?void 0:E.contains(g))||((h=f.getElementById(P.panelId.current))==null?void 0:h.contains(g))})}),p=b(f=>{for(let g of a)g.buttonId.current!==f&&g.close()}),m=(0,_.useMemo)(()=>({registerPopover:u,unregisterPopover:l,isFocusWithinPopoverGroup:s,closeOthers:p}),[u,l,s,p]),d=(0,_.useMemo)(()=>({}),[]),v=t,c={ref:i};return _.default.createElement(rr.Provider,{value:m},C({ourProps:c,theirProps:v,slot:d,defaultTag:gi,name:"Popover.Group"}))}),vi=Object.assign(si,{Button:pi,Overlay:fi,Panel:bi,Group:yi});var ee=pe(require("react"),1);var Ge=require("react");function tn(e=0){let[t,r]=(0,Ge.useState)(e),n=(0,Ge.useCallback)(l=>r(u=>u|l),[t]),i=(0,Ge.useCallback)(l=>Boolean(t&l),[t]),a=(0,Ge.useCallback)(l=>r(u=>u&~l),[r]),o=(0,Ge.useCallback)(l=>r(u=>u^l),[r]);return{addFlag:n,hasFlag:i,removeFlag:a,toggleFlag:o}}var Se=pe(require("react"),1);var rn=(0,Se.createContext)(null);function nn(){let e=(0,Se.useContext)(rn);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,nn),t}return e}function mt(){let[e,t]=(0,Se.useState)([]);return[e.length>0?e.join(" "):void 0,(0,Se.useMemo)(()=>function(n){let i=b(o=>(t(l=>[...l,o]),()=>t(l=>{let u=l.slice(),s=u.indexOf(o);return s!==-1&&u.splice(s,1),u}))),a=(0,Se.useMemo)(()=>({register:i,slot:n.slot,name:n.name,props:n.props}),[i,n.slot,n.name,n.props]);return Se.default.createElement(rn.Provider,{value:a},n.children)},[t])]}var Pi="label",Ct=L(function(t,r){let n=V(),{id:i=`headlessui-label-${n}`,passive:a=!1,...o}=t,l=nn(),u=D(r);H(()=>l.register(i),[i,l.register]);let s={ref:u,...l.props,id:i};return a&&("onClick"in s&&delete s.onClick,"onClick"in o&&delete o.onClick),C({ourProps:s,theirProps:o,slot:l.slot||{},defaultTag:Pi,name:l.name||"Label"})});var Ei={[0](e,t){let r=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:ve(r,n=>n.element.current)}},[1](e,t){let r=e.options.slice(),n=e.options.findIndex(i=>i.id===t.id);return n===-1?e:(r.splice(n,1),{...e,options:r})}},or=(0,ee.createContext)(null);or.displayName="RadioGroupDataContext";function on(e){let t=(0,ee.useContext)(or);if(t===null){let r=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,on),r}return t}var ir=(0,ee.createContext)(null);ir.displayName="RadioGroupActionsContext";function ln(e){let t=(0,ee.useContext)(ir);if(t===null){let r=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ln),r}return t}function xi(e,t){return M(t.type,Ei,e,t)}var Ri="div",Si=L(function(t,r){let n=V(),{id:i=`headlessui-radiogroup-${n}`,value:a,defaultValue:o,name:l,onChange:u,by:s=(U,$)=>U===$,disabled:p=!1,...m}=t,d=b(typeof s=="string"?(U,$)=>{let Z=s;return(U==null?void 0:U[Z])===($==null?void 0:$[Z])}:s),[v,c]=(0,ee.useReducer)(xi,{options:[]}),f=v.options,[g,y]=mt(),[P,E]=Ue(),h=(0,ee.useRef)(null),F=D(h,r),[R,S]=Ie(a,u,o),x=(0,ee.useMemo)(()=>f.find(U=>!U.propsRef.current.disabled),[f]),N=(0,ee.useMemo)(()=>f.some(U=>d(U.propsRef.current.value,R)),[f,R]),I=b(U=>{var Z;if(p||d(U,R))return!1;let $=(Z=f.find(A=>d(A.propsRef.current.value,U)))==null?void 0:Z.propsRef.current;return $!=null&&$.disabled?!1:(S==null||S(U),!0)});We({container:h.current,accept(U){return U.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:U.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(U){U.setAttribute("role","none")}});let w=b(U=>{let $=h.current;if(!$)return;let Z=de($),A=f.filter(B=>B.propsRef.current.disabled===!1).map(B=>B.element.current);switch(U.key){case"Enter":Et(U.currentTarget);break;case"ArrowLeft":case"ArrowUp":if(U.preventDefault(),U.stopPropagation(),oe(A,18)===2){let k=f.find(Q=>Q.element.current===(Z==null?void 0:Z.activeElement));k&&I(k.propsRef.current.value)}break;case"ArrowRight":case"ArrowDown":if(U.preventDefault(),U.stopPropagation(),oe(A,20)===2){let k=f.find(Q=>Q.element.current===(Z==null?void 0:Z.activeElement));k&&I(k.propsRef.current.value)}break;case" ":{U.preventDefault(),U.stopPropagation();let B=f.find(k=>k.element.current===(Z==null?void 0:Z.activeElement));B&&I(B.propsRef.current.value)}break}}),T=b(U=>(c({type:0,...U}),()=>c({type:1,id:U.id}))),O=(0,ee.useMemo)(()=>({value:R,firstOption:x,containsCheckedOption:N,disabled:p,compare:d,...v}),[R,x,N,p,d,v]),W=(0,ee.useMemo)(()=>({registerOption:T,change:I}),[T,I]),Y={ref:F,id:i,role:"radiogroup","aria-labelledby":g,"aria-describedby":P,onKeyDown:w},ue=(0,ee.useMemo)(()=>({value:R}),[R]),re=(0,ee.useRef)(null),te=le();return(0,ee.useEffect)(()=>{!re.current||o!==void 0&&te.addEventListener(re.current,"reset",()=>{I(o)})},[re,I]),ee.default.createElement(E,{name:"RadioGroup.Description"},ee.default.createElement(y,{name:"RadioGroup.Label"},ee.default.createElement(ir.Provider,{value:W},ee.default.createElement(or.Provider,{value:O},l!=null&&R!=null&&we({[l]:R}).map(([U,$],Z)=>ee.default.createElement(se,{features:4,ref:Z===0?A=>{var B;re.current=(B=A==null?void 0:A.closest("form"))!=null?B:null}:void 0,...Ae({key:U,as:"input",type:"radio",checked:$!=null,hidden:!0,readOnly:!0,name:U,value:$})})),C({ourProps:Y,theirProps:m,slot:ue,defaultTag:Ri,name:"RadioGroup"})))))});var Oi="div",Ai=L(function(t,r){var T;let n=V(),{id:i=`headlessui-radiogroup-option-${n}`,value:a,disabled:o=!1,...l}=t,u=(0,ee.useRef)(null),s=D(u,r),[p,m]=mt(),[d,v]=Ue(),{addFlag:c,removeFlag:f,hasFlag:g}=tn(1),y=J({value:a,disabled:o}),P=on("RadioGroup.Option"),E=ln("RadioGroup.Option");H(()=>E.registerOption({id:i,element:u,propsRef:y}),[i,E,u,t]);let h=b(O=>{var W;if(fe(O.currentTarget))return O.preventDefault();!E.change(a)||(c(2),(W=u.current)==null||W.focus())}),F=b(O=>{if(fe(O.currentTarget))return O.preventDefault();c(2)}),R=b(()=>f(2)),S=((T=P.firstOption)==null?void 0:T.id)===i,x=P.disabled||o,N=P.compare(P.value,a),I={ref:s,id:i,role:"radio","aria-checked":N?"true":"false","aria-labelledby":p,"aria-describedby":d,"aria-disabled":x?!0:void 0,tabIndex:(()=>x?-1:N||!P.containsCheckedOption&&S?0:-1)(),onClick:x?void 0:h,onFocus:x?void 0:F,onBlur:x?void 0:R},w=(0,ee.useMemo)(()=>({checked:N,disabled:x,active:g(2)}),[N,x,g]);return ee.default.createElement(v,{name:"RadioGroup.Description"},ee.default.createElement(m,{name:"RadioGroup.Label"},C({ourProps:I,theirProps:l,slot:w,defaultTag:Oi,name:"RadioGroup.Option"})))}),hi=Object.assign(Si,{Option:Ai,Label:Ct,Description:Ze});var ae=pe(require("react"),1);var lr=(0,ae.createContext)(null);lr.displayName="GroupContext";var Ci=ae.Fragment;function Li(e){let[t,r]=(0,ae.useState)(null),[n,i]=mt(),[a,o]=Ue(),l=(0,ae.useMemo)(()=>({switch:t,setSwitch:r,labelledby:n,describedby:a}),[t,r,n,a]),u={},s=e;return ae.default.createElement(o,{name:"Switch.Description"},ae.default.createElement(i,{name:"Switch.Label",props:{onClick(){!t||(t.click(),t.focus({preventScroll:!0}))}}},ae.default.createElement(lr.Provider,{value:l},C({ourProps:u,theirProps:s,defaultTag:Ci,name:"Switch.Group"}))))}var Ii="button",Mi=L(function(t,r){let n=V(),{id:i=`headlessui-switch-${n}`,checked:a,defaultChecked:o=!1,onChange:l,name:u,value:s,...p}=t,m=(0,ae.useContext)(lr),d=(0,ae.useRef)(null),v=D(d,r,m===null?null:m.setSwitch),[c,f]=Ie(a,l,o),g=b(()=>f==null?void 0:f(!c)),y=b(S=>{if(fe(S.currentTarget))return S.preventDefault();S.preventDefault(),g()}),P=b(S=>{S.key===" "?(S.preventDefault(),g()):S.key==="Enter"&&Et(S.currentTarget)}),E=b(S=>S.preventDefault()),h=(0,ae.useMemo)(()=>({checked:c}),[c]),F={id:i,ref:v,role:"switch",type:be(t,d),tabIndex:0,"aria-checked":c,"aria-labelledby":m==null?void 0:m.labelledby,"aria-describedby":m==null?void 0:m.describedby,onClick:y,onKeyUp:P,onKeyPress:E},R=le();return(0,ae.useEffect)(()=>{var x;let S=(x=d.current)==null?void 0:x.closest("form");!S||o!==void 0&&R.addEventListener(S,"reset",()=>{f(o)})},[d,f]),ae.default.createElement(ae.default.Fragment,null,u!=null&&c&&ae.default.createElement(se,{features:4,...Ae({as:"input",type:"checkbox",hidden:!0,readOnly:!0,checked:c,name:u,value:s})}),C({ourProps:F,theirProps:p,slot:h,defaultTag:Ii,name:"Switch"}))}),Di=Object.assign(Mi,{Group:Li,Label:Ct,Description:Ze});var z=pe(require("react"),1);var Lt=pe(require("react"),1);function an({onFocus:e}){let[t,r]=(0,Lt.useState)(!0);return t?Lt.default.createElement(se,{as:"button",type:"button",features:2,onFocus:n=>{n.preventDefault();let i,a=50;function o(){if(a--<=0){i&&cancelAnimationFrame(i);return}if(e()){r(!1),cancelAnimationFrame(i);return}i=requestAnimationFrame(o)}i=requestAnimationFrame(o)}}):null}var Fi={[0](e,t){let r=e.tabs.filter(o=>{var l;return!((l=o.current)!=null&&l.hasAttribute("disabled"))});if(t.index<0)return{...e,selectedIndex:e.tabs.indexOf(r[0])};if(t.index>e.tabs.length)return{...e,selectedIndex:e.tabs.indexOf(r[r.length-1])};let n=e.tabs.slice(0,t.index),a=[...e.tabs.slice(t.index),...n].find(o=>r.includes(o));return a?{...e,selectedIndex:e.tabs.indexOf(a)}:e},[1](e,t){var a;if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],n=ve([...e.tabs,t.tab],o=>o.current),i=(a=n.indexOf(r))!=null?a:e.selectedIndex;return i===-1&&(i=e.selectedIndex),{...e,tabs:n,selectedIndex:i}},[2](e,t){return{...e,tabs:e.tabs.filter(r=>r!==t.tab)}},[3](e,t){return e.panels.includes(t.panel)?e:{...e,panels:ve([...e.panels,t.panel],r=>r.current)}},[4](e,t){return{...e,panels:e.panels.filter(r=>r!==t.panel)}}},ar=(0,z.createContext)(null);ar.displayName="TabsSSRContext";function sr(e){let t=(0,z.useContext)(ar);if(t===null){let r=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,sr),r}return t}var ur=(0,z.createContext)(null);ur.displayName="TabsDataContext";function tt(e){let t=(0,z.useContext)(ur);if(t===null){let r=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,tt),r}return t}var pr=(0,z.createContext)(null);pr.displayName="TabsActionsContext";function dr(e){let t=(0,z.useContext)(pr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,dr),r}return t}function wi(e,t){return M(t.type,Fi,e,t)}var ki=z.Fragment,Hi=L(function(t,r){let{defaultIndex:n=0,vertical:i=!1,manual:a=!1,onChange:o,selectedIndex:l=null,...u}=t,s=i?"vertical":"horizontal",p=a?"manual":"auto",m=l!==null,d=D(r),[v,c]=(0,z.useReducer)(wi,{selectedIndex:l!=null?l:n,tabs:[],panels:[]}),f=(0,z.useMemo)(()=>({selectedIndex:v.selectedIndex}),[v.selectedIndex]),g=J(o||(()=>{})),y=J(v.tabs),P=(0,z.useMemo)(()=>({orientation:s,activation:p,...v}),[s,p,v]),E=b(I=>(c({type:1,tab:I}),()=>c({type:2,tab:I}))),h=b(I=>(c({type:3,panel:I}),()=>c({type:4,panel:I}))),F=b(I=>{R.current!==I&&g.current(I),m||c({type:0,index:I})}),R=J(m?t.selectedIndex:v.selectedIndex),S=(0,z.useMemo)(()=>({registerTab:E,registerPanel:h,change:F}),[]);H(()=>{c({type:0,index:l!=null?l:n})},[l]);let x=(0,z.useRef)({tabs:[],panels:[]}),N={ref:d};return z.default.createElement(ar.Provider,{value:x},z.default.createElement(pr.Provider,{value:S},z.default.createElement(ur.Provider,{value:P},P.tabs.length<=0&&z.default.createElement(an,{onFocus:()=>{var I,w;for(let T of y.current)if(((I=T.current)==null?void 0:I.tabIndex)===0)return(w=T.current)==null||w.focus(),!0;return!1}}),C({ourProps:N,theirProps:u,slot:f,defaultTag:ki,name:"Tabs"}))))}),_i="div",Ni=L(function(t,r){let{orientation:n,selectedIndex:i}=tt("Tab.List"),a=D(r);return C({ourProps:{ref:a,role:"tablist","aria-orientation":n},theirProps:t,slot:{selectedIndex:i},defaultTag:_i,name:"Tabs.List"})}),Bi="button",Ui=L(function(t,r){var I,w;let n=V(),{id:i=`headlessui-tabs-tab-${n}`,...a}=t,{orientation:o,activation:l,selectedIndex:u,tabs:s,panels:p}=tt("Tab"),m=dr("Tab"),d=tt("Tab"),v=sr("Tab"),c=(0,z.useRef)(null),f=D(c,r);H(()=>m.registerTab(c),[m,c]);let g=v.current.tabs.indexOf(i);g===-1&&(g=v.current.tabs.push(i)-1);let y=s.indexOf(c);y===-1&&(y=g);let P=y===u,E=b(T=>{var W;let O=T();if(O===2&&l==="auto"){let Y=(W=de(c))==null?void 0:W.activeElement,ue=d.tabs.findIndex(re=>re.current===Y);ue!==-1&&m.change(ue)}return O}),h=b(T=>{let O=s.map(Y=>Y.current).filter(Boolean);if(T.key===" "||T.key==="Enter"){T.preventDefault(),T.stopPropagation(),m.change(y);return}switch(T.key){case"Home":case"PageUp":return T.preventDefault(),T.stopPropagation(),E(()=>oe(O,1));case"End":case"PageDown":return T.preventDefault(),T.stopPropagation(),E(()=>oe(O,8))}if(E(()=>M(o,{vertical(){return T.key==="ArrowUp"?oe(O,18):T.key==="ArrowDown"?oe(O,20):0},horizontal(){return T.key==="ArrowLeft"?oe(O,18):T.key==="ArrowRight"?oe(O,20):0}}))===2)return T.preventDefault()}),F=(0,z.useRef)(!1),R=b(()=>{var T;F.current||(F.current=!0,(T=c.current)==null||T.focus(),m.change(y),he(()=>{F.current=!1}))}),S=b(T=>{T.preventDefault()}),x=(0,z.useMemo)(()=>({selected:P}),[P]),N={ref:f,onKeyDown:h,onMouseDown:S,onClick:R,id:i,role:"tab",type:be(t,c),"aria-controls":(w=(I=p[y])==null?void 0:I.current)==null?void 0:w.id,"aria-selected":P,tabIndex:P?0:-1};return C({ourProps:N,theirProps:a,slot:x,defaultTag:Bi,name:"Tabs.Tab"})}),Gi="div",Vi=L(function(t,r){let{selectedIndex:n}=tt("Tab.Panels"),i=D(r),a=(0,z.useMemo)(()=>({selectedIndex:n}),[n]);return C({ourProps:{ref:i},theirProps:t,slot:a,defaultTag:Gi,name:"Tabs.Panels"})}),ji="div",Wi=3,Ki=L(function(t,r){var P,E,h,F;let n=V(),{id:i=`headlessui-tabs-panel-${n}`,...a}=t,{selectedIndex:o,tabs:l,panels:u}=tt("Tab.Panel"),s=dr("Tab.Panel"),p=sr("Tab.Panel"),m=(0,z.useRef)(null),d=D(m,r);H(()=>s.registerPanel(m),[s,m]);let v=p.current.panels.indexOf(i);v===-1&&(v=p.current.panels.push(i)-1);let c=u.indexOf(m);c===-1&&(c=v);let f=c===o,g=(0,z.useMemo)(()=>({selected:f}),[f]),y={ref:d,id:i,role:"tabpanel","aria-labelledby":(E=(P=l[c])==null?void 0:P.current)==null?void 0:E.id,tabIndex:f?0:-1};return!f&&((h=a.unmount)!=null?h:!0)&&!((F=a.static)!=null&&F)?z.default.createElement(se,{as:"span",...y}):C({ourProps:y,theirProps:a,slot:g,defaultTag:ji,features:Wi,visible:f,name:"Tabs.Panel"})}),$i=Object.assign(Ui,{Group:Hi,List:Ni,Panels:Vi,Panel:Ki});var G=pe(require("react"),1);function sn(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function cr(e,...t){e&&t.length>0&&e.classList.add(...t)}function fr(e,...t){e&&t.length>0&&e.classList.remove(...t)}function qi(e,t){let r=ie();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,o]=[n,i].map(u=>{let[s=0]=u.split(",").filter(Boolean).map(p=>p.includes("ms")?parseFloat(p):parseFloat(p)*1e3).sort((p,m)=>m-p);return s});if(a+o!==0){let u=r.addEventListener(e,"transitionend",s=>{s.target===s.currentTarget&&(t(),u())})}else t();return r.add(()=>t()),r.dispose}function un(e,t,r,n){let i=r?"enter":"leave",a=ie(),o=n!==void 0?sn(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let l=M(i,{enter:()=>t.enter,leave:()=>t.leave}),u=M(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),s=M(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return fr(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),cr(e,...l,...s),a.nextFrame(()=>{fr(e,...s),cr(e,...u),qi(e,()=>(fr(e,...l),cr(e,...t.entered),o()))}),a.dispose}function pn({container:e,direction:t,classes:r,onStart:n,onStop:i}){let a=_e(),o=le(),l=J(t);H(()=>{let u=ie();o.add(u.dispose);let s=e.current;if(!!s&&l.current!=="idle"&&!!a.current)return u.dispose(),n.current(l.current),u.add(un(s,r.current,l.current==="enter",()=>{u.dispose(),i.current(l.current)})),u.dispose},[t])}function dn(...e){return e.filter(Boolean).join(" ")}function Ve(e=""){return e.split(" ").filter(t=>t.trim().length>1)}var It=(0,G.createContext)(null);It.displayName="TransitionContext";function Qi(){let e=(0,G.useContext)(It);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Xi(){let e=(0,G.useContext)(Mt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}var Mt=(0,G.createContext)(null);Mt.displayName="NestingContext";function Dt(e){return"children"in e?Dt(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function fn(e,t){let r=J(e),n=(0,G.useRef)([]),i=_e(),a=le(),o=b((v,c=1)=>{let f=n.current.findIndex(({el:g})=>g===v);f!==-1&&(M(c,{[0](){n.current.splice(f,1)},[1](){n.current[f].state="hidden"}}),a.microTask(()=>{var g;!Dt(n)&&i.current&&((g=r.current)==null||g.call(r))}))}),l=b(v=>{let c=n.current.find(({el:f})=>f===v);return c?c.state!=="visible"&&(c.state="visible"):n.current.push({el:v,state:"visible"}),()=>o(v,0)}),u=(0,G.useRef)([]),s=(0,G.useRef)(Promise.resolve()),p=(0,G.useRef)({enter:[],leave:[],idle:[]}),m=b((v,c,f)=>{u.current.splice(0),t&&(t.chains.current[c]=t.chains.current[c].filter(([g])=>g!==v)),t==null||t.chains.current[c].push([v,new Promise(g=>{u.current.push(g)})]),t==null||t.chains.current[c].push([v,new Promise(g=>{Promise.all(p.current[c].map(([y,P])=>P)).then(()=>g())})]),c==="enter"?s.current=s.current.then(()=>t==null?void 0:t.wait.current).then(()=>f(c)):f(c)}),d=b((v,c,f)=>{Promise.all(p.current[c].splice(0).map(([g,y])=>y)).then(()=>{var g;(g=u.current.shift())==null||g()}).then(()=>f(c))});return(0,G.useMemo)(()=>({children:n,register:l,unregister:o,onStart:m,onStop:d,wait:s,chains:p}),[l,o,n,m,d,p,s])}function Yi(){}var Ji=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function cn(e){var r;let t={};for(let n of Ji)t[n]=(r=e[n])!=null?r:Yi;return t}function zi(e){let t=(0,G.useRef)(cn(e));return(0,G.useEffect)(()=>{t.current=cn(e)},[e]),t}var Zi="div",mn=1,Tn=L(function(t,r){let{beforeEnter:n,afterEnter:i,beforeLeave:a,afterLeave:o,enter:l,enterFrom:u,enterTo:s,entered:p,leave:m,leaveFrom:d,leaveTo:v,...c}=t,f=(0,G.useRef)(null),g=D(f,r),y=c.unmount?0:1,{show:P,appear:E,initial:h}=Qi(),[F,R]=(0,G.useState)(P?"visible":"hidden"),S=Xi(),{register:x,unregister:N}=S,I=(0,G.useRef)(null);(0,G.useEffect)(()=>x(f),[x,f]),(0,G.useEffect)(()=>{if(y===1&&!!f.current){if(P&&F!=="visible"){R("visible");return}return M(F,{["hidden"]:()=>N(f),["visible"]:()=>x(f)})}},[F,f,x,N,P,y]);let w=J({enter:Ve(l),enterFrom:Ve(u),enterTo:Ve(s),entered:Ve(p),leave:Ve(m),leaveFrom:Ve(d),leaveTo:Ve(v)}),T=zi({beforeEnter:n,afterEnter:i,beforeLeave:a,afterLeave:o}),O=xe();(0,G.useEffect)(()=>{if(O&&F==="visible"&&f.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[f,F,O]);let W=h&&!E,Y=(()=>!O||W||I.current===P?"idle":P?"enter":"leave")(),ue=b(A=>M(A,{enter:()=>T.current.beforeEnter(),leave:()=>T.current.beforeLeave(),idle:()=>{}})),re=b(A=>M(A,{enter:()=>T.current.afterEnter(),leave:()=>T.current.afterLeave(),idle:()=>{}})),te=fn(()=>{R("hidden"),N(f)},S);pn({container:f,classes:w,direction:Y,onStart:J(A=>{te.onStart(f,A,ue)}),onStop:J(A=>{te.onStop(f,A,re),A==="leave"&&!Dt(te)&&(R("hidden"),N(f))})}),(0,G.useEffect)(()=>{!W||(y===1?I.current=null:I.current=P)},[P,W,F]);let U=c,$={ref:g};return E&&P&&(typeof window=="undefined"||typeof document=="undefined")&&(U={...U,className:dn(c.className,...w.current.enter,...w.current.enterFrom)}),G.default.createElement(Mt.Provider,{value:te},G.default.createElement(Ee,{value:M(F,{["visible"]:0,["hidden"]:1})},C({ourProps:$,theirProps:U,defaultTag:Zi,features:mn,visible:F==="visible",name:"Transition.Child"})))}),mr=L(function(t,r){let{show:n,appear:i=!1,unmount:a,...o}=t,l=(0,G.useRef)(null),u=D(l,r);xe();let s=Te();if(n===void 0&&s!==null&&(n=M(s,{[0]:!0,[1]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[p,m]=(0,G.useState)(n?"visible":"hidden"),d=fn(()=>{m("hidden")}),[v,c]=(0,G.useState)(!0),f=(0,G.useRef)([n]);H(()=>{v!==!1&&f.current[f.current.length-1]!==n&&(f.current.push(n),c(!1))},[f,n]);let g=(0,G.useMemo)(()=>({show:n,appear:i,initial:v}),[n,i,v]);(0,G.useEffect)(()=>{if(n)m("visible");else if(!Dt(d))m("hidden");else{let P=l.current;if(!P)return;let E=P.getBoundingClientRect();E.x===0&&E.y===0&&E.width===0&&E.height===0&&m("hidden")}},[n,d]);let y={unmount:a};return G.default.createElement(Mt.Provider,{value:d},G.default.createElement(It.Provider,{value:g},C({ourProps:{...y,as:G.Fragment,children:G.default.createElement(Tn,{ref:u,...y,...o})},theirProps:{},defaultTag:G.Fragment,features:mn,visible:p==="visible",name:"Transition"})))}),el=L(function(t,r){let n=(0,G.useContext)(It)!==null,i=Te()!==null;return G.default.createElement(G.default.Fragment,null,!n&&i?G.default.createElement(mr,{ref:r,...t}):G.default.createElement(Tn,{ref:r,...t}))}),tl=Object.assign(mr,{Child:el,Root:mr});