@petnow/ui 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.es.js +16 -22
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/mobile/popup/Popup.d.ts +5 -3
- package/package.json +1 -1
- /package/dist/test/{Modal.test.d.ts → Popup.test.d.ts} +0 -0
package/dist/index.umd.js
CHANGED
|
@@ -73,7 +73,7 @@ So animateHeight is most likely having no effect at all.`);var zt=(0,e.default)(
|
|
|
73
73
|
* This source code is licensed under the MIT license found in the
|
|
74
74
|
* LICENSE file in the root directory of this source tree.
|
|
75
75
|
*/var iu;function Qh(){return iu||(iu=1,process.env.NODE_ENV!=="production"&&function(){function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=d,e=typeof Object.is=="function"?Object.is:n,t=r.useSyncExternalStore,o=r.useRef,a=r.useEffect,i=r.useMemo,s=r.useDebugValue;ei.useSyncExternalStoreWithSelector=function(l,u,c,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=i(function(){function g(D){if(!x){if(x=!0,E=D,D=f(D),h!==void 0&&m.hasValue){var T=m.value;if(h(T,D))return w=T}return w=D}if(T=w,e(E,D))return T;var $=f(D);return h!==void 0&&h(T,$)?(E=D,T):(E=D,w=$)}var x=!1,E,w,k=c===void 0?null:c;return[function(){return g(u())},k===null?void 0:function(){return g(k())}]},[u,c,f,h]);var v=t(l,p[0],p[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),s(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ei}var su;function Gh(){return su||(su=1,process.env.NODE_ENV==="production"?co.exports=Uh():co.exports=Qh()),co.exports}var Kh=Gh();function we(n,r,e=nu){return Kh.useSyncExternalStoreWithSelector(ee(t=>n.subscribe(Xh,t)),ee(()=>n.state),ee(()=>n.state),ee(r),e)}function Xh(n){return n}function br(n,r){let e=d.useId(),t=In.get(r),[o,a]=we(t,d.useCallback(i=>[t.selectors.isTop(i,e),t.selectors.inStack(i,e)],[t,e]));return fe(()=>{if(n)return t.actions.push(e),()=>t.actions.pop(e)},[t,n,e]),n?a?o:!0:!1}let ti=new Map,yr=new Map;function lu(n){var r;let e=(r=yr.get(n))!=null?r:0;return yr.set(n,e+1),e!==0?()=>uu(n):(ti.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0,()=>uu(n))}function uu(n){var r;let e=(r=yr.get(n))!=null?r:1;if(e===1?yr.delete(n):yr.set(n,e-1),e!==1)return;let t=ti.get(n);t&&(t["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",t["aria-hidden"]),n.inert=t.inert,ti.delete(n))}function ni(n,{allowed:r,disallowed:e}={}){let t=br(n,"inert-others");fe(()=>{var o,a;if(!t)return;let i=rt();for(let l of(o=e==null?void 0:e())!=null?o:[])l&&i.add(lu(l));let s=(a=r==null?void 0:r())!=null?a:[];for(let l of s){if(!l)continue;let u=dn(l);if(!u)continue;let c=l.parentElement;for(;c&&c!==u.body;){for(let f of c.children)s.some(h=>f.contains(h))||i.add(lu(f));c=c.parentElement}}return i.dispose},[t,r,e])}function ri(n,r,e){let t=Pt(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&e()});d.useEffect(()=>{if(!n)return;let o=r===null?null:Ke(r)?r:r.current;if(!o)return;let a=rt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>t.current(o));i.observe(o),a.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>t.current(o));i.observe(o),a.add(()=>i.disconnect())}return()=>a.dispose()},[r,t,n])}let fo=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(","),Jh=["[data-autofocus]"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var dt=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n[n.AutoFocus=64]="AutoFocus",n))(dt||{}),oi=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(oi||{}),Zh=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(Zh||{});function cu(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(fo)).sort((r,e)=>Math.sign((r.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}function em(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(Jh)).sort((r,e)=>Math.sign((r.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}var ai=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(ai||{});function du(n,r=0){var e;return n===((e=dn(n))==null?void 0:e.body)?!1:Le(r,{0(){return n.matches(fo)},1(){let t=n;for(;t!==null;){if(t.matches(fo))return!0;t=t.parentElement}return!1}})}var tm=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(tm||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Lt(n){n==null||n.focus({preventScroll:!0})}let nm=["textarea","input"].join(",");function rm(n){var r,e;return(e=(r=n==null?void 0:n.matches)==null?void 0:r.call(n,nm))!=null?e:!1}function ii(n,r=e=>e){return n.slice().sort((e,t)=>{let o=r(e),a=r(t);if(o===null||a===null)return 0;let i=o.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function om(n,r){return Nn(cu(),r,{relativeTo:n})}function Nn(n,r,{sorted:e=!0,relativeTo:t=null,skipElements:o=[]}={}){let a=Array.isArray(n)?n.length>0?n[0].ownerDocument:document:n.ownerDocument,i=Array.isArray(n)?e?ii(n):n:r&64?em(n):cu(n);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(m=>m!=null&&"current"in m?(m==null?void 0:m.current)===p:m===p))),t=t??a.activeElement;let s=(()=>{if(r&5)return 1;if(r&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(r&1)return 0;if(r&2)return Math.max(0,i.indexOf(t))-1;if(r&4)return Math.max(0,i.indexOf(t))+1;if(r&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=r&32?{preventScroll:!0}:{},c=0,f=i.length,h;do{if(c>=f||c+f<=0)return 0;let p=l+c;if(r&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}h=i[p],h==null||h.focus(u),c+=s}while(h!==a.activeElement);return r&6&&rm(h)&&h.select(),2}function fu(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function am(){return/Android/gi.test(window.navigator.userAgent)}function si(){return fu()||am()}function Ln(n,r,e,t){let o=Pt(e);d.useEffect(()=>{if(!n)return;function a(i){o.current(i)}return document.addEventListener(r,a,t),()=>document.removeEventListener(r,a,t)},[n,r,t])}function pu(n,r,e,t){let o=Pt(e);d.useEffect(()=>{if(!n)return;function a(i){o.current(i)}return window.addEventListener(r,a,t),()=>window.removeEventListener(r,a,t)},[n,r,t])}const hu=30;function li(n,r,e){let t=Pt(e),o=d.useCallback(function(s,l){if(s.defaultPrevented)return;let u=l(s);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function f(h){return typeof h=="function"?f(h()):Array.isArray(h)||h instanceof Set?h:[h]}(r);for(let f of c)if(f!==null&&(f.contains(u)||s.composed&&s.composedPath().includes(f)))return;return!du(u,ai.Loose)&&u.tabIndex!==-1&&s.preventDefault(),t.current(s,u)},[t,r]),a=d.useRef(null);Ln(n,"pointerdown",s=>{var l,u;si()||(a.current=((u=(l=s.composedPath)==null?void 0:l.call(s))==null?void 0:u[0])||s.target)},!0),Ln(n,"pointerup",s=>{if(si()||!a.current)return;let l=a.current;return a.current=null,o(s,()=>l)},!0);let i=d.useRef({x:0,y:0});Ln(n,"touchstart",s=>{i.current.x=s.touches[0].clientX,i.current.y=s.touches[0].clientY},!0),Ln(n,"touchend",s=>{let l={x:s.changedTouches[0].clientX,y:s.changedTouches[0].clientY};if(!(Math.abs(l.x-i.current.x)>=hu||Math.abs(l.y-i.current.y)>=hu))return o(s,()=>Nt(s.target)?s.target:null)},!0),pu(n,"blur",s=>o(s,()=>fh(window.document.activeElement)?window.document.activeElement:null),!0)}function Ft(...n){return d.useMemo(()=>dn(...n),[...n])}var im=(n=>(n[n.Ignore=0]="Ignore",n[n.Select=1]="Select",n[n.Close=2]="Close",n))(im||{});const $t={Ignore:{kind:0},Select:n=>({kind:1,target:n}),Close:{kind:2}},sm=200;function mu(n,{trigger:r,action:e,close:t,select:o}){let a=d.useRef(null);Ln(n&&r!==null,"pointerdown",i=>{qa(i==null?void 0:i.target)&&r!=null&&r.contains(i.target)&&(a.current=new Date)}),Ln(n&&r!==null,"pointerup",i=>{if(a.current===null||!Nt(i.target))return;let s=e(i),l=new Date().getTime()-a.current.getTime();switch(a.current=null,s.kind){case 0:return;case 1:{l>sm&&(o(s.target),t());break}case 2:{t();break}}},{capture:!0})}function ui(n,r,e,t){let o=Pt(e);d.useEffect(()=>{n=n??window;function a(i){o.current(i)}return n.addEventListener(r,a,t),()=>n.removeEventListener(r,a,t)},[n,r,t])}function vu(n){let r=d.useRef({value:"",selectionStart:null,selectionEnd:null});return ui(n,"blur",e=>{let t=e.target;io(t)&&(r.current={value:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd})}),ee(()=>{if(document.activeElement!==n&&io(n)&&n.isConnected){if(n.focus({preventScroll:!0}),n.value!==r.current.value)n.setSelectionRange(n.value.length,n.value.length);else{let{selectionStart:e,selectionEnd:t}=r.current;e!==null&&t!==null&&n.setSelectionRange(e,t)}r.current={value:"",selectionStart:null,selectionEnd:null}}})}function gu(n,r){return d.useMemo(()=>{var e;if(n.type)return n.type;let t=(e=n.as)!=null?e:"button";if(typeof t=="string"&&t.toLowerCase()==="button"||(r==null?void 0:r.tagName)==="BUTTON"&&!r.hasAttribute("type"))return"button"},[n.type,n.as,r])}function lm(n){return d.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot)}function um(n,r){let e=n(),t=new Set;return{getSnapshot(){return e},subscribe(o){return t.add(o),()=>t.delete(o)},dispatch(o,...a){let i=r[o].call(e,...a);i&&(e=i,t.forEach(s=>s()))}}}function cm(){let n;return{before({doc:r}){var e;let t=r.documentElement,o=(e=r.defaultView)!=null?e:window;n=Math.max(0,o.innerWidth-t.clientWidth)},after({doc:r,d:e}){let t=r.documentElement,o=Math.max(0,t.clientWidth-t.offsetWidth),a=Math.max(0,n-o);e.style(t,"paddingRight",`${a}px`)}}}function dm(){return fu()?{before({doc:n,d:r,meta:e}){function t(o){return e.containers.flatMap(a=>a()).some(a=>a.contains(o))}r.microTask(()=>{var o;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let s=rt();s.style(n.documentElement,"scrollBehavior","auto"),r.add(()=>r.microTask(()=>s.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;r.addEventListener(n,"click",s=>{if(Nt(s.target))try{let l=s.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),c=n.querySelector(u);Nt(c)&&!t(c)&&(i=c)}catch{}},!0),r.addEventListener(n,"touchstart",s=>{if(Nt(s.target)&&dh(s.target))if(t(s.target)){let l=s.target;for(;l.parentElement&&t(l.parentElement);)l=l.parentElement;r.style(l,"overscrollBehavior","contain")}else r.style(s.target,"touchAction","none")}),r.addEventListener(n,"touchmove",s=>{if(Nt(s.target)){if(io(s.target))return;if(t(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),r.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;a!==l&&window.scrollTo(0,a),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function fm(){return{before({doc:n,d:r}){r.style(n.documentElement,"overflow","hidden")}}}function pm(n){let r={};for(let e of n)Object.assign(r,e(r));return r}let fn=um(()=>new Map,{PUSH(n,r){var e;let t=(e=this.get(n))!=null?e:{doc:n,count:0,d:rt(),meta:new Set};return t.count++,t.meta.add(r),this.set(n,t),this},POP(n,r){let e=this.get(n);return e&&(e.count--,e.meta.delete(r)),this},SCROLL_PREVENT({doc:n,d:r,meta:e}){let t={doc:n,d:r,meta:pm(e)},o=[dm(),cm(),fm()];o.forEach(({before:a})=>a==null?void 0:a(t)),o.forEach(({after:a})=>a==null?void 0:a(t))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});fn.subscribe(()=>{let n=fn.getSnapshot(),r=new Map;for(let[e]of n)r.set(e,e.documentElement.style.overflow);for(let e of n.values()){let t=r.get(e.doc)==="hidden",o=e.count!==0;(o&&!t||!o&&t)&&fn.dispatch(e.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",e),e.count===0&&fn.dispatch("TEARDOWN",e)}});function hm(n,r,e=()=>({containers:[]})){let t=lm(fn),o=r?t.get(r):void 0,a=o?o.count>0:!1;return fe(()=>{if(!(!r||!n))return fn.dispatch("PUSH",r,e),()=>fn.dispatch("POP",r,e)},[n,r]),a}function ci(n,r,e=()=>[document.body]){let t=br(n,"scroll-lock");hm(t,r,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],e]}})}function bu(n){return[n.screenX,n.screenY]}function yu(){let n=d.useRef([-1,-1]);return{wasMoved(r){let e=bu(r);return n.current[0]===e[0]&&n.current[1]===e[1]?!1:(n.current=e,!0)},update(r){n.current=bu(r)}}}function mm(n=0){let[r,e]=d.useState(n),t=d.useCallback(l=>e(l),[r]),o=d.useCallback(l=>e(u=>u|l),[r]),a=d.useCallback(l=>(r&l)===l,[r]),i=d.useCallback(l=>e(u=>u&~l),[e]),s=d.useCallback(l=>e(u=>u^l),[e]);return{flags:r,setFlag:t,addFlag:o,hasFlag:a,removeFlag:i,toggleFlag:s}}var wu,xu;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((wu=process==null?void 0:process.env)==null?void 0:wu.NODE_ENV)==="test"&&typeof((xu=Element==null?void 0:Element.prototype)==null?void 0:xu.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(`
|
|
76
|
-
`)),[]});var vm=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(vm||{});function di(n){let r={};for(let e in n)n[e]===!0&&(r[`data-${e}`]="");return r}function fi(n,r,e,t){let[o,a]=d.useState(e),{hasFlag:i,addFlag:s,removeFlag:l}=mm(n&&o?3:0),u=d.useRef(!1),c=d.useRef(!1),f=Qt();return fe(()=>{var h;if(n){if(e&&a(!0),!r){e&&s(3);return}return(h=t==null?void 0:t.start)==null||h.call(t,e),gm(r,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(e?(s(3),l(4)):(s(4),l(2)))},run(){c.current?e?(l(3),s(4)):(l(4),s(3)):e?l(1):s(1)},done(){var p;c.current&&typeof r.getAnimations=="function"&&r.getAnimations().length>0||(u.current=!1,l(7),e||a(!1),(p=t==null?void 0:t.end)==null||p.call(t,e))}})}},[n,e,r,f]),n?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[e,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function gm(n,{prepare:r,run:e,done:t,inFlight:o}){let a=rt();return ym(n,{prepare:r,inFlight:o}),a.nextFrame(()=>{e(),a.requestAnimationFrame(()=>{a.add(bm(n,t))})}),a.dispose}function bm(n,r){var e,t;let o=rt();if(!n)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=(t=(e=n.getAnimations)==null?void 0:e.call(n).filter(s=>s instanceof CSSTransition))!=null?t:[];return i.length===0?(r(),o.dispose):(Promise.allSettled(i.map(s=>s.finished)).then(()=>{a||r()}),o.dispose)}function ym(n,{inFlight:r,prepare:e}){if(r!=null&&r.current){e();return}let t=n.style.transition;n.style.transition="none",e(),n.offsetHeight,n.style.transition=t}function wm(n,{container:r,accept:e,walk:t}){let o=d.useRef(e),a=d.useRef(t);d.useEffect(()=>{o.current=e,a.current=t},[e,t]),fe(()=>{if(!r||!n)return;let i=dn(r);if(!i)return;let s=o.current,l=a.current,u=Object.assign(f=>s(f),{acceptNode:s}),c=i.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)l(c.currentNode)},[r,n,o,a])}function wr(n,r){let e=d.useRef([]),t=ee(n);d.useEffect(()=>{let o=[...e.current];for(let[a,i]of r.entries())if(e.current[a]!==i){let s=t(r,o);return e.current=r,s}},[t,...r])}function po(){return typeof window<"u"}function Fn(n){return Eu(n)?(n.nodeName||"").toLowerCase():"#document"}function Ze(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function mt(n){var r;return(r=(Eu(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Eu(n){return po()?n instanceof Node||n instanceof Ze(n).Node:!1}function Fe(n){return po()?n instanceof Element||n instanceof Ze(n).Element:!1}function vt(n){return po()?n instanceof HTMLElement||n instanceof Ze(n).HTMLElement:!1}function Du(n){return!po()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ze(n).ShadowRoot}function xr(n){const{overflow:r,overflowX:e,overflowY:t,display:o}=at(n);return/auto|scroll|overlay|hidden|clip/.test(r+t+e)&&!["inline","contents"].includes(o)}function xm(n){return["table","td","th"].includes(Fn(n))}function ho(n){return[":popover-open",":modal"].some(r=>{try{return n.matches(r)}catch{return!1}})}function pi(n){const r=hi(),e=Fe(n)?at(n):n;return["transform","translate","scale","rotate","perspective"].some(t=>e[t]?e[t]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!r&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!r&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(t=>(e.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(e.contain||"").includes(t))}function Em(n){let r=Jt(n);for(;vt(r)&&!$n(r);){if(pi(r))return r;if(ho(r))return null;r=Jt(r)}return null}function hi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $n(n){return["html","body","#document"].includes(Fn(n))}function at(n){return Ze(n).getComputedStyle(n)}function mo(n){return Fe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Jt(n){if(Fn(n)==="html")return n;const r=n.assignedSlot||n.parentNode||Du(n)&&n.host||mt(n);return Du(r)?r.host:r}function Su(n){const r=Jt(n);return $n(r)?n.ownerDocument?n.ownerDocument.body:n.body:vt(r)&&xr(r)?r:Su(r)}function Er(n,r,e){var t;r===void 0&&(r=[]),e===void 0&&(e=!0);const o=Su(n),a=o===((t=n.ownerDocument)==null?void 0:t.body),i=Ze(o);if(a){const s=mi(i);return r.concat(i,i.visualViewport||[],xr(o)?o:[],s&&e?Er(s):[])}return r.concat(o,Er(o,[],e))}function mi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Dm(){const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(r=>{let{brand:e,version:t}=r;return e+"/"+t}).join(" "):navigator.userAgent}const At=Math.min,Ue=Math.max,Dr=Math.round,vo=Math.floor,gt=n=>({x:n,y:n}),Sm={left:"right",right:"left",bottom:"top",top:"bottom"},km={start:"end",end:"start"};function vi(n,r,e){return Ue(n,At(r,e))}function pn(n,r){return typeof n=="function"?n(r):n}function Zt(n){return n.split("-")[0]}function An(n){return n.split("-")[1]}function ku(n){return n==="x"?"y":"x"}function gi(n){return n==="y"?"height":"width"}function hn(n){return["top","bottom"].includes(Zt(n))?"y":"x"}function bi(n){return ku(hn(n))}function _m(n,r,e){e===void 0&&(e=!1);const t=An(n),o=bi(n),a=gi(o);let i=o==="x"?t===(e?"end":"start")?"right":"left":t==="start"?"bottom":"top";return r.reference[a]>r.floating[a]&&(i=go(i)),[i,go(i)]}function Cm(n){const r=go(n);return[yi(n),r,yi(r)]}function yi(n){return n.replace(/start|end/g,r=>km[r])}function Om(n,r,e){const t=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(n){case"top":case"bottom":return e?r?o:t:r?t:o;case"left":case"right":return r?a:i;default:return[]}}function Mm(n,r,e,t){const o=An(n);let a=Om(Zt(n),e==="start",t);return o&&(a=a.map(i=>i+"-"+o),r&&(a=a.concat(a.map(yi)))),a}function go(n){return n.replace(/left|right|bottom|top/g,r=>Sm[r])}function Tm(n){return{top:0,right:0,bottom:0,left:0,...n}}function _u(n){return typeof n!="number"?Tm(n):{top:n,right:n,bottom:n,left:n}}function bo(n){const{x:r,y:e,width:t,height:o}=n;return{width:t,height:o,top:e,left:r,right:r+t,bottom:e+o,x:r,y:e}}function Cu(n,r,e){let{reference:t,floating:o}=n;const a=hn(r),i=bi(r),s=gi(i),l=Zt(r),u=a==="y",c=t.x+t.width/2-o.width/2,f=t.y+t.height/2-o.height/2,h=t[s]/2-o[s]/2;let p;switch(l){case"top":p={x:c,y:t.y-o.height};break;case"bottom":p={x:c,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:f};break;case"left":p={x:t.x-o.width,y:f};break;default:p={x:t.x,y:t.y}}switch(An(r)){case"start":p[i]-=h*(e&&u?-1:1);break;case"end":p[i]+=h*(e&&u?-1:1);break}return p}const Pm=async(n,r,e)=>{const{placement:t="bottom",strategy:o="absolute",middleware:a=[],platform:i}=e,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(r));let u=await i.getElementRects({reference:n,floating:r,strategy:o}),{x:c,y:f}=Cu(u,t,l),h=t,p={},m=0;for(let v=0;v<s.length;v++){const{name:g,fn:x}=s[v],{x:E,y:w,data:k,reset:D}=await x({x:c,y:f,initialPlacement:t,placement:h,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:n,floating:r}});c=E??c,f=w??f,p={...p,[g]:{...p[g],...k}},D&&m<=50&&(m++,typeof D=="object"&&(D.placement&&(h=D.placement),D.rects&&(u=D.rects===!0?await i.getElementRects({reference:n,floating:r,strategy:o}):D.rects),{x:c,y:f}=Cu(u,h,l)),v=-1)}return{x:c,y:f,placement:h,strategy:o,middlewareData:p}};async function yo(n,r){var e;r===void 0&&(r={});const{x:t,y:o,platform:a,rects:i,elements:s,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=pn(r,n),m=_u(p),g=s[h?f==="floating"?"reference":"floating":f],x=bo(await a.getClippingRect({element:(e=await(a.isElement==null?void 0:a.isElement(g)))==null||e?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:t,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),k=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},D=bo(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:w,strategy:l}):E);return{top:(x.top-D.top+m.top)/k.y,bottom:(D.bottom-x.bottom+m.bottom)/k.y,left:(x.left-D.left+m.left)/k.x,right:(D.right-x.right+m.right)/k.x}}const Im=n=>({name:"arrow",options:n,async fn(r){const{x:e,y:t,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=r,{element:u,padding:c=0}=pn(n,r)||{};if(u==null)return{};const f=_u(c),h={x:e,y:t},p=bi(o),m=gi(p),v=await i.getDimensions(u),g=p==="y",x=g?"top":"left",E=g?"bottom":"right",w=g?"clientHeight":"clientWidth",k=a.reference[m]+a.reference[p]-h[p]-a.floating[m],D=h[p]-a.reference[p],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let $=T?T[w]:0;(!$||!await(i.isElement==null?void 0:i.isElement(T)))&&($=s.floating[w]||a.floating[m]);const _=k/2-D/2,C=$/2-v[m]/2-1,O=At(f[x],C),R=At(f[E],C),b=O,S=$-v[m]-R,L=$/2-v[m]/2+_,P=vi(b,L,S),N=!l.arrow&&An(o)!=null&&L!==P&&a.reference[m]/2-(L<b?O:R)-v[m]/2<0,z=N?L<b?L-b:L-S:0;return{[p]:h[p]+z,data:{[p]:P,centerOffset:L-P-z,...N&&{alignmentOffset:z}},reset:N}}}),Nm=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var e,t;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=r,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=pn(n,r);if((e=a.arrow)!=null&&e.alignmentOffset)return{};const x=Zt(o),E=hn(s),w=Zt(s)===s,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),D=h||(w||!v?[go(s)]:Cm(s)),T=m!=="none";!h&&T&&D.push(...Mm(s,v,m,k));const $=[s,...D],_=await yo(r,g),C=[];let O=((t=a.flip)==null?void 0:t.overflows)||[];if(c&&C.push(_[x]),f){const L=_m(o,i,k);C.push(_[L[0]],_[L[1]])}if(O=[...O,{placement:o,overflows:C}],!C.every(L=>L<=0)){var R,b;const L=(((R=a.flip)==null?void 0:R.index)||0)+1,P=$[L];if(P)return{data:{index:L,overflows:O},reset:{placement:P}};let N=(b=O.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:b.placement;if(!N)switch(p){case"bestFit":{var S;const z=(S=O.filter(I=>{if(T){const te=hn(I.placement);return te===E||te==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(te=>te>0).reduce((te,M)=>te+M,0)]).sort((I,te)=>I[1]-te[1])[0])==null?void 0:S[0];z&&(N=z);break}case"initialPlacement":N=s;break}if(o!==N)return{reset:{placement:N}}}return{}}}};async function Lm(n,r){const{placement:e,platform:t,elements:o}=n,a=await(t.isRTL==null?void 0:t.isRTL(o.floating)),i=Zt(e),s=An(e),l=hn(e)==="y",u=["left","top"].includes(i)?-1:1,c=a&&l?-1:1,f=pn(r,n);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const Fm=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var e,t;const{x:o,y:a,placement:i,middlewareData:s}=r,l=await Lm(r,n);return i===((e=s.offset)==null?void 0:e.placement)&&(t=s.arrow)!=null&&t.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},$m=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:e,y:t,placement:o}=r,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:g=>{let{x,y:E}=g;return{x,y:E}}},...l}=pn(n,r),u={x:e,y:t},c=await yo(r,l),f=hn(Zt(o)),h=ku(f);let p=u[h],m=u[f];if(a){const g=h==="y"?"top":"left",x=h==="y"?"bottom":"right",E=p+c[g],w=p-c[x];p=vi(E,p,w)}if(i){const g=f==="y"?"top":"left",x=f==="y"?"bottom":"right",E=m+c[g],w=m-c[x];m=vi(E,m,w)}const v=s.fn({...r,[h]:p,[f]:m});return{...v,data:{x:v.x-e,y:v.y-t,enabled:{[h]:a,[f]:i}}}}}},Am=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){var e,t;const{placement:o,rects:a,platform:i,elements:s}=r,{apply:l=()=>{},...u}=pn(n,r),c=await yo(r,u),f=Zt(o),h=An(o),p=hn(o)==="y",{width:m,height:v}=a.floating;let g,x;f==="top"||f==="bottom"?(g=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(x=f,g=h==="end"?"top":"bottom");const E=v-c.top-c.bottom,w=m-c.left-c.right,k=At(v-c[g],E),D=At(m-c[x],w),T=!r.middlewareData.shift;let $=k,_=D;if((e=r.middlewareData.shift)!=null&&e.enabled.x&&(_=w),(t=r.middlewareData.shift)!=null&&t.enabled.y&&($=E),T&&!h){const O=Ue(c.left,0),R=Ue(c.right,0),b=Ue(c.top,0),S=Ue(c.bottom,0);p?_=m-2*(O!==0||R!==0?O+R:Ue(c.left,c.right)):$=v-2*(b!==0||S!==0?b+S:Ue(c.top,c.bottom))}await l({...r,availableWidth:_,availableHeight:$});const C=await i.getDimensions(s.floating);return m!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}};function Ou(n){const r=at(n);let e=parseFloat(r.width)||0,t=parseFloat(r.height)||0;const o=vt(n),a=o?n.offsetWidth:e,i=o?n.offsetHeight:t,s=Dr(e)!==a||Dr(t)!==i;return s&&(e=a,t=i),{width:e,height:t,$:s}}function wi(n){return Fe(n)?n:n.contextElement}function Yn(n){const r=wi(n);if(!vt(r))return gt(1);const e=r.getBoundingClientRect(),{width:t,height:o,$:a}=Ou(r);let i=(a?Dr(e.width):e.width)/t,s=(a?Dr(e.height):e.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const Ym=gt(0);function Mu(n){const r=Ze(n);return!hi()||!r.visualViewport?Ym:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function Rm(n,r,e){return r===void 0&&(r=!1),!e||r&&e!==Ze(n)?!1:r}function mn(n,r,e,t){r===void 0&&(r=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),a=wi(n);let i=gt(1);r&&(t?Fe(t)&&(i=Yn(t)):i=Yn(n));const s=Rm(a,e,t)?Mu(a):gt(0);let l=(o.left+s.x)/i.x,u=(o.top+s.y)/i.y,c=o.width/i.x,f=o.height/i.y;if(a){const h=Ze(a),p=t&&Fe(t)?Ze(t):t;let m=h,v=mi(m);for(;v&&t&&p!==m;){const g=Yn(v),x=v.getBoundingClientRect(),E=at(v),w=x.left+(v.clientLeft+parseFloat(E.paddingLeft))*g.x,k=x.top+(v.clientTop+parseFloat(E.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=w,u+=k,m=Ze(v),v=mi(m)}}return bo({width:c,height:f,x:l,y:u})}function xi(n,r){const e=mo(n).scrollLeft;return r?r.left+e:mn(mt(n)).left+e}function Tu(n,r,e){e===void 0&&(e=!1);const t=n.getBoundingClientRect(),o=t.left+r.scrollLeft-(e?0:xi(n,t)),a=t.top+r.scrollTop;return{x:o,y:a}}function jm(n){let{elements:r,rect:e,offsetParent:t,strategy:o}=n;const a=o==="fixed",i=mt(t),s=r?ho(r.floating):!1;if(t===i||s&&a)return e;let l={scrollLeft:0,scrollTop:0},u=gt(1);const c=gt(0),f=vt(t);if((f||!f&&!a)&&((Fn(t)!=="body"||xr(i))&&(l=mo(t)),vt(t))){const p=mn(t);u=Yn(t),c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}const h=i&&!f&&!a?Tu(i,l,!0):gt(0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:e.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Wm(n){return Array.from(n.getClientRects())}function Hm(n){const r=mt(n),e=mo(n),t=n.ownerDocument.body,o=Ue(r.scrollWidth,r.clientWidth,t.scrollWidth,t.clientWidth),a=Ue(r.scrollHeight,r.clientHeight,t.scrollHeight,t.clientHeight);let i=-e.scrollLeft+xi(n);const s=-e.scrollTop;return at(t).direction==="rtl"&&(i+=Ue(r.clientWidth,t.clientWidth)-o),{width:o,height:a,x:i,y:s}}function Bm(n,r){const e=Ze(n),t=mt(n),o=e.visualViewport;let a=t.clientWidth,i=t.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const u=hi();(!u||u&&r==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}function Vm(n,r){const e=mn(n,!0,r==="fixed"),t=e.top+n.clientTop,o=e.left+n.clientLeft,a=vt(n)?Yn(n):gt(1),i=n.clientWidth*a.x,s=n.clientHeight*a.y,l=o*a.x,u=t*a.y;return{width:i,height:s,x:l,y:u}}function Pu(n,r,e){let t;if(r==="viewport")t=Bm(n,e);else if(r==="document")t=Hm(mt(n));else if(Fe(r))t=Vm(r,e);else{const o=Mu(n);t={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return bo(t)}function Iu(n,r){const e=Jt(n);return e===r||!Fe(e)||$n(e)?!1:at(e).position==="fixed"||Iu(e,r)}function zm(n,r){const e=r.get(n);if(e)return e;let t=Er(n,[],!1).filter(s=>Fe(s)&&Fn(s)!=="body"),o=null;const a=at(n).position==="fixed";let i=a?Jt(n):n;for(;Fe(i)&&!$n(i);){const s=at(i),l=pi(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xr(i)&&!l&&Iu(n,i))?t=t.filter(c=>c!==i):o=s,i=Jt(i)}return r.set(n,t),t}function qm(n){let{element:r,boundary:e,rootBoundary:t,strategy:o}=n;const i=[...e==="clippingAncestors"?ho(r)?[]:zm(r,this._c):[].concat(e),t],s=i[0],l=i.reduce((u,c)=>{const f=Pu(r,c,o);return u.top=Ue(f.top,u.top),u.right=At(f.right,u.right),u.bottom=At(f.bottom,u.bottom),u.left=Ue(f.left,u.left),u},Pu(r,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Um(n){const{width:r,height:e}=Ou(n);return{width:r,height:e}}function Qm(n,r,e){const t=vt(r),o=mt(r),a=e==="fixed",i=mn(n,!0,a,r);let s={scrollLeft:0,scrollTop:0};const l=gt(0);if(t||!t&&!a)if((Fn(r)!=="body"||xr(o))&&(s=mo(r)),t){const h=mn(r,!0,a,r);l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}else o&&(l.x=xi(o));const u=o&&!t&&!a?Tu(o,s):gt(0),c=i.left+s.scrollLeft-l.x-u.x,f=i.top+s.scrollTop-l.y-u.y;return{x:c,y:f,width:i.width,height:i.height}}function Ei(n){return at(n).position==="static"}function Nu(n,r){if(!vt(n)||at(n).position==="fixed")return null;if(r)return r(n);let e=n.offsetParent;return mt(n)===e&&(e=e.ownerDocument.body),e}function Lu(n,r){const e=Ze(n);if(ho(n))return e;if(!vt(n)){let o=Jt(n);for(;o&&!$n(o);){if(Fe(o)&&!Ei(o))return o;o=Jt(o)}return e}let t=Nu(n,r);for(;t&&xm(t)&&Ei(t);)t=Nu(t,r);return t&&$n(t)&&Ei(t)&&!pi(t)?e:t||Em(n)||e}const Gm=async function(n){const r=this.getOffsetParent||Lu,e=this.getDimensions,t=await e(n.floating);return{reference:Qm(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function Km(n){return at(n).direction==="rtl"}const Xm={convertOffsetParentRelativeRectToViewportRelativeRect:jm,getDocumentElement:mt,getClippingRect:qm,getOffsetParent:Lu,getElementRects:Gm,getClientRects:Wm,getDimensions:Um,getScale:Yn,isElement:Fe,isRTL:Km};function Fu(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function Jm(n,r){let e=null,t;const o=mt(n);function a(){var s;clearTimeout(t),(s=e)==null||s.disconnect(),e=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=n.getBoundingClientRect(),{left:c,top:f,width:h,height:p}=u;if(s||r(),!h||!p)return;const m=vo(f),v=vo(o.clientWidth-(c+h)),g=vo(o.clientHeight-(f+p)),x=vo(c),w={rootMargin:-m+"px "+-v+"px "+-g+"px "+-x+"px",threshold:Ue(0,At(1,l))||1};let k=!0;function D(T){const $=T[0].intersectionRatio;if($!==l){if(!k)return i();$?i(!1,$):t=setTimeout(()=>{i(!1,1e-7)},1e3)}$===1&&!Fu(u,n.getBoundingClientRect())&&i(),k=!1}try{e=new IntersectionObserver(D,{...w,root:o.ownerDocument})}catch{e=new IntersectionObserver(D,w)}e.observe(n)}return i(!0),a}function $u(n,r,e,t){t===void 0&&(t={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=t,u=wi(n),c=o||a?[...u?Er(u):[],...Er(r)]:[];c.forEach(x=>{o&&x.addEventListener("scroll",e,{passive:!0}),a&&x.addEventListener("resize",e)});const f=u&&s?Jm(u,e):null;let h=-1,p=null;i&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===u&&p&&(p.unobserve(r),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(r)})),e()}),u&&!l&&p.observe(u),p.observe(r));let m,v=l?mn(n):null;l&&g();function g(){const x=mn(n);v&&!Fu(v,x)&&e(),v=x,m=requestAnimationFrame(g)}return e(),()=>{var x;c.forEach(E=>{o&&E.removeEventListener("scroll",e),a&&E.removeEventListener("resize",e)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Di=yo,Zm=Fm,ev=$m,tv=Nm,nv=Am,Au=Im,rv=(n,r,e)=>{const t=new Map,o={platform:Xm,...e},a={...o.platform,_c:t};return Pm(n,r,{...o,platform:a})};var wo=typeof document<"u"?d.useLayoutEffect:d.useEffect;function xo(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let e,t,o;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(e=n.length,e!==r.length)return!1;for(t=e;t--!==0;)if(!xo(n[t],r[t]))return!1;return!0}if(o=Object.keys(n),e=o.length,e!==Object.keys(r).length)return!1;for(t=e;t--!==0;)if(!{}.hasOwnProperty.call(r,o[t]))return!1;for(t=e;t--!==0;){const a=o[t];if(!(a==="_owner"&&n.$$typeof)&&!xo(n[a],r[a]))return!1}return!0}return n!==n&&r!==r}function Yu(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ru(n,r){const e=Yu(n);return Math.round(r*e)/e}function Si(n){const r=V.useRef(n);return wo(()=>{r.current=n}),r}function ju(n){n===void 0&&(n={});const{placement:r="bottom",strategy:e="absolute",middleware:t=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=n,[c,f]=V.useState({x:0,y:0,strategy:e,placement:r,middlewareData:{},isPositioned:!1}),[h,p]=V.useState(t);xo(h,t)||p(t);const[m,v]=V.useState(null),[g,x]=V.useState(null),E=V.useCallback(I=>{I!==T.current&&(T.current=I,v(I))},[]),w=V.useCallback(I=>{I!==$.current&&($.current=I,x(I))},[]),k=a||m,D=i||g,T=V.useRef(null),$=V.useRef(null),_=V.useRef(c),C=l!=null,O=Si(l),R=Si(o),b=Si(u),S=V.useCallback(()=>{if(!T.current||!$.current)return;const I={placement:r,strategy:e,middleware:h};R.current&&(I.platform=R.current),rv(T.current,$.current,I).then(te=>{const M={...te,isPositioned:b.current!==!1};L.current&&!xo(_.current,M)&&(_.current=M,Hr.flushSync(()=>{f(M)}))})},[h,r,e,R,b]);wo(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(I=>({...I,isPositioned:!1})))},[u]);const L=V.useRef(!1);wo(()=>(L.current=!0,()=>{L.current=!1}),[]),wo(()=>{if(k&&(T.current=k),D&&($.current=D),k&&D){if(O.current)return O.current(k,D,S);S()}},[k,D,S,O,C]);const P=V.useMemo(()=>({reference:T,floating:$,setReference:E,setFloating:w}),[E,w]),N=V.useMemo(()=>({reference:k,floating:D}),[k,D]),z=V.useMemo(()=>{const I={position:e,left:0,top:0};if(!N.floating)return I;const te=Ru(N.floating,c.x),M=Ru(N.floating,c.y);return s?{...I,transform:"translate("+te+"px, "+M+"px)",...Yu(N.floating)>=1.5&&{willChange:"transform"}}:{position:e,left:te,top:M}},[e,s,N.floating,c.x,c.y]);return V.useMemo(()=>({...c,update:S,refs:P,elements:N,floatingStyles:z}),[c,S,P,N,z])}const ov=n=>{function r(e){return{}.hasOwnProperty.call(e,"current")}return{name:"arrow",options:n,fn(e){const{element:t,padding:o}=typeof n=="function"?n(e):n;return t&&r(t)?t.current!=null?Au({element:t.current,padding:o}).fn(e):{}:t?Au({element:t,padding:o}).fn(e):{}}}},ki=(n,r)=>({...Zm(n),options:[n,r]}),av=(n,r)=>({...ev(n),options:[n,r]}),Wu=(n,r)=>({...tv(n),options:[n,r]}),iv=(n,r)=>({...nv(n),options:[n,r]}),sv=(n,r)=>({...ov(n),options:[n,r]}),Hu={...V},lv=Hu.useInsertionEffect||(n=>n());function Bu(n){const r=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return lv(()=>{r.current=n}),V.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}var _i=typeof document<"u"?d.useLayoutEffect:d.useEffect;let Vu=!1,uv=0;const zu=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+uv++;function cv(){const[n,r]=V.useState(()=>Vu?zu():void 0);return _i(()=>{n==null&&r(zu())},[]),V.useEffect(()=>{Vu=!0},[]),n}const dv=Hu.useId||cv;let Sr;process.env.NODE_ENV!=="production"&&(Sr=new Set);function fv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Sr)!=null&&n.has(o))){var a;(a=Sr)==null||a.add(o),console.warn(o)}}function pv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Sr)!=null&&n.has(o))){var a;(a=Sr)==null||a.add(o),console.error(o)}}function hv(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.set(r,[...n.get(r)||[],e])},off(r,e){var t;n.set(r,((t=n.get(r))==null?void 0:t.filter(o=>o!==e))||[])}}}const mv=V.createContext(null),vv=V.createContext(null),gv=()=>{var n;return((n=V.useContext(mv))==null?void 0:n.id)||null},bv=()=>V.useContext(vv),yv="data-floating-ui-focusable";function wv(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=dv(),a=V.useRef({}),[i]=V.useState(()=>hv()),s=gv()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!Fe(p)&&pv("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=V.useState(t.reference),c=Bu((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=V.useMemo(()=>({setPositionReference:u}),[]),h=V.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return V.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function xv(n){n===void 0&&(n={});const{nodeId:r}=n,e=wv({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=V.useState(null),[s,l]=V.useState(null),c=(o==null?void 0:o.domReference)||a,f=V.useRef(null),h=bv();_i(()=>{c&&(f.current=c)},[c]);const p=ju({...n,elements:{...o,...s&&{reference:s}}}),m=V.useCallback(w=>{const k=Fe(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;l(k),p.refs.setReference(k)},[p.refs]),v=V.useCallback(w=>{(Fe(w)||w===null)&&(f.current=w,i(w)),(Fe(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!Fe(w))&&p.refs.setReference(w)},[p.refs]),g=V.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),x=V.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=V.useMemo(()=>({...p,...t,refs:g,elements:x,nodeId:r}),[p,g,x,r,t]);return _i(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(k=>k.id===r);w&&(w.context=E)}),V.useMemo(()=>({...p,context:E,refs:g,elements:x}),[p,g,x,E])}const qu="active",Uu="selected";function Ci(n,r,e){const t=new Map,o=e==="item";let a=n;if(o&&n){const{[qu]:i,[Uu]:s,...l}=n;a=l}return{...e==="floating"&&{tabIndex:-1,[yv]:""},...a,...r.map(i=>{const s=i?i[e]:null;return typeof s=="function"?n?s(n):null:s}).concat(n).reduce((i,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(o&&[qu,Uu].includes(u)))if(u.indexOf("on")===0){if(t.has(u)||t.set(u,[]),typeof c=="function"){var f;(f=t.get(u))==null||f.push(c),i[u]=function(){for(var h,p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return(h=t.get(u))==null?void 0:h.map(g=>g(...m)).find(g=>g!==void 0)}}}else i[u]=c}),i),{})}}function Ev(n){n===void 0&&(n=[]);const r=n.map(s=>s==null?void 0:s.reference),e=n.map(s=>s==null?void 0:s.floating),t=n.map(s=>s==null?void 0:s.item),o=V.useCallback(s=>Ci(s,n,"reference"),r),a=V.useCallback(s=>Ci(s,n,"floating"),e),i=V.useCallback(s=>Ci(s,n,"item"),t);return V.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}function Qu(n,r){return{...n,rects:{...n.rects,floating:{...n.rects.floating,height:r}}}}const Dv=n=>({name:"inner",options:n,async fn(r){const{listRef:e,overflowRef:t,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:s=4,referenceOverflowThreshold:l=0,scrollRef:u,...c}=pn(n,r),{rects:f,elements:{floating:h}}=r,p=e.current[i],m=(u==null?void 0:u.current)||h,v=h.clientTop||m.clientTop,g=h.clientTop!==0,x=m.clientTop!==0,E=h===m;if(process.env.NODE_ENV!=="production"&&(r.placement.startsWith("bottom")||fv('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...r,...await ki(-p.offsetTop-h.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(r)},k=await Di(Qu(w,m.scrollHeight+v+h.clientTop),c),D=await Di(w,{...c,elementContext:"reference"}),T=Ue(0,k.top),$=w.y+T,O=(m.scrollHeight>m.clientHeight?R=>R:Dr)(Ue(0,m.scrollHeight+(g&&E||x?v*2:0)-T-Ue(0,k.bottom)));if(m.style.maxHeight=O+"px",m.scrollTop=T,o){const R=m.offsetHeight<p.offsetHeight*At(s,e.current.length)-1||D.top>=-l||D.bottom>=-l;Hr.flushSync(()=>o(R))}return t&&(t.current=await Di(Qu({...w,y:$},m.offsetHeight+v+h.clientTop),c)),{y:$}}});function Sv(n,r){const{open:e,elements:t}=n,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:s}=r,l=Bu(s),u=V.useRef(!1),c=V.useRef(null),f=V.useRef(null);V.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!m||a.current==null)return;const g=v.deltaY,x=a.current.top>=-.5,E=a.current.bottom>=-.5,w=m.scrollHeight-m.clientHeight,k=g<0?-1:1,D=g<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&g>0||!E&&g<0?(v.preventDefault(),Hr.flushSync(()=>{l(T=>T+Math[D](g,w*k))})):/firefox/i.test(Dm())&&(m.scrollTop+=g))}const m=(i==null?void 0:i.current)||t.floating;if(e&&m)return m.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=m.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{c.current=null,f.current=null,m.removeEventListener("wheel",p)}},[o,e,t.floating,a,i,l]);const h=V.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(i==null?void 0:i.current)||t.floating;if(!(!a.current||!p||!u.current)){if(c.current!==null){const m=p.scrollTop-c.current;(a.current.bottom<-.5&&m<-1||a.current.top<-.5&&m>1)&&Hr.flushSync(()=>l(v=>v+m))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[t.floating,l,a,i]);return V.useMemo(()=>o?{floating:h}:{},[o,h])}let Rn=d.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Rn.displayName="FloatingContext";let Oi=d.createContext(null);Oi.displayName="PlacementContext";function Gu(n){return d.useMemo(()=>n?typeof n=="string"?{to:n}:n:null,[n])}function Ku(){return d.useContext(Rn).setReference}function kv(){return d.useContext(Rn).getReferenceProps}function Xu(){let{getFloatingProps:n,slot:r}=d.useContext(Rn);return d.useCallback((...e)=>Object.assign({},n(...e),{"data-anchor":r.anchor}),[n,r])}function Ju(n=null){n===!1&&(n=null),typeof n=="string"&&(n={to:n});let r=d.useContext(Oi),e=d.useMemo(()=>n,[JSON.stringify(n,(o,a)=>{var i;return(i=a==null?void 0:a.outerHTML)!=null?i:a})]);fe(()=>{r==null||r(e??null)},[r,e]);let t=d.useContext(Rn);return d.useMemo(()=>[t.setFloating,n?t.styles:{}],[t.setFloating,n,t.styles])}let Zu=4;function ec({children:n,enabled:r=!0}){let[e,t]=d.useState(null),[o,a]=d.useState(0),i=d.useRef(null),[s,l]=d.useState(null);_v(s);let u=r&&e!==null&&s!==null,{to:c="bottom",gap:f=0,offset:h=0,padding:p=0,inner:m}=Cv(e,s),[v,g="center"]=c.split(" ");fe(()=>{u&&a(0)},[u]);let{refs:x,floatingStyles:E,context:w}=xv({open:u,placement:v==="selection"?g==="center"?"bottom":`bottom-${g}`:g==="center"?`${v}`:`${v}-${g}`,strategy:"absolute",transform:!1,middleware:[ki({mainAxis:v==="selection"?0:f,crossAxis:h}),av({padding:p}),v!=="selection"&&Wu({padding:p}),v==="selection"&&m?Dv({...m,padding:p,overflowRef:i,offset:o,minItemsVisible:Zu,referenceOverflowThreshold:p,onFallbackChange(R){var b,S;if(!R)return;let L=w.elements.floating;if(!L)return;let P=parseFloat(getComputedStyle(L).scrollPaddingBottom)||0,N=Math.min(Zu,L.childElementCount),z=0,I=0;for(let te of(S=(b=w.elements.floating)==null?void 0:b.childNodes)!=null?S:[])if(Ke(te)){let M=te.offsetTop,j=M+te.clientHeight+P,Q=L.scrollTop,W=Q+L.clientHeight;if(M>=Q&&j<=W)N--;else{I=Math.max(0,Math.min(j,W)-Math.max(M,Q)),z=te.clientHeight;break}}N>=1&&a(te=>{let M=z*N-I+P;return te>=M?te:M})}}):null,iv({padding:p,apply({availableWidth:R,availableHeight:b,elements:S}){Object.assign(S.floating.style,{overflow:"auto",maxWidth:`${R}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${b}px)`})}})].filter(Boolean),whileElementsMounted:$u}),[k=v,D=g]=w.placement.split("-");v==="selection"&&(k="selection");let T=d.useMemo(()=>({anchor:[k,D].filter(Boolean).join(" ")}),[k,D]),$=Sv(w,{overflowRef:i,onChange:a}),{getReferenceProps:_,getFloatingProps:C}=Ev([$]),O=ee(R=>{l(R),x.setFloating(R)});return V.createElement(Oi.Provider,{value:t},V.createElement(Rn.Provider,{value:{setFloating:O,setReference:x.setReference,styles:E,getReferenceProps:_,getFloatingProps:C,slot:T}},n))}function _v(n){fe(()=>{if(!n)return;let r=new MutationObserver(()=>{let e=window.getComputedStyle(n).maxHeight,t=parseFloat(e);if(isNaN(t))return;let o=parseInt(e);isNaN(o)||t!==o&&(n.style.maxHeight=`${Math.ceil(t)}px`)});return r.observe(n,{attributes:!0,attributeFilter:["style"]}),()=>{r.disconnect()}},[n])}function Cv(n,r){var e,t,o;let a=Mi((e=n==null?void 0:n.gap)!=null?e:"var(--anchor-gap, 0)",r),i=Mi((t=n==null?void 0:n.offset)!=null?t:"var(--anchor-offset, 0)",r),s=Mi((o=n==null?void 0:n.padding)!=null?o:"var(--anchor-padding, 0)",r);return{...n,gap:a,offset:i,padding:s}}function Mi(n,r,e=void 0){let t=Qt(),o=ee((l,u)=>{if(l==null)return[e,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!u)return[e,null];let c=nc(l,u);return[c,f=>{let h=tc(l);{let p=h.map(m=>window.getComputedStyle(u).getPropertyValue(m));t.requestAnimationFrame(function m(){t.nextFrame(m);let v=!1;for(let[x,E]of h.entries()){let w=window.getComputedStyle(u).getPropertyValue(E);if(p[x]!==w){p[x]=w,v=!0;break}}if(!v)return;let g=nc(l,u);c!==g&&(f(g),c=g)})}return t.dispose}]}return[e,null]}),a=d.useMemo(()=>o(n,r)[0],[n,r]),[i=a,s]=d.useState();return fe(()=>{let[l,u]=o(n,r);if(s(l),!!u)return u(s)},[n,r]),i}function tc(n){let r=/var\((.*)\)/.exec(n);if(r){let e=r[1].indexOf(",");if(e===-1)return[r[1]];let t=r[1].slice(0,e).trim(),o=r[1].slice(e+1).trim();return o?[t,...tc(o)]:[t]}return[]}function nc(n,r){let e=document.createElement("div");r.appendChild(e),e.style.setProperty("margin-top","0px","important"),e.style.setProperty("margin-top",n,"important");let t=parseFloat(window.getComputedStyle(e).marginTop)||0;return r.removeChild(e),t}function Ov({children:n,freeze:r}){let e=Eo(r,n);return d.createElement(d.Fragment,null,e)}function Eo(n,r){let[e,t]=d.useState(r);return!n&&e!==r&&t(r),n?e:r}let Do=d.createContext(null);Do.displayName="OpenClosedContext";var He=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(He||{});function jn(){return d.useContext(Do)}function Ti({value:n,children:r}){return d.createElement(Do.Provider,{value:n},r)}function Mv({children:n}){return d.createElement(Do.Provider,{value:null},n)}function Tv(n){function r(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}let bt=[];Tv(()=>{function n(r){if(!Nt(r.target)||r.target===document.body||bt[0]===r.target)return;let e=r.target;e=e.closest(fo),bt.unshift(e??r.target),bt=bt.filter(t=>t!=null&&t.isConnected),bt.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function Pv(n){throw new Error("Unexpected object: "+n)}var se=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(se||{});function Wn(n,r){let e=r.resolveItems();if(e.length<=0)return null;let t=r.resolveActiveIndex(),o=t??-1;switch(n.focus){case 0:{for(let a=0;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 1:{o===-1&&(o=e.length);for(let a=o-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 2:{for(let a=o+1;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 3:{for(let a=e.length-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 4:{for(let a=0;a<e.length;++a)if(r.resolveId(e[a],a,e)===n.id)return a;return t}case 5:return null;default:Pv(n)}}var Pi=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(Pi||{});function So(n){let r=ee(n),e=d.useRef(!1);d.useEffect(()=>(e.current=!1,()=>{e.current=!0,ro(()=>{e.current&&r()})}),[r])}function Iv(){let n=typeof document>"u";return"useSyncExternalStore"in V?(r=>r.useSyncExternalStore)(V)(()=>()=>{},()=>!1,()=>!n):!1}function kr(){let n=Iv(),[r,e]=V.useState(cn.isHandoffComplete);return r&&cn.isHandoffComplete===!1&&e(!1),V.useEffect(()=>{r!==!0&&e(!0)},[r]),V.useEffect(()=>cn.handoff(),[]),n?!1:r}let rc=d.createContext(!1);function Nv(){return d.useContext(rc)}function oc(n){return d.createElement(rc.Provider,{value:n.force},n.children)}function Lv(n){let r=Nv(),e=d.useContext(ic),[t,o]=d.useState(()=>{var a;if(!r&&e!==null)return(a=e.current)!=null?a:null;if(cn.isServer)return null;let i=n==null?void 0:n.getElementById("headlessui-portal-root");if(i)return i;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return d.useEffect(()=>{t!==null&&(n!=null&&n.body.contains(t)||n==null||n.body.appendChild(t))},[t,n]),d.useEffect(()=>{r||e!==null&&o(e.current)},[e,o,r]),t}let ac=d.Fragment,Fv=Ce(function(n,r){let{ownerDocument:e=null,...t}=n,o=d.useRef(null),a=Re(vh(p=>{o.current=p}),r),i=Ft(o),s=e??i,l=Lv(s),[u]=d.useState(()=>{var p;return cn.isServer?null:(p=s==null?void 0:s.createElement("div"))!=null?p:null}),c=d.useContext(Ii),f=kr();fe(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),fe(()=>{if(u&&c)return c.register(u)},[c,u]),So(()=>{var p;!l||!u||(qa(u)&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((p=l.parentElement)==null||p.removeChild(l)))});let h=Me();return f?!l||!u?null:Ne.createPortal(h({ourProps:{ref:a},theirProps:t,slot:{},defaultTag:ac,name:"Portal"}),u):null});function $v(n,r){let e=Re(r),{enabled:t=!0,ownerDocument:o,...a}=n,i=Me();return t?d.createElement(Fv,{...a,ownerDocument:o,ref:e}):i({ourProps:{ref:e},theirProps:a,slot:{},defaultTag:ac,name:"Portal"})}let Av=d.Fragment,ic=d.createContext(null);function Yv(n,r){let{target:e,...t}=n,o={ref:Re(r)},a=Me();return d.createElement(ic.Provider,{value:e},a({ourProps:o,theirProps:t,defaultTag:Av,name:"Popover.Group"}))}let Ii=d.createContext(null);function Rv(){let n=d.useContext(Ii),r=d.useRef([]),e=ee(a=>(r.current.push(a),n&&n.register(a),()=>t(a))),t=ee(a=>{let i=r.current.indexOf(a);i!==-1&&r.current.splice(i,1),n&&n.unregister(a)}),o=d.useMemo(()=>({register:e,unregister:t,portals:r}),[e,t,r]);return[r,d.useMemo(()=>function({children:a}){return d.createElement(Ii.Provider,{value:o},a)},[o])]}let jv=Ce($v),sc=Ce(Yv),Ni=Object.assign(jv,{Group:sc});var Wv=Object.defineProperty,Hv=(n,r,e)=>r in n?Wv(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,lc=(n,r,e)=>(Hv(n,typeof r!="symbol"?r+"":r,e),e),de=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(de||{}),et=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(et||{}),en=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(en||{}),uc=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.SetTyping=3]="SetTyping",n[n.RegisterOption=4]="RegisterOption",n[n.UnregisterOption=5]="UnregisterOption",n[n.DefaultToFirstOption=6]="DefaultToFirstOption",n[n.SetActivationTrigger=7]="SetActivationTrigger",n[n.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",n[n.SetInputElement=9]="SetInputElement",n[n.SetButtonElement=10]="SetButtonElement",n[n.SetOptionsElement=11]="SetOptionsElement",n))(uc||{});function Li(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=r(n.options.slice()),o=t.length>0&&t[0].dataRef.current.order!==null?t.sort((i,s)=>i.dataRef.current.order-s.dataRef.current.order):ii(t,i=>i.dataRef.current.domRef.current),a=e?o.indexOf(e):null;return a===-1&&(a=null),{options:o,activeOptionIndex:a}}let Bv={1(n){var r;return(r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(n){var r,e;if((r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===0)return n;if((e=n.dataRef.current)!=null&&e.value){let t=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(t!==-1)return{...n,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...n,comboboxState:0,__demoMode:!1}},3(n,r){return n.isTyping===r.isTyping?n:{...n,isTyping:r.isTyping}},2(n,r){var e,t,o,a;if((e=n.dataRef.current)!=null&&e.disabled||n.optionsElement&&!((t=n.dataRef.current)!=null&&t.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let{options:u,disabled:c}=n.virtual,f=r.focus===se.Specific?r.idx:Wn(r,{resolveItems:()=>u,resolveActiveIndex:()=>{var p,m;return(m=(p=n.activeOptionIndex)!=null?p:u.findIndex(v=>!c(v)))!=null?m:null},resolveDisabled:c,resolveId(){throw new Error("Function not implemented.")}}),h=(o=r.trigger)!=null?o:2;return n.activeOptionIndex===f&&n.activationTrigger===h?n:{...n,activeOptionIndex:f,activationTrigger:h,isTyping:!1,__demoMode:!1}}let i=Li(n);if(i.activeOptionIndex===null){let u=i.options.findIndex(c=>!c.dataRef.current.disabled);u!==-1&&(i.activeOptionIndex=u)}let s=r.focus===se.Specific?r.idx:Wn(r,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),l=(a=r.trigger)!=null?a:2;return n.activeOptionIndex===s&&n.activationTrigger===l?n:{...n,...i,isTyping:!1,activeOptionIndex:s,activationTrigger:l,__demoMode:!1}},4:(n,r)=>{var e,t,o,a;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:[...n.options,r.payload]};let i=r.payload,s=Li(n,u=>(u.push(i),u));n.activeOptionIndex===null&&(o=(t=n.dataRef.current).isSelected)!=null&&o.call(t,r.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let l={...n,...s,activationTrigger:2};return(a=n.dataRef.current)!=null&&a.__demoMode&&n.dataRef.current.value===void 0&&(l.activeOptionIndex=0),l},5:(n,r)=>{var e;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:n.options.filter(o=>o.id!==r.id)};let t=Li(n,o=>{let a=o.findIndex(i=>i.id===r.id);return a!==-1&&o.splice(a,1),o});return{...n,...t,activationTrigger:2}},6:(n,r)=>n.defaultToFirstOption===r.value?n:{...n,defaultToFirstOption:r.value},7:(n,r)=>n.activationTrigger===r.trigger?n:{...n,activationTrigger:r.trigger},8:(n,r)=>{var e,t;if(n.virtual===null)return{...n,virtual:{options:r.options,disabled:(e=r.disabled)!=null?e:()=>!1}};if(n.virtual.options===r.options&&n.virtual.disabled===r.disabled)return n;let o=n.activeOptionIndex;if(n.activeOptionIndex!==null){let a=r.options.indexOf(n.virtual.options[n.activeOptionIndex]);a!==-1?o=a:o=null}return{...n,activeOptionIndex:o,virtual:{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}}},9:(n,r)=>n.inputElement===r.element?n:{...n,inputElement:r.element},10:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},11:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element}},Vv=class df extends Ga{constructor(r){super(r),lc(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Le(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:(e,t)=>(this.send({type:4,payload:{id:e,dataRef:t}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(t.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:e})}),goToOption:(e,t)=>(this.send({type:6,value:!1}),this.send({type:2,...e,trigger:t})),setIsTyping:e=>{this.send({type:3,isTyping:e})},closeCombobox:()=>{var e,t;this.send({type:1}),this.send({type:6,value:!1}),(t=(e=this.state.dataRef.current).onClose)==null||t.call(e)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:e=>{this.send({type:7,trigger:e})},selectActiveOption:()=>{let e=this.selectors.activeOptionIndex(this.state);if(e!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[e]);else{let{dataRef:t}=this.state.options[e];this.actions.onChange(t.current.value)}this.actions.goToOption({focus:se.Specific,idx:e})}},setInputElement:e=>{this.send({type:9,element:e})},setButtonElement:e=>{this.send({type:10,element:e})},setOptionsElement:e=>{this.send({type:11,element:e})}}),lc(this,"selectors",{activeDescendantId:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);if(a!==null)return e.virtual?(o=e.options.find(i=>!i.dataRef.current.disabled&&e.dataRef.current.compare(i.dataRef.current.value,e.virtual.options[a])))==null?void 0:o.id:(t=e.options[a])==null?void 0:t.id},activeOptionIndex:e=>{if(e.defaultToFirstOption&&e.activeOptionIndex===null&&(e.virtual?e.virtual.options.length>0:e.options.length>0)){if(e.virtual){let{options:o,disabled:a}=e.virtual,i=o.findIndex(s=>{var l;return!((l=a==null?void 0:a(s))!=null&&l)});if(i!==-1)return i}let t=e.options.findIndex(o=>!o.dataRef.current.disabled);if(t!==-1)return t}return e.activeOptionIndex},activeOption:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);return a===null?null:e.virtual?e.virtual.options[a??0]:(o=(t=e.options[a])==null?void 0:t.dataRef.current.value)!=null?o:null},isActive:(e,t,o)=>{var a;let i=this.selectors.activeOptionIndex(e);return i===null?!1:e.virtual?i===e.dataRef.current.calculateIndex(t):((a=e.options[i])==null?void 0:a.id)===o},shouldScrollIntoView:(e,t,o)=>!(e.virtual||e.__demoMode||e.comboboxState!==0||e.activationTrigger===0||!this.selectors.isActive(e,t,o))});{let e=this.state.id,t=In.get(null);this.disposables.add(t.on(Ja.Push,o=>{!t.selectors.isTop(o,e)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,virtual:e=null,__demoMode:t=!1}){var o;return new df({id:r,dataRef:{current:{}},comboboxState:t?0:1,isTyping:!1,options:[],virtual:e?{options:e.options,disabled:(o=e.disabled)!=null?o:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:t})}reduce(r,e){return Le(e.type,Bv,r,e)}};const cc=d.createContext(null);function _r(n){let r=d.useContext(cc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,dc),e}return r}function dc({id:n,virtual:r=null,__demoMode:e=!1}){let t=d.useMemo(()=>Vv.new({id:n,virtual:r,__demoMode:e}),[]);return So(()=>t.dispose()),t}let Cr=d.createContext(null);Cr.displayName="ComboboxDataContext";function Hn(n){let r=d.useContext(Cr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Hn),e}return r}let fc=d.createContext(null);function zv(n){let r=_r("VirtualProvider"),e=Hn("VirtualProvider"),{options:t}=e.virtual,o=we(r,p=>p.optionsElement),[a,i]=d.useMemo(()=>{let p=o;if(!p)return[0,0];let m=window.getComputedStyle(p);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[o]),s=Ah({enabled:t.length!==0,scrollPaddingStart:a,scrollPaddingEnd:i,count:t.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[l,u]=d.useState(0);fe(()=>{u(p=>p+1)},[t]);let c=s.getVirtualItems(),f=we(r,p=>p.activationTrigger===en.Pointer),h=we(r,r.selectors.activeOptionIndex);return c.length===0?null:d.createElement(fc.Provider,{value:s},d.createElement("div",{style:{position:"relative",width:"100%",height:`${s.getTotalSize()}px`},ref:p=>{p&&(f||h!==null&&t.length>h&&s.scrollToIndex(h))}},c.map(p=>{var m;return d.createElement(d.Fragment,{key:p.key},d.cloneElement((m=n.children)==null?void 0:m.call(n,{...n.slot,option:t[p.index]}),{key:`${l}-${p.key}`,"data-index":p.index,"aria-setsize":t.length,"aria-posinset":p.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${p.start}px)`,overflowAnchor:"none"}}))})))}let qv=d.Fragment;function Uv(n,r){let e=d.useId(),t=oo(),{value:o,defaultValue:a,onChange:i,form:s,name:l,by:u,invalid:c=!1,disabled:f=t||!1,onClose:h,__demoMode:p=!1,multiple:m=!1,immediate:v=!1,virtual:g=null,nullable:x,...E}=n,w=Il(a),[k=m?[]:void 0,D]=Pl(o,i,w),T=dc({id:e,virtual:g,__demoMode:p}),$=d.useRef({static:!1,hold:!1}),_=Jl(u),C=ee(H=>g?u===null?g.options.indexOf(H):g.options.findIndex(G=>_(G,H)):T.state.options.findIndex(G=>_(G.dataRef.current.value,H))),O=d.useCallback(H=>Le(S.mode,{[et.Multi]:()=>k.some(G=>_(G,H)),[et.Single]:()=>_(k,H)}),[k]),R=we(T,H=>H.virtual),b=ee(()=>h==null?void 0:h()),S=d.useMemo(()=>({__demoMode:p,immediate:v,optionsPropsRef:$,value:k,defaultValue:w,disabled:f,invalid:c,mode:m?et.Multi:et.Single,virtual:g?R:null,onChange:D,isSelected:O,calculateIndex:C,compare:_,onClose:b}),[k,w,f,c,m,D,O,p,T,g,R,b]);fe(()=>{var H;g&&T.send({type:uc.UpdateVirtualConfiguration,options:g.options,disabled:(H=g.disabled)!=null?H:null})},[g,g==null?void 0:g.options,g==null?void 0:g.disabled]),fe(()=>{T.state.dataRef.current=S},[S]);let[L,P,N,z]=we(T,H=>[H.comboboxState,H.buttonElement,H.inputElement,H.optionsElement]),I=In.get(null),te=we(I,d.useCallback(H=>I.selectors.isTop(H,e),[I,e]));li(te,[P,N,z],()=>T.actions.closeCombobox());let M=we(T,T.selectors.activeOptionIndex),j=we(T,T.selectors.activeOption),Q=d.useMemo(()=>({open:L===de.Open,disabled:f,invalid:c,activeIndex:M,activeOption:j,value:k}),[S,f,k,c,j,L]),[W,F]=zl(),ne=r===null?{}:{ref:r},q=d.useCallback(()=>{if(w!==void 0)return D==null?void 0:D(w)},[D,w]),A=Me();return d.createElement(F,{value:W,props:{htmlFor:N==null?void 0:N.id},slot:{open:L===de.Open,disabled:f}},d.createElement(ec,null,d.createElement(Cr.Provider,{value:S},d.createElement(cc.Provider,{value:T},d.createElement(Ti,{value:Le(L,{[de.Open]:He.Open,[de.Closed]:He.Closed})},l!=null&&d.createElement($l,{disabled:f,data:k!=null?{[l]:k}:{},form:s,onReset:q}),A({ourProps:ne,theirProps:E,slot:Q,defaultTag:qv,name:"Combobox"}))))))}let Qv="input";function Gv(n,r){var e,t;let o=_r("Combobox.Input"),a=Hn("Combobox.Input"),i=d.useId(),s=za(),{id:l=s||`headlessui-combobox-input-${i}`,onChange:u,displayValue:c,disabled:f=a.disabled||!1,autoFocus:h=!1,type:p="text",...m}=n,[v]=we(o,F=>[F.inputElement]),g=d.useRef(null),x=Re(g,r,Ku(),o.actions.setInputElement),E=Ft(v),[w,k]=we(o,F=>[F.comboboxState,F.isTyping]),D=Qt(),T=ee(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:se.Nothing})}),$=d.useMemo(()=>{var F;return typeof c=="function"&&a.value!==void 0?(F=c(a.value))!=null?F:"":typeof a.value=="string"?a.value:""},[a.value,c]);wr(([F,ne],[q,A])=>{if(o.state.isTyping)return;let H=g.current;H&&((A===de.Open&&ne===de.Closed||F!==q)&&(H.value=F),requestAnimationFrame(()=>{if(o.state.isTyping||!H||(E==null?void 0:E.activeElement)!==H)return;let{selectionStart:G,selectionEnd:X}=H;Math.abs((X??0)-(G??0))===0&&G===0&&H.setSelectionRange(H.value.length,H.value.length)}))},[$,w,E,k]),wr(([F],[ne])=>{if(F===de.Open&&ne===de.Closed){if(o.state.isTyping)return;let q=g.current;if(!q)return;let A=q.value,{selectionStart:H,selectionEnd:G,selectionDirection:X}=q;q.value="",q.value=A,X!==null?q.setSelectionRange(H,G,X):q.setSelectionRange(H,G)}},[w]);let _=d.useRef(!1),C=ee(()=>{_.current=!0}),O=ee(()=>{D.nextFrame(()=>{_.current=!1})}),R=ee(F=>{switch(o.actions.setIsTyping(!0),F.key){case he.Enter:if(o.state.comboboxState!==de.Open||_.current)return;if(F.preventDefault(),F.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),a.mode===et.Single&&o.actions.closeCombobox();break;case he.ArrowDown:return F.preventDefault(),F.stopPropagation(),Le(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Next}),[de.Closed]:()=>o.actions.openCombobox()});case he.ArrowUp:return F.preventDefault(),F.stopPropagation(),Le(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Previous}),[de.Closed]:()=>{Ne.flushSync(()=>o.actions.openCombobox()),a.value||o.actions.goToOption({focus:se.Last})}});case he.Home:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.PageUp:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.End:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.PageDown:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.Escape:return o.state.comboboxState!==de.Open?void 0:(F.preventDefault(),o.state.optionsElement&&!a.optionsPropsRef.current.static&&F.stopPropagation(),a.mode===et.Single&&a.value===null&&T(),o.actions.closeCombobox());case he.Tab:if(o.state.comboboxState!==de.Open)return;a.mode===et.Single&&o.state.activationTrigger!==en.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),b=ee(F=>{u==null||u(F),a.mode===et.Single&&F.target.value===""&&T(),o.actions.openCombobox()}),S=ee(F=>{var ne,q,A;let H=(ne=F.relatedTarget)!=null?ne:bt.find(G=>G!==F.currentTarget);if(!((q=o.state.optionsElement)!=null&&q.contains(H))&&!((A=o.state.buttonElement)!=null&&A.contains(H))&&o.state.comboboxState===de.Open)return F.preventDefault(),a.mode===et.Single&&a.value===null&&T(),o.actions.closeCombobox()}),L=ee(F=>{var ne,q,A;let H=(ne=F.relatedTarget)!=null?ne:bt.find(G=>G!==F.currentTarget);(q=o.state.buttonElement)!=null&&q.contains(H)||(A=o.state.optionsElement)!=null&&A.contains(H)||a.disabled||a.immediate&&o.state.comboboxState!==de.Open&&D.microTask(()=>{Ne.flushSync(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(en.Focus)})}),P=mr(),N=Hl(),{isFocused:z,focusProps:I}=Wa({autoFocus:h}),{isHovered:te,hoverProps:M}=ja({isDisabled:f}),j=we(o,F=>F.optionsElement),Q=d.useMemo(()=>({open:w===de.Open,disabled:f,invalid:a.invalid,hover:te,focus:z,autofocus:h}),[a,te,z,h,f,a.invalid]),W=pr({ref:x,id:l,role:"combobox",type:p,"aria-controls":j==null?void 0:j.id,"aria-expanded":w===de.Open,"aria-activedescendant":we(o,o.selectors.activeDescendantId),"aria-labelledby":P,"aria-describedby":N,"aria-autocomplete":"list",defaultValue:(t=(e=n.defaultValue)!=null?e:a.defaultValue!==void 0?c==null?void 0:c(a.defaultValue):null)!=null?t:a.defaultValue,disabled:f||void 0,autoFocus:h,onCompositionStart:C,onCompositionEnd:O,onKeyDown:R,onChange:b,onFocus:L,onBlur:S},I,M);return Me()({ourProps:W,theirProps:m,slot:Q,defaultTag:Qv,name:"Combobox.Input"})}let Kv="button";function Xv(n,r){let e=_r("Combobox.Button"),t=Hn("Combobox.Button"),[o,a]=d.useState(null),i=Re(r,a,e.actions.setButtonElement),s=d.useId(),{id:l=`headlessui-combobox-button-${s}`,disabled:u=t.disabled||!1,autoFocus:c=!1,...f}=n,[h,p,m]=we(e,b=>[b.comboboxState,b.inputElement,b.optionsElement]),v=vu(p),g=h===de.Open;mu(g,{trigger:o,action:d.useCallback(b=>{if(o!=null&&o.contains(b.target)||p!=null&&p.contains(b.target))return $t.Ignore;let S=b.target.closest('[role="option"]:not([data-disabled])');return Ke(S)?$t.Select(S):m!=null&&m.contains(b.target)?$t.Ignore:$t.Close},[o,p,m]),close:e.actions.closeCombobox,select:e.actions.selectActiveOption});let x=ee(b=>{switch(b.key){case he.Space:case he.Enter:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&Ne.flushSync(()=>e.actions.openCombobox()),v();return;case he.ArrowDown:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Ne.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.First})),v();return;case he.ArrowUp:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Ne.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.Last})),v();return;case he.Escape:if(e.state.comboboxState!==de.Open)return;b.preventDefault(),e.state.optionsElement&&!t.optionsPropsRef.current.static&&b.stopPropagation(),Ne.flushSync(()=>e.actions.closeCombobox()),v();return;default:return}}),E=ee(b=>{b.preventDefault(),!Rl(b.currentTarget)&&(b.button===Pi.Left&&(e.state.comboboxState===de.Open?e.actions.closeCombobox():e.actions.openCombobox()),v())}),w=mr([l]),{isFocusVisible:k,focusProps:D}=Wa({autoFocus:c}),{isHovered:T,hoverProps:$}=ja({isDisabled:u}),{pressed:_,pressProps:C}=Ml({disabled:u}),O=d.useMemo(()=>({open:h===de.Open,active:_||h===de.Open,disabled:u,invalid:t.invalid,value:t.value,hover:T,focus:k}),[t,T,k,_,u,h]),R=pr({ref:i,id:l,type:gu(n,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":h===de.Open,"aria-labelledby":w,disabled:u||void 0,autoFocus:c,onPointerDown:E,onKeyDown:x},D,$,C);return Me()({ourProps:R,theirProps:f,slot:O,defaultTag:Kv,name:"Combobox.Button"})}let Jv="div",Zv=Gt.RenderStrategy|Gt.Static;function eg(n,r){var e,t,o;let a=d.useId(),{id:i=`headlessui-combobox-options-${a}`,hold:s=!1,anchor:l,portal:u=!1,modal:c=!0,transition:f=!1,...h}=n,p=_r("Combobox.Options"),m=Hn("Combobox.Options"),v=Gu(l);v&&(u=!0);let[g,x]=Ju(v),[E,w]=d.useState(null),k=Xu(),D=Re(r,v?g:null,p.actions.setOptionsElement,w),[T,$,_,C,O]=we(p,X=>[X.comboboxState,X.inputElement,X.buttonElement,X.optionsElement,X.activationTrigger]),R=Ft($||_),b=Ft(C),S=jn(),[L,P]=fi(f,E,S!==null?(S&He.Open)===He.Open:T===de.Open);ri(L,$,p.actions.closeCombobox);let N=m.__demoMode?!1:c&&T===de.Open;ci(N,b);let z=m.__demoMode?!1:c&&T===de.Open;ni(z,{allowed:d.useCallback(()=>[$,_,C],[$,_,C])}),fe(()=>{var X;m.optionsPropsRef.current.static=(X=n.static)!=null?X:!1},[m.optionsPropsRef,n.static]),fe(()=>{m.optionsPropsRef.current.hold=s},[m.optionsPropsRef,s]),wm(T===de.Open,{container:C,accept(X){return X.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:X.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(X){X.setAttribute("role","none")}});let I=mr([_==null?void 0:_.id]),te=d.useMemo(()=>({open:T===de.Open,option:void 0}),[T]),M=ee(()=>{p.actions.setActivationTrigger(en.Pointer)}),j=ee(X=>{X.preventDefault(),p.actions.setActivationTrigger(en.Pointer)}),Q=pr(v?k():{},{"aria-labelledby":I,role:"listbox","aria-multiselectable":m.mode===et.Multi?!0:void 0,id:i,ref:D,style:{...h.style,...x,"--input-width":Ua($,!0).width,"--button-width":Ua(_,!0).width},onWheel:O===en.Pointer?void 0:M,onMouseDown:j,...di(P)}),W=L&&T===de.Closed,F=Eo(W,(e=m.virtual)==null?void 0:e.options),ne=Eo(W,m.value),q=ee(X=>m.compare(ne,X)),A=d.useMemo(()=>{if(!m.virtual)return m;if(F===void 0)throw new Error("Missing `options` in virtual mode");return F!==m.virtual.options?{...m,virtual:{...m.virtual,options:F}}:m},[m,F,(t=m.virtual)==null?void 0:t.options]);m.virtual&&Object.assign(h,{children:d.createElement(Cr.Provider,{value:A},d.createElement(zv,{slot:te},h.children))});let H=Me(),G=d.useMemo(()=>m.mode===et.Multi?m:{...m,isSelected:q},[m,q]);return d.createElement(Ni,{enabled:u?n.static||L:!1,ownerDocument:R},d.createElement(Cr.Provider,{value:G},H({ourProps:Q,theirProps:{...h,children:d.createElement(Ov,{freeze:W},typeof h.children=="function"?(o=h.children)==null?void 0:o.call(h,te):h.children)},slot:te,defaultTag:Jv,features:Zv,visible:L,name:"Combobox.Options"})))}let tg="div";function ng(n,r){var e,t,o;let a=Hn("Combobox.Option"),i=_r("Combobox.Option"),s=d.useId(),{id:l=`headlessui-combobox-option-${s}`,value:u,disabled:c=(o=(t=(e=a.virtual)==null?void 0:e.disabled)==null?void 0:t.call(e,u))!=null?o:!1,order:f=null,...h}=n,[p]=we(i,P=>[P.inputElement]),m=vu(p),v=we(i,d.useCallback(P=>i.selectors.isActive(P,u,l),[u,l])),g=a.isSelected(u),x=d.useRef(null),E=Pt({disabled:c,value:u,domRef:x,order:f}),w=d.useContext(fc),k=Re(r,x,w?w.measureElement:null),D=ee(()=>{i.actions.setIsTyping(!1),i.actions.onChange(u)});fe(()=>i.actions.registerOption(l,E),[E,l]);let T=we(i,d.useCallback(P=>i.selectors.shouldScrollIntoView(P,u,l),[u,l]));fe(()=>{if(T)return rt().requestAnimationFrame(()=>{var P,N;(N=(P=x.current)==null?void 0:P.scrollIntoView)==null||N.call(P,{block:"nearest"})})},[T,x]);let $=ee(P=>{P.preventDefault(),P.button===Pi.Left&&(c||(D(),si()||requestAnimationFrame(()=>m()),a.mode===et.Single&&i.actions.closeCombobox()))}),_=ee(()=>{if(c)return i.actions.goToOption({focus:se.Nothing});let P=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:P})}),C=yu(),O=ee(P=>C.update(P)),R=ee(P=>{if(!C.wasMoved(P)||c||v)return;let N=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:N},en.Pointer)}),b=ee(P=>{C.wasMoved(P)&&(c||v&&(a.optionsPropsRef.current.hold||i.actions.goToOption({focus:se.Nothing})))}),S=d.useMemo(()=>({active:v,focus:v,selected:g,disabled:c}),[v,g,c]),L={id:l,ref:k,role:"option",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,"aria-selected":g,disabled:void 0,onMouseDown:$,onFocus:_,onPointerEnter:O,onMouseEnter:O,onPointerMove:R,onMouseMove:R,onPointerLeave:b,onMouseLeave:b};return Me()({ourProps:L,theirProps:h,slot:S,defaultTag:tg,name:"Combobox.Option"})}let rg=Ce(Uv),og=Ce(Xv),pc=Ce(Gv),ag=uo,hc=Ce(eg),mc=Ce(ng),ig=Object.assign(rg,{Input:pc,Button:og,Label:ag,Options:hc,Option:mc});function sg(n,r=typeof document<"u"?document.defaultView:null,e){let t=br(n,"escape");ui(r,"keydown",o=>{t&&(o.defaultPrevented||o.key===he.Escape&&e(o))})}function lg(){var n;let[r]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[e,t]=d.useState((n=r==null?void 0:r.matches)!=null?n:!1);return fe(()=>{if(!r)return;function o(a){t(a.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),e}function ug({defaultContainers:n=[],portals:r,mainTreeNode:e}={}){let t=Ft(e),o=ee(()=>{var a,i;let s=[];for(let l of n)l!==null&&(It(l)?s.push(l):"current"in l&&It(l.current)&&s.push(l.current));if(r!=null&&r.current)for(let l of r.current)s.push(l);for(let l of(a=t==null?void 0:t.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&It(l)&&l.id!=="headlessui-portal-root"&&(e&&(l.contains(e)||l.contains((i=e==null?void 0:e.getRootNode())==null?void 0:i.host))||s.some(u=>l.contains(u))||s.push(l));return s});return{resolveContainers:o,contains:ee(a=>o().some(i=>i.contains(a)))}}let vc=d.createContext(null);function gc({children:n,node:r}){let[e,t]=d.useState(null),o=bc(r??e);return d.createElement(vc.Provider,{value:o},n,o===null&&d.createElement(hr,{features:Tn.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=dn(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&It(l)&&l!=null&&l.contains(a)){t(l);break}}}}))}function bc(n=null){var r;return(r=d.useContext(vc))!=null?r:n}function Fi(){let n=d.useRef(!1);return fe(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var Or=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(Or||{});function cg(){let n=d.useRef(0);return pu(!0,"keydown",r=>{r.key==="Tab"&&(n.current=r.shiftKey?1:0)},!0),n}function yc(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let r=new Set;for(let e of n.current)It(e.current)&&r.add(e.current);return r}let dg="div";var vn=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(vn||{});function fg(n,r){let e=d.useRef(null),t=Re(e,r),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=n;kr()||(s=0);let u=Ft(e);vg(s,{ownerDocument:u});let c=gg(s,{ownerDocument:u,container:e,initialFocus:o,initialFocusFallback:a});bg(s,{ownerDocument:u,container:e,containers:i,previousActiveElement:c});let f=cg(),h=ee(E=>{if(!Ke(e.current))return;let w=e.current;(k=>k())(()=>{Le(f.current,{[Or.Forwards]:()=>{Nn(w,dt.First,{skipElements:[E.relatedTarget,a]})},[Or.Backwards]:()=>{Nn(w,dt.Last,{skipElements:[E.relatedTarget,a]})}})})}),p=br(!!(s&2),"focus-trap#tab-lock"),m=Qt(),v=d.useRef(!1),g={ref:t,onKeyDown(E){E.key=="Tab"&&(v.current=!0,m.requestAnimationFrame(()=>{v.current=!1}))},onBlur(E){if(!(s&4))return;let w=yc(i);Ke(e.current)&&w.add(e.current);let k=E.relatedTarget;Nt(k)&&k.dataset.headlessuiFocusGuard!=="true"&&(wc(w,k)||(v.current?Nn(e.current,Le(f.current,{[Or.Forwards]:()=>dt.Next,[Or.Backwards]:()=>dt.Previous})|dt.WrapAround,{relativeTo:E.target}):Nt(E.target)&&Lt(E.target)))}},x=Me();return d.createElement(d.Fragment,null,p&&d.createElement(hr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Tn.Focusable}),x({ourProps:g,theirProps:l,defaultTag:dg,name:"FocusTrap"}),p&&d.createElement(hr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Tn.Focusable}))}let pg=Ce(fg),hg=Object.assign(pg,{features:vn});function mg(n=!0){let r=d.useRef(bt.slice());return wr(([e],[t])=>{t===!0&&e===!1&&ro(()=>{r.current.splice(0)}),t===!1&&e===!0&&(r.current=bt.slice())},[n,bt,r]),ee(()=>{var e;return(e=r.current.find(t=>t!=null&&t.isConnected))!=null?e:null})}function vg(n,{ownerDocument:r}){let e=!!(n&8),t=mg(e);wr(()=>{e||(r==null?void 0:r.activeElement)===(r==null?void 0:r.body)&&Lt(t())},[e]),So(()=>{e&&Lt(t())})}function gg(n,{ownerDocument:r,container:e,initialFocus:t,initialFocusFallback:o}){let a=d.useRef(null),i=br(!!(n&1),"focus-trap#initial-focus"),s=Fi();return wr(()=>{if(n===0)return;if(!i){o!=null&&o.current&&Lt(o.current);return}let l=e.current;l&&ro(()=>{if(!s.current)return;let u=r==null?void 0:r.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===u){a.current=u;return}}else if(l.contains(u)){a.current=u;return}if(t!=null&&t.current)Lt(t.current);else{if(n&16){if(Nn(l,dt.First|dt.AutoFocus)!==oi.Error)return}else if(Nn(l,dt.First)!==oi.Error)return;if(o!=null&&o.current&&(Lt(o.current),(r==null?void 0:r.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=r==null?void 0:r.activeElement})},[o,i,n]),a}function bg(n,{ownerDocument:r,container:e,containers:t,previousActiveElement:o}){let a=Fi(),i=!!(n&4);ui(r==null?void 0:r.defaultView,"focus",s=>{if(!i||!a.current)return;let l=yc(t);Ke(e.current)&&l.add(e.current);let u=o.current;if(!u)return;let c=s.target;Ke(c)?wc(l,c)?(o.current=c,Lt(c)):(s.preventDefault(),s.stopPropagation(),Lt(u)):Lt(o.current)},!0)}function wc(n,r){for(let e of n)if(e.contains(r))return!0;return!1}function xc(n){var r;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||((r=n.as)!=null?r:Dc)!==d.Fragment||d.Children.count(n.children)===1}let ko=d.createContext(null);ko.displayName="TransitionContext";var yg=(n=>(n.Visible="visible",n.Hidden="hidden",n))(yg||{});function wg(){let n=d.useContext(ko);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function xg(){let n=d.useContext(_o);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let _o=d.createContext(null);_o.displayName="NestingContext";function Co(n){return"children"in n?Co(n.children):n.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function Ec(n,r){let e=Pt(n),t=d.useRef([]),o=Fi(),a=Qt(),i=ee((p,m=Kt.Hidden)=>{let v=t.current.findIndex(({el:g})=>g===p);v!==-1&&(Le(m,{[Kt.Unmount](){t.current.splice(v,1)},[Kt.Hidden](){t.current[v].state="hidden"}}),a.microTask(()=>{var g;!Co(t)&&o.current&&((g=e.current)==null||g.call(e))}))}),s=ee(p=>{let m=t.current.find(({el:v})=>v===p);return m?m.state!=="visible"&&(m.state="visible"):t.current.push({el:p,state:"visible"}),()=>i(p,Kt.Unmount)}),l=d.useRef([]),u=d.useRef(Promise.resolve()),c=d.useRef({enter:[],leave:[]}),f=ee((p,m,v)=>{l.current.splice(0),r&&(r.chains.current[m]=r.chains.current[m].filter(([g])=>g!==p)),r==null||r.chains.current[m].push([p,new Promise(g=>{l.current.push(g)})]),r==null||r.chains.current[m].push([p,new Promise(g=>{Promise.all(c.current[m].map(([x,E])=>E)).then(()=>g())})]),m==="enter"?u.current=u.current.then(()=>r==null?void 0:r.wait.current).then(()=>v(m)):v(m)}),h=ee((p,m,v)=>{Promise.all(c.current[m].splice(0).map(([g,x])=>x)).then(()=>{var g;(g=l.current.shift())==null||g()}).then(()=>v(m))});return d.useMemo(()=>({children:t,register:s,unregister:i,onStart:f,onStop:h,wait:u,chains:c}),[s,i,t,f,h,c,u])}let Dc=d.Fragment,Sc=Gt.RenderStrategy;function Eg(n,r){var e,t;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:u,enterFrom:c,enterTo:f,entered:h,leave:p,leaveFrom:m,leaveTo:v,...g}=n,[x,E]=d.useState(null),w=d.useRef(null),k=xc(n),D=Re(...k?[w,r,E]:r===null?[]:[r]),T=(e=g.unmount)==null||e?Kt.Unmount:Kt.Hidden,{show:$,appear:_,initial:C}=wg(),[O,R]=d.useState($?"visible":"hidden"),b=xg(),{register:S,unregister:L}=b;fe(()=>S(w),[S,w]),fe(()=>{if(T===Kt.Hidden&&w.current){if($&&O!=="visible"){R("visible");return}return Le(O,{hidden:()=>L(w),visible:()=>S(w)})}},[O,w,S,L,$,T]);let P=kr();fe(()=>{if(k&&P&&O==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,O,P,k]);let N=C&&!_,z=_&&$&&C,I=d.useRef(!1),te=Ec(()=>{I.current||(R("hidden"),L(w))},b),M=ee(A=>{I.current=!0;let H=A?"enter":"leave";te.onStart(w,H,G=>{G==="enter"?a==null||a():G==="leave"&&(s==null||s())})}),j=ee(A=>{let H=A?"enter":"leave";I.current=!1,te.onStop(w,H,G=>{G==="enter"?i==null||i():G==="leave"&&(l==null||l())}),H==="leave"&&!Co(te)&&(R("hidden"),L(w))});d.useEffect(()=>{k&&o||(M($),j($))},[$,k,o]);let Q=!(!o||!k||!P||N),[,W]=fi(Q,x,$,{start:M,end:j}),F=Xt({ref:D,className:((t=Ba(g.className,z&&u,z&&c,W.enter&&u,W.enter&&W.closed&&c,W.enter&&!W.closed&&f,W.leave&&p,W.leave&&!W.closed&&m,W.leave&&W.closed&&v,!W.transition&&$&&h))==null?void 0:t.trim())||void 0,...di(W)}),ne=0;O==="visible"&&(ne|=He.Open),O==="hidden"&&(ne|=He.Closed),$&&O==="hidden"&&(ne|=He.Opening),!$&&O==="visible"&&(ne|=He.Closing);let q=Me();return d.createElement(_o.Provider,{value:te},d.createElement(Ti,{value:ne},q({ourProps:F,theirProps:g,defaultTag:Dc,features:Sc,visible:O==="visible",name:"Transition.Child"})))}function Dg(n,r){let{show:e,appear:t=!1,unmount:o=!0,...a}=n,i=d.useRef(null),s=xc(n),l=Re(...s?[i,r]:r===null?[]:[r]);kr();let u=jn();if(e===void 0&&u!==null&&(e=(u&He.Open)===He.Open),e===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=d.useState(e?"visible":"hidden"),h=Ec(()=>{e||f("hidden")}),[p,m]=d.useState(!0),v=d.useRef([e]);fe(()=>{p!==!1&&v.current[v.current.length-1]!==e&&(v.current.push(e),m(!1))},[v,e]);let g=d.useMemo(()=>({show:e,appear:t,initial:p}),[e,t,p]);fe(()=>{e?f("visible"):!Co(h)&&i.current!==null&&f("hidden")},[e,h]);let x={unmount:o},E=ee(()=>{var D;p&&m(!1),(D=n.beforeEnter)==null||D.call(n)}),w=ee(()=>{var D;p&&m(!1),(D=n.beforeLeave)==null||D.call(n)}),k=Me();return d.createElement(_o.Provider,{value:h},d.createElement(ko.Provider,{value:g},k({ourProps:{...x,as:d.Fragment,children:d.createElement(kc,{ref:l,...x,...a,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:d.Fragment,features:Sc,visible:c==="visible",name:"Transition"})))}function Sg(n,r){let e=d.useContext(ko)!==null,t=jn()!==null;return d.createElement(d.Fragment,null,!e&&t?d.createElement($i,{ref:r,...n}):d.createElement(kc,{ref:r,...n}))}let $i=Ce(Dg),kc=Ce(Eg),Ai=Ce(Sg),_c=Object.assign($i,{Child:Ai,Root:$i});var kg=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(kg||{}),_g=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(_g||{});let Cg={0(n,r){return n.titleId===r.id?n:{...n,titleId:r.id}}},Yi=d.createContext(null);Yi.displayName="DialogContext";function Oo(n){let r=d.useContext(Yi);if(r===null){let e=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Oo),e}return r}function Og(n,r){return Le(r.type,Cg,n,r)}let Cc=Ce(function(n,r){let e=d.useId(),{id:t=`headlessui-dialog-${e}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:c=!1,...f}=n,h=d.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(h.current||(h.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=jn();o===void 0&&p!==null&&(o=(p&He.Open)===He.Open);let m=d.useRef(null),v=Re(m,r),g=Ft(m),x=o?0:1,[E,w]=d.useReducer(Og,{titleId:null,descriptionId:null,panelRef:d.createRef()}),k=ee(()=>a(!1)),D=ee(W=>w({type:0,id:W})),T=kr()?x===0:!1,[$,_]=Rv(),C={get current(){var W;return(W=E.panelRef.current)!=null?W:m.current}},O=bc(),{resolveContainers:R}=ug({mainTreeNode:O,portals:$,defaultContainers:[C]}),b=p!==null?(p&He.Closing)===He.Closing:!1;ni(u||b?!1:T,{allowed:ee(()=>{var W,F;return[(F=(W=m.current)==null?void 0:W.closest("[data-headlessui-portal]"))!=null?F:null]}),disallowed:ee(()=>{var W;return[(W=O==null?void 0:O.closest("body > *:not(#headlessui-portal-root)"))!=null?W:null]})});let S=In.get(null);fe(()=>{if(T)return S.actions.push(t),()=>S.actions.pop(t)},[S,t,T]);let L=we(S,d.useCallback(W=>S.selectors.isTop(W,t),[S,t]));li(L,R,W=>{W.preventDefault(),k()}),sg(L,g==null?void 0:g.defaultView,W=>{W.preventDefault(),W.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),k()}),ci(u||b?!1:T,g,R),ri(T,m,k);let[P,N]=gh(),z=d.useMemo(()=>[{dialogState:x,close:k,setTitleId:D,unmount:c},E],[x,E,k,D,c]),I=d.useMemo(()=>({open:x===0}),[x]),te={ref:v,id:t,role:s,tabIndex:-1,"aria-modal":u?void 0:x===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":P,unmount:c},M=!lg(),j=vn.None;T&&!u&&(j|=vn.RestoreFocus,j|=vn.TabLock,l&&(j|=vn.AutoFocus),M&&(j|=vn.InitialFocus));let Q=Me();return d.createElement(Mv,null,d.createElement(oc,{force:!0},d.createElement(Ni,null,d.createElement(Yi.Provider,{value:z},d.createElement(sc,{target:m},d.createElement(oc,{force:!1},d.createElement(N,{slot:I},d.createElement(_,null,d.createElement(hg,{initialFocus:i,initialFocusFallback:m,containers:R,features:j},d.createElement(kh,{value:k},Q({ourProps:te,theirProps:f,slot:I,defaultTag:Mg,features:Tg,visible:x===0,name:"Dialog"})))))))))))}),Mg="div",Tg=Gt.RenderStrategy|Gt.Static;function Pg(n,r){let{transition:e=!1,open:t,...o}=n,a=jn(),i=n.hasOwnProperty("open")||a!==null,s=n.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(t!==void 0||e)&&!o.static?d.createElement(gc,null,d.createElement(_c,{show:t,transition:e,unmount:o.unmount},d.createElement(Cc,{ref:r,...o}))):d.createElement(gc,null,d.createElement(Cc,{ref:r,open:t,...o}))}let Ig="div";function Ng(n,r){let e=d.useId(),{id:t=`headlessui-dialog-panel-${e}`,transition:o=!1,...a}=n,[{dialogState:i,unmount:s},l]=Oo("Dialog.Panel"),u=Re(r,l.panelRef),c=d.useMemo(()=>({open:i===0}),[i]),f=ee(g=>{g.stopPropagation()}),h={ref:u,id:t,onClick:f},p=o?Ai:d.Fragment,m=o?{unmount:s}:{},v=Me();return d.createElement(p,{...m},v({ourProps:h,theirProps:a,slot:c,defaultTag:Ig,name:"Dialog.Panel"}))}let Lg="div";function Fg(n,r){let{transition:e=!1,...t}=n,[{dialogState:o,unmount:a}]=Oo("Dialog.Backdrop"),i=d.useMemo(()=>({open:o===0}),[o]),s={ref:r,"aria-hidden":!0},l=e?Ai:d.Fragment,u=e?{unmount:a}:{},c=Me();return d.createElement(l,{...u},c({ourProps:s,theirProps:t,slot:i,defaultTag:Lg,name:"Dialog.Backdrop"}))}let $g="h2";function Ag(n,r){let e=d.useId(),{id:t=`headlessui-dialog-title-${e}`,...o}=n,[{dialogState:a,setTitleId:i}]=Oo("Dialog.Title"),s=Re(r);d.useEffect(()=>(i(t),()=>i(null)),[t,i]);let l=d.useMemo(()=>({open:a===0}),[a]),u={ref:s,id:t};return Me()({ourProps:u,theirProps:o,slot:l,defaultTag:$g,name:"Dialog.Title"})}let Yg=Ce(Pg),Oc=Ce(Ng);Ce(Fg);let Mc=Ce(Ag),Mr=Object.assign(Yg,{Panel:Oc,Title:Mc,Description:Bl});function Rg(n,r){let e=d.useRef({left:0,top:0});if(fe(()=>{if(!r)return;let o=r.getBoundingClientRect();o&&(e.current=o)},[n,r]),r==null||!n||r===document.activeElement)return!1;let t=r.getBoundingClientRect();return t.top!==e.current.top||t.left!==e.current.left}let Tc=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Pc(n){var r,e;let t=(r=n.innerText)!=null?r:"",o=n.cloneNode(!0);if(!Ke(o))return t;let a=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let i=a?(e=o.innerText)!=null?e:"":t;return Tc.test(i)&&(i=i.replace(Tc,"")),i}function jg(n){let r=n.getAttribute("aria-label");if(typeof r=="string")return r.trim();let e=n.getAttribute("aria-labelledby");if(e){let t=e.split(" ").map(o=>{let a=document.getElementById(o);if(a){let i=a.getAttribute("aria-label");return typeof i=="string"?i.trim():Pc(a).trim()}return null}).filter(Boolean);if(t.length>0)return t.join(", ")}return Pc(n).trim()}function Wg(n){let r=d.useRef(""),e=d.useRef("");return ee(()=>{let t=n.current;if(!t)return"";let o=t.innerText;if(r.current===o)return e.current;let a=jg(t).trim().toLowerCase();return r.current=o,e.current=a,a})}var Hg=Object.defineProperty,Bg=(n,r,e)=>r in n?Hg(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Ic=(n,r,e)=>(Bg(n,typeof r!="symbol"?r+"":r,e),e),Ve=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Ve||{}),yt=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(yt||{}),Ri=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(Ri||{}),Nc=(n=>(n[n.OpenListbox=0]="OpenListbox",n[n.CloseListbox=1]="CloseListbox",n[n.GoToOption=2]="GoToOption",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterOptions=5]="RegisterOptions",n[n.UnregisterOptions=6]="UnregisterOptions",n[n.SetButtonElement=7]="SetButtonElement",n[n.SetOptionsElement=8]="SetOptionsElement",n[n.SortOptions=9]="SortOptions",n))(Nc||{});function Lc(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=ii(r(n.options.slice()),a=>a.dataRef.current.domRef.current),o=e?t.indexOf(e):null;return o===-1&&(o=null),{options:t,activeOptionIndex:o}}let Vg={1(n){return n.dataRef.current.disabled||n.listboxState===1?n:{...n,activeOptionIndex:null,pendingFocus:{focus:se.Nothing},listboxState:1,__demoMode:!1}},0(n,r){if(n.dataRef.current.disabled||n.listboxState===0)return n;let e=n.activeOptionIndex,{isSelected:t}=n.dataRef.current,o=n.options.findIndex(a=>t(a.dataRef.current.value));return o!==-1&&(e=o),{...n,pendingFocus:r.focus,listboxState:0,activeOptionIndex:e,__demoMode:!1}},2(n,r){var e,t,o,a,i;if(n.dataRef.current.disabled||n.listboxState===1)return n;let s={...n,searchQuery:"",activationTrigger:(e=r.trigger)!=null?e:1,__demoMode:!1};if(r.focus===se.Nothing)return{...s,activeOptionIndex:null};if(r.focus===se.Specific)return{...s,activeOptionIndex:n.options.findIndex(c=>c.id===r.id)};if(r.focus===se.Previous){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Wn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((t=f.current)==null?void 0:t.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:h}}}}else if(r.focus===se.Next){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Wn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...s,activeOptionIndex:h}}}}let l=Lc(n),u=Wn(r,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...s,...l,activeOptionIndex:u}},3:(n,r)=>{if(n.dataRef.current.disabled||n.listboxState===1)return n;let e=n.searchQuery!==""?0:1,t=n.searchQuery+r.value.toLowerCase(),o=(n.activeOptionIndex!==null?n.options.slice(n.activeOptionIndex+e).concat(n.options.slice(0,n.activeOptionIndex+e)):n.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(t))}),a=o?n.options.indexOf(o):-1;return a===-1||a===n.activeOptionIndex?{...n,searchQuery:t}:{...n,searchQuery:t,activeOptionIndex:a,activationTrigger:1}},4(n){return n.dataRef.current.disabled||n.listboxState===1||n.searchQuery===""?n:{...n,searchQuery:""}},5:(n,r)=>{let e=n.options.concat(r.options),t=n.activeOptionIndex;if(n.pendingFocus.focus!==se.Nothing&&(t=Wn(n.pendingFocus,{resolveItems:()=>e,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),n.activeOptionIndex===null){let{isSelected:o}=n.dataRef.current;if(o){let a=e.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));a!==-1&&(t=a)}}return{...n,options:e,activeOptionIndex:t,pendingFocus:{focus:se.Nothing},pendingShouldSort:!0}},6:(n,r)=>{let e=n.options,t=[],o=new Set(r.options);for(let[a,i]of e.entries())if(o.has(i.id)&&(t.push(a),o.delete(i.id),o.size===0))break;if(t.length>0){e=e.slice();for(let a of t.reverse())e.splice(a,1)}return{...n,options:e,activationTrigger:1}},7:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},8:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element},9:n=>n.pendingShouldSort?{...n,...Lc(n),pendingShouldSort:!1}:n},zg=class ff extends Ga{constructor(r){super(r),Ic(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Le(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:Xa(()=>{let e=[],t=new Set;return[(o,a)=>{t.has(a)||(t.add(a),e.push({id:o,dataRef:a}))},()=>(t.clear(),this.send({type:5,options:e.splice(0)}))]}),unregisterOption:Xa(()=>{let e=[];return[t=>e.push(t),()=>{this.send({type:6,options:e.splice(0)})}]}),goToOption:Xa(()=>{let e=null;return[(t,o)=>{e={type:2,...t,trigger:o}},()=>e&&this.send(e)]}),closeListbox:()=>{this.send({type:1})},openListbox:e=>{this.send({type:0,focus:e})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:e,id:t}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(e.current.value),this.send({type:2,focus:se.Specific,id:t})}},selectOption:e=>{let t=this.state.options.find(o=>o.id===e);t&&this.actions.onChange(t.dataRef.current.value)},search:e=>{this.send({type:3,value:e})},clearSearch:()=>{this.send({type:4})},setButtonElement:e=>{this.send({type:7,element:e})},setOptionsElement:e=>{this.send({type:8,element:e})}}),Ic(this,"selectors",{activeDescendantId(e){var t;let o=e.activeOptionIndex,a=e.options;return o===null||(t=a[o])==null?void 0:t.id},isActive(e,t){var o;let a=e.activeOptionIndex,i=e.options;return a!==null?((o=i[a])==null?void 0:o.id)===t:!1},shouldScrollIntoView(e,t){return e.__demoMode||e.listboxState!==0||e.activationTrigger===0?!1:this.isActive(e,t)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let e=this.state.id,t=In.get(null);this.disposables.add(t.on(Ja.Push,o=>{!t.selectors.isTop(o,e)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,__demoMode:e=!1}){return new ff({id:r,dataRef:{current:{}},listboxState:e?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:se.Nothing},__demoMode:e})}reduce(r,e){return Le(e.type,Vg,r,e)}};const Fc=d.createContext(null);function ji(n){let r=d.useContext(Fc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,$c),e}return r}function $c({id:n,__demoMode:r=!1}){let e=d.useMemo(()=>zg.new({id:n,__demoMode:r}),[]);return So(()=>e.dispose()),e}let Mo=d.createContext(null);Mo.displayName="ListboxDataContext";function Tr(n){let r=d.useContext(Mo);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Tr),e}return r}let qg=d.Fragment;function Ug(n,r){let e=d.useId(),t=oo(),{value:o,defaultValue:a,form:i,name:s,onChange:l,by:u,invalid:c=!1,disabled:f=t||!1,horizontal:h=!1,multiple:p=!1,__demoMode:m=!1,...v}=n;const g=h?"horizontal":"vertical";let x=Re(r),E=Il(a),[w=p?[]:void 0,k]=Pl(o,l,E),D=$c({id:e,__demoMode:m}),T=d.useRef({static:!1,hold:!1}),$=d.useRef(new Map),_=Jl(u),C=d.useCallback(Q=>Le(O.mode,{[yt.Multi]:()=>w.some(W=>_(W,Q)),[yt.Single]:()=>_(w,Q)}),[w]),O=d.useMemo(()=>({value:w,disabled:f,invalid:c,mode:p?yt.Multi:yt.Single,orientation:g,onChange:k,compare:_,isSelected:C,optionsPropsRef:T,listRef:$}),[w,f,c,p,g,k,_,C,T,$]);fe(()=>{D.state.dataRef.current=O},[O]);let R=we(D,Q=>Q.listboxState),b=In.get(null),S=we(b,d.useCallback(Q=>b.selectors.isTop(Q,e),[b,e])),[L,P]=we(D,Q=>[Q.buttonElement,Q.optionsElement]);li(S,[L,P],(Q,W)=>{D.send({type:Nc.CloseListbox}),du(W,ai.Loose)||(Q.preventDefault(),L==null||L.focus())});let N=d.useMemo(()=>({open:R===Ve.Open,disabled:f,invalid:c,value:w}),[R,f,c,w]),[z,I]=zl({inherit:!0}),te={ref:x},M=d.useCallback(()=>{if(E!==void 0)return k==null?void 0:k(E)},[k,E]),j=Me();return d.createElement(I,{value:z,props:{htmlFor:L==null?void 0:L.id},slot:{open:R===Ve.Open,disabled:f}},d.createElement(ec,null,d.createElement(Fc.Provider,{value:D},d.createElement(Mo.Provider,{value:O},d.createElement(Ti,{value:Le(R,{[Ve.Open]:He.Open,[Ve.Closed]:He.Closed})},s!=null&&w!=null&&d.createElement($l,{disabled:f,data:{[s]:w},form:i,onReset:M}),j({ourProps:te,theirProps:v,slot:N,defaultTag:qg,name:"Listbox"}))))))}let Qg="button";function Gg(n,r){let e=d.useId(),t=za(),o=Tr("Listbox.Button"),a=ji("Listbox.Button"),{id:i=t||`headlessui-listbox-button-${e}`,disabled:s=o.disabled||!1,autoFocus:l=!1,...u}=n,c=Re(r,Ku(),a.actions.setButtonElement),f=kv(),[h,p,m]=we(a,P=>[P.listboxState,P.buttonElement,P.optionsElement]),v=h===Ve.Open;mu(v,{trigger:p,action:d.useCallback(P=>{if(p!=null&&p.contains(P.target))return $t.Ignore;let N=P.target.closest('[role="option"]:not([data-disabled])');return Ke(N)?$t.Select(N):m!=null&&m.contains(P.target)?$t.Ignore:$t.Close},[p,m]),close:a.actions.closeListbox,select:a.actions.selectActiveOption});let g=ee(P=>{switch(P.key){case he.Enter:oh(P.currentTarget);break;case he.Space:case he.ArrowDown:P.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.First});break;case he.ArrowUp:P.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.Last});break}}),x=ee(P=>{switch(P.key){case he.Space:P.preventDefault();break}}),E=ee(P=>{var N;if(P.button===0){if(Rl(P.currentTarget))return P.preventDefault();a.state.listboxState===Ve.Open?(Ne.flushSync(()=>a.actions.closeListbox()),(N=a.state.buttonElement)==null||N.focus({preventScroll:!0})):(P.preventDefault(),a.actions.openListbox({focus:se.Nothing}))}}),w=ee(P=>P.preventDefault()),k=mr([i]),D=Hl(),{isFocusVisible:T,focusProps:$}=Wa({autoFocus:l}),{isHovered:_,hoverProps:C}=ja({isDisabled:s}),{pressed:O,pressProps:R}=Ml({disabled:s}),b=d.useMemo(()=>({open:h===Ve.Open,active:O||h===Ve.Open,disabled:s,invalid:o.invalid,value:o.value,hover:_,focus:T,autofocus:l}),[h,o.value,s,_,T,O,o.invalid,l]),S=we(a,P=>P.listboxState===Ve.Open),L=pr(f(),{ref:c,id:i,type:gu(n,p),"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":S,"aria-labelledby":k,"aria-describedby":D,disabled:s||void 0,autoFocus:l,onKeyDown:g,onKeyUp:x,onKeyPress:w,onPointerDown:E},$,C,R);return Me()({ourProps:L,theirProps:u,slot:b,defaultTag:Qg,name:"Listbox.Button"})}let Ac=d.createContext(!1),Kg="div",Xg=Gt.RenderStrategy|Gt.Static;function Jg(n,r){let e=d.useId(),{id:t=`headlessui-listbox-options-${e}`,anchor:o,portal:a=!1,modal:i=!0,transition:s=!1,...l}=n,u=Gu(o),[c,f]=d.useState(null);u&&(a=!0);let h=Tr("Listbox.Options"),p=ji("Listbox.Options"),[m,v,g,x]=we(p,A=>[A.listboxState,A.buttonElement,A.optionsElement,A.__demoMode]),E=Ft(v),w=Ft(g),k=jn(),[D,T]=fi(s,c,k!==null?(k&He.Open)===He.Open:m===Ve.Open);ri(D,v,p.actions.closeListbox);let $=x?!1:i&&m===Ve.Open;ci($,w);let _=x?!1:i&&m===Ve.Open;ni(_,{allowed:d.useCallback(()=>[v,g],[v,g])});let C=m!==Ve.Open,O=Rg(C,v)?!1:D,R=D&&m===Ve.Closed,b=Eo(R,h.value),S=ee(A=>h.compare(b,A)),L=we(p,A=>{var H;if(u==null||!((H=u==null?void 0:u.to)!=null&&H.includes("selection")))return null;let G=A.options.findIndex(X=>S(X.dataRef.current.value));return G===-1&&(G=0),G}),P=(()=>{if(u==null)return;if(L===null)return{...u,inner:void 0};let A=Array.from(h.listRef.current.values());return{...u,inner:{listRef:{current:A},index:L}}})(),[N,z]=Ju(P),I=Xu(),te=Re(r,u?N:null,p.actions.setOptionsElement,f),M=Qt();d.useEffect(()=>{var A;let H=g;H&&m===Ve.Open&&H!==((A=dn(H))==null?void 0:A.activeElement)&&(H==null||H.focus({preventScroll:!0}))},[m,g]);let j=ee(A=>{var H,G;switch(M.dispose(),A.key){case he.Space:if(p.state.searchQuery!=="")return A.preventDefault(),A.stopPropagation(),p.actions.search(A.key);case he.Enter:if(A.preventDefault(),A.stopPropagation(),p.state.activeOptionIndex!==null){let{dataRef:X}=p.state.options[p.state.activeOptionIndex];p.actions.onChange(X.current.value)}h.mode===yt.Single&&(Ne.flushSync(()=>p.actions.closeListbox()),(H=p.state.buttonElement)==null||H.focus({preventScroll:!0}));break;case Le(h.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Next});case Le(h.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Previous});case he.Home:case he.PageUp:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.First});case he.End:case he.PageDown:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Last});case he.Escape:A.preventDefault(),A.stopPropagation(),Ne.flushSync(()=>p.actions.closeListbox()),(G=p.state.buttonElement)==null||G.focus({preventScroll:!0});return;case he.Tab:A.preventDefault(),A.stopPropagation(),Ne.flushSync(()=>p.actions.closeListbox()),om(p.state.buttonElement,A.shiftKey?dt.Previous:dt.Next);break;default:A.key.length===1&&(p.actions.search(A.key),M.setTimeout(()=>p.actions.clearSearch(),350));break}}),Q=we(p,A=>{var H;return(H=A.buttonElement)==null?void 0:H.id}),W=d.useMemo(()=>({open:m===Ve.Open}),[m]),F=pr(u?I():{},{id:t,ref:te,"aria-activedescendant":we(p,p.selectors.activeDescendantId),"aria-multiselectable":h.mode===yt.Multi?!0:void 0,"aria-labelledby":Q,"aria-orientation":h.orientation,onKeyDown:j,role:"listbox",tabIndex:m===Ve.Open?0:void 0,style:{...l.style,...z,"--button-width":Ua(v,!0).width},...di(T)}),ne=Me(),q=d.useMemo(()=>h.mode===yt.Multi?h:{...h,isSelected:S},[h,S]);return d.createElement(Ni,{enabled:a?n.static||D:!1,ownerDocument:E},d.createElement(Mo.Provider,{value:q},ne({ourProps:F,theirProps:l,slot:W,defaultTag:Kg,features:Xg,visible:O,name:"Listbox.Options"})))}let Zg="div";function eb(n,r){let e=d.useId(),{id:t=`headlessui-listbox-option-${e}`,disabled:o=!1,value:a,...i}=n,s=d.useContext(Ac)===!0,l=Tr("Listbox.Option"),u=ji("Listbox.Option"),c=we(u,O=>u.selectors.isActive(O,t)),f=l.isSelected(a),h=d.useRef(null),p=Wg(h),m=Pt({disabled:o,value:a,domRef:h,get textValue(){return p()}}),v=Re(r,h,O=>{O?l.listRef.current.set(t,O):l.listRef.current.delete(t)}),g=we(u,O=>u.selectors.shouldScrollIntoView(O,t));fe(()=>{if(g)return rt().requestAnimationFrame(()=>{var O,R;(R=(O=h.current)==null?void 0:O.scrollIntoView)==null||R.call(O,{block:"nearest"})})},[g,h]),fe(()=>{if(!s)return u.actions.registerOption(t,m),()=>u.actions.unregisterOption(t)},[m,t,s]);let x=ee(O=>{var R;if(o)return O.preventDefault();u.actions.onChange(a),l.mode===yt.Single&&(Ne.flushSync(()=>u.actions.closeListbox()),(R=u.state.buttonElement)==null||R.focus({preventScroll:!0}))}),E=ee(()=>{if(o)return u.actions.goToOption({focus:se.Nothing});u.actions.goToOption({focus:se.Specific,id:t})}),w=yu(),k=ee(O=>{w.update(O),!o&&(c||u.actions.goToOption({focus:se.Specific,id:t},Ri.Pointer))}),D=ee(O=>{w.wasMoved(O)&&(o||c||u.actions.goToOption({focus:se.Specific,id:t},Ri.Pointer))}),T=ee(O=>{w.wasMoved(O)&&(o||c&&u.actions.goToOption({focus:se.Nothing}))}),$=d.useMemo(()=>({active:c,focus:c,selected:f,disabled:o,selectedOption:f&&s}),[c,f,o,s]),_=s?{}:{id:t,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:E,onPointerEnter:k,onMouseEnter:k,onPointerMove:D,onMouseMove:D,onPointerLeave:T,onMouseLeave:T},C=Me();return!f&&s?null:C({ourProps:_,theirProps:i,slot:$,defaultTag:Zg,name:"Listbox.Option"})}let tb=d.Fragment;function nb(n,r){let{options:e,placeholder:t,...o}=n,a={ref:Re(r)},i=Tr("ListboxSelectedOption"),s=d.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===yt.Multi&&Array.isArray(i.value)&&i.value.length===0,u=Me();return d.createElement(Ac.Provider,{value:!0},u({ourProps:a,theirProps:{...o,children:d.createElement(d.Fragment,null,t&&l?t:e)},slot:s,defaultTag:tb,name:"ListboxSelectedOption"}))}let rb=Ce(Ug),Yc=Ce(Gg),ob=uo,Rc=Ce(Jg),jc=Ce(eb),ab=Ce(nb),ib=Object.assign(rb,{Button:Yc,Label:ob,Options:Rc,Option:jc,SelectedOption:ab});const sb=n=>{const{isOpen:r,setIsOpen:e,title:t,image:o,description:a,confirm:i,cancel:s,className:l}=n;return Y.jsx(_c,{show:r,enter:"transition ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:Y.jsxs(Mr,{onClose:()=>e(!1),className:"relative z-50 focus:outline-hidden",children:[Y.jsx("div",{className:"fixed inset-0 bg-black/40","aria-hidden":!r}),Y.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center p-4",children:Y.jsxs(Oc,{className:tt(l==null?void 0:l.popup,"ja-break-all flex w-[90vw] max-w-[300px] flex-col gap-[16px] rounded-[16px] bg-white p-[20px]"),children:[Y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[t&&Y.jsx(Mc,{className:tt(l==null?void 0:l.title,"global-break-all text-[18px] leading-[26px] font-bold text-black"),children:t}),o&&Y.jsx("img",{className:l==null?void 0:l.image,src:o.url,alt:o.alt}),a&&a!==""&&Y.jsx(Bl,{className:tt(l==null?void 0:l.description,"text-petnow-grey-tertiary text-[16px] leading-[24px] break-all"),children:a})]}),Y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[Y.jsx("button",{className:"bg-petnow-orange-primary sm:hover:bg-petnow-orange-40 w-full cursor-pointer rounded-[12px] py-[12px] text-[14px] leading-[22px] font-bold text-white transition duration-200",onClick:i.onClick,children:i.text}),s&&Y.jsx("button",{onClick:()=>e(!1),className:"bg-background-tertiary sm:hover:bg-petnow-grey-90 text-petnow-grey-tertiary w-full cursor-pointer rounded-[12px] py-[12px] text-[14px] leading-[22px] font-bold transition duration-200",children:s.text})]})]})})]})})},lb=({className:n,id:r,name:e,onChange:t,disabled:o,isChecked:a})=>Y.jsxs("label",{htmlFor:r,className:"relative inline-flex cursor-pointer items-center",children:[Y.jsx("input",{type:"checkbox",disabled:o,checked:a,id:r,name:e,className:"peer sr-only",onChange:t}),Y.jsx("div",{className:tt(n,"bg-petnow-grey-primary peer-checked:bg-petnow-orange-primary h-[32px] w-[52px] rounded-full duration-[250ms] peer-focus:outline-none after:absolute after:start-[2px] after:top-[3px] after:size-[26px] after:rounded-full after:bg-white after:shadow-[0_3px_8px_0_rgba(0,0,0,0.15)] after:transition-all after:duration-[250ms] after:content-[''] peer-checked:after:translate-x-[calc(100%-4px)] peer-checked:after:border-white",o&&"cursor-not-allowed opacity-50")})]});var Wc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hc=d.createContext&&d.createContext(Wc),ub=["attr","size","title"];function cb(n,r){if(n==null)return{};var e=db(n,r),t,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)t=a[o],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(e[t]=n[t])}return e}function db(n,r){if(n==null)return{};var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(r.indexOf(t)>=0)continue;e[t]=n[t]}return e}function To(){return To=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},To.apply(this,arguments)}function Bc(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,t)}return e}function Po(n){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Bc(Object(e),!0).forEach(function(t){fb(n,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Bc(Object(e)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}return n}function fb(n,r,e){return r=pb(r),r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function pb(n){var r=hb(n,"string");return typeof r=="symbol"?r:r+""}function hb(n,r){if(typeof n!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var t=e.call(n,r);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}function Vc(n){return n&&n.map((r,e)=>d.createElement(r.tag,Po({key:e},r.attr),Vc(r.child)))}function Pr(n){return r=>d.createElement(mb,To({attr:Po({},n.attr)},r),Vc(n.child))}function mb(n){var r=e=>{var{attr:t,size:o,title:a}=n,i=cb(n,ub),s=o||e.size||"1em",l;return e.className&&(l=e.className),n.className&&(l=(l?l+" ":"")+n.className),d.createElement("svg",To({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,i,{className:l,style:Po(Po({color:n.color||e.color},e.style),n.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&d.createElement("title",null,a),n.children)};return Hc!==void 0?d.createElement(Hc.Consumer,null,e=>r(e)):r(Wc)}function vb(n){return Pr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"},child:[]}]})(n)}function zc(n){return Pr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(n)}const gb=({checked:n,label:r,onChange:e,termImageUrl:t})=>{const[o,a]=d.useState(!1);return Y.jsxs(Y.Fragment,{children:[Y.jsx(bb,{isOpen:o,setIsOpen:a,termImageUrl:t}),Y.jsxs("div",{className:"inline-flex items-center",children:[Y.jsxs("label",{className:"relative flex cursor-pointer items-center rounded-full p-3",htmlFor:"check",children:[Y.jsx("input",{type:"checkbox",className:"before:content[''] border-petnow-grey-primary peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity",id:r,checked:n,onChange:i=>{e(i.target.checked)}}),Y.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:Y.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),r&&Y.jsxs("div",{className:"flex items-center",children:[Y.jsx("label",{className:"cursor-pointer font-medium",htmlFor:r,children:r}),Y.jsx(vb,{onClick:()=>{a(!0)},className:"text-petnow-grey-tertiary mt-[2.5px] ml-2 cursor-pointer",size:24})]})]})]})},bb=({isOpen:n,setIsOpen:r,termImageUrl:e})=>Y.jsxs(Mr,{open:n,onClose:()=>r(!1),className:"relative z-50",children:[Y.jsx("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),Y.jsx("div",{className:"fixed inset-0 w-screen overflow-y-auto",children:Y.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:Y.jsxs(Mr.Panel,{className:"mx-auto flex max-w-sm flex-col items-center rounded-sm bg-white",children:[Y.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-full flex-row-reverse items-center",children:Y.jsx(zc,{size:20,className:"mr-2",onClick:()=>r(!1)})}),Y.jsx("img",{src:e,alt:"약관동의 이미지"})]})})})]});var Wi=function(n,r){return Wi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},Wi(n,r)},Bn=function(){return Bn=Object.assign||function(n){for(var r,e=1,t=arguments.length;e<t;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},Bn.apply(this,arguments)};function yb(n,r){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(t=Object.getOwnPropertySymbols(n);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(e[t[o]]=n[t[o]])}return e}var Hi,qc="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",wb=(Hi=null,function(n){return n===void 0&&(n=qc),Hi||(Hi=new Promise(function(r,e){var t=document.createElement("script");t.src=n,t.onload=function(){var o;if(!((o=window==null?void 0:window.daum)===null||o===void 0)&&o.Postcode)return r(window.daum.Postcode);e(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},t.onerror=function(o){return e(o)},t.id="daum_postcode_script",document.body.appendChild(t)}))}),xb=d.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),Eb={width:"100%",height:400},Db={scriptUrl:qc,errorMessage:xb,autoClose:!0},Sb=function(n){function r(){var e=n!==null&&n.apply(this,arguments)||this;return e.mounted=!1,e.wrap=d.createRef(),e.state={hasError:!1,completed:!1},e.initiate=function(t){if(e.wrap.current){var o=e.props;o.scriptUrl,o.className,o.style;var a=o.defaultQuery,i=o.autoClose;o.errorMessage;var s=o.onComplete,l=o.onClose,u=o.onResize,c=o.onSearch,f=yb(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new t(Bn(Bn({},f),{oncomplete:function(h){s&&s(h),e.setState({completed:!0})},onsearch:c,onresize:u,onclose:l,width:"100%",height:"100%"})).embed(e.wrap.current,{q:a,autoClose:i})}},e.onError=function(t){console.error(t),e.setState({hasError:!0})},e}return function(e,t){function o(){this.constructor=e}Wi(e,t),e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}(r,n),r.prototype.componentDidMount=function(){var e=this.initiate,t=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(wb(o).then(e).catch(t),this.mounted=!0))},r.prototype.render=function(){var e=this.props,t=e.className,o=e.style,a=e.errorMessage,i=e.autoClose,s=this.state,l=s.hasError,u=s.completed;return i===!0&&u===!0?null:d.createElement("div",{ref:this.wrap,className:t,style:Bn(Bn({},Eb),o)},l&&a)},r.defaultProps=Db,r}(d.Component);const kb=({label:n,value:r,onFrontChange:e,onBackChange:t,onPostalCodeChange:o,disabled:a})=>{const[i,s]=d.useState(!1),l=f=>{let h=f.address,p="";f.addressType==="R"&&(f.bname!==""&&(p+=f.bname),f.buildingName!==""&&(p+=p!==""?`, ${f.buildingName}`:f.buildingName),h+=p!==""?` (${p})`:""),e(h),o&&o(f.zonecode),s(!1)},u=()=>{s(!0)},c=()=>r.front?r.front:Y.jsx("p",{className:"text-petnow-grey-primary",children:"주소를 입력해주세요."});return Y.jsxs(Y.Fragment,{children:[Y.jsx(_b,{isOpen:i,setIsOpen:s,handleComplete:l}),Y.jsxs("div",{className:"text-petnow-grey-tertiary",children:[Y.jsx("label",{htmlFor:n,className:"text-sm font-bold text-black",children:n}),Y.jsxs("div",{className:"relative flex flex-col",children:[Y.jsx("div",{className:`bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full cursor-pointer overflow-hidden rounded-xl p-4 text-base whitespace-nowrap focus:outline-hidden ${a&&"opacity-50"}`,onClick:u,children:c()}),Y.jsx("input",{disabled:!r.front||a,value:r.back,type:"text",name:n,id:n,placeholder:"상세 주소를 입력해주세요.",className:"bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full rounded-xl p-4 text-base focus:outline-hidden disabled:opacity-50",autoComplete:"off",onChange:f=>t(f.target.value)})]})]})]})},_b=n=>{const{isOpen:r,setIsOpen:e,handleComplete:t}=n;return Y.jsx(Mr,{open:r,onClose:()=>e(!1),className:"relateive z-50",children:Y.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center",children:Y.jsx(Mr.Panel,{children:Y.jsxs("div",{children:[Y.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-[100vw] flex-row-reverse items-center px-2",onClick:()=>e(!1),children:Y.jsx(zc,{size:24,onClick:()=>e(!1)})}),Y.jsx(Sb,{onComplete:t,style:{width:"100vw",height:"calc(100vh - 36px)"}})]})})})})};function Cb(n){return Pr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function Ob(n){return Pr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}const Mb=({title:n,description:r,titleTextClassName:e,descriptionTextClassName:t})=>{const[o,a]=d.useState(!1);return Y.jsxs("div",{className:"my-2.5 flex w-full cursor-pointer flex-col justify-center rounded-xl px-4 pt-8 shadow-[0_2px_8px_0_rgba(0,0,0,0.08)] md:rounded-2xl md:pt-10",onClick:()=>a(i=>!i),children:[Y.jsxs("div",{className:"flex w-full items-center justify-between px-2 pb-8 transition-all duration-300 md:px-4 md:pb-10",children:[Y.jsxs("p",{className:tt("mr-4 text-lg font-medium md:text-xl",e),children:[Y.jsx("span",{className:"font-semibold",children:"Q."})," ",n]}),o?Y.jsx(Ob,{className:"text-petnow-orange-primary min-w-6",size:24}):Y.jsx(Cb,{className:"text-petnow-orange-primary min-w-6",size:24})]}),Y.jsx("p",{className:tt(`text-petnow-grey-secondary w-full overflow-hidden px-2 text-base leading-6 whitespace-pre-wrap transition-all duration-300 md:px-4 md:text-lg ${o?"max-h-[24rem] pb-8 sm:max-h-60 md:pb-10":"max-h-0"}`,t),children:r})]})},Uc=6048e5,Tb=864e5,Io=6e4,No=36e5,Pb=1e3,Qc=Symbol.for("constructDateFrom");function De(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&Qc in n?n[Qc](r):n instanceof Date?new n.constructor(r):new Date(r)}function ae(n,r){return De(r||n,n)}function ft(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(r)?De((e==null?void 0:e.in)||n,NaN):(r&&t.setDate(t.getDate()+r),t)}function pt(n,r,e){const t=ae(n,e==null?void 0:e.in);if(isNaN(r))return De(n,NaN);if(!r)return t;const o=t.getDate(),a=De(n,t.getTime());a.setMonth(t.getMonth()+r+1,0);const i=a.getDate();return o>=i?a:(t.setFullYear(a.getFullYear(),a.getMonth(),o),t)}function Gc(n,r,e){return De(n,+ae(n)+r)}function Ib(n,r,e){return Gc(n,r*No)}let Nb={};function gn(){return Nb}function Yt(n,r){var s,l,u,c;const e=gn(),t=(r==null?void 0:r.weekStartsOn)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?7:0)+a-t;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Vn(n,r){return Yt(n,{...r,weekStartsOn:1})}function Kc(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=De(e,0);o.setFullYear(t+1,0,4),o.setHours(0,0,0,0);const a=Vn(o),i=De(e,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const s=Vn(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=s.getTime()?t:t-1}function Lo(n){const r=ae(n),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+n-+e}function Rt(n,...r){const e=De.bind(null,r.find(t=>typeof t=="object"));return r.map(e)}function bn(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(0,0,0,0),e}function zn(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=bn(t),i=bn(o),s=+a-Lo(a),l=+i-Lo(i);return Math.round((s-l)/Tb)}function Lb(n,r){const e=Kc(n,r),t=De(n,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),Vn(t)}function Bi(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setTime(t.getTime()+r*Io),t}function Vi(n,r,e){return pt(n,r*3,e)}function Fb(n,r,e){return Gc(n,r*1e3)}function Fo(n,r,e){return ft(n,r*7,e)}function jt(n,r,e){return pt(n,r*12,e)}function Xc(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e<a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function Jc(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e>a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function $b(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return+bn(t)==+bn(o)}function Wt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function $o(n){return!(!Wt(n)&&typeof n!="number"||isNaN(+ae(n)))}function Ao(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=t.getMonth()-o.getMonth();return a*12+i}function yn(n,r){const e=ae(n,r==null?void 0:r.in);return Math.trunc(e.getMonth()/3)+1}function Yo(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=yn(t)-yn(o);return a*4+i}function Ro(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return t.getFullYear()-o.getFullYear()}function Ab(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=Zc(t,o),i=Math.abs(zn(t,o));t.setDate(t.getDate()-a*i);const s=+(Zc(t,o)===-a),l=a*(i-s);return l===0?0:l}function Zc(n,r){const e=n.getFullYear()-r.getFullYear()||n.getMonth()-r.getMonth()||n.getDate()-r.getDate()||n.getHours()-r.getHours()||n.getMinutes()-r.getMinutes()||n.getSeconds()-r.getSeconds()||n.getMilliseconds()-r.getMilliseconds();return e<0?-1:e>0?1:e}function ed(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(23,59,59,999),e}function td(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function zi(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth(),o=t-t%3;return e.setMonth(o,1),e.setHours(0,0,0,0),e}function nd(n,r){const e=ae(n,r==null?void 0:r.in);return e.setDate(1),e.setHours(0,0,0,0),e}function rd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function jo(n,r){const e=ae(n,r==null?void 0:r.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Yb(n,r){var s,l;const e=gn(),t=e.weekStartsOn??((l=(s=e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?-7:0)+6-(a-t);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const Rb={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},jb=(n,r,e)=>{let t;const o=Rb[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+t:t+" ago":t};function qn(n){return(r={})=>{const e=r.width?String(r.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Wb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Hb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Bb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vb={date:qn({formats:Wb,defaultWidth:"full"}),time:qn({formats:Hb,defaultWidth:"full"}),dateTime:qn({formats:Bb,defaultWidth:"full"})},zb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qb=(n,r,e,t)=>zb[n];function wt(n){return(r,e)=>{const t=e!=null&&e.context?String(e.context):"standalone";let o;if(t==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=n.formattingValues[s]||n.formattingValues[i]}else{const i=n.defaultWidth,s=e!=null&&e.width?String(e.width):n.defaultWidth;o=n.values[s]||n.values[i]}const a=n.argumentCallback?n.argumentCallback(r):r;return o[a]}}const Ub={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Gb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Kb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Xb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Jb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Zb={ordinalNumber:(n,r)=>{const e=Number(n),t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:wt({values:Ub,defaultWidth:"wide"}),quarter:wt({values:Qb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:Gb,defaultWidth:"wide"}),day:wt({values:Kb,defaultWidth:"wide"}),dayPeriod:wt({values:Xb,defaultWidth:"wide",formattingValues:Jb,defaultFormattingWidth:"wide"})};function xt(n){return(r,e={})=>{const t=e.width,o=t&&n.matchPatterns[t]||n.matchPatterns[n.defaultMatchWidth],a=r.match(o);if(!a)return null;const i=a[0],s=t&&n.parsePatterns[t]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(s)?ty(s,f=>f.test(i)):ey(s,f=>f.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=r.slice(i.length);return{value:u,rest:c}}}function ey(n,r){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&r(n[e]))return e}function ty(n,r){for(let e=0;e<n.length;e++)if(r(n[e]))return e}function od(n){return(r,e={})=>{const t=r.match(n.matchPattern);if(!t)return null;const o=t[0],a=r.match(n.parsePattern);if(!a)return null;let i=n.valueCallback?n.valueCallback(a[0]):a[0];i=e.valueCallback?e.valueCallback(i):i;const s=r.slice(o.length);return{value:i,rest:s}}}const ny=/^(\d+)(th|st|nd|rd)?/i,ry=/\d+/i,oy={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ay={any:[/^b/i,/^(a|c)/i]},iy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sy={any:[/1/i,/2/i,/3/i,/4/i]},ly={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uy={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fy={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},py={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},hy={ordinalNumber:od({matchPattern:ny,parsePattern:ry,valueCallback:n=>parseInt(n,10)}),era:xt({matchPatterns:oy,defaultMatchWidth:"wide",parsePatterns:ay,defaultParseWidth:"any"}),quarter:xt({matchPatterns:iy,defaultMatchWidth:"wide",parsePatterns:sy,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xt({matchPatterns:ly,defaultMatchWidth:"wide",parsePatterns:uy,defaultParseWidth:"any"}),day:xt({matchPatterns:cy,defaultMatchWidth:"wide",parsePatterns:dy,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:fy,defaultMatchWidth:"any",parsePatterns:py,defaultParseWidth:"any"})},ad={code:"en-US",formatDistance:jb,formatLong:Vb,formatRelative:qb,localize:Zb,match:hy,options:{weekStartsOn:0,firstWeekContainsDate:1}};function my(n,r){const e=ae(n,r==null?void 0:r.in);return zn(e,jo(e))+1}function qi(n,r){const e=ae(n,r==null?void 0:r.in),t=+Vn(e)-+Lb(e);return Math.round(t/Uc)+1}function Ui(n,r){var c,f,h,p;const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=gn(),a=(r==null?void 0:r.firstWeekContainsDate)??((f=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=De((r==null?void 0:r.in)||n,0);i.setFullYear(t+1,0,a),i.setHours(0,0,0,0);const s=Yt(i,r),l=De((r==null?void 0:r.in)||n,0);l.setFullYear(t,0,a),l.setHours(0,0,0,0);const u=Yt(l,r);return+e>=+s?t+1:+e>=+u?t:t-1}function vy(n,r){var s,l,u,c;const e=gn(),t=(r==null?void 0:r.firstWeekContainsDate)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Ui(n,r),a=De((r==null?void 0:r.in)||n,0);return a.setFullYear(o,0,t),a.setHours(0,0,0,0),Yt(a,r)}function id(n,r){const e=ae(n,r==null?void 0:r.in),t=+Yt(e,r)-+vy(e,r);return Math.round(t/Uc)+1}function Se(n,r){const e=n<0?"-":"",t=Math.abs(n).toString().padStart(r,"0");return e+t}const tn={y(n,r){const e=n.getFullYear(),t=e>0?e:1-e;return Se(r==="yy"?t%100:t,r.length)},M(n,r){const e=n.getMonth();return r==="M"?String(e+1):Se(e+1,2)},d(n,r){return Se(n.getDate(),r.length)},a(n,r){const e=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,r){return Se(n.getHours()%12||12,r.length)},H(n,r){return Se(n.getHours(),r.length)},m(n,r){return Se(n.getMinutes(),r.length)},s(n,r){return Se(n.getSeconds(),r.length)},S(n,r){const e=r.length,t=n.getMilliseconds(),o=Math.trunc(t*Math.pow(10,e-3));return Se(o,r.length)}},Un={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sd={G:function(n,r,e){const t=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(t,{width:"abbreviated"});case"GGGGG":return e.era(t,{width:"narrow"});case"GGGG":default:return e.era(t,{width:"wide"})}},y:function(n,r,e){if(r==="yo"){const t=n.getFullYear(),o=t>0?t:1-t;return e.ordinalNumber(o,{unit:"year"})}return tn.y(n,r)},Y:function(n,r,e,t){const o=Ui(n,t),a=o>0?o:1-o;if(r==="YY"){const i=a%100;return Se(i,2)}return r==="Yo"?e.ordinalNumber(a,{unit:"year"}):Se(a,r.length)},R:function(n,r){const e=Kc(n);return Se(e,r.length)},u:function(n,r){const e=n.getFullYear();return Se(e,r.length)},Q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(t);case"QQ":return Se(t,2);case"Qo":return e.ordinalNumber(t,{unit:"quarter"});case"QQQ":return e.quarter(t,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(t,{width:"wide",context:"formatting"})}},q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(t);case"qq":return Se(t,2);case"qo":return e.ordinalNumber(t,{unit:"quarter"});case"qqq":return e.quarter(t,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(t,{width:"wide",context:"standalone"})}},M:function(n,r,e){const t=n.getMonth();switch(r){case"M":case"MM":return tn.M(n,r);case"Mo":return e.ordinalNumber(t+1,{unit:"month"});case"MMM":return e.month(t,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(t,{width:"wide",context:"formatting"})}},L:function(n,r,e){const t=n.getMonth();switch(r){case"L":return String(t+1);case"LL":return Se(t+1,2);case"Lo":return e.ordinalNumber(t+1,{unit:"month"});case"LLL":return e.month(t,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(t,{width:"wide",context:"standalone"})}},w:function(n,r,e,t){const o=id(n,t);return r==="wo"?e.ordinalNumber(o,{unit:"week"}):Se(o,r.length)},I:function(n,r,e){const t=qi(n);return r==="Io"?e.ordinalNumber(t,{unit:"week"}):Se(t,r.length)},d:function(n,r,e){return r==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):tn.d(n,r)},D:function(n,r,e){const t=my(n);return r==="Do"?e.ordinalNumber(t,{unit:"dayOfYear"}):Se(t,r.length)},E:function(n,r,e){const t=n.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(t,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(t,{width:"short",context:"formatting"});case"EEEE":default:return e.day(t,{width:"wide",context:"formatting"})}},e:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"e":return String(a);case"ee":return Se(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"c":return String(a);case"cc":return Se(a,r.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,r,e){const t=n.getDay(),o=t===0?7:t;switch(r){case"i":return String(o);case"ii":return Se(o,r.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(t,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(t,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(t,{width:"short",context:"formatting"});case"iiii":default:return e.day(t,{width:"wide",context:"formatting"})}},a:function(n,r,e){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,r,e){const t=n.getHours();let o;switch(t===12?o=Un.noon:t===0?o=Un.midnight:o=t/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,r,e){const t=n.getHours();let o;switch(t>=17?o=Un.evening:t>=12?o=Un.afternoon:t>=4?o=Un.morning:o=Un.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,r,e){if(r==="ho"){let t=n.getHours()%12;return t===0&&(t=12),e.ordinalNumber(t,{unit:"hour"})}return tn.h(n,r)},H:function(n,r,e){return r==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):tn.H(n,r)},K:function(n,r,e){const t=n.getHours()%12;return r==="Ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},k:function(n,r,e){let t=n.getHours();return t===0&&(t=24),r==="ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},m:function(n,r,e){return r==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):tn.m(n,r)},s:function(n,r,e){return r==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):tn.s(n,r)},S:function(n,r){return tn.S(n,r)},X:function(n,r,e){const t=n.getTimezoneOffset();if(t===0)return"Z";switch(r){case"X":return ud(t);case"XXXX":case"XX":return wn(t);case"XXXXX":case"XXX":default:return wn(t,":")}},x:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"x":return ud(t);case"xxxx":case"xx":return wn(t);case"xxxxx":case"xxx":default:return wn(t,":")}},O:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+ld(t,":");case"OOOO":default:return"GMT"+wn(t,":")}},z:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+ld(t,":");case"zzzz":default:return"GMT"+wn(t,":")}},t:function(n,r,e){const t=Math.trunc(+n/1e3);return Se(t,r.length)},T:function(n,r,e){return Se(+n,r.length)}};function ld(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Math.trunc(t/60),a=t%60;return a===0?e+String(o):e+String(o)+r+Se(a,2)}function ud(n,r){return n%60===0?(n>0?"-":"+")+Se(Math.abs(n)/60,2):wn(n,r)}function wn(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Se(Math.trunc(t/60),2),a=Se(t%60,2);return e+o+r+a}const cd=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},dd=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Qi={p:dd,P:(n,r)=>{const e=n.match(/(P+)(p+)?/)||[],t=e[1],o=e[2];if(!o)return cd(n,r);let a;switch(t){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",cd(t,r)).replace("{{time}}",dd(o,r))}},gy=/^D+$/,by=/^Y+$/,yy=["D","DD","YY","YYYY"];function wy(n){return gy.test(n)}function xy(n){return by.test(n)}function Ey(n,r,e){const t=Dy(n,r,e);if(console.warn(t),yy.includes(n))throw new RangeError(t)}function Dy(n,r,e){const t=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Sy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ky=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_y=/^'([^]*?)'?$/,Cy=/''/g,Oy=/[a-zA-Z]/;function fd(n,r,e){var c,f,h,p,m,v,g,x;const t=gn(),o=(e==null?void 0:e.locale)??t.locale??ad,a=(e==null?void 0:e.firstWeekContainsDate)??((f=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??t.firstWeekContainsDate??((p=(h=t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=(e==null?void 0:e.weekStartsOn)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??t.weekStartsOn??((x=(g=t.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,s=ae(n,e==null?void 0:e.in);if(!$o(s))throw new RangeError("Invalid time value");let l=r.match(ky).map(E=>{const w=E[0];if(w==="p"||w==="P"){const k=Qi[w];return k(E,o.formatLong)}return E}).join("").match(Sy).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const w=E[0];if(w==="'")return{isToken:!1,value:My(E)};if(sd[w])return{isToken:!0,value:E};if(w.match(Oy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:E}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(E=>{if(!E.isToken)return E.value;const w=E.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&xy(w)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&wy(w))&&Ey(w,r,String(n));const k=sd[w[0]];return k(s,w,o.localize,u)}).join("")}function My(n){const r=n.match(_y);return r?r[1].replace(Cy,"'"):n}function pd(n,r){return ae(n,r==null?void 0:r.in).getDate()}function Ty(n,r){return ae(n,r==null?void 0:r.in).getDay()}function Py(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=e.getMonth(),a=De(e,0);return a.setFullYear(t,o+1,0),a.setHours(0,0,0,0),a.getDate()}function Iy(){return Object.assign({},gn())}function Ht(n,r){return ae(n,r==null?void 0:r.in).getHours()}function Ny(n,r){const e=ae(n,r==null?void 0:r.in).getDay();return e===0?7:e}function Bt(n,r){return ae(n,r==null?void 0:r.in).getMinutes()}function qe(n,r){return ae(n,r==null?void 0:r.in).getMonth()}function nn(n){return ae(n).getSeconds()}function Gi(n){return+ae(n)}function le(n,r){return ae(n,r==null?void 0:r.in).getFullYear()}function rn(n,r){return+ae(n)>+ae(r)}function xn(n,r){return+ae(n)<+ae(r)}function Ly(n,r){return+ae(n)==+ae(r)}function Fy(n,r){const e=$y(r)?new r(0):De(r,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function $y(n){var r;return typeof n=="function"&&((r=n.prototype)==null?void 0:r.constructor)===n}const Ay=10;class hd{constructor(){Z(this,"subPriority",0)}validate(r,e){return!0}}class Yy extends hd{constructor(r,e,t,o,a){super(),this.value=r,this.validateValue=e,this.setValue=t,this.priority=o,a&&(this.subPriority=a)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,t){return this.setValue(r,e,this.value,t)}}class Ry extends hd{constructor(e,t){super();Z(this,"priority",Ay);Z(this,"subPriority",-1);this.context=e||(o=>De(t,o))}set(e,t){return t.timestampIsSet?e:De(e,Fy(e,this.context))}}class ge{run(r,e,t,o){const a=this.parse(r,e,t,o);return a?{setter:new Yy(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,e,t){return!0}}class jy extends ge{constructor(){super(...arguments);Z(this,"priority",140);Z(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,o){switch(t){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});case"GGGG":default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,t,o){return t.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}const $e={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Et={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ae(n,r){return n&&{value:r(n.value),rest:n.rest}}function Te(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function Dt(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const t=e[1]==="+"?1:-1,o=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:t*(o*No+a*Io+i*Pb),rest:r.slice(e[0].length)}}function md(n){return Te($e.anyDigitsSigned,n)}function Ie(n,r){switch(n){case 1:return Te($e.singleDigit,r);case 2:return Te($e.twoDigits,r);case 3:return Te($e.threeDigits,r);case 4:return Te($e.fourDigits,r);default:return Te(new RegExp("^\\d{1,"+n+"}"),r)}}function Wo(n,r){switch(n){case 1:return Te($e.singleDigitSigned,r);case 2:return Te($e.twoDigitsSigned,r);case 3:return Te($e.threeDigitsSigned,r);case 4:return Te($e.fourDigitsSigned,r);default:return Te(new RegExp("^-?\\d{1,"+n+"}"),r)}}function Ki(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function vd(n,r){const e=r>0,t=e?r:1-r;let o;if(t<=50)o=n||100;else{const a=t+50,i=Math.trunc(a/100)*100,s=n>=a%100;o=n+i-(s?100:0)}return e?o:1-o}function gd(n){return n%400===0||n%4===0&&n%100!==0}class Wy extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="yy"});switch(t){case"y":return Ae(Ie(4,e),a);case"yo":return Ae(o.ordinalNumber(e,{unit:"year"}),a);default:return Ae(Ie(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o){const a=e.getFullYear();if(o.isTwoDigitYear){const s=vd(o.year,a);return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}const i=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class Hy extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="YY"});switch(t){case"Y":return Ae(Ie(4,e),a);case"Yo":return Ae(o.ordinalNumber(e,{unit:"year"}),a);default:return Ae(Ie(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o,a){const i=Ui(e,a);if(o.isTwoDigitYear){const l=vd(o.year,i);return e.setFullYear(l,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Yt(e,a)}const s=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(s,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Yt(e,a)}}class By extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return Wo(t==="R"?4:t.length,e)}set(e,t,o){const a=De(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Vn(a)}}class Vy extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return Wo(t==="u"?4:t.length,e)}set(e,t,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class zy extends ge{constructor(){super(...arguments);Z(this,"priority",120);Z(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"Q":case"QQ":return Ie(t.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class qy extends ge{constructor(){super(...arguments);Z(this,"priority",120);Z(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"q":case"qq":return Ie(t.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class Uy extends ge{constructor(){super(...arguments);Z(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Z(this,"priority",110)}parse(e,t,o){const a=i=>i-1;switch(t){case"M":return Ae(Te($e.month,e),a);case"MM":return Ae(Ie(2,e),a);case"Mo":return Ae(o.ordinalNumber(e,{unit:"month"}),a);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class Qy extends ge{constructor(){super(...arguments);Z(this,"priority",110);Z(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,o){const a=i=>i-1;switch(t){case"L":return Ae(Te($e.month,e),a);case"LL":return Ae(Ie(2,e),a);case"Lo":return Ae(o.ordinalNumber(e,{unit:"month"}),a);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}function Gy(n,r,e){const t=ae(n,e==null?void 0:e.in),o=id(t,e)-r;return t.setDate(t.getDate()-o*7),ae(t,e==null?void 0:e.in)}class Ky extends ge{constructor(){super(...arguments);Z(this,"priority",100);Z(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,o){switch(t){case"w":return Te($e.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o,a){return Yt(Gy(e,o,a),a)}}function Xy(n,r,e){const t=ae(n,e==null?void 0:e.in),o=qi(t,e)-r;return t.setDate(t.getDate()-o*7),t}class Jy extends ge{constructor(){super(...arguments);Z(this,"priority",100);Z(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,o){switch(t){case"I":return Te($e.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o){return Vn(Xy(e,o))}}const Zy=[31,28,31,30,31,30,31,31,30,31,30,31],ew=[31,29,31,30,31,30,31,31,30,31,30,31];class tw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"subPriority",1);Z(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"d":return Te($e.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return Ie(t.length,e)}}validate(e,t){const o=e.getFullYear(),a=gd(o),i=e.getMonth();return a?t>=1&&t<=ew[i]:t>=1&&t<=Zy[i]}set(e,t,o){return e.setDate(o),e.setHours(0,0,0,0),e}}class nw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"subpriority",1);Z(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,o){switch(t){case"D":case"DD":return Te($e.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return Ie(t.length,e)}}validate(e,t){const o=e.getFullYear();return gd(o)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}}function Xi(n,r,e){var f,h,p,m;const t=gn(),o=(e==null?void 0:e.weekStartsOn)??((h=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,a=ae(n,e==null?void 0:e.in),i=a.getDay(),l=(r%7+7)%7,u=7-o,c=r<0||r>6?r-(i+u)%7:(l+u)%7-(i+u)%7;return ft(a,c,e)}class rw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Xi(e,o,a),e.setHours(0,0,0,0),e}}class ow extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"e":case"ee":return Ae(Ie(t.length,e),i);case"eo":return Ae(o.ordinalNumber(e,{unit:"day"}),i);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Xi(e,o,a),e.setHours(0,0,0,0),e}}class aw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"c":case"cc":return Ae(Ie(t.length,e),i);case"co":return Ae(o.ordinalNumber(e,{unit:"day"}),i);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Xi(e,o,a),e.setHours(0,0,0,0),e}}function iw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Ny(t,e),a=r-o;return ft(t,a,e)}class sw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,o){const a=i=>i===0?7:i;switch(t){case"i":case"ii":return Ie(t.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Ae(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ae(o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ae(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Ae(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,o){return e=iw(e,o),e.setHours(0,0,0,0),e}}class lw extends ge{constructor(){super(...arguments);Z(this,"priority",80);Z(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,o){switch(t){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(Ki(o),0,0,0),e}}class uw extends ge{constructor(){super(...arguments);Z(this,"priority",80);Z(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,t,o){switch(t){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(Ki(o),0,0,0),e}}class cw extends ge{constructor(){super(...arguments);Z(this,"priority",80);Z(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,o){switch(t){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(Ki(o),0,0,0),e}}class dw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,o){switch(t){case"h":return Te($e.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,o){const a=e.getHours()>=12;return a&&o<12?e.setHours(o+12,0,0,0):!a&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}}class fw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,o){switch(t){case"H":return Te($e.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,o){return e.setHours(o,0,0,0),e}}class pw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,o){switch(t){case"K":return Te($e.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}}class hw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,o){switch(t){case"k":return Te($e.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,o){const a=o<=24?o%24:o;return e.setHours(a,0,0,0),e}}class mw extends ge{constructor(){super(...arguments);Z(this,"priority",60);Z(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"m":return Te($e.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setMinutes(o,0,0),e}}class vw extends ge{constructor(){super(...arguments);Z(this,"priority",50);Z(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"s":return Te($e.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setSeconds(o,0),e}}class gw extends ge{constructor(){super(...arguments);Z(this,"priority",30);Z(this,"incompatibleTokens",["t","T"])}parse(e,t){const o=a=>Math.trunc(a*Math.pow(10,-t.length+3));return Ae(Ie(t.length,e),o)}set(e,t,o){return e.setMilliseconds(o),e}}class bw extends ge{constructor(){super(...arguments);Z(this,"priority",10);Z(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return Dt(Et.basicOptionalMinutes,e);case"XX":return Dt(Et.basic,e);case"XXXX":return Dt(Et.basicOptionalSeconds,e);case"XXXXX":return Dt(Et.extendedOptionalSeconds,e);case"XXX":default:return Dt(Et.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-Lo(e)-o)}}class yw extends ge{constructor(){super(...arguments);Z(this,"priority",10);Z(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return Dt(Et.basicOptionalMinutes,e);case"xx":return Dt(Et.basic,e);case"xxxx":return Dt(Et.basicOptionalSeconds,e);case"xxxxx":return Dt(Et.extendedOptionalSeconds,e);case"xxx":default:return Dt(Et.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-Lo(e)-o)}}class ww extends ge{constructor(){super(...arguments);Z(this,"priority",40);Z(this,"incompatibleTokens","*")}parse(e){return md(e)}set(e,t,o){return[De(e,o*1e3),{timestampIsSet:!0}]}}class xw extends ge{constructor(){super(...arguments);Z(this,"priority",20);Z(this,"incompatibleTokens","*")}parse(e){return md(e)}set(e,t,o){return[De(e,o),{timestampIsSet:!0}]}}const Ew={G:new jy,y:new Wy,Y:new Hy,R:new By,u:new Vy,Q:new zy,q:new qy,M:new Uy,L:new Qy,w:new Ky,I:new Jy,d:new tw,D:new nw,E:new rw,e:new ow,c:new aw,i:new sw,a:new lw,b:new uw,B:new cw,h:new dw,H:new fw,K:new pw,k:new hw,m:new mw,s:new vw,S:new gw,X:new bw,x:new yw,t:new ww,T:new xw},Dw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,kw=/^'([^]*?)'?$/,_w=/''/g,Cw=/\S/,Ow=/[a-zA-Z]/;function Mw(n,r,e,t){var g,x,E,w,k,D,T,$;const o=()=>De((t==null?void 0:t.in)||e,NaN),a=Iy(),i=(t==null?void 0:t.locale)??a.locale??ad,s=(t==null?void 0:t.firstWeekContainsDate)??((x=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??a.firstWeekContainsDate??((w=(E=a.locale)==null?void 0:E.options)==null?void 0:w.firstWeekContainsDate)??1,l=(t==null?void 0:t.weekStartsOn)??((D=(k=t==null?void 0:t.locale)==null?void 0:k.options)==null?void 0:D.weekStartsOn)??a.weekStartsOn??(($=(T=a.locale)==null?void 0:T.options)==null?void 0:$.weekStartsOn)??0;if(!r)return n?o():ae(e,t==null?void 0:t.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:i},c=[new Ry(t==null?void 0:t.in,e)],f=r.match(Sw).map(_=>{const C=_[0];if(C in Qi){const O=Qi[C];return O(_,i.formatLong)}return _}).join("").match(Dw),h=[];for(let _ of f){const C=_[0],O=Ew[C];if(O){const{incompatibleTokens:R}=O;if(Array.isArray(R)){const S=h.find(L=>R.includes(L.token)||L.token===C);if(S)throw new RangeError(`The format string mustn't contain \`${S.fullToken}\` and \`${_}\` at the same time`)}else if(O.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);h.push({token:C,fullToken:_});const b=O.run(n,_,i.match,u);if(!b)return o();c.push(b.setter),n=b.rest}else{if(C.match(Ow))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(_==="''"?_="'":C==="'"&&(_=Tw(_)),n.indexOf(_)===0)n=n.slice(_.length);else return o()}}if(n.length>0&&Cw.test(n))return o();const p=c.map(_=>_.priority).sort((_,C)=>C-_).filter((_,C,O)=>O.indexOf(_)===C).map(_=>c.filter(C=>C.priority===_).sort((C,O)=>O.subPriority-C.subPriority)).map(_=>_[0]);let m=ae(e,t==null?void 0:t.in);if(isNaN(+m))return o();const v={};for(const _ of p){if(!_.validate(m,u))return o();const C=_.set(m,v,u);Array.isArray(C)?(m=C[0],Object.assign(v,C[1])):m=C}return m}function Tw(n){return n.match(kw)[1].replace(_w,"'")}function Pw(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()}function Iw(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return+zi(t)==+zi(o)}function Nw(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()}function Ir(n,r,e){const t=+ae(n,e==null?void 0:e.in),[o,a]=[+ae(r.start,e==null?void 0:e.in),+ae(r.end,e==null?void 0:e.in)].sort((i,s)=>i-s);return t>=o&&t<=a}function Lw(n,r,e){return ft(n,-1,e)}function Fw(n,r){const e=()=>De(r==null?void 0:r.in,NaN),o=Rw(n);let a;if(o.date){const u=jw(o.date,2);a=Ww(u.restDateString,u.year)}if(!a||isNaN(+a))return e();const i=+a;let s=0,l;if(o.time&&(s=Hw(o.time),isNaN(s)))return e();if(o.timezone){if(l=Bw(o.timezone),isNaN(l))return e()}else{const u=new Date(i+s),c=ae(0,r==null?void 0:r.in);return c.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),c.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),c}return ae(i+s+l,r==null?void 0:r.in)}const Ho={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},$w=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Aw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Yw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Rw(n){const r={},e=n.split(Ho.dateTimeDelimiter);let t;if(e.length>2)return r;if(/:/.test(e[0])?t=e[0]:(r.date=e[0],t=e[1],Ho.timeZoneDelimiter.test(r.date)&&(r.date=n.split(Ho.timeZoneDelimiter)[0],t=n.substr(r.date.length,n.length))),t){const o=Ho.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function jw(n,r){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),t=n.match(e);if(!t)return{year:NaN,restDateString:""};const o=t[1]?parseInt(t[1]):null,a=t[2]?parseInt(t[2]):null;return{year:a===null?o:a*100,restDateString:n.slice((t[1]||t[2]).length)}}function Ww(n,r){if(r===null)return new Date(NaN);const e=n.match($w);if(!e)return new Date(NaN);const t=!!e[4],o=Nr(e[1]),a=Nr(e[2])-1,i=Nr(e[3]),s=Nr(e[4]),l=Nr(e[5])-1;if(t)return Qw(r,s,l)?Vw(r,s,l):new Date(NaN);{const u=new Date(0);return!qw(r,a,i)||!Uw(r,o)?new Date(NaN):(u.setUTCFullYear(r,a,Math.max(o,i)),u)}}function Nr(n){return n?parseInt(n):1}function Hw(n){const r=n.match(Aw);if(!r)return NaN;const e=Ji(r[1]),t=Ji(r[2]),o=Ji(r[3]);return Gw(e,t,o)?e*No+t*Io+o*1e3:NaN}function Ji(n){return n&&parseFloat(n.replace(",","."))||0}function Bw(n){if(n==="Z")return 0;const r=n.match(Yw);if(!r)return 0;const e=r[1]==="+"?-1:1,t=parseInt(r[2]),o=r[3]&&parseInt(r[3])||0;return Kw(t,o)?e*(t*No+o*Io):NaN}function Vw(n,r,e){const t=new Date(0);t.setUTCFullYear(n,0,4);const o=t.getUTCDay()||7,a=(r-1)*7+e+1-o;return t.setUTCDate(t.getUTCDate()+a),t}const zw=[31,null,31,30,31,30,31,31,30,31,30,31];function bd(n){return n%400===0||n%4===0&&n%100!==0}function qw(n,r,e){return r>=0&&r<=11&&e>=1&&e<=(zw[r]||(bd(n)?29:28))}function Uw(n,r){return r>=1&&r<=(bd(n)?366:365)}function Qw(n,r,e){return r>=1&&r<=53&&e>=0&&e<=6}function Gw(n,r,e){return n===24?r===0&&e===0:e>=0&&e<60&&r>=0&&r<60&&n>=0&&n<25}function Kw(n,r){return r>=0&&r<=59}function it(n,r,e){const t=ae(n,e==null?void 0:e.in),o=t.getFullYear(),a=t.getDate(),i=De(n,0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);const s=Py(i);return t.setMonth(r,Math.min(a,s)),t}function Bo(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setHours(r),t}function Vo(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setMinutes(r),t}function Qn(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Math.trunc(t.getMonth()/3)+1,a=r-o;return it(t,t.getMonth()+a*3)}function zo(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setSeconds(r),t}function St(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(+t)?De(n,NaN):(t.setFullYear(r),t)}function En(n,r,e){return pt(n,-r,e)}function yd(n,r,e){return Vi(n,-1,e)}function wd(n,r,e){return Fo(n,-1,e)}function Gn(n,r,e){return jt(n,-r,e)}const Xw={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},Jw=(n,r,e)=>{let t;const o=Xw[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?t+" 후":t+" 전":t},Zw={full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},e0={full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},t0={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},n0={date:qn({formats:Zw,defaultWidth:"full"}),time:qn({formats:e0,defaultWidth:"full"}),dateTime:qn({formats:t0,defaultWidth:"full"})},r0={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},o0=(n,r,e,t)=>r0[n],a0={narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},i0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},s0={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},l0={narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},u0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},c0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},d0={ordinalNumber:(n,r)=>{const e=Number(n);switch(String(r==null?void 0:r.unit)){case"minute":case"second":return String(e);case"date":return e+"일";default:return e+"번째"}},era:wt({values:a0,defaultWidth:"wide"}),quarter:wt({values:i0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:s0,defaultWidth:"wide"}),day:wt({values:l0,defaultWidth:"wide"}),dayPeriod:wt({values:u0,defaultWidth:"wide",formattingValues:c0,defaultFormattingWidth:"wide"})},f0=/^(\d+)(일|번째)?/i,p0=/\d+/i,h0={narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},m0={any:[/^(bc|기원전)/i,/^(ad|서기)/i]},v0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},g0={any:[/1/i,/2/i,/3/i,/4/i]},b0={narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},y0={any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},w0={narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},x0={any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},E0={any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},D0={any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},S0={ordinalNumber:od({matchPattern:f0,parsePattern:p0,valueCallback:n=>parseInt(n,10)}),era:xt({matchPatterns:h0,defaultMatchWidth:"wide",parsePatterns:m0,defaultParseWidth:"any"}),quarter:xt({matchPatterns:v0,defaultMatchWidth:"wide",parsePatterns:g0,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xt({matchPatterns:b0,defaultMatchWidth:"wide",parsePatterns:y0,defaultParseWidth:"any"}),day:xt({matchPatterns:w0,defaultMatchWidth:"wide",parsePatterns:x0,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:E0,defaultMatchWidth:"any",parsePatterns:D0,defaultParseWidth:"any"})},k0={code:"ko",formatDistance:Jw,formatLong:n0,formatRelative:o0,localize:d0,match:S0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var qo=typeof document<"u"?d.useLayoutEffect:d.useEffect;const _0={...V}.useInsertionEffect||(n=>n());function C0(n){const r=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _0(()=>{r.current=n}),V.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}const O0={...V};let xd=!1,M0=0;const Ed=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+M0++;function T0(){const[n,r]=V.useState(()=>xd?Ed():void 0);return qo(()=>{n==null&&r(Ed())},[]),V.useEffect(()=>{xd=!0},[]),n}const Dd=O0.useId||T0;let Lr;process.env.NODE_ENV!=="production"&&(Lr=new Set);function P0(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.warn(o)}}function I0(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.error(o)}}const N0=V.forwardRef(function(r,e){const{context:{placement:t,elements:{floating:o},middlewareData:{arrow:a,shift:i}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:f,stroke:h,d:p,style:{transform:m,...v}={},...g}=r;process.env.NODE_ENV!=="production"&&(e||P0("The `ref` prop is required for `FloatingArrow`."));const x=Dd(),[E,w]=V.useState(!1);if(qo(()=>{if(!o)return;at(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const[k,D]=t.split("-"),T=k==="top"||k==="bottom";let $=f;(T&&i!=null&&i.x||!T&&i!=null&&i.y)&&($=null);const _=c*2,C=_/2,O=s/2*(u/-8+1),R=l/2*u/4,b=!!p,S=$&&D==="end"?"bottom":"top";let L=$&&D==="end"?"right":"left";$&&E&&(L=D==="end"?"left":"right");const P=(a==null?void 0:a.x)!=null?$||a.x:"",N=(a==null?void 0:a.y)!=null?$||a.y:"",z=p||"M0,0"+(" H"+s)+(" L"+(s-O)+","+(l-R))+(" Q"+s/2+","+l+" "+O+","+(l-R))+" Z",I={top:b?"rotate(180deg)":"",left:b?"rotate(90deg)":"rotate(-90deg)",bottom:b?"":"rotate(180deg)",right:b?"rotate(-90deg)":"rotate(90deg)"}[k];return Y.jsxs("svg",{...g,"aria-hidden":!0,ref:e,width:b?s:s+_,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[L]:P,[S]:N,[k]:T||b?"100%":"calc(100% - "+_/2+"px)",transform:[I,m].filter(te=>!!te).join(" "),...v},children:[_>0&&Y.jsx("path",{clipPath:"url(#"+x+")",fill:"none",stroke:h,strokeWidth:_+(p?0:1),d:z}),Y.jsx("path",{stroke:_&&!p?g.fill:"none",d:z}),Y.jsx("clipPath",{id:x,children:Y.jsx("rect",{x:-C,y:C*(b?-1:1),width:s+_,height:s})})]})});function L0(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.has(r)||n.set(r,new Set),n.get(r).add(e)},off(r,e){var t;(t=n.get(r))==null||t.delete(e)}}}const F0=V.createContext(null),$0=V.createContext(null),A0=()=>{var n;return((n=V.useContext(F0))==null?void 0:n.id)||null},Y0=()=>V.useContext($0);function R0(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=Dd(),a=V.useRef({}),[i]=V.useState(()=>L0()),s=A0()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!Fe(p)&&I0("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=V.useState(t.reference),c=C0((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=V.useMemo(()=>({setPositionReference:u}),[]),h=V.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return V.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function j0(n){n===void 0&&(n={});const{nodeId:r}=n,e=R0({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=V.useState(null),[s,l]=V.useState(null),c=(o==null?void 0:o.domReference)||a,f=V.useRef(null),h=Y0();qo(()=>{c&&(f.current=c)},[c]);const p=ju({...n,elements:{...o,...s&&{reference:s}}}),m=V.useCallback(w=>{const k=Fe(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(k),p.refs.setReference(k)},[p.refs]),v=V.useCallback(w=>{(Fe(w)||w===null)&&(f.current=w,i(w)),(Fe(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!Fe(w))&&p.refs.setReference(w)},[p.refs]),g=V.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),x=V.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=V.useMemo(()=>({...p,...t,refs:g,elements:x,nodeId:r}),[p,g,x,r,t]);return qo(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(k=>k.id===r);w&&(w.context=E)}),V.useMemo(()=>({...p,context:E,refs:g,elements:x}),[p,g,x,E])}/*!
|
|
76
|
+
`)),[]});var vm=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(vm||{});function di(n){let r={};for(let e in n)n[e]===!0&&(r[`data-${e}`]="");return r}function fi(n,r,e,t){let[o,a]=d.useState(e),{hasFlag:i,addFlag:s,removeFlag:l}=mm(n&&o?3:0),u=d.useRef(!1),c=d.useRef(!1),f=Qt();return fe(()=>{var h;if(n){if(e&&a(!0),!r){e&&s(3);return}return(h=t==null?void 0:t.start)==null||h.call(t,e),gm(r,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(e?(s(3),l(4)):(s(4),l(2)))},run(){c.current?e?(l(3),s(4)):(l(4),s(3)):e?l(1):s(1)},done(){var p;c.current&&typeof r.getAnimations=="function"&&r.getAnimations().length>0||(u.current=!1,l(7),e||a(!1),(p=t==null?void 0:t.end)==null||p.call(t,e))}})}},[n,e,r,f]),n?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[e,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function gm(n,{prepare:r,run:e,done:t,inFlight:o}){let a=rt();return ym(n,{prepare:r,inFlight:o}),a.nextFrame(()=>{e(),a.requestAnimationFrame(()=>{a.add(bm(n,t))})}),a.dispose}function bm(n,r){var e,t;let o=rt();if(!n)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=(t=(e=n.getAnimations)==null?void 0:e.call(n).filter(s=>s instanceof CSSTransition))!=null?t:[];return i.length===0?(r(),o.dispose):(Promise.allSettled(i.map(s=>s.finished)).then(()=>{a||r()}),o.dispose)}function ym(n,{inFlight:r,prepare:e}){if(r!=null&&r.current){e();return}let t=n.style.transition;n.style.transition="none",e(),n.offsetHeight,n.style.transition=t}function wm(n,{container:r,accept:e,walk:t}){let o=d.useRef(e),a=d.useRef(t);d.useEffect(()=>{o.current=e,a.current=t},[e,t]),fe(()=>{if(!r||!n)return;let i=dn(r);if(!i)return;let s=o.current,l=a.current,u=Object.assign(f=>s(f),{acceptNode:s}),c=i.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)l(c.currentNode)},[r,n,o,a])}function wr(n,r){let e=d.useRef([]),t=ee(n);d.useEffect(()=>{let o=[...e.current];for(let[a,i]of r.entries())if(e.current[a]!==i){let s=t(r,o);return e.current=r,s}},[t,...r])}function po(){return typeof window<"u"}function Fn(n){return Eu(n)?(n.nodeName||"").toLowerCase():"#document"}function Ze(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function mt(n){var r;return(r=(Eu(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Eu(n){return po()?n instanceof Node||n instanceof Ze(n).Node:!1}function Fe(n){return po()?n instanceof Element||n instanceof Ze(n).Element:!1}function vt(n){return po()?n instanceof HTMLElement||n instanceof Ze(n).HTMLElement:!1}function Du(n){return!po()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ze(n).ShadowRoot}function xr(n){const{overflow:r,overflowX:e,overflowY:t,display:o}=at(n);return/auto|scroll|overlay|hidden|clip/.test(r+t+e)&&!["inline","contents"].includes(o)}function xm(n){return["table","td","th"].includes(Fn(n))}function ho(n){return[":popover-open",":modal"].some(r=>{try{return n.matches(r)}catch{return!1}})}function pi(n){const r=hi(),e=Fe(n)?at(n):n;return["transform","translate","scale","rotate","perspective"].some(t=>e[t]?e[t]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!r&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!r&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(t=>(e.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(e.contain||"").includes(t))}function Em(n){let r=Jt(n);for(;vt(r)&&!$n(r);){if(pi(r))return r;if(ho(r))return null;r=Jt(r)}return null}function hi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $n(n){return["html","body","#document"].includes(Fn(n))}function at(n){return Ze(n).getComputedStyle(n)}function mo(n){return Fe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Jt(n){if(Fn(n)==="html")return n;const r=n.assignedSlot||n.parentNode||Du(n)&&n.host||mt(n);return Du(r)?r.host:r}function Su(n){const r=Jt(n);return $n(r)?n.ownerDocument?n.ownerDocument.body:n.body:vt(r)&&xr(r)?r:Su(r)}function Er(n,r,e){var t;r===void 0&&(r=[]),e===void 0&&(e=!0);const o=Su(n),a=o===((t=n.ownerDocument)==null?void 0:t.body),i=Ze(o);if(a){const s=mi(i);return r.concat(i,i.visualViewport||[],xr(o)?o:[],s&&e?Er(s):[])}return r.concat(o,Er(o,[],e))}function mi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Dm(){const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(r=>{let{brand:e,version:t}=r;return e+"/"+t}).join(" "):navigator.userAgent}const At=Math.min,Ue=Math.max,Dr=Math.round,vo=Math.floor,gt=n=>({x:n,y:n}),Sm={left:"right",right:"left",bottom:"top",top:"bottom"},km={start:"end",end:"start"};function vi(n,r,e){return Ue(n,At(r,e))}function pn(n,r){return typeof n=="function"?n(r):n}function Zt(n){return n.split("-")[0]}function An(n){return n.split("-")[1]}function ku(n){return n==="x"?"y":"x"}function gi(n){return n==="y"?"height":"width"}function hn(n){return["top","bottom"].includes(Zt(n))?"y":"x"}function bi(n){return ku(hn(n))}function _m(n,r,e){e===void 0&&(e=!1);const t=An(n),o=bi(n),a=gi(o);let i=o==="x"?t===(e?"end":"start")?"right":"left":t==="start"?"bottom":"top";return r.reference[a]>r.floating[a]&&(i=go(i)),[i,go(i)]}function Cm(n){const r=go(n);return[yi(n),r,yi(r)]}function yi(n){return n.replace(/start|end/g,r=>km[r])}function Om(n,r,e){const t=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(n){case"top":case"bottom":return e?r?o:t:r?t:o;case"left":case"right":return r?a:i;default:return[]}}function Mm(n,r,e,t){const o=An(n);let a=Om(Zt(n),e==="start",t);return o&&(a=a.map(i=>i+"-"+o),r&&(a=a.concat(a.map(yi)))),a}function go(n){return n.replace(/left|right|bottom|top/g,r=>Sm[r])}function Tm(n){return{top:0,right:0,bottom:0,left:0,...n}}function _u(n){return typeof n!="number"?Tm(n):{top:n,right:n,bottom:n,left:n}}function bo(n){const{x:r,y:e,width:t,height:o}=n;return{width:t,height:o,top:e,left:r,right:r+t,bottom:e+o,x:r,y:e}}function Cu(n,r,e){let{reference:t,floating:o}=n;const a=hn(r),i=bi(r),s=gi(i),l=Zt(r),u=a==="y",c=t.x+t.width/2-o.width/2,f=t.y+t.height/2-o.height/2,h=t[s]/2-o[s]/2;let p;switch(l){case"top":p={x:c,y:t.y-o.height};break;case"bottom":p={x:c,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:f};break;case"left":p={x:t.x-o.width,y:f};break;default:p={x:t.x,y:t.y}}switch(An(r)){case"start":p[i]-=h*(e&&u?-1:1);break;case"end":p[i]+=h*(e&&u?-1:1);break}return p}const Pm=async(n,r,e)=>{const{placement:t="bottom",strategy:o="absolute",middleware:a=[],platform:i}=e,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(r));let u=await i.getElementRects({reference:n,floating:r,strategy:o}),{x:c,y:f}=Cu(u,t,l),h=t,p={},m=0;for(let v=0;v<s.length;v++){const{name:g,fn:x}=s[v],{x:E,y:w,data:k,reset:D}=await x({x:c,y:f,initialPlacement:t,placement:h,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:n,floating:r}});c=E??c,f=w??f,p={...p,[g]:{...p[g],...k}},D&&m<=50&&(m++,typeof D=="object"&&(D.placement&&(h=D.placement),D.rects&&(u=D.rects===!0?await i.getElementRects({reference:n,floating:r,strategy:o}):D.rects),{x:c,y:f}=Cu(u,h,l)),v=-1)}return{x:c,y:f,placement:h,strategy:o,middlewareData:p}};async function yo(n,r){var e;r===void 0&&(r={});const{x:t,y:o,platform:a,rects:i,elements:s,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=pn(r,n),m=_u(p),g=s[h?f==="floating"?"reference":"floating":f],x=bo(await a.getClippingRect({element:(e=await(a.isElement==null?void 0:a.isElement(g)))==null||e?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:t,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),k=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},D=bo(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:w,strategy:l}):E);return{top:(x.top-D.top+m.top)/k.y,bottom:(D.bottom-x.bottom+m.bottom)/k.y,left:(x.left-D.left+m.left)/k.x,right:(D.right-x.right+m.right)/k.x}}const Im=n=>({name:"arrow",options:n,async fn(r){const{x:e,y:t,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=r,{element:u,padding:c=0}=pn(n,r)||{};if(u==null)return{};const f=_u(c),h={x:e,y:t},p=bi(o),m=gi(p),v=await i.getDimensions(u),g=p==="y",x=g?"top":"left",E=g?"bottom":"right",w=g?"clientHeight":"clientWidth",k=a.reference[m]+a.reference[p]-h[p]-a.floating[m],D=h[p]-a.reference[p],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let $=T?T[w]:0;(!$||!await(i.isElement==null?void 0:i.isElement(T)))&&($=s.floating[w]||a.floating[m]);const _=k/2-D/2,C=$/2-v[m]/2-1,O=At(f[x],C),R=At(f[E],C),b=O,S=$-v[m]-R,L=$/2-v[m]/2+_,P=vi(b,L,S),N=!l.arrow&&An(o)!=null&&L!==P&&a.reference[m]/2-(L<b?O:R)-v[m]/2<0,z=N?L<b?L-b:L-S:0;return{[p]:h[p]+z,data:{[p]:P,centerOffset:L-P-z,...N&&{alignmentOffset:z}},reset:N}}}),Nm=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var e,t;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=r,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=pn(n,r);if((e=a.arrow)!=null&&e.alignmentOffset)return{};const x=Zt(o),E=hn(s),w=Zt(s)===s,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),D=h||(w||!v?[go(s)]:Cm(s)),T=m!=="none";!h&&T&&D.push(...Mm(s,v,m,k));const $=[s,...D],_=await yo(r,g),C=[];let O=((t=a.flip)==null?void 0:t.overflows)||[];if(c&&C.push(_[x]),f){const L=_m(o,i,k);C.push(_[L[0]],_[L[1]])}if(O=[...O,{placement:o,overflows:C}],!C.every(L=>L<=0)){var R,b;const L=(((R=a.flip)==null?void 0:R.index)||0)+1,P=$[L];if(P)return{data:{index:L,overflows:O},reset:{placement:P}};let N=(b=O.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:b.placement;if(!N)switch(p){case"bestFit":{var S;const z=(S=O.filter(I=>{if(T){const te=hn(I.placement);return te===E||te==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(te=>te>0).reduce((te,M)=>te+M,0)]).sort((I,te)=>I[1]-te[1])[0])==null?void 0:S[0];z&&(N=z);break}case"initialPlacement":N=s;break}if(o!==N)return{reset:{placement:N}}}return{}}}};async function Lm(n,r){const{placement:e,platform:t,elements:o}=n,a=await(t.isRTL==null?void 0:t.isRTL(o.floating)),i=Zt(e),s=An(e),l=hn(e)==="y",u=["left","top"].includes(i)?-1:1,c=a&&l?-1:1,f=pn(r,n);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const Fm=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var e,t;const{x:o,y:a,placement:i,middlewareData:s}=r,l=await Lm(r,n);return i===((e=s.offset)==null?void 0:e.placement)&&(t=s.arrow)!=null&&t.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},$m=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:e,y:t,placement:o}=r,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:g=>{let{x,y:E}=g;return{x,y:E}}},...l}=pn(n,r),u={x:e,y:t},c=await yo(r,l),f=hn(Zt(o)),h=ku(f);let p=u[h],m=u[f];if(a){const g=h==="y"?"top":"left",x=h==="y"?"bottom":"right",E=p+c[g],w=p-c[x];p=vi(E,p,w)}if(i){const g=f==="y"?"top":"left",x=f==="y"?"bottom":"right",E=m+c[g],w=m-c[x];m=vi(E,m,w)}const v=s.fn({...r,[h]:p,[f]:m});return{...v,data:{x:v.x-e,y:v.y-t,enabled:{[h]:a,[f]:i}}}}}},Am=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){var e,t;const{placement:o,rects:a,platform:i,elements:s}=r,{apply:l=()=>{},...u}=pn(n,r),c=await yo(r,u),f=Zt(o),h=An(o),p=hn(o)==="y",{width:m,height:v}=a.floating;let g,x;f==="top"||f==="bottom"?(g=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(x=f,g=h==="end"?"top":"bottom");const E=v-c.top-c.bottom,w=m-c.left-c.right,k=At(v-c[g],E),D=At(m-c[x],w),T=!r.middlewareData.shift;let $=k,_=D;if((e=r.middlewareData.shift)!=null&&e.enabled.x&&(_=w),(t=r.middlewareData.shift)!=null&&t.enabled.y&&($=E),T&&!h){const O=Ue(c.left,0),R=Ue(c.right,0),b=Ue(c.top,0),S=Ue(c.bottom,0);p?_=m-2*(O!==0||R!==0?O+R:Ue(c.left,c.right)):$=v-2*(b!==0||S!==0?b+S:Ue(c.top,c.bottom))}await l({...r,availableWidth:_,availableHeight:$});const C=await i.getDimensions(s.floating);return m!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}};function Ou(n){const r=at(n);let e=parseFloat(r.width)||0,t=parseFloat(r.height)||0;const o=vt(n),a=o?n.offsetWidth:e,i=o?n.offsetHeight:t,s=Dr(e)!==a||Dr(t)!==i;return s&&(e=a,t=i),{width:e,height:t,$:s}}function wi(n){return Fe(n)?n:n.contextElement}function Yn(n){const r=wi(n);if(!vt(r))return gt(1);const e=r.getBoundingClientRect(),{width:t,height:o,$:a}=Ou(r);let i=(a?Dr(e.width):e.width)/t,s=(a?Dr(e.height):e.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const Ym=gt(0);function Mu(n){const r=Ze(n);return!hi()||!r.visualViewport?Ym:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function Rm(n,r,e){return r===void 0&&(r=!1),!e||r&&e!==Ze(n)?!1:r}function mn(n,r,e,t){r===void 0&&(r=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),a=wi(n);let i=gt(1);r&&(t?Fe(t)&&(i=Yn(t)):i=Yn(n));const s=Rm(a,e,t)?Mu(a):gt(0);let l=(o.left+s.x)/i.x,u=(o.top+s.y)/i.y,c=o.width/i.x,f=o.height/i.y;if(a){const h=Ze(a),p=t&&Fe(t)?Ze(t):t;let m=h,v=mi(m);for(;v&&t&&p!==m;){const g=Yn(v),x=v.getBoundingClientRect(),E=at(v),w=x.left+(v.clientLeft+parseFloat(E.paddingLeft))*g.x,k=x.top+(v.clientTop+parseFloat(E.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=w,u+=k,m=Ze(v),v=mi(m)}}return bo({width:c,height:f,x:l,y:u})}function xi(n,r){const e=mo(n).scrollLeft;return r?r.left+e:mn(mt(n)).left+e}function Tu(n,r,e){e===void 0&&(e=!1);const t=n.getBoundingClientRect(),o=t.left+r.scrollLeft-(e?0:xi(n,t)),a=t.top+r.scrollTop;return{x:o,y:a}}function jm(n){let{elements:r,rect:e,offsetParent:t,strategy:o}=n;const a=o==="fixed",i=mt(t),s=r?ho(r.floating):!1;if(t===i||s&&a)return e;let l={scrollLeft:0,scrollTop:0},u=gt(1);const c=gt(0),f=vt(t);if((f||!f&&!a)&&((Fn(t)!=="body"||xr(i))&&(l=mo(t)),vt(t))){const p=mn(t);u=Yn(t),c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}const h=i&&!f&&!a?Tu(i,l,!0):gt(0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:e.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Wm(n){return Array.from(n.getClientRects())}function Hm(n){const r=mt(n),e=mo(n),t=n.ownerDocument.body,o=Ue(r.scrollWidth,r.clientWidth,t.scrollWidth,t.clientWidth),a=Ue(r.scrollHeight,r.clientHeight,t.scrollHeight,t.clientHeight);let i=-e.scrollLeft+xi(n);const s=-e.scrollTop;return at(t).direction==="rtl"&&(i+=Ue(r.clientWidth,t.clientWidth)-o),{width:o,height:a,x:i,y:s}}function Bm(n,r){const e=Ze(n),t=mt(n),o=e.visualViewport;let a=t.clientWidth,i=t.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const u=hi();(!u||u&&r==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}function Vm(n,r){const e=mn(n,!0,r==="fixed"),t=e.top+n.clientTop,o=e.left+n.clientLeft,a=vt(n)?Yn(n):gt(1),i=n.clientWidth*a.x,s=n.clientHeight*a.y,l=o*a.x,u=t*a.y;return{width:i,height:s,x:l,y:u}}function Pu(n,r,e){let t;if(r==="viewport")t=Bm(n,e);else if(r==="document")t=Hm(mt(n));else if(Fe(r))t=Vm(r,e);else{const o=Mu(n);t={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return bo(t)}function Iu(n,r){const e=Jt(n);return e===r||!Fe(e)||$n(e)?!1:at(e).position==="fixed"||Iu(e,r)}function zm(n,r){const e=r.get(n);if(e)return e;let t=Er(n,[],!1).filter(s=>Fe(s)&&Fn(s)!=="body"),o=null;const a=at(n).position==="fixed";let i=a?Jt(n):n;for(;Fe(i)&&!$n(i);){const s=at(i),l=pi(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xr(i)&&!l&&Iu(n,i))?t=t.filter(c=>c!==i):o=s,i=Jt(i)}return r.set(n,t),t}function qm(n){let{element:r,boundary:e,rootBoundary:t,strategy:o}=n;const i=[...e==="clippingAncestors"?ho(r)?[]:zm(r,this._c):[].concat(e),t],s=i[0],l=i.reduce((u,c)=>{const f=Pu(r,c,o);return u.top=Ue(f.top,u.top),u.right=At(f.right,u.right),u.bottom=At(f.bottom,u.bottom),u.left=Ue(f.left,u.left),u},Pu(r,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Um(n){const{width:r,height:e}=Ou(n);return{width:r,height:e}}function Qm(n,r,e){const t=vt(r),o=mt(r),a=e==="fixed",i=mn(n,!0,a,r);let s={scrollLeft:0,scrollTop:0};const l=gt(0);if(t||!t&&!a)if((Fn(r)!=="body"||xr(o))&&(s=mo(r)),t){const h=mn(r,!0,a,r);l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}else o&&(l.x=xi(o));const u=o&&!t&&!a?Tu(o,s):gt(0),c=i.left+s.scrollLeft-l.x-u.x,f=i.top+s.scrollTop-l.y-u.y;return{x:c,y:f,width:i.width,height:i.height}}function Ei(n){return at(n).position==="static"}function Nu(n,r){if(!vt(n)||at(n).position==="fixed")return null;if(r)return r(n);let e=n.offsetParent;return mt(n)===e&&(e=e.ownerDocument.body),e}function Lu(n,r){const e=Ze(n);if(ho(n))return e;if(!vt(n)){let o=Jt(n);for(;o&&!$n(o);){if(Fe(o)&&!Ei(o))return o;o=Jt(o)}return e}let t=Nu(n,r);for(;t&&xm(t)&&Ei(t);)t=Nu(t,r);return t&&$n(t)&&Ei(t)&&!pi(t)?e:t||Em(n)||e}const Gm=async function(n){const r=this.getOffsetParent||Lu,e=this.getDimensions,t=await e(n.floating);return{reference:Qm(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function Km(n){return at(n).direction==="rtl"}const Xm={convertOffsetParentRelativeRectToViewportRelativeRect:jm,getDocumentElement:mt,getClippingRect:qm,getOffsetParent:Lu,getElementRects:Gm,getClientRects:Wm,getDimensions:Um,getScale:Yn,isElement:Fe,isRTL:Km};function Fu(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function Jm(n,r){let e=null,t;const o=mt(n);function a(){var s;clearTimeout(t),(s=e)==null||s.disconnect(),e=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=n.getBoundingClientRect(),{left:c,top:f,width:h,height:p}=u;if(s||r(),!h||!p)return;const m=vo(f),v=vo(o.clientWidth-(c+h)),g=vo(o.clientHeight-(f+p)),x=vo(c),w={rootMargin:-m+"px "+-v+"px "+-g+"px "+-x+"px",threshold:Ue(0,At(1,l))||1};let k=!0;function D(T){const $=T[0].intersectionRatio;if($!==l){if(!k)return i();$?i(!1,$):t=setTimeout(()=>{i(!1,1e-7)},1e3)}$===1&&!Fu(u,n.getBoundingClientRect())&&i(),k=!1}try{e=new IntersectionObserver(D,{...w,root:o.ownerDocument})}catch{e=new IntersectionObserver(D,w)}e.observe(n)}return i(!0),a}function $u(n,r,e,t){t===void 0&&(t={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=t,u=wi(n),c=o||a?[...u?Er(u):[],...Er(r)]:[];c.forEach(x=>{o&&x.addEventListener("scroll",e,{passive:!0}),a&&x.addEventListener("resize",e)});const f=u&&s?Jm(u,e):null;let h=-1,p=null;i&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===u&&p&&(p.unobserve(r),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(r)})),e()}),u&&!l&&p.observe(u),p.observe(r));let m,v=l?mn(n):null;l&&g();function g(){const x=mn(n);v&&!Fu(v,x)&&e(),v=x,m=requestAnimationFrame(g)}return e(),()=>{var x;c.forEach(E=>{o&&E.removeEventListener("scroll",e),a&&E.removeEventListener("resize",e)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Di=yo,Zm=Fm,ev=$m,tv=Nm,nv=Am,Au=Im,rv=(n,r,e)=>{const t=new Map,o={platform:Xm,...e},a={...o.platform,_c:t};return Pm(n,r,{...o,platform:a})};var wo=typeof document<"u"?d.useLayoutEffect:d.useEffect;function xo(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let e,t,o;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(e=n.length,e!==r.length)return!1;for(t=e;t--!==0;)if(!xo(n[t],r[t]))return!1;return!0}if(o=Object.keys(n),e=o.length,e!==Object.keys(r).length)return!1;for(t=e;t--!==0;)if(!{}.hasOwnProperty.call(r,o[t]))return!1;for(t=e;t--!==0;){const a=o[t];if(!(a==="_owner"&&n.$$typeof)&&!xo(n[a],r[a]))return!1}return!0}return n!==n&&r!==r}function Yu(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ru(n,r){const e=Yu(n);return Math.round(r*e)/e}function Si(n){const r=V.useRef(n);return wo(()=>{r.current=n}),r}function ju(n){n===void 0&&(n={});const{placement:r="bottom",strategy:e="absolute",middleware:t=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=n,[c,f]=V.useState({x:0,y:0,strategy:e,placement:r,middlewareData:{},isPositioned:!1}),[h,p]=V.useState(t);xo(h,t)||p(t);const[m,v]=V.useState(null),[g,x]=V.useState(null),E=V.useCallback(I=>{I!==T.current&&(T.current=I,v(I))},[]),w=V.useCallback(I=>{I!==$.current&&($.current=I,x(I))},[]),k=a||m,D=i||g,T=V.useRef(null),$=V.useRef(null),_=V.useRef(c),C=l!=null,O=Si(l),R=Si(o),b=Si(u),S=V.useCallback(()=>{if(!T.current||!$.current)return;const I={placement:r,strategy:e,middleware:h};R.current&&(I.platform=R.current),rv(T.current,$.current,I).then(te=>{const M={...te,isPositioned:b.current!==!1};L.current&&!xo(_.current,M)&&(_.current=M,Hr.flushSync(()=>{f(M)}))})},[h,r,e,R,b]);wo(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(I=>({...I,isPositioned:!1})))},[u]);const L=V.useRef(!1);wo(()=>(L.current=!0,()=>{L.current=!1}),[]),wo(()=>{if(k&&(T.current=k),D&&($.current=D),k&&D){if(O.current)return O.current(k,D,S);S()}},[k,D,S,O,C]);const P=V.useMemo(()=>({reference:T,floating:$,setReference:E,setFloating:w}),[E,w]),N=V.useMemo(()=>({reference:k,floating:D}),[k,D]),z=V.useMemo(()=>{const I={position:e,left:0,top:0};if(!N.floating)return I;const te=Ru(N.floating,c.x),M=Ru(N.floating,c.y);return s?{...I,transform:"translate("+te+"px, "+M+"px)",...Yu(N.floating)>=1.5&&{willChange:"transform"}}:{position:e,left:te,top:M}},[e,s,N.floating,c.x,c.y]);return V.useMemo(()=>({...c,update:S,refs:P,elements:N,floatingStyles:z}),[c,S,P,N,z])}const ov=n=>{function r(e){return{}.hasOwnProperty.call(e,"current")}return{name:"arrow",options:n,fn(e){const{element:t,padding:o}=typeof n=="function"?n(e):n;return t&&r(t)?t.current!=null?Au({element:t.current,padding:o}).fn(e):{}:t?Au({element:t,padding:o}).fn(e):{}}}},ki=(n,r)=>({...Zm(n),options:[n,r]}),av=(n,r)=>({...ev(n),options:[n,r]}),Wu=(n,r)=>({...tv(n),options:[n,r]}),iv=(n,r)=>({...nv(n),options:[n,r]}),sv=(n,r)=>({...ov(n),options:[n,r]}),Hu={...V},lv=Hu.useInsertionEffect||(n=>n());function Bu(n){const r=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return lv(()=>{r.current=n}),V.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}var _i=typeof document<"u"?d.useLayoutEffect:d.useEffect;let Vu=!1,uv=0;const zu=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+uv++;function cv(){const[n,r]=V.useState(()=>Vu?zu():void 0);return _i(()=>{n==null&&r(zu())},[]),V.useEffect(()=>{Vu=!0},[]),n}const dv=Hu.useId||cv;let Sr;process.env.NODE_ENV!=="production"&&(Sr=new Set);function fv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Sr)!=null&&n.has(o))){var a;(a=Sr)==null||a.add(o),console.warn(o)}}function pv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Sr)!=null&&n.has(o))){var a;(a=Sr)==null||a.add(o),console.error(o)}}function hv(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.set(r,[...n.get(r)||[],e])},off(r,e){var t;n.set(r,((t=n.get(r))==null?void 0:t.filter(o=>o!==e))||[])}}}const mv=V.createContext(null),vv=V.createContext(null),gv=()=>{var n;return((n=V.useContext(mv))==null?void 0:n.id)||null},bv=()=>V.useContext(vv),yv="data-floating-ui-focusable";function wv(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=dv(),a=V.useRef({}),[i]=V.useState(()=>hv()),s=gv()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!Fe(p)&&pv("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=V.useState(t.reference),c=Bu((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=V.useMemo(()=>({setPositionReference:u}),[]),h=V.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return V.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function xv(n){n===void 0&&(n={});const{nodeId:r}=n,e=wv({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=V.useState(null),[s,l]=V.useState(null),c=(o==null?void 0:o.domReference)||a,f=V.useRef(null),h=bv();_i(()=>{c&&(f.current=c)},[c]);const p=ju({...n,elements:{...o,...s&&{reference:s}}}),m=V.useCallback(w=>{const k=Fe(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;l(k),p.refs.setReference(k)},[p.refs]),v=V.useCallback(w=>{(Fe(w)||w===null)&&(f.current=w,i(w)),(Fe(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!Fe(w))&&p.refs.setReference(w)},[p.refs]),g=V.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),x=V.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=V.useMemo(()=>({...p,...t,refs:g,elements:x,nodeId:r}),[p,g,x,r,t]);return _i(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(k=>k.id===r);w&&(w.context=E)}),V.useMemo(()=>({...p,context:E,refs:g,elements:x}),[p,g,x,E])}const qu="active",Uu="selected";function Ci(n,r,e){const t=new Map,o=e==="item";let a=n;if(o&&n){const{[qu]:i,[Uu]:s,...l}=n;a=l}return{...e==="floating"&&{tabIndex:-1,[yv]:""},...a,...r.map(i=>{const s=i?i[e]:null;return typeof s=="function"?n?s(n):null:s}).concat(n).reduce((i,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(o&&[qu,Uu].includes(u)))if(u.indexOf("on")===0){if(t.has(u)||t.set(u,[]),typeof c=="function"){var f;(f=t.get(u))==null||f.push(c),i[u]=function(){for(var h,p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return(h=t.get(u))==null?void 0:h.map(g=>g(...m)).find(g=>g!==void 0)}}}else i[u]=c}),i),{})}}function Ev(n){n===void 0&&(n=[]);const r=n.map(s=>s==null?void 0:s.reference),e=n.map(s=>s==null?void 0:s.floating),t=n.map(s=>s==null?void 0:s.item),o=V.useCallback(s=>Ci(s,n,"reference"),r),a=V.useCallback(s=>Ci(s,n,"floating"),e),i=V.useCallback(s=>Ci(s,n,"item"),t);return V.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}function Qu(n,r){return{...n,rects:{...n.rects,floating:{...n.rects.floating,height:r}}}}const Dv=n=>({name:"inner",options:n,async fn(r){const{listRef:e,overflowRef:t,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:s=4,referenceOverflowThreshold:l=0,scrollRef:u,...c}=pn(n,r),{rects:f,elements:{floating:h}}=r,p=e.current[i],m=(u==null?void 0:u.current)||h,v=h.clientTop||m.clientTop,g=h.clientTop!==0,x=m.clientTop!==0,E=h===m;if(process.env.NODE_ENV!=="production"&&(r.placement.startsWith("bottom")||fv('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...r,...await ki(-p.offsetTop-h.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(r)},k=await Di(Qu(w,m.scrollHeight+v+h.clientTop),c),D=await Di(w,{...c,elementContext:"reference"}),T=Ue(0,k.top),$=w.y+T,O=(m.scrollHeight>m.clientHeight?R=>R:Dr)(Ue(0,m.scrollHeight+(g&&E||x?v*2:0)-T-Ue(0,k.bottom)));if(m.style.maxHeight=O+"px",m.scrollTop=T,o){const R=m.offsetHeight<p.offsetHeight*At(s,e.current.length)-1||D.top>=-l||D.bottom>=-l;Hr.flushSync(()=>o(R))}return t&&(t.current=await Di(Qu({...w,y:$},m.offsetHeight+v+h.clientTop),c)),{y:$}}});function Sv(n,r){const{open:e,elements:t}=n,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:s}=r,l=Bu(s),u=V.useRef(!1),c=V.useRef(null),f=V.useRef(null);V.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!m||a.current==null)return;const g=v.deltaY,x=a.current.top>=-.5,E=a.current.bottom>=-.5,w=m.scrollHeight-m.clientHeight,k=g<0?-1:1,D=g<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&g>0||!E&&g<0?(v.preventDefault(),Hr.flushSync(()=>{l(T=>T+Math[D](g,w*k))})):/firefox/i.test(Dm())&&(m.scrollTop+=g))}const m=(i==null?void 0:i.current)||t.floating;if(e&&m)return m.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=m.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{c.current=null,f.current=null,m.removeEventListener("wheel",p)}},[o,e,t.floating,a,i,l]);const h=V.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(i==null?void 0:i.current)||t.floating;if(!(!a.current||!p||!u.current)){if(c.current!==null){const m=p.scrollTop-c.current;(a.current.bottom<-.5&&m<-1||a.current.top<-.5&&m>1)&&Hr.flushSync(()=>l(v=>v+m))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[t.floating,l,a,i]);return V.useMemo(()=>o?{floating:h}:{},[o,h])}let Rn=d.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Rn.displayName="FloatingContext";let Oi=d.createContext(null);Oi.displayName="PlacementContext";function Gu(n){return d.useMemo(()=>n?typeof n=="string"?{to:n}:n:null,[n])}function Ku(){return d.useContext(Rn).setReference}function kv(){return d.useContext(Rn).getReferenceProps}function Xu(){let{getFloatingProps:n,slot:r}=d.useContext(Rn);return d.useCallback((...e)=>Object.assign({},n(...e),{"data-anchor":r.anchor}),[n,r])}function Ju(n=null){n===!1&&(n=null),typeof n=="string"&&(n={to:n});let r=d.useContext(Oi),e=d.useMemo(()=>n,[JSON.stringify(n,(o,a)=>{var i;return(i=a==null?void 0:a.outerHTML)!=null?i:a})]);fe(()=>{r==null||r(e??null)},[r,e]);let t=d.useContext(Rn);return d.useMemo(()=>[t.setFloating,n?t.styles:{}],[t.setFloating,n,t.styles])}let Zu=4;function ec({children:n,enabled:r=!0}){let[e,t]=d.useState(null),[o,a]=d.useState(0),i=d.useRef(null),[s,l]=d.useState(null);_v(s);let u=r&&e!==null&&s!==null,{to:c="bottom",gap:f=0,offset:h=0,padding:p=0,inner:m}=Cv(e,s),[v,g="center"]=c.split(" ");fe(()=>{u&&a(0)},[u]);let{refs:x,floatingStyles:E,context:w}=xv({open:u,placement:v==="selection"?g==="center"?"bottom":`bottom-${g}`:g==="center"?`${v}`:`${v}-${g}`,strategy:"absolute",transform:!1,middleware:[ki({mainAxis:v==="selection"?0:f,crossAxis:h}),av({padding:p}),v!=="selection"&&Wu({padding:p}),v==="selection"&&m?Dv({...m,padding:p,overflowRef:i,offset:o,minItemsVisible:Zu,referenceOverflowThreshold:p,onFallbackChange(R){var b,S;if(!R)return;let L=w.elements.floating;if(!L)return;let P=parseFloat(getComputedStyle(L).scrollPaddingBottom)||0,N=Math.min(Zu,L.childElementCount),z=0,I=0;for(let te of(S=(b=w.elements.floating)==null?void 0:b.childNodes)!=null?S:[])if(Ke(te)){let M=te.offsetTop,j=M+te.clientHeight+P,Q=L.scrollTop,W=Q+L.clientHeight;if(M>=Q&&j<=W)N--;else{I=Math.max(0,Math.min(j,W)-Math.max(M,Q)),z=te.clientHeight;break}}N>=1&&a(te=>{let M=z*N-I+P;return te>=M?te:M})}}):null,iv({padding:p,apply({availableWidth:R,availableHeight:b,elements:S}){Object.assign(S.floating.style,{overflow:"auto",maxWidth:`${R}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${b}px)`})}})].filter(Boolean),whileElementsMounted:$u}),[k=v,D=g]=w.placement.split("-");v==="selection"&&(k="selection");let T=d.useMemo(()=>({anchor:[k,D].filter(Boolean).join(" ")}),[k,D]),$=Sv(w,{overflowRef:i,onChange:a}),{getReferenceProps:_,getFloatingProps:C}=Ev([$]),O=ee(R=>{l(R),x.setFloating(R)});return V.createElement(Oi.Provider,{value:t},V.createElement(Rn.Provider,{value:{setFloating:O,setReference:x.setReference,styles:E,getReferenceProps:_,getFloatingProps:C,slot:T}},n))}function _v(n){fe(()=>{if(!n)return;let r=new MutationObserver(()=>{let e=window.getComputedStyle(n).maxHeight,t=parseFloat(e);if(isNaN(t))return;let o=parseInt(e);isNaN(o)||t!==o&&(n.style.maxHeight=`${Math.ceil(t)}px`)});return r.observe(n,{attributes:!0,attributeFilter:["style"]}),()=>{r.disconnect()}},[n])}function Cv(n,r){var e,t,o;let a=Mi((e=n==null?void 0:n.gap)!=null?e:"var(--anchor-gap, 0)",r),i=Mi((t=n==null?void 0:n.offset)!=null?t:"var(--anchor-offset, 0)",r),s=Mi((o=n==null?void 0:n.padding)!=null?o:"var(--anchor-padding, 0)",r);return{...n,gap:a,offset:i,padding:s}}function Mi(n,r,e=void 0){let t=Qt(),o=ee((l,u)=>{if(l==null)return[e,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!u)return[e,null];let c=nc(l,u);return[c,f=>{let h=tc(l);{let p=h.map(m=>window.getComputedStyle(u).getPropertyValue(m));t.requestAnimationFrame(function m(){t.nextFrame(m);let v=!1;for(let[x,E]of h.entries()){let w=window.getComputedStyle(u).getPropertyValue(E);if(p[x]!==w){p[x]=w,v=!0;break}}if(!v)return;let g=nc(l,u);c!==g&&(f(g),c=g)})}return t.dispose}]}return[e,null]}),a=d.useMemo(()=>o(n,r)[0],[n,r]),[i=a,s]=d.useState();return fe(()=>{let[l,u]=o(n,r);if(s(l),!!u)return u(s)},[n,r]),i}function tc(n){let r=/var\((.*)\)/.exec(n);if(r){let e=r[1].indexOf(",");if(e===-1)return[r[1]];let t=r[1].slice(0,e).trim(),o=r[1].slice(e+1).trim();return o?[t,...tc(o)]:[t]}return[]}function nc(n,r){let e=document.createElement("div");r.appendChild(e),e.style.setProperty("margin-top","0px","important"),e.style.setProperty("margin-top",n,"important");let t=parseFloat(window.getComputedStyle(e).marginTop)||0;return r.removeChild(e),t}function Ov({children:n,freeze:r}){let e=Eo(r,n);return d.createElement(d.Fragment,null,e)}function Eo(n,r){let[e,t]=d.useState(r);return!n&&e!==r&&t(r),n?e:r}let Do=d.createContext(null);Do.displayName="OpenClosedContext";var He=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(He||{});function jn(){return d.useContext(Do)}function Ti({value:n,children:r}){return d.createElement(Do.Provider,{value:n},r)}function Mv({children:n}){return d.createElement(Do.Provider,{value:null},n)}function Tv(n){function r(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}let bt=[];Tv(()=>{function n(r){if(!Nt(r.target)||r.target===document.body||bt[0]===r.target)return;let e=r.target;e=e.closest(fo),bt.unshift(e??r.target),bt=bt.filter(t=>t!=null&&t.isConnected),bt.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function Pv(n){throw new Error("Unexpected object: "+n)}var se=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(se||{});function Wn(n,r){let e=r.resolveItems();if(e.length<=0)return null;let t=r.resolveActiveIndex(),o=t??-1;switch(n.focus){case 0:{for(let a=0;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 1:{o===-1&&(o=e.length);for(let a=o-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 2:{for(let a=o+1;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 3:{for(let a=e.length-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 4:{for(let a=0;a<e.length;++a)if(r.resolveId(e[a],a,e)===n.id)return a;return t}case 5:return null;default:Pv(n)}}var Pi=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(Pi||{});function So(n){let r=ee(n),e=d.useRef(!1);d.useEffect(()=>(e.current=!1,()=>{e.current=!0,ro(()=>{e.current&&r()})}),[r])}function Iv(){let n=typeof document>"u";return"useSyncExternalStore"in V?(r=>r.useSyncExternalStore)(V)(()=>()=>{},()=>!1,()=>!n):!1}function kr(){let n=Iv(),[r,e]=V.useState(cn.isHandoffComplete);return r&&cn.isHandoffComplete===!1&&e(!1),V.useEffect(()=>{r!==!0&&e(!0)},[r]),V.useEffect(()=>cn.handoff(),[]),n?!1:r}let rc=d.createContext(!1);function Nv(){return d.useContext(rc)}function oc(n){return d.createElement(rc.Provider,{value:n.force},n.children)}function Lv(n){let r=Nv(),e=d.useContext(ic),[t,o]=d.useState(()=>{var a;if(!r&&e!==null)return(a=e.current)!=null?a:null;if(cn.isServer)return null;let i=n==null?void 0:n.getElementById("headlessui-portal-root");if(i)return i;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return d.useEffect(()=>{t!==null&&(n!=null&&n.body.contains(t)||n==null||n.body.appendChild(t))},[t,n]),d.useEffect(()=>{r||e!==null&&o(e.current)},[e,o,r]),t}let ac=d.Fragment,Fv=Ce(function(n,r){let{ownerDocument:e=null,...t}=n,o=d.useRef(null),a=Re(vh(p=>{o.current=p}),r),i=Ft(o),s=e??i,l=Lv(s),[u]=d.useState(()=>{var p;return cn.isServer?null:(p=s==null?void 0:s.createElement("div"))!=null?p:null}),c=d.useContext(Ii),f=kr();fe(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),fe(()=>{if(u&&c)return c.register(u)},[c,u]),So(()=>{var p;!l||!u||(qa(u)&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((p=l.parentElement)==null||p.removeChild(l)))});let h=Me();return f?!l||!u?null:Ne.createPortal(h({ourProps:{ref:a},theirProps:t,slot:{},defaultTag:ac,name:"Portal"}),u):null});function $v(n,r){let e=Re(r),{enabled:t=!0,ownerDocument:o,...a}=n,i=Me();return t?d.createElement(Fv,{...a,ownerDocument:o,ref:e}):i({ourProps:{ref:e},theirProps:a,slot:{},defaultTag:ac,name:"Portal"})}let Av=d.Fragment,ic=d.createContext(null);function Yv(n,r){let{target:e,...t}=n,o={ref:Re(r)},a=Me();return d.createElement(ic.Provider,{value:e},a({ourProps:o,theirProps:t,defaultTag:Av,name:"Popover.Group"}))}let Ii=d.createContext(null);function Rv(){let n=d.useContext(Ii),r=d.useRef([]),e=ee(a=>(r.current.push(a),n&&n.register(a),()=>t(a))),t=ee(a=>{let i=r.current.indexOf(a);i!==-1&&r.current.splice(i,1),n&&n.unregister(a)}),o=d.useMemo(()=>({register:e,unregister:t,portals:r}),[e,t,r]);return[r,d.useMemo(()=>function({children:a}){return d.createElement(Ii.Provider,{value:o},a)},[o])]}let jv=Ce($v),sc=Ce(Yv),Ni=Object.assign(jv,{Group:sc});var Wv=Object.defineProperty,Hv=(n,r,e)=>r in n?Wv(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,lc=(n,r,e)=>(Hv(n,typeof r!="symbol"?r+"":r,e),e),de=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(de||{}),et=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(et||{}),en=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(en||{}),uc=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.SetTyping=3]="SetTyping",n[n.RegisterOption=4]="RegisterOption",n[n.UnregisterOption=5]="UnregisterOption",n[n.DefaultToFirstOption=6]="DefaultToFirstOption",n[n.SetActivationTrigger=7]="SetActivationTrigger",n[n.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",n[n.SetInputElement=9]="SetInputElement",n[n.SetButtonElement=10]="SetButtonElement",n[n.SetOptionsElement=11]="SetOptionsElement",n))(uc||{});function Li(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=r(n.options.slice()),o=t.length>0&&t[0].dataRef.current.order!==null?t.sort((i,s)=>i.dataRef.current.order-s.dataRef.current.order):ii(t,i=>i.dataRef.current.domRef.current),a=e?o.indexOf(e):null;return a===-1&&(a=null),{options:o,activeOptionIndex:a}}let Bv={1(n){var r;return(r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(n){var r,e;if((r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===0)return n;if((e=n.dataRef.current)!=null&&e.value){let t=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(t!==-1)return{...n,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...n,comboboxState:0,__demoMode:!1}},3(n,r){return n.isTyping===r.isTyping?n:{...n,isTyping:r.isTyping}},2(n,r){var e,t,o,a;if((e=n.dataRef.current)!=null&&e.disabled||n.optionsElement&&!((t=n.dataRef.current)!=null&&t.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let{options:u,disabled:c}=n.virtual,f=r.focus===se.Specific?r.idx:Wn(r,{resolveItems:()=>u,resolveActiveIndex:()=>{var p,m;return(m=(p=n.activeOptionIndex)!=null?p:u.findIndex(v=>!c(v)))!=null?m:null},resolveDisabled:c,resolveId(){throw new Error("Function not implemented.")}}),h=(o=r.trigger)!=null?o:2;return n.activeOptionIndex===f&&n.activationTrigger===h?n:{...n,activeOptionIndex:f,activationTrigger:h,isTyping:!1,__demoMode:!1}}let i=Li(n);if(i.activeOptionIndex===null){let u=i.options.findIndex(c=>!c.dataRef.current.disabled);u!==-1&&(i.activeOptionIndex=u)}let s=r.focus===se.Specific?r.idx:Wn(r,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),l=(a=r.trigger)!=null?a:2;return n.activeOptionIndex===s&&n.activationTrigger===l?n:{...n,...i,isTyping:!1,activeOptionIndex:s,activationTrigger:l,__demoMode:!1}},4:(n,r)=>{var e,t,o,a;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:[...n.options,r.payload]};let i=r.payload,s=Li(n,u=>(u.push(i),u));n.activeOptionIndex===null&&(o=(t=n.dataRef.current).isSelected)!=null&&o.call(t,r.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let l={...n,...s,activationTrigger:2};return(a=n.dataRef.current)!=null&&a.__demoMode&&n.dataRef.current.value===void 0&&(l.activeOptionIndex=0),l},5:(n,r)=>{var e;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:n.options.filter(o=>o.id!==r.id)};let t=Li(n,o=>{let a=o.findIndex(i=>i.id===r.id);return a!==-1&&o.splice(a,1),o});return{...n,...t,activationTrigger:2}},6:(n,r)=>n.defaultToFirstOption===r.value?n:{...n,defaultToFirstOption:r.value},7:(n,r)=>n.activationTrigger===r.trigger?n:{...n,activationTrigger:r.trigger},8:(n,r)=>{var e,t;if(n.virtual===null)return{...n,virtual:{options:r.options,disabled:(e=r.disabled)!=null?e:()=>!1}};if(n.virtual.options===r.options&&n.virtual.disabled===r.disabled)return n;let o=n.activeOptionIndex;if(n.activeOptionIndex!==null){let a=r.options.indexOf(n.virtual.options[n.activeOptionIndex]);a!==-1?o=a:o=null}return{...n,activeOptionIndex:o,virtual:{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}}},9:(n,r)=>n.inputElement===r.element?n:{...n,inputElement:r.element},10:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},11:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element}},Vv=class df extends Ga{constructor(r){super(r),lc(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Le(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:(e,t)=>(this.send({type:4,payload:{id:e,dataRef:t}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(t.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:e})}),goToOption:(e,t)=>(this.send({type:6,value:!1}),this.send({type:2,...e,trigger:t})),setIsTyping:e=>{this.send({type:3,isTyping:e})},closeCombobox:()=>{var e,t;this.send({type:1}),this.send({type:6,value:!1}),(t=(e=this.state.dataRef.current).onClose)==null||t.call(e)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:e=>{this.send({type:7,trigger:e})},selectActiveOption:()=>{let e=this.selectors.activeOptionIndex(this.state);if(e!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[e]);else{let{dataRef:t}=this.state.options[e];this.actions.onChange(t.current.value)}this.actions.goToOption({focus:se.Specific,idx:e})}},setInputElement:e=>{this.send({type:9,element:e})},setButtonElement:e=>{this.send({type:10,element:e})},setOptionsElement:e=>{this.send({type:11,element:e})}}),lc(this,"selectors",{activeDescendantId:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);if(a!==null)return e.virtual?(o=e.options.find(i=>!i.dataRef.current.disabled&&e.dataRef.current.compare(i.dataRef.current.value,e.virtual.options[a])))==null?void 0:o.id:(t=e.options[a])==null?void 0:t.id},activeOptionIndex:e=>{if(e.defaultToFirstOption&&e.activeOptionIndex===null&&(e.virtual?e.virtual.options.length>0:e.options.length>0)){if(e.virtual){let{options:o,disabled:a}=e.virtual,i=o.findIndex(s=>{var l;return!((l=a==null?void 0:a(s))!=null&&l)});if(i!==-1)return i}let t=e.options.findIndex(o=>!o.dataRef.current.disabled);if(t!==-1)return t}return e.activeOptionIndex},activeOption:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);return a===null?null:e.virtual?e.virtual.options[a??0]:(o=(t=e.options[a])==null?void 0:t.dataRef.current.value)!=null?o:null},isActive:(e,t,o)=>{var a;let i=this.selectors.activeOptionIndex(e);return i===null?!1:e.virtual?i===e.dataRef.current.calculateIndex(t):((a=e.options[i])==null?void 0:a.id)===o},shouldScrollIntoView:(e,t,o)=>!(e.virtual||e.__demoMode||e.comboboxState!==0||e.activationTrigger===0||!this.selectors.isActive(e,t,o))});{let e=this.state.id,t=In.get(null);this.disposables.add(t.on(Ja.Push,o=>{!t.selectors.isTop(o,e)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,virtual:e=null,__demoMode:t=!1}){var o;return new df({id:r,dataRef:{current:{}},comboboxState:t?0:1,isTyping:!1,options:[],virtual:e?{options:e.options,disabled:(o=e.disabled)!=null?o:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:t})}reduce(r,e){return Le(e.type,Bv,r,e)}};const cc=d.createContext(null);function _r(n){let r=d.useContext(cc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,dc),e}return r}function dc({id:n,virtual:r=null,__demoMode:e=!1}){let t=d.useMemo(()=>Vv.new({id:n,virtual:r,__demoMode:e}),[]);return So(()=>t.dispose()),t}let Cr=d.createContext(null);Cr.displayName="ComboboxDataContext";function Hn(n){let r=d.useContext(Cr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Hn),e}return r}let fc=d.createContext(null);function zv(n){let r=_r("VirtualProvider"),e=Hn("VirtualProvider"),{options:t}=e.virtual,o=we(r,p=>p.optionsElement),[a,i]=d.useMemo(()=>{let p=o;if(!p)return[0,0];let m=window.getComputedStyle(p);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[o]),s=Ah({enabled:t.length!==0,scrollPaddingStart:a,scrollPaddingEnd:i,count:t.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[l,u]=d.useState(0);fe(()=>{u(p=>p+1)},[t]);let c=s.getVirtualItems(),f=we(r,p=>p.activationTrigger===en.Pointer),h=we(r,r.selectors.activeOptionIndex);return c.length===0?null:d.createElement(fc.Provider,{value:s},d.createElement("div",{style:{position:"relative",width:"100%",height:`${s.getTotalSize()}px`},ref:p=>{p&&(f||h!==null&&t.length>h&&s.scrollToIndex(h))}},c.map(p=>{var m;return d.createElement(d.Fragment,{key:p.key},d.cloneElement((m=n.children)==null?void 0:m.call(n,{...n.slot,option:t[p.index]}),{key:`${l}-${p.key}`,"data-index":p.index,"aria-setsize":t.length,"aria-posinset":p.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${p.start}px)`,overflowAnchor:"none"}}))})))}let qv=d.Fragment;function Uv(n,r){let e=d.useId(),t=oo(),{value:o,defaultValue:a,onChange:i,form:s,name:l,by:u,invalid:c=!1,disabled:f=t||!1,onClose:h,__demoMode:p=!1,multiple:m=!1,immediate:v=!1,virtual:g=null,nullable:x,...E}=n,w=Il(a),[k=m?[]:void 0,D]=Pl(o,i,w),T=dc({id:e,virtual:g,__demoMode:p}),$=d.useRef({static:!1,hold:!1}),_=Jl(u),C=ee(H=>g?u===null?g.options.indexOf(H):g.options.findIndex(G=>_(G,H)):T.state.options.findIndex(G=>_(G.dataRef.current.value,H))),O=d.useCallback(H=>Le(S.mode,{[et.Multi]:()=>k.some(G=>_(G,H)),[et.Single]:()=>_(k,H)}),[k]),R=we(T,H=>H.virtual),b=ee(()=>h==null?void 0:h()),S=d.useMemo(()=>({__demoMode:p,immediate:v,optionsPropsRef:$,value:k,defaultValue:w,disabled:f,invalid:c,mode:m?et.Multi:et.Single,virtual:g?R:null,onChange:D,isSelected:O,calculateIndex:C,compare:_,onClose:b}),[k,w,f,c,m,D,O,p,T,g,R,b]);fe(()=>{var H;g&&T.send({type:uc.UpdateVirtualConfiguration,options:g.options,disabled:(H=g.disabled)!=null?H:null})},[g,g==null?void 0:g.options,g==null?void 0:g.disabled]),fe(()=>{T.state.dataRef.current=S},[S]);let[L,P,N,z]=we(T,H=>[H.comboboxState,H.buttonElement,H.inputElement,H.optionsElement]),I=In.get(null),te=we(I,d.useCallback(H=>I.selectors.isTop(H,e),[I,e]));li(te,[P,N,z],()=>T.actions.closeCombobox());let M=we(T,T.selectors.activeOptionIndex),j=we(T,T.selectors.activeOption),Q=d.useMemo(()=>({open:L===de.Open,disabled:f,invalid:c,activeIndex:M,activeOption:j,value:k}),[S,f,k,c,j,L]),[W,F]=zl(),ne=r===null?{}:{ref:r},q=d.useCallback(()=>{if(w!==void 0)return D==null?void 0:D(w)},[D,w]),A=Me();return d.createElement(F,{value:W,props:{htmlFor:N==null?void 0:N.id},slot:{open:L===de.Open,disabled:f}},d.createElement(ec,null,d.createElement(Cr.Provider,{value:S},d.createElement(cc.Provider,{value:T},d.createElement(Ti,{value:Le(L,{[de.Open]:He.Open,[de.Closed]:He.Closed})},l!=null&&d.createElement($l,{disabled:f,data:k!=null?{[l]:k}:{},form:s,onReset:q}),A({ourProps:ne,theirProps:E,slot:Q,defaultTag:qv,name:"Combobox"}))))))}let Qv="input";function Gv(n,r){var e,t;let o=_r("Combobox.Input"),a=Hn("Combobox.Input"),i=d.useId(),s=za(),{id:l=s||`headlessui-combobox-input-${i}`,onChange:u,displayValue:c,disabled:f=a.disabled||!1,autoFocus:h=!1,type:p="text",...m}=n,[v]=we(o,F=>[F.inputElement]),g=d.useRef(null),x=Re(g,r,Ku(),o.actions.setInputElement),E=Ft(v),[w,k]=we(o,F=>[F.comboboxState,F.isTyping]),D=Qt(),T=ee(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:se.Nothing})}),$=d.useMemo(()=>{var F;return typeof c=="function"&&a.value!==void 0?(F=c(a.value))!=null?F:"":typeof a.value=="string"?a.value:""},[a.value,c]);wr(([F,ne],[q,A])=>{if(o.state.isTyping)return;let H=g.current;H&&((A===de.Open&&ne===de.Closed||F!==q)&&(H.value=F),requestAnimationFrame(()=>{if(o.state.isTyping||!H||(E==null?void 0:E.activeElement)!==H)return;let{selectionStart:G,selectionEnd:X}=H;Math.abs((X??0)-(G??0))===0&&G===0&&H.setSelectionRange(H.value.length,H.value.length)}))},[$,w,E,k]),wr(([F],[ne])=>{if(F===de.Open&&ne===de.Closed){if(o.state.isTyping)return;let q=g.current;if(!q)return;let A=q.value,{selectionStart:H,selectionEnd:G,selectionDirection:X}=q;q.value="",q.value=A,X!==null?q.setSelectionRange(H,G,X):q.setSelectionRange(H,G)}},[w]);let _=d.useRef(!1),C=ee(()=>{_.current=!0}),O=ee(()=>{D.nextFrame(()=>{_.current=!1})}),R=ee(F=>{switch(o.actions.setIsTyping(!0),F.key){case he.Enter:if(o.state.comboboxState!==de.Open||_.current)return;if(F.preventDefault(),F.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),a.mode===et.Single&&o.actions.closeCombobox();break;case he.ArrowDown:return F.preventDefault(),F.stopPropagation(),Le(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Next}),[de.Closed]:()=>o.actions.openCombobox()});case he.ArrowUp:return F.preventDefault(),F.stopPropagation(),Le(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Previous}),[de.Closed]:()=>{Ne.flushSync(()=>o.actions.openCombobox()),a.value||o.actions.goToOption({focus:se.Last})}});case he.Home:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.PageUp:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.End:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.PageDown:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.Escape:return o.state.comboboxState!==de.Open?void 0:(F.preventDefault(),o.state.optionsElement&&!a.optionsPropsRef.current.static&&F.stopPropagation(),a.mode===et.Single&&a.value===null&&T(),o.actions.closeCombobox());case he.Tab:if(o.state.comboboxState!==de.Open)return;a.mode===et.Single&&o.state.activationTrigger!==en.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),b=ee(F=>{u==null||u(F),a.mode===et.Single&&F.target.value===""&&T(),o.actions.openCombobox()}),S=ee(F=>{var ne,q,A;let H=(ne=F.relatedTarget)!=null?ne:bt.find(G=>G!==F.currentTarget);if(!((q=o.state.optionsElement)!=null&&q.contains(H))&&!((A=o.state.buttonElement)!=null&&A.contains(H))&&o.state.comboboxState===de.Open)return F.preventDefault(),a.mode===et.Single&&a.value===null&&T(),o.actions.closeCombobox()}),L=ee(F=>{var ne,q,A;let H=(ne=F.relatedTarget)!=null?ne:bt.find(G=>G!==F.currentTarget);(q=o.state.buttonElement)!=null&&q.contains(H)||(A=o.state.optionsElement)!=null&&A.contains(H)||a.disabled||a.immediate&&o.state.comboboxState!==de.Open&&D.microTask(()=>{Ne.flushSync(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(en.Focus)})}),P=mr(),N=Hl(),{isFocused:z,focusProps:I}=Wa({autoFocus:h}),{isHovered:te,hoverProps:M}=ja({isDisabled:f}),j=we(o,F=>F.optionsElement),Q=d.useMemo(()=>({open:w===de.Open,disabled:f,invalid:a.invalid,hover:te,focus:z,autofocus:h}),[a,te,z,h,f,a.invalid]),W=pr({ref:x,id:l,role:"combobox",type:p,"aria-controls":j==null?void 0:j.id,"aria-expanded":w===de.Open,"aria-activedescendant":we(o,o.selectors.activeDescendantId),"aria-labelledby":P,"aria-describedby":N,"aria-autocomplete":"list",defaultValue:(t=(e=n.defaultValue)!=null?e:a.defaultValue!==void 0?c==null?void 0:c(a.defaultValue):null)!=null?t:a.defaultValue,disabled:f||void 0,autoFocus:h,onCompositionStart:C,onCompositionEnd:O,onKeyDown:R,onChange:b,onFocus:L,onBlur:S},I,M);return Me()({ourProps:W,theirProps:m,slot:Q,defaultTag:Qv,name:"Combobox.Input"})}let Kv="button";function Xv(n,r){let e=_r("Combobox.Button"),t=Hn("Combobox.Button"),[o,a]=d.useState(null),i=Re(r,a,e.actions.setButtonElement),s=d.useId(),{id:l=`headlessui-combobox-button-${s}`,disabled:u=t.disabled||!1,autoFocus:c=!1,...f}=n,[h,p,m]=we(e,b=>[b.comboboxState,b.inputElement,b.optionsElement]),v=vu(p),g=h===de.Open;mu(g,{trigger:o,action:d.useCallback(b=>{if(o!=null&&o.contains(b.target)||p!=null&&p.contains(b.target))return $t.Ignore;let S=b.target.closest('[role="option"]:not([data-disabled])');return Ke(S)?$t.Select(S):m!=null&&m.contains(b.target)?$t.Ignore:$t.Close},[o,p,m]),close:e.actions.closeCombobox,select:e.actions.selectActiveOption});let x=ee(b=>{switch(b.key){case he.Space:case he.Enter:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&Ne.flushSync(()=>e.actions.openCombobox()),v();return;case he.ArrowDown:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Ne.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.First})),v();return;case he.ArrowUp:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Ne.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.Last})),v();return;case he.Escape:if(e.state.comboboxState!==de.Open)return;b.preventDefault(),e.state.optionsElement&&!t.optionsPropsRef.current.static&&b.stopPropagation(),Ne.flushSync(()=>e.actions.closeCombobox()),v();return;default:return}}),E=ee(b=>{b.preventDefault(),!Rl(b.currentTarget)&&(b.button===Pi.Left&&(e.state.comboboxState===de.Open?e.actions.closeCombobox():e.actions.openCombobox()),v())}),w=mr([l]),{isFocusVisible:k,focusProps:D}=Wa({autoFocus:c}),{isHovered:T,hoverProps:$}=ja({isDisabled:u}),{pressed:_,pressProps:C}=Ml({disabled:u}),O=d.useMemo(()=>({open:h===de.Open,active:_||h===de.Open,disabled:u,invalid:t.invalid,value:t.value,hover:T,focus:k}),[t,T,k,_,u,h]),R=pr({ref:i,id:l,type:gu(n,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":h===de.Open,"aria-labelledby":w,disabled:u||void 0,autoFocus:c,onPointerDown:E,onKeyDown:x},D,$,C);return Me()({ourProps:R,theirProps:f,slot:O,defaultTag:Kv,name:"Combobox.Button"})}let Jv="div",Zv=Gt.RenderStrategy|Gt.Static;function eg(n,r){var e,t,o;let a=d.useId(),{id:i=`headlessui-combobox-options-${a}`,hold:s=!1,anchor:l,portal:u=!1,modal:c=!0,transition:f=!1,...h}=n,p=_r("Combobox.Options"),m=Hn("Combobox.Options"),v=Gu(l);v&&(u=!0);let[g,x]=Ju(v),[E,w]=d.useState(null),k=Xu(),D=Re(r,v?g:null,p.actions.setOptionsElement,w),[T,$,_,C,O]=we(p,X=>[X.comboboxState,X.inputElement,X.buttonElement,X.optionsElement,X.activationTrigger]),R=Ft($||_),b=Ft(C),S=jn(),[L,P]=fi(f,E,S!==null?(S&He.Open)===He.Open:T===de.Open);ri(L,$,p.actions.closeCombobox);let N=m.__demoMode?!1:c&&T===de.Open;ci(N,b);let z=m.__demoMode?!1:c&&T===de.Open;ni(z,{allowed:d.useCallback(()=>[$,_,C],[$,_,C])}),fe(()=>{var X;m.optionsPropsRef.current.static=(X=n.static)!=null?X:!1},[m.optionsPropsRef,n.static]),fe(()=>{m.optionsPropsRef.current.hold=s},[m.optionsPropsRef,s]),wm(T===de.Open,{container:C,accept(X){return X.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:X.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(X){X.setAttribute("role","none")}});let I=mr([_==null?void 0:_.id]),te=d.useMemo(()=>({open:T===de.Open,option:void 0}),[T]),M=ee(()=>{p.actions.setActivationTrigger(en.Pointer)}),j=ee(X=>{X.preventDefault(),p.actions.setActivationTrigger(en.Pointer)}),Q=pr(v?k():{},{"aria-labelledby":I,role:"listbox","aria-multiselectable":m.mode===et.Multi?!0:void 0,id:i,ref:D,style:{...h.style,...x,"--input-width":Ua($,!0).width,"--button-width":Ua(_,!0).width},onWheel:O===en.Pointer?void 0:M,onMouseDown:j,...di(P)}),W=L&&T===de.Closed,F=Eo(W,(e=m.virtual)==null?void 0:e.options),ne=Eo(W,m.value),q=ee(X=>m.compare(ne,X)),A=d.useMemo(()=>{if(!m.virtual)return m;if(F===void 0)throw new Error("Missing `options` in virtual mode");return F!==m.virtual.options?{...m,virtual:{...m.virtual,options:F}}:m},[m,F,(t=m.virtual)==null?void 0:t.options]);m.virtual&&Object.assign(h,{children:d.createElement(Cr.Provider,{value:A},d.createElement(zv,{slot:te},h.children))});let H=Me(),G=d.useMemo(()=>m.mode===et.Multi?m:{...m,isSelected:q},[m,q]);return d.createElement(Ni,{enabled:u?n.static||L:!1,ownerDocument:R},d.createElement(Cr.Provider,{value:G},H({ourProps:Q,theirProps:{...h,children:d.createElement(Ov,{freeze:W},typeof h.children=="function"?(o=h.children)==null?void 0:o.call(h,te):h.children)},slot:te,defaultTag:Jv,features:Zv,visible:L,name:"Combobox.Options"})))}let tg="div";function ng(n,r){var e,t,o;let a=Hn("Combobox.Option"),i=_r("Combobox.Option"),s=d.useId(),{id:l=`headlessui-combobox-option-${s}`,value:u,disabled:c=(o=(t=(e=a.virtual)==null?void 0:e.disabled)==null?void 0:t.call(e,u))!=null?o:!1,order:f=null,...h}=n,[p]=we(i,P=>[P.inputElement]),m=vu(p),v=we(i,d.useCallback(P=>i.selectors.isActive(P,u,l),[u,l])),g=a.isSelected(u),x=d.useRef(null),E=Pt({disabled:c,value:u,domRef:x,order:f}),w=d.useContext(fc),k=Re(r,x,w?w.measureElement:null),D=ee(()=>{i.actions.setIsTyping(!1),i.actions.onChange(u)});fe(()=>i.actions.registerOption(l,E),[E,l]);let T=we(i,d.useCallback(P=>i.selectors.shouldScrollIntoView(P,u,l),[u,l]));fe(()=>{if(T)return rt().requestAnimationFrame(()=>{var P,N;(N=(P=x.current)==null?void 0:P.scrollIntoView)==null||N.call(P,{block:"nearest"})})},[T,x]);let $=ee(P=>{P.preventDefault(),P.button===Pi.Left&&(c||(D(),si()||requestAnimationFrame(()=>m()),a.mode===et.Single&&i.actions.closeCombobox()))}),_=ee(()=>{if(c)return i.actions.goToOption({focus:se.Nothing});let P=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:P})}),C=yu(),O=ee(P=>C.update(P)),R=ee(P=>{if(!C.wasMoved(P)||c||v)return;let N=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:N},en.Pointer)}),b=ee(P=>{C.wasMoved(P)&&(c||v&&(a.optionsPropsRef.current.hold||i.actions.goToOption({focus:se.Nothing})))}),S=d.useMemo(()=>({active:v,focus:v,selected:g,disabled:c}),[v,g,c]),L={id:l,ref:k,role:"option",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,"aria-selected":g,disabled:void 0,onMouseDown:$,onFocus:_,onPointerEnter:O,onMouseEnter:O,onPointerMove:R,onMouseMove:R,onPointerLeave:b,onMouseLeave:b};return Me()({ourProps:L,theirProps:h,slot:S,defaultTag:tg,name:"Combobox.Option"})}let rg=Ce(Uv),og=Ce(Xv),pc=Ce(Gv),ag=uo,hc=Ce(eg),mc=Ce(ng),ig=Object.assign(rg,{Input:pc,Button:og,Label:ag,Options:hc,Option:mc});function sg(n,r=typeof document<"u"?document.defaultView:null,e){let t=br(n,"escape");ui(r,"keydown",o=>{t&&(o.defaultPrevented||o.key===he.Escape&&e(o))})}function lg(){var n;let[r]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[e,t]=d.useState((n=r==null?void 0:r.matches)!=null?n:!1);return fe(()=>{if(!r)return;function o(a){t(a.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),e}function ug({defaultContainers:n=[],portals:r,mainTreeNode:e}={}){let t=Ft(e),o=ee(()=>{var a,i;let s=[];for(let l of n)l!==null&&(It(l)?s.push(l):"current"in l&&It(l.current)&&s.push(l.current));if(r!=null&&r.current)for(let l of r.current)s.push(l);for(let l of(a=t==null?void 0:t.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&It(l)&&l.id!=="headlessui-portal-root"&&(e&&(l.contains(e)||l.contains((i=e==null?void 0:e.getRootNode())==null?void 0:i.host))||s.some(u=>l.contains(u))||s.push(l));return s});return{resolveContainers:o,contains:ee(a=>o().some(i=>i.contains(a)))}}let vc=d.createContext(null);function gc({children:n,node:r}){let[e,t]=d.useState(null),o=bc(r??e);return d.createElement(vc.Provider,{value:o},n,o===null&&d.createElement(hr,{features:Tn.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=dn(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&It(l)&&l!=null&&l.contains(a)){t(l);break}}}}))}function bc(n=null){var r;return(r=d.useContext(vc))!=null?r:n}function Fi(){let n=d.useRef(!1);return fe(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var Or=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(Or||{});function cg(){let n=d.useRef(0);return pu(!0,"keydown",r=>{r.key==="Tab"&&(n.current=r.shiftKey?1:0)},!0),n}function yc(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let r=new Set;for(let e of n.current)It(e.current)&&r.add(e.current);return r}let dg="div";var vn=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(vn||{});function fg(n,r){let e=d.useRef(null),t=Re(e,r),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=n;kr()||(s=0);let u=Ft(e);vg(s,{ownerDocument:u});let c=gg(s,{ownerDocument:u,container:e,initialFocus:o,initialFocusFallback:a});bg(s,{ownerDocument:u,container:e,containers:i,previousActiveElement:c});let f=cg(),h=ee(E=>{if(!Ke(e.current))return;let w=e.current;(k=>k())(()=>{Le(f.current,{[Or.Forwards]:()=>{Nn(w,dt.First,{skipElements:[E.relatedTarget,a]})},[Or.Backwards]:()=>{Nn(w,dt.Last,{skipElements:[E.relatedTarget,a]})}})})}),p=br(!!(s&2),"focus-trap#tab-lock"),m=Qt(),v=d.useRef(!1),g={ref:t,onKeyDown(E){E.key=="Tab"&&(v.current=!0,m.requestAnimationFrame(()=>{v.current=!1}))},onBlur(E){if(!(s&4))return;let w=yc(i);Ke(e.current)&&w.add(e.current);let k=E.relatedTarget;Nt(k)&&k.dataset.headlessuiFocusGuard!=="true"&&(wc(w,k)||(v.current?Nn(e.current,Le(f.current,{[Or.Forwards]:()=>dt.Next,[Or.Backwards]:()=>dt.Previous})|dt.WrapAround,{relativeTo:E.target}):Nt(E.target)&&Lt(E.target)))}},x=Me();return d.createElement(d.Fragment,null,p&&d.createElement(hr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Tn.Focusable}),x({ourProps:g,theirProps:l,defaultTag:dg,name:"FocusTrap"}),p&&d.createElement(hr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Tn.Focusable}))}let pg=Ce(fg),hg=Object.assign(pg,{features:vn});function mg(n=!0){let r=d.useRef(bt.slice());return wr(([e],[t])=>{t===!0&&e===!1&&ro(()=>{r.current.splice(0)}),t===!1&&e===!0&&(r.current=bt.slice())},[n,bt,r]),ee(()=>{var e;return(e=r.current.find(t=>t!=null&&t.isConnected))!=null?e:null})}function vg(n,{ownerDocument:r}){let e=!!(n&8),t=mg(e);wr(()=>{e||(r==null?void 0:r.activeElement)===(r==null?void 0:r.body)&&Lt(t())},[e]),So(()=>{e&&Lt(t())})}function gg(n,{ownerDocument:r,container:e,initialFocus:t,initialFocusFallback:o}){let a=d.useRef(null),i=br(!!(n&1),"focus-trap#initial-focus"),s=Fi();return wr(()=>{if(n===0)return;if(!i){o!=null&&o.current&&Lt(o.current);return}let l=e.current;l&&ro(()=>{if(!s.current)return;let u=r==null?void 0:r.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===u){a.current=u;return}}else if(l.contains(u)){a.current=u;return}if(t!=null&&t.current)Lt(t.current);else{if(n&16){if(Nn(l,dt.First|dt.AutoFocus)!==oi.Error)return}else if(Nn(l,dt.First)!==oi.Error)return;if(o!=null&&o.current&&(Lt(o.current),(r==null?void 0:r.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=r==null?void 0:r.activeElement})},[o,i,n]),a}function bg(n,{ownerDocument:r,container:e,containers:t,previousActiveElement:o}){let a=Fi(),i=!!(n&4);ui(r==null?void 0:r.defaultView,"focus",s=>{if(!i||!a.current)return;let l=yc(t);Ke(e.current)&&l.add(e.current);let u=o.current;if(!u)return;let c=s.target;Ke(c)?wc(l,c)?(o.current=c,Lt(c)):(s.preventDefault(),s.stopPropagation(),Lt(u)):Lt(o.current)},!0)}function wc(n,r){for(let e of n)if(e.contains(r))return!0;return!1}function xc(n){var r;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||((r=n.as)!=null?r:Dc)!==d.Fragment||d.Children.count(n.children)===1}let ko=d.createContext(null);ko.displayName="TransitionContext";var yg=(n=>(n.Visible="visible",n.Hidden="hidden",n))(yg||{});function wg(){let n=d.useContext(ko);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function xg(){let n=d.useContext(_o);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let _o=d.createContext(null);_o.displayName="NestingContext";function Co(n){return"children"in n?Co(n.children):n.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function Ec(n,r){let e=Pt(n),t=d.useRef([]),o=Fi(),a=Qt(),i=ee((p,m=Kt.Hidden)=>{let v=t.current.findIndex(({el:g})=>g===p);v!==-1&&(Le(m,{[Kt.Unmount](){t.current.splice(v,1)},[Kt.Hidden](){t.current[v].state="hidden"}}),a.microTask(()=>{var g;!Co(t)&&o.current&&((g=e.current)==null||g.call(e))}))}),s=ee(p=>{let m=t.current.find(({el:v})=>v===p);return m?m.state!=="visible"&&(m.state="visible"):t.current.push({el:p,state:"visible"}),()=>i(p,Kt.Unmount)}),l=d.useRef([]),u=d.useRef(Promise.resolve()),c=d.useRef({enter:[],leave:[]}),f=ee((p,m,v)=>{l.current.splice(0),r&&(r.chains.current[m]=r.chains.current[m].filter(([g])=>g!==p)),r==null||r.chains.current[m].push([p,new Promise(g=>{l.current.push(g)})]),r==null||r.chains.current[m].push([p,new Promise(g=>{Promise.all(c.current[m].map(([x,E])=>E)).then(()=>g())})]),m==="enter"?u.current=u.current.then(()=>r==null?void 0:r.wait.current).then(()=>v(m)):v(m)}),h=ee((p,m,v)=>{Promise.all(c.current[m].splice(0).map(([g,x])=>x)).then(()=>{var g;(g=l.current.shift())==null||g()}).then(()=>v(m))});return d.useMemo(()=>({children:t,register:s,unregister:i,onStart:f,onStop:h,wait:u,chains:c}),[s,i,t,f,h,c,u])}let Dc=d.Fragment,Sc=Gt.RenderStrategy;function Eg(n,r){var e,t;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:u,enterFrom:c,enterTo:f,entered:h,leave:p,leaveFrom:m,leaveTo:v,...g}=n,[x,E]=d.useState(null),w=d.useRef(null),k=xc(n),D=Re(...k?[w,r,E]:r===null?[]:[r]),T=(e=g.unmount)==null||e?Kt.Unmount:Kt.Hidden,{show:$,appear:_,initial:C}=wg(),[O,R]=d.useState($?"visible":"hidden"),b=xg(),{register:S,unregister:L}=b;fe(()=>S(w),[S,w]),fe(()=>{if(T===Kt.Hidden&&w.current){if($&&O!=="visible"){R("visible");return}return Le(O,{hidden:()=>L(w),visible:()=>S(w)})}},[O,w,S,L,$,T]);let P=kr();fe(()=>{if(k&&P&&O==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,O,P,k]);let N=C&&!_,z=_&&$&&C,I=d.useRef(!1),te=Ec(()=>{I.current||(R("hidden"),L(w))},b),M=ee(A=>{I.current=!0;let H=A?"enter":"leave";te.onStart(w,H,G=>{G==="enter"?a==null||a():G==="leave"&&(s==null||s())})}),j=ee(A=>{let H=A?"enter":"leave";I.current=!1,te.onStop(w,H,G=>{G==="enter"?i==null||i():G==="leave"&&(l==null||l())}),H==="leave"&&!Co(te)&&(R("hidden"),L(w))});d.useEffect(()=>{k&&o||(M($),j($))},[$,k,o]);let Q=!(!o||!k||!P||N),[,W]=fi(Q,x,$,{start:M,end:j}),F=Xt({ref:D,className:((t=Ba(g.className,z&&u,z&&c,W.enter&&u,W.enter&&W.closed&&c,W.enter&&!W.closed&&f,W.leave&&p,W.leave&&!W.closed&&m,W.leave&&W.closed&&v,!W.transition&&$&&h))==null?void 0:t.trim())||void 0,...di(W)}),ne=0;O==="visible"&&(ne|=He.Open),O==="hidden"&&(ne|=He.Closed),$&&O==="hidden"&&(ne|=He.Opening),!$&&O==="visible"&&(ne|=He.Closing);let q=Me();return d.createElement(_o.Provider,{value:te},d.createElement(Ti,{value:ne},q({ourProps:F,theirProps:g,defaultTag:Dc,features:Sc,visible:O==="visible",name:"Transition.Child"})))}function Dg(n,r){let{show:e,appear:t=!1,unmount:o=!0,...a}=n,i=d.useRef(null),s=xc(n),l=Re(...s?[i,r]:r===null?[]:[r]);kr();let u=jn();if(e===void 0&&u!==null&&(e=(u&He.Open)===He.Open),e===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=d.useState(e?"visible":"hidden"),h=Ec(()=>{e||f("hidden")}),[p,m]=d.useState(!0),v=d.useRef([e]);fe(()=>{p!==!1&&v.current[v.current.length-1]!==e&&(v.current.push(e),m(!1))},[v,e]);let g=d.useMemo(()=>({show:e,appear:t,initial:p}),[e,t,p]);fe(()=>{e?f("visible"):!Co(h)&&i.current!==null&&f("hidden")},[e,h]);let x={unmount:o},E=ee(()=>{var D;p&&m(!1),(D=n.beforeEnter)==null||D.call(n)}),w=ee(()=>{var D;p&&m(!1),(D=n.beforeLeave)==null||D.call(n)}),k=Me();return d.createElement(_o.Provider,{value:h},d.createElement(ko.Provider,{value:g},k({ourProps:{...x,as:d.Fragment,children:d.createElement(kc,{ref:l,...x,...a,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:d.Fragment,features:Sc,visible:c==="visible",name:"Transition"})))}function Sg(n,r){let e=d.useContext(ko)!==null,t=jn()!==null;return d.createElement(d.Fragment,null,!e&&t?d.createElement($i,{ref:r,...n}):d.createElement(kc,{ref:r,...n}))}let $i=Ce(Dg),kc=Ce(Eg),Ai=Ce(Sg),_c=Object.assign($i,{Child:Ai,Root:$i});var kg=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(kg||{}),_g=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(_g||{});let Cg={0(n,r){return n.titleId===r.id?n:{...n,titleId:r.id}}},Yi=d.createContext(null);Yi.displayName="DialogContext";function Oo(n){let r=d.useContext(Yi);if(r===null){let e=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Oo),e}return r}function Og(n,r){return Le(r.type,Cg,n,r)}let Cc=Ce(function(n,r){let e=d.useId(),{id:t=`headlessui-dialog-${e}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:c=!1,...f}=n,h=d.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(h.current||(h.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=jn();o===void 0&&p!==null&&(o=(p&He.Open)===He.Open);let m=d.useRef(null),v=Re(m,r),g=Ft(m),x=o?0:1,[E,w]=d.useReducer(Og,{titleId:null,descriptionId:null,panelRef:d.createRef()}),k=ee(()=>a(!1)),D=ee(W=>w({type:0,id:W})),T=kr()?x===0:!1,[$,_]=Rv(),C={get current(){var W;return(W=E.panelRef.current)!=null?W:m.current}},O=bc(),{resolveContainers:R}=ug({mainTreeNode:O,portals:$,defaultContainers:[C]}),b=p!==null?(p&He.Closing)===He.Closing:!1;ni(u||b?!1:T,{allowed:ee(()=>{var W,F;return[(F=(W=m.current)==null?void 0:W.closest("[data-headlessui-portal]"))!=null?F:null]}),disallowed:ee(()=>{var W;return[(W=O==null?void 0:O.closest("body > *:not(#headlessui-portal-root)"))!=null?W:null]})});let S=In.get(null);fe(()=>{if(T)return S.actions.push(t),()=>S.actions.pop(t)},[S,t,T]);let L=we(S,d.useCallback(W=>S.selectors.isTop(W,t),[S,t]));li(L,R,W=>{W.preventDefault(),k()}),sg(L,g==null?void 0:g.defaultView,W=>{W.preventDefault(),W.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),k()}),ci(u||b?!1:T,g,R),ri(T,m,k);let[P,N]=gh(),z=d.useMemo(()=>[{dialogState:x,close:k,setTitleId:D,unmount:c},E],[x,E,k,D,c]),I=d.useMemo(()=>({open:x===0}),[x]),te={ref:v,id:t,role:s,tabIndex:-1,"aria-modal":u?void 0:x===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":P,unmount:c},M=!lg(),j=vn.None;T&&!u&&(j|=vn.RestoreFocus,j|=vn.TabLock,l&&(j|=vn.AutoFocus),M&&(j|=vn.InitialFocus));let Q=Me();return d.createElement(Mv,null,d.createElement(oc,{force:!0},d.createElement(Ni,null,d.createElement(Yi.Provider,{value:z},d.createElement(sc,{target:m},d.createElement(oc,{force:!1},d.createElement(N,{slot:I},d.createElement(_,null,d.createElement(hg,{initialFocus:i,initialFocusFallback:m,containers:R,features:j},d.createElement(kh,{value:k},Q({ourProps:te,theirProps:f,slot:I,defaultTag:Mg,features:Tg,visible:x===0,name:"Dialog"})))))))))))}),Mg="div",Tg=Gt.RenderStrategy|Gt.Static;function Pg(n,r){let{transition:e=!1,open:t,...o}=n,a=jn(),i=n.hasOwnProperty("open")||a!==null,s=n.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(t!==void 0||e)&&!o.static?d.createElement(gc,null,d.createElement(_c,{show:t,transition:e,unmount:o.unmount},d.createElement(Cc,{ref:r,...o}))):d.createElement(gc,null,d.createElement(Cc,{ref:r,open:t,...o}))}let Ig="div";function Ng(n,r){let e=d.useId(),{id:t=`headlessui-dialog-panel-${e}`,transition:o=!1,...a}=n,[{dialogState:i,unmount:s},l]=Oo("Dialog.Panel"),u=Re(r,l.panelRef),c=d.useMemo(()=>({open:i===0}),[i]),f=ee(g=>{g.stopPropagation()}),h={ref:u,id:t,onClick:f},p=o?Ai:d.Fragment,m=o?{unmount:s}:{},v=Me();return d.createElement(p,{...m},v({ourProps:h,theirProps:a,slot:c,defaultTag:Ig,name:"Dialog.Panel"}))}let Lg="div";function Fg(n,r){let{transition:e=!1,...t}=n,[{dialogState:o,unmount:a}]=Oo("Dialog.Backdrop"),i=d.useMemo(()=>({open:o===0}),[o]),s={ref:r,"aria-hidden":!0},l=e?Ai:d.Fragment,u=e?{unmount:a}:{},c=Me();return d.createElement(l,{...u},c({ourProps:s,theirProps:t,slot:i,defaultTag:Lg,name:"Dialog.Backdrop"}))}let $g="h2";function Ag(n,r){let e=d.useId(),{id:t=`headlessui-dialog-title-${e}`,...o}=n,[{dialogState:a,setTitleId:i}]=Oo("Dialog.Title"),s=Re(r);d.useEffect(()=>(i(t),()=>i(null)),[t,i]);let l=d.useMemo(()=>({open:a===0}),[a]),u={ref:s,id:t};return Me()({ourProps:u,theirProps:o,slot:l,defaultTag:$g,name:"Dialog.Title"})}let Yg=Ce(Pg),Oc=Ce(Ng);Ce(Fg);let Mc=Ce(Ag),Mr=Object.assign(Yg,{Panel:Oc,Title:Mc,Description:Bl});function Rg(n,r){let e=d.useRef({left:0,top:0});if(fe(()=>{if(!r)return;let o=r.getBoundingClientRect();o&&(e.current=o)},[n,r]),r==null||!n||r===document.activeElement)return!1;let t=r.getBoundingClientRect();return t.top!==e.current.top||t.left!==e.current.left}let Tc=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Pc(n){var r,e;let t=(r=n.innerText)!=null?r:"",o=n.cloneNode(!0);if(!Ke(o))return t;let a=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let i=a?(e=o.innerText)!=null?e:"":t;return Tc.test(i)&&(i=i.replace(Tc,"")),i}function jg(n){let r=n.getAttribute("aria-label");if(typeof r=="string")return r.trim();let e=n.getAttribute("aria-labelledby");if(e){let t=e.split(" ").map(o=>{let a=document.getElementById(o);if(a){let i=a.getAttribute("aria-label");return typeof i=="string"?i.trim():Pc(a).trim()}return null}).filter(Boolean);if(t.length>0)return t.join(", ")}return Pc(n).trim()}function Wg(n){let r=d.useRef(""),e=d.useRef("");return ee(()=>{let t=n.current;if(!t)return"";let o=t.innerText;if(r.current===o)return e.current;let a=jg(t).trim().toLowerCase();return r.current=o,e.current=a,a})}var Hg=Object.defineProperty,Bg=(n,r,e)=>r in n?Hg(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Ic=(n,r,e)=>(Bg(n,typeof r!="symbol"?r+"":r,e),e),Ve=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Ve||{}),yt=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(yt||{}),Ri=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(Ri||{}),Nc=(n=>(n[n.OpenListbox=0]="OpenListbox",n[n.CloseListbox=1]="CloseListbox",n[n.GoToOption=2]="GoToOption",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterOptions=5]="RegisterOptions",n[n.UnregisterOptions=6]="UnregisterOptions",n[n.SetButtonElement=7]="SetButtonElement",n[n.SetOptionsElement=8]="SetOptionsElement",n[n.SortOptions=9]="SortOptions",n))(Nc||{});function Lc(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=ii(r(n.options.slice()),a=>a.dataRef.current.domRef.current),o=e?t.indexOf(e):null;return o===-1&&(o=null),{options:t,activeOptionIndex:o}}let Vg={1(n){return n.dataRef.current.disabled||n.listboxState===1?n:{...n,activeOptionIndex:null,pendingFocus:{focus:se.Nothing},listboxState:1,__demoMode:!1}},0(n,r){if(n.dataRef.current.disabled||n.listboxState===0)return n;let e=n.activeOptionIndex,{isSelected:t}=n.dataRef.current,o=n.options.findIndex(a=>t(a.dataRef.current.value));return o!==-1&&(e=o),{...n,pendingFocus:r.focus,listboxState:0,activeOptionIndex:e,__demoMode:!1}},2(n,r){var e,t,o,a,i;if(n.dataRef.current.disabled||n.listboxState===1)return n;let s={...n,searchQuery:"",activationTrigger:(e=r.trigger)!=null?e:1,__demoMode:!1};if(r.focus===se.Nothing)return{...s,activeOptionIndex:null};if(r.focus===se.Specific)return{...s,activeOptionIndex:n.options.findIndex(c=>c.id===r.id)};if(r.focus===se.Previous){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Wn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((t=f.current)==null?void 0:t.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:h}}}}else if(r.focus===se.Next){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Wn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...s,activeOptionIndex:h}}}}let l=Lc(n),u=Wn(r,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...s,...l,activeOptionIndex:u}},3:(n,r)=>{if(n.dataRef.current.disabled||n.listboxState===1)return n;let e=n.searchQuery!==""?0:1,t=n.searchQuery+r.value.toLowerCase(),o=(n.activeOptionIndex!==null?n.options.slice(n.activeOptionIndex+e).concat(n.options.slice(0,n.activeOptionIndex+e)):n.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(t))}),a=o?n.options.indexOf(o):-1;return a===-1||a===n.activeOptionIndex?{...n,searchQuery:t}:{...n,searchQuery:t,activeOptionIndex:a,activationTrigger:1}},4(n){return n.dataRef.current.disabled||n.listboxState===1||n.searchQuery===""?n:{...n,searchQuery:""}},5:(n,r)=>{let e=n.options.concat(r.options),t=n.activeOptionIndex;if(n.pendingFocus.focus!==se.Nothing&&(t=Wn(n.pendingFocus,{resolveItems:()=>e,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),n.activeOptionIndex===null){let{isSelected:o}=n.dataRef.current;if(o){let a=e.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));a!==-1&&(t=a)}}return{...n,options:e,activeOptionIndex:t,pendingFocus:{focus:se.Nothing},pendingShouldSort:!0}},6:(n,r)=>{let e=n.options,t=[],o=new Set(r.options);for(let[a,i]of e.entries())if(o.has(i.id)&&(t.push(a),o.delete(i.id),o.size===0))break;if(t.length>0){e=e.slice();for(let a of t.reverse())e.splice(a,1)}return{...n,options:e,activationTrigger:1}},7:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},8:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element},9:n=>n.pendingShouldSort?{...n,...Lc(n),pendingShouldSort:!1}:n},zg=class ff extends Ga{constructor(r){super(r),Ic(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Le(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:Xa(()=>{let e=[],t=new Set;return[(o,a)=>{t.has(a)||(t.add(a),e.push({id:o,dataRef:a}))},()=>(t.clear(),this.send({type:5,options:e.splice(0)}))]}),unregisterOption:Xa(()=>{let e=[];return[t=>e.push(t),()=>{this.send({type:6,options:e.splice(0)})}]}),goToOption:Xa(()=>{let e=null;return[(t,o)=>{e={type:2,...t,trigger:o}},()=>e&&this.send(e)]}),closeListbox:()=>{this.send({type:1})},openListbox:e=>{this.send({type:0,focus:e})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:e,id:t}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(e.current.value),this.send({type:2,focus:se.Specific,id:t})}},selectOption:e=>{let t=this.state.options.find(o=>o.id===e);t&&this.actions.onChange(t.dataRef.current.value)},search:e=>{this.send({type:3,value:e})},clearSearch:()=>{this.send({type:4})},setButtonElement:e=>{this.send({type:7,element:e})},setOptionsElement:e=>{this.send({type:8,element:e})}}),Ic(this,"selectors",{activeDescendantId(e){var t;let o=e.activeOptionIndex,a=e.options;return o===null||(t=a[o])==null?void 0:t.id},isActive(e,t){var o;let a=e.activeOptionIndex,i=e.options;return a!==null?((o=i[a])==null?void 0:o.id)===t:!1},shouldScrollIntoView(e,t){return e.__demoMode||e.listboxState!==0||e.activationTrigger===0?!1:this.isActive(e,t)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let e=this.state.id,t=In.get(null);this.disposables.add(t.on(Ja.Push,o=>{!t.selectors.isTop(o,e)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,__demoMode:e=!1}){return new ff({id:r,dataRef:{current:{}},listboxState:e?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:se.Nothing},__demoMode:e})}reduce(r,e){return Le(e.type,Vg,r,e)}};const Fc=d.createContext(null);function ji(n){let r=d.useContext(Fc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,$c),e}return r}function $c({id:n,__demoMode:r=!1}){let e=d.useMemo(()=>zg.new({id:n,__demoMode:r}),[]);return So(()=>e.dispose()),e}let Mo=d.createContext(null);Mo.displayName="ListboxDataContext";function Tr(n){let r=d.useContext(Mo);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Tr),e}return r}let qg=d.Fragment;function Ug(n,r){let e=d.useId(),t=oo(),{value:o,defaultValue:a,form:i,name:s,onChange:l,by:u,invalid:c=!1,disabled:f=t||!1,horizontal:h=!1,multiple:p=!1,__demoMode:m=!1,...v}=n;const g=h?"horizontal":"vertical";let x=Re(r),E=Il(a),[w=p?[]:void 0,k]=Pl(o,l,E),D=$c({id:e,__demoMode:m}),T=d.useRef({static:!1,hold:!1}),$=d.useRef(new Map),_=Jl(u),C=d.useCallback(Q=>Le(O.mode,{[yt.Multi]:()=>w.some(W=>_(W,Q)),[yt.Single]:()=>_(w,Q)}),[w]),O=d.useMemo(()=>({value:w,disabled:f,invalid:c,mode:p?yt.Multi:yt.Single,orientation:g,onChange:k,compare:_,isSelected:C,optionsPropsRef:T,listRef:$}),[w,f,c,p,g,k,_,C,T,$]);fe(()=>{D.state.dataRef.current=O},[O]);let R=we(D,Q=>Q.listboxState),b=In.get(null),S=we(b,d.useCallback(Q=>b.selectors.isTop(Q,e),[b,e])),[L,P]=we(D,Q=>[Q.buttonElement,Q.optionsElement]);li(S,[L,P],(Q,W)=>{D.send({type:Nc.CloseListbox}),du(W,ai.Loose)||(Q.preventDefault(),L==null||L.focus())});let N=d.useMemo(()=>({open:R===Ve.Open,disabled:f,invalid:c,value:w}),[R,f,c,w]),[z,I]=zl({inherit:!0}),te={ref:x},M=d.useCallback(()=>{if(E!==void 0)return k==null?void 0:k(E)},[k,E]),j=Me();return d.createElement(I,{value:z,props:{htmlFor:L==null?void 0:L.id},slot:{open:R===Ve.Open,disabled:f}},d.createElement(ec,null,d.createElement(Fc.Provider,{value:D},d.createElement(Mo.Provider,{value:O},d.createElement(Ti,{value:Le(R,{[Ve.Open]:He.Open,[Ve.Closed]:He.Closed})},s!=null&&w!=null&&d.createElement($l,{disabled:f,data:{[s]:w},form:i,onReset:M}),j({ourProps:te,theirProps:v,slot:N,defaultTag:qg,name:"Listbox"}))))))}let Qg="button";function Gg(n,r){let e=d.useId(),t=za(),o=Tr("Listbox.Button"),a=ji("Listbox.Button"),{id:i=t||`headlessui-listbox-button-${e}`,disabled:s=o.disabled||!1,autoFocus:l=!1,...u}=n,c=Re(r,Ku(),a.actions.setButtonElement),f=kv(),[h,p,m]=we(a,P=>[P.listboxState,P.buttonElement,P.optionsElement]),v=h===Ve.Open;mu(v,{trigger:p,action:d.useCallback(P=>{if(p!=null&&p.contains(P.target))return $t.Ignore;let N=P.target.closest('[role="option"]:not([data-disabled])');return Ke(N)?$t.Select(N):m!=null&&m.contains(P.target)?$t.Ignore:$t.Close},[p,m]),close:a.actions.closeListbox,select:a.actions.selectActiveOption});let g=ee(P=>{switch(P.key){case he.Enter:oh(P.currentTarget);break;case he.Space:case he.ArrowDown:P.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.First});break;case he.ArrowUp:P.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.Last});break}}),x=ee(P=>{switch(P.key){case he.Space:P.preventDefault();break}}),E=ee(P=>{var N;if(P.button===0){if(Rl(P.currentTarget))return P.preventDefault();a.state.listboxState===Ve.Open?(Ne.flushSync(()=>a.actions.closeListbox()),(N=a.state.buttonElement)==null||N.focus({preventScroll:!0})):(P.preventDefault(),a.actions.openListbox({focus:se.Nothing}))}}),w=ee(P=>P.preventDefault()),k=mr([i]),D=Hl(),{isFocusVisible:T,focusProps:$}=Wa({autoFocus:l}),{isHovered:_,hoverProps:C}=ja({isDisabled:s}),{pressed:O,pressProps:R}=Ml({disabled:s}),b=d.useMemo(()=>({open:h===Ve.Open,active:O||h===Ve.Open,disabled:s,invalid:o.invalid,value:o.value,hover:_,focus:T,autofocus:l}),[h,o.value,s,_,T,O,o.invalid,l]),S=we(a,P=>P.listboxState===Ve.Open),L=pr(f(),{ref:c,id:i,type:gu(n,p),"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":S,"aria-labelledby":k,"aria-describedby":D,disabled:s||void 0,autoFocus:l,onKeyDown:g,onKeyUp:x,onKeyPress:w,onPointerDown:E},$,C,R);return Me()({ourProps:L,theirProps:u,slot:b,defaultTag:Qg,name:"Listbox.Button"})}let Ac=d.createContext(!1),Kg="div",Xg=Gt.RenderStrategy|Gt.Static;function Jg(n,r){let e=d.useId(),{id:t=`headlessui-listbox-options-${e}`,anchor:o,portal:a=!1,modal:i=!0,transition:s=!1,...l}=n,u=Gu(o),[c,f]=d.useState(null);u&&(a=!0);let h=Tr("Listbox.Options"),p=ji("Listbox.Options"),[m,v,g,x]=we(p,A=>[A.listboxState,A.buttonElement,A.optionsElement,A.__demoMode]),E=Ft(v),w=Ft(g),k=jn(),[D,T]=fi(s,c,k!==null?(k&He.Open)===He.Open:m===Ve.Open);ri(D,v,p.actions.closeListbox);let $=x?!1:i&&m===Ve.Open;ci($,w);let _=x?!1:i&&m===Ve.Open;ni(_,{allowed:d.useCallback(()=>[v,g],[v,g])});let C=m!==Ve.Open,O=Rg(C,v)?!1:D,R=D&&m===Ve.Closed,b=Eo(R,h.value),S=ee(A=>h.compare(b,A)),L=we(p,A=>{var H;if(u==null||!((H=u==null?void 0:u.to)!=null&&H.includes("selection")))return null;let G=A.options.findIndex(X=>S(X.dataRef.current.value));return G===-1&&(G=0),G}),P=(()=>{if(u==null)return;if(L===null)return{...u,inner:void 0};let A=Array.from(h.listRef.current.values());return{...u,inner:{listRef:{current:A},index:L}}})(),[N,z]=Ju(P),I=Xu(),te=Re(r,u?N:null,p.actions.setOptionsElement,f),M=Qt();d.useEffect(()=>{var A;let H=g;H&&m===Ve.Open&&H!==((A=dn(H))==null?void 0:A.activeElement)&&(H==null||H.focus({preventScroll:!0}))},[m,g]);let j=ee(A=>{var H,G;switch(M.dispose(),A.key){case he.Space:if(p.state.searchQuery!=="")return A.preventDefault(),A.stopPropagation(),p.actions.search(A.key);case he.Enter:if(A.preventDefault(),A.stopPropagation(),p.state.activeOptionIndex!==null){let{dataRef:X}=p.state.options[p.state.activeOptionIndex];p.actions.onChange(X.current.value)}h.mode===yt.Single&&(Ne.flushSync(()=>p.actions.closeListbox()),(H=p.state.buttonElement)==null||H.focus({preventScroll:!0}));break;case Le(h.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Next});case Le(h.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Previous});case he.Home:case he.PageUp:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.First});case he.End:case he.PageDown:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Last});case he.Escape:A.preventDefault(),A.stopPropagation(),Ne.flushSync(()=>p.actions.closeListbox()),(G=p.state.buttonElement)==null||G.focus({preventScroll:!0});return;case he.Tab:A.preventDefault(),A.stopPropagation(),Ne.flushSync(()=>p.actions.closeListbox()),om(p.state.buttonElement,A.shiftKey?dt.Previous:dt.Next);break;default:A.key.length===1&&(p.actions.search(A.key),M.setTimeout(()=>p.actions.clearSearch(),350));break}}),Q=we(p,A=>{var H;return(H=A.buttonElement)==null?void 0:H.id}),W=d.useMemo(()=>({open:m===Ve.Open}),[m]),F=pr(u?I():{},{id:t,ref:te,"aria-activedescendant":we(p,p.selectors.activeDescendantId),"aria-multiselectable":h.mode===yt.Multi?!0:void 0,"aria-labelledby":Q,"aria-orientation":h.orientation,onKeyDown:j,role:"listbox",tabIndex:m===Ve.Open?0:void 0,style:{...l.style,...z,"--button-width":Ua(v,!0).width},...di(T)}),ne=Me(),q=d.useMemo(()=>h.mode===yt.Multi?h:{...h,isSelected:S},[h,S]);return d.createElement(Ni,{enabled:a?n.static||D:!1,ownerDocument:E},d.createElement(Mo.Provider,{value:q},ne({ourProps:F,theirProps:l,slot:W,defaultTag:Kg,features:Xg,visible:O,name:"Listbox.Options"})))}let Zg="div";function eb(n,r){let e=d.useId(),{id:t=`headlessui-listbox-option-${e}`,disabled:o=!1,value:a,...i}=n,s=d.useContext(Ac)===!0,l=Tr("Listbox.Option"),u=ji("Listbox.Option"),c=we(u,O=>u.selectors.isActive(O,t)),f=l.isSelected(a),h=d.useRef(null),p=Wg(h),m=Pt({disabled:o,value:a,domRef:h,get textValue(){return p()}}),v=Re(r,h,O=>{O?l.listRef.current.set(t,O):l.listRef.current.delete(t)}),g=we(u,O=>u.selectors.shouldScrollIntoView(O,t));fe(()=>{if(g)return rt().requestAnimationFrame(()=>{var O,R;(R=(O=h.current)==null?void 0:O.scrollIntoView)==null||R.call(O,{block:"nearest"})})},[g,h]),fe(()=>{if(!s)return u.actions.registerOption(t,m),()=>u.actions.unregisterOption(t)},[m,t,s]);let x=ee(O=>{var R;if(o)return O.preventDefault();u.actions.onChange(a),l.mode===yt.Single&&(Ne.flushSync(()=>u.actions.closeListbox()),(R=u.state.buttonElement)==null||R.focus({preventScroll:!0}))}),E=ee(()=>{if(o)return u.actions.goToOption({focus:se.Nothing});u.actions.goToOption({focus:se.Specific,id:t})}),w=yu(),k=ee(O=>{w.update(O),!o&&(c||u.actions.goToOption({focus:se.Specific,id:t},Ri.Pointer))}),D=ee(O=>{w.wasMoved(O)&&(o||c||u.actions.goToOption({focus:se.Specific,id:t},Ri.Pointer))}),T=ee(O=>{w.wasMoved(O)&&(o||c&&u.actions.goToOption({focus:se.Nothing}))}),$=d.useMemo(()=>({active:c,focus:c,selected:f,disabled:o,selectedOption:f&&s}),[c,f,o,s]),_=s?{}:{id:t,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:E,onPointerEnter:k,onMouseEnter:k,onPointerMove:D,onMouseMove:D,onPointerLeave:T,onMouseLeave:T},C=Me();return!f&&s?null:C({ourProps:_,theirProps:i,slot:$,defaultTag:Zg,name:"Listbox.Option"})}let tb=d.Fragment;function nb(n,r){let{options:e,placeholder:t,...o}=n,a={ref:Re(r)},i=Tr("ListboxSelectedOption"),s=d.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===yt.Multi&&Array.isArray(i.value)&&i.value.length===0,u=Me();return d.createElement(Ac.Provider,{value:!0},u({ourProps:a,theirProps:{...o,children:d.createElement(d.Fragment,null,t&&l?t:e)},slot:s,defaultTag:tb,name:"ListboxSelectedOption"}))}let rb=Ce(Ug),Yc=Ce(Gg),ob=uo,Rc=Ce(Jg),jc=Ce(eb),ab=Ce(nb),ib=Object.assign(rb,{Button:Yc,Label:ob,Options:Rc,Option:jc,SelectedOption:ab});const sb=n=>{const{isOpen:r,setIsOpen:e,onClose:t,title:o,image:a,description:i,confirm:s,cancel:l,className:u}=n;return Y.jsx(_c,{show:r,enter:"transition ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:Y.jsxs(Mr,{onClose:t,className:"relative z-50 focus:outline-hidden",children:[Y.jsx("div",{className:"fixed inset-0 bg-black/40","aria-hidden":!r}),Y.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center p-4",children:Y.jsxs(Oc,{className:tt(u==null?void 0:u.popup,"ja-break-all flex w-[90vw] max-w-[300px] flex-col gap-[16px] rounded-[16px] bg-white p-[20px]"),children:[Y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[o&&Y.jsx(Mc,{className:tt(u==null?void 0:u.title,"global-break-all text-title-small font-bold text-black"),children:o}),a&&Y.jsx("img",{className:u==null?void 0:u.image,src:a.url,alt:a.alt}),i&&i!==""&&Y.jsx(Bl,{className:tt(u==null?void 0:u.description,"text-petnow-grey-tertiary text-body-large popup-scrollbar max-h-[314px] overflow-y-auto break-all"),children:i})]}),Y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[s&&Y.jsx("button",{className:"bg-petnow-orange-primary sm:hover:bg-petnow-orange-40 text-label-medium w-full cursor-pointer rounded-[12px] py-[12px] font-bold text-white transition duration-200",onClick:s.onClick,children:s.text}),l&&Y.jsx("button",{onClick:()=>e(!1),className:"bg-background-tertiary sm:hover:bg-petnow-grey-90 text-petnow-grey-tertiary text-label-medium w-full cursor-pointer rounded-[12px] py-[12px] font-bold transition duration-200",children:l.text})]})]})})]})})},lb=({className:n,id:r,name:e,onChange:t,disabled:o,isChecked:a})=>Y.jsxs("label",{htmlFor:r,className:"relative inline-flex cursor-pointer items-center",children:[Y.jsx("input",{type:"checkbox",disabled:o,checked:a,id:r,name:e,className:"peer sr-only",onChange:t}),Y.jsx("div",{className:tt(n,"bg-petnow-grey-primary peer-checked:bg-petnow-orange-primary h-[32px] w-[52px] rounded-full duration-[250ms] peer-focus:outline-none after:absolute after:start-[2px] after:top-[3px] after:size-[26px] after:rounded-full after:bg-white after:shadow-[0_3px_8px_0_rgba(0,0,0,0.15)] after:transition-all after:duration-[250ms] after:content-[''] peer-checked:after:translate-x-[calc(100%-4px)] peer-checked:after:border-white",o&&"cursor-not-allowed opacity-50")})]});var Wc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hc=d.createContext&&d.createContext(Wc),ub=["attr","size","title"];function cb(n,r){if(n==null)return{};var e=db(n,r),t,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)t=a[o],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(e[t]=n[t])}return e}function db(n,r){if(n==null)return{};var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(r.indexOf(t)>=0)continue;e[t]=n[t]}return e}function To(){return To=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},To.apply(this,arguments)}function Bc(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,t)}return e}function Po(n){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Bc(Object(e),!0).forEach(function(t){fb(n,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Bc(Object(e)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}return n}function fb(n,r,e){return r=pb(r),r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function pb(n){var r=hb(n,"string");return typeof r=="symbol"?r:r+""}function hb(n,r){if(typeof n!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var t=e.call(n,r);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}function Vc(n){return n&&n.map((r,e)=>d.createElement(r.tag,Po({key:e},r.attr),Vc(r.child)))}function Pr(n){return r=>d.createElement(mb,To({attr:Po({},n.attr)},r),Vc(n.child))}function mb(n){var r=e=>{var{attr:t,size:o,title:a}=n,i=cb(n,ub),s=o||e.size||"1em",l;return e.className&&(l=e.className),n.className&&(l=(l?l+" ":"")+n.className),d.createElement("svg",To({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,i,{className:l,style:Po(Po({color:n.color||e.color},e.style),n.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&d.createElement("title",null,a),n.children)};return Hc!==void 0?d.createElement(Hc.Consumer,null,e=>r(e)):r(Wc)}function vb(n){return Pr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"},child:[]}]})(n)}function zc(n){return Pr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(n)}const gb=({checked:n,label:r,onChange:e,termImageUrl:t})=>{const[o,a]=d.useState(!1);return Y.jsxs(Y.Fragment,{children:[Y.jsx(bb,{isOpen:o,setIsOpen:a,termImageUrl:t}),Y.jsxs("div",{className:"inline-flex items-center",children:[Y.jsxs("label",{className:"relative flex cursor-pointer items-center rounded-full p-3",htmlFor:"check",children:[Y.jsx("input",{type:"checkbox",className:"before:content[''] border-petnow-grey-primary peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity",id:r,checked:n,onChange:i=>{e(i.target.checked)}}),Y.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:Y.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),r&&Y.jsxs("div",{className:"flex items-center",children:[Y.jsx("label",{className:"cursor-pointer font-medium",htmlFor:r,children:r}),Y.jsx(vb,{onClick:()=>{a(!0)},className:"text-petnow-grey-tertiary mt-[2.5px] ml-2 cursor-pointer",size:24})]})]})]})},bb=({isOpen:n,setIsOpen:r,termImageUrl:e})=>Y.jsxs(Mr,{open:n,onClose:()=>r(!1),className:"relative z-50",children:[Y.jsx("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),Y.jsx("div",{className:"fixed inset-0 w-screen overflow-y-auto",children:Y.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:Y.jsxs(Mr.Panel,{className:"mx-auto flex max-w-sm flex-col items-center rounded-sm bg-white",children:[Y.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-full flex-row-reverse items-center",children:Y.jsx(zc,{size:20,className:"mr-2",onClick:()=>r(!1)})}),Y.jsx("img",{src:e,alt:"약관동의 이미지"})]})})})]});var Wi=function(n,r){return Wi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},Wi(n,r)},Bn=function(){return Bn=Object.assign||function(n){for(var r,e=1,t=arguments.length;e<t;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},Bn.apply(this,arguments)};function yb(n,r){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(t=Object.getOwnPropertySymbols(n);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(e[t[o]]=n[t[o]])}return e}var Hi,qc="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",wb=(Hi=null,function(n){return n===void 0&&(n=qc),Hi||(Hi=new Promise(function(r,e){var t=document.createElement("script");t.src=n,t.onload=function(){var o;if(!((o=window==null?void 0:window.daum)===null||o===void 0)&&o.Postcode)return r(window.daum.Postcode);e(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},t.onerror=function(o){return e(o)},t.id="daum_postcode_script",document.body.appendChild(t)}))}),xb=d.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),Eb={width:"100%",height:400},Db={scriptUrl:qc,errorMessage:xb,autoClose:!0},Sb=function(n){function r(){var e=n!==null&&n.apply(this,arguments)||this;return e.mounted=!1,e.wrap=d.createRef(),e.state={hasError:!1,completed:!1},e.initiate=function(t){if(e.wrap.current){var o=e.props;o.scriptUrl,o.className,o.style;var a=o.defaultQuery,i=o.autoClose;o.errorMessage;var s=o.onComplete,l=o.onClose,u=o.onResize,c=o.onSearch,f=yb(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new t(Bn(Bn({},f),{oncomplete:function(h){s&&s(h),e.setState({completed:!0})},onsearch:c,onresize:u,onclose:l,width:"100%",height:"100%"})).embed(e.wrap.current,{q:a,autoClose:i})}},e.onError=function(t){console.error(t),e.setState({hasError:!0})},e}return function(e,t){function o(){this.constructor=e}Wi(e,t),e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}(r,n),r.prototype.componentDidMount=function(){var e=this.initiate,t=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(wb(o).then(e).catch(t),this.mounted=!0))},r.prototype.render=function(){var e=this.props,t=e.className,o=e.style,a=e.errorMessage,i=e.autoClose,s=this.state,l=s.hasError,u=s.completed;return i===!0&&u===!0?null:d.createElement("div",{ref:this.wrap,className:t,style:Bn(Bn({},Eb),o)},l&&a)},r.defaultProps=Db,r}(d.Component);const kb=({label:n,value:r,onFrontChange:e,onBackChange:t,onPostalCodeChange:o,disabled:a})=>{const[i,s]=d.useState(!1),l=f=>{let h=f.address,p="";f.addressType==="R"&&(f.bname!==""&&(p+=f.bname),f.buildingName!==""&&(p+=p!==""?`, ${f.buildingName}`:f.buildingName),h+=p!==""?` (${p})`:""),e(h),o&&o(f.zonecode),s(!1)},u=()=>{s(!0)},c=()=>r.front?r.front:Y.jsx("p",{className:"text-petnow-grey-primary",children:"주소를 입력해주세요."});return Y.jsxs(Y.Fragment,{children:[Y.jsx(_b,{isOpen:i,setIsOpen:s,handleComplete:l}),Y.jsxs("div",{className:"text-petnow-grey-tertiary",children:[Y.jsx("label",{htmlFor:n,className:"text-sm font-bold text-black",children:n}),Y.jsxs("div",{className:"relative flex flex-col",children:[Y.jsx("div",{className:`bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full cursor-pointer overflow-hidden rounded-xl p-4 text-base whitespace-nowrap focus:outline-hidden ${a&&"opacity-50"}`,onClick:u,children:c()}),Y.jsx("input",{disabled:!r.front||a,value:r.back,type:"text",name:n,id:n,placeholder:"상세 주소를 입력해주세요.",className:"bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full rounded-xl p-4 text-base focus:outline-hidden disabled:opacity-50",autoComplete:"off",onChange:f=>t(f.target.value)})]})]})]})},_b=n=>{const{isOpen:r,setIsOpen:e,handleComplete:t}=n;return Y.jsx(Mr,{open:r,onClose:()=>e(!1),className:"relateive z-50",children:Y.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center",children:Y.jsx(Mr.Panel,{children:Y.jsxs("div",{children:[Y.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-[100vw] flex-row-reverse items-center px-2",onClick:()=>e(!1),children:Y.jsx(zc,{size:24,onClick:()=>e(!1)})}),Y.jsx(Sb,{onComplete:t,style:{width:"100vw",height:"calc(100vh - 36px)"}})]})})})})};function Cb(n){return Pr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function Ob(n){return Pr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}const Mb=({title:n,description:r,titleTextClassName:e,descriptionTextClassName:t})=>{const[o,a]=d.useState(!1);return Y.jsxs("div",{className:"my-2.5 flex w-full cursor-pointer flex-col justify-center rounded-xl px-4 pt-8 shadow-[0_2px_8px_0_rgba(0,0,0,0.08)] md:rounded-2xl md:pt-10",onClick:()=>a(i=>!i),children:[Y.jsxs("div",{className:"flex w-full items-center justify-between px-2 pb-8 transition-all duration-300 md:px-4 md:pb-10",children:[Y.jsxs("p",{className:tt("mr-4 text-lg font-medium md:text-xl",e),children:[Y.jsx("span",{className:"font-semibold",children:"Q."})," ",n]}),o?Y.jsx(Ob,{className:"text-petnow-orange-primary min-w-6",size:24}):Y.jsx(Cb,{className:"text-petnow-orange-primary min-w-6",size:24})]}),Y.jsx("p",{className:tt(`text-petnow-grey-secondary w-full overflow-hidden px-2 text-base leading-6 whitespace-pre-wrap transition-all duration-300 md:px-4 md:text-lg ${o?"max-h-[24rem] pb-8 sm:max-h-60 md:pb-10":"max-h-0"}`,t),children:r})]})},Uc=6048e5,Tb=864e5,Io=6e4,No=36e5,Pb=1e3,Qc=Symbol.for("constructDateFrom");function De(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&Qc in n?n[Qc](r):n instanceof Date?new n.constructor(r):new Date(r)}function ae(n,r){return De(r||n,n)}function ft(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(r)?De((e==null?void 0:e.in)||n,NaN):(r&&t.setDate(t.getDate()+r),t)}function pt(n,r,e){const t=ae(n,e==null?void 0:e.in);if(isNaN(r))return De(n,NaN);if(!r)return t;const o=t.getDate(),a=De(n,t.getTime());a.setMonth(t.getMonth()+r+1,0);const i=a.getDate();return o>=i?a:(t.setFullYear(a.getFullYear(),a.getMonth(),o),t)}function Gc(n,r,e){return De(n,+ae(n)+r)}function Ib(n,r,e){return Gc(n,r*No)}let Nb={};function gn(){return Nb}function Yt(n,r){var s,l,u,c;const e=gn(),t=(r==null?void 0:r.weekStartsOn)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?7:0)+a-t;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Vn(n,r){return Yt(n,{...r,weekStartsOn:1})}function Kc(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=De(e,0);o.setFullYear(t+1,0,4),o.setHours(0,0,0,0);const a=Vn(o),i=De(e,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const s=Vn(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=s.getTime()?t:t-1}function Lo(n){const r=ae(n),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+n-+e}function Rt(n,...r){const e=De.bind(null,r.find(t=>typeof t=="object"));return r.map(e)}function bn(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(0,0,0,0),e}function zn(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=bn(t),i=bn(o),s=+a-Lo(a),l=+i-Lo(i);return Math.round((s-l)/Tb)}function Lb(n,r){const e=Kc(n,r),t=De(n,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),Vn(t)}function Bi(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setTime(t.getTime()+r*Io),t}function Vi(n,r,e){return pt(n,r*3,e)}function Fb(n,r,e){return Gc(n,r*1e3)}function Fo(n,r,e){return ft(n,r*7,e)}function jt(n,r,e){return pt(n,r*12,e)}function Xc(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e<a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function Jc(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e>a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function $b(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return+bn(t)==+bn(o)}function Wt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function $o(n){return!(!Wt(n)&&typeof n!="number"||isNaN(+ae(n)))}function Ao(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=t.getMonth()-o.getMonth();return a*12+i}function yn(n,r){const e=ae(n,r==null?void 0:r.in);return Math.trunc(e.getMonth()/3)+1}function Yo(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=yn(t)-yn(o);return a*4+i}function Ro(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return t.getFullYear()-o.getFullYear()}function Ab(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r),a=Zc(t,o),i=Math.abs(zn(t,o));t.setDate(t.getDate()-a*i);const s=+(Zc(t,o)===-a),l=a*(i-s);return l===0?0:l}function Zc(n,r){const e=n.getFullYear()-r.getFullYear()||n.getMonth()-r.getMonth()||n.getDate()-r.getDate()||n.getHours()-r.getHours()||n.getMinutes()-r.getMinutes()||n.getSeconds()-r.getSeconds()||n.getMilliseconds()-r.getMilliseconds();return e<0?-1:e>0?1:e}function ed(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(23,59,59,999),e}function td(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function zi(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth(),o=t-t%3;return e.setMonth(o,1),e.setHours(0,0,0,0),e}function nd(n,r){const e=ae(n,r==null?void 0:r.in);return e.setDate(1),e.setHours(0,0,0,0),e}function rd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function jo(n,r){const e=ae(n,r==null?void 0:r.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Yb(n,r){var s,l;const e=gn(),t=e.weekStartsOn??((l=(s=e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?-7:0)+6-(a-t);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const Rb={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},jb=(n,r,e)=>{let t;const o=Rb[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+t:t+" ago":t};function qn(n){return(r={})=>{const e=r.width?String(r.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Wb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Hb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Bb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vb={date:qn({formats:Wb,defaultWidth:"full"}),time:qn({formats:Hb,defaultWidth:"full"}),dateTime:qn({formats:Bb,defaultWidth:"full"})},zb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qb=(n,r,e,t)=>zb[n];function wt(n){return(r,e)=>{const t=e!=null&&e.context?String(e.context):"standalone";let o;if(t==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=n.formattingValues[s]||n.formattingValues[i]}else{const i=n.defaultWidth,s=e!=null&&e.width?String(e.width):n.defaultWidth;o=n.values[s]||n.values[i]}const a=n.argumentCallback?n.argumentCallback(r):r;return o[a]}}const Ub={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Gb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Kb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Xb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Jb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Zb={ordinalNumber:(n,r)=>{const e=Number(n),t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:wt({values:Ub,defaultWidth:"wide"}),quarter:wt({values:Qb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:Gb,defaultWidth:"wide"}),day:wt({values:Kb,defaultWidth:"wide"}),dayPeriod:wt({values:Xb,defaultWidth:"wide",formattingValues:Jb,defaultFormattingWidth:"wide"})};function xt(n){return(r,e={})=>{const t=e.width,o=t&&n.matchPatterns[t]||n.matchPatterns[n.defaultMatchWidth],a=r.match(o);if(!a)return null;const i=a[0],s=t&&n.parsePatterns[t]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(s)?ty(s,f=>f.test(i)):ey(s,f=>f.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=r.slice(i.length);return{value:u,rest:c}}}function ey(n,r){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&r(n[e]))return e}function ty(n,r){for(let e=0;e<n.length;e++)if(r(n[e]))return e}function od(n){return(r,e={})=>{const t=r.match(n.matchPattern);if(!t)return null;const o=t[0],a=r.match(n.parsePattern);if(!a)return null;let i=n.valueCallback?n.valueCallback(a[0]):a[0];i=e.valueCallback?e.valueCallback(i):i;const s=r.slice(o.length);return{value:i,rest:s}}}const ny=/^(\d+)(th|st|nd|rd)?/i,ry=/\d+/i,oy={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ay={any:[/^b/i,/^(a|c)/i]},iy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sy={any:[/1/i,/2/i,/3/i,/4/i]},ly={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uy={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fy={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},py={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},hy={ordinalNumber:od({matchPattern:ny,parsePattern:ry,valueCallback:n=>parseInt(n,10)}),era:xt({matchPatterns:oy,defaultMatchWidth:"wide",parsePatterns:ay,defaultParseWidth:"any"}),quarter:xt({matchPatterns:iy,defaultMatchWidth:"wide",parsePatterns:sy,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xt({matchPatterns:ly,defaultMatchWidth:"wide",parsePatterns:uy,defaultParseWidth:"any"}),day:xt({matchPatterns:cy,defaultMatchWidth:"wide",parsePatterns:dy,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:fy,defaultMatchWidth:"any",parsePatterns:py,defaultParseWidth:"any"})},ad={code:"en-US",formatDistance:jb,formatLong:Vb,formatRelative:qb,localize:Zb,match:hy,options:{weekStartsOn:0,firstWeekContainsDate:1}};function my(n,r){const e=ae(n,r==null?void 0:r.in);return zn(e,jo(e))+1}function qi(n,r){const e=ae(n,r==null?void 0:r.in),t=+Vn(e)-+Lb(e);return Math.round(t/Uc)+1}function Ui(n,r){var c,f,h,p;const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=gn(),a=(r==null?void 0:r.firstWeekContainsDate)??((f=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=De((r==null?void 0:r.in)||n,0);i.setFullYear(t+1,0,a),i.setHours(0,0,0,0);const s=Yt(i,r),l=De((r==null?void 0:r.in)||n,0);l.setFullYear(t,0,a),l.setHours(0,0,0,0);const u=Yt(l,r);return+e>=+s?t+1:+e>=+u?t:t-1}function vy(n,r){var s,l,u,c;const e=gn(),t=(r==null?void 0:r.firstWeekContainsDate)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Ui(n,r),a=De((r==null?void 0:r.in)||n,0);return a.setFullYear(o,0,t),a.setHours(0,0,0,0),Yt(a,r)}function id(n,r){const e=ae(n,r==null?void 0:r.in),t=+Yt(e,r)-+vy(e,r);return Math.round(t/Uc)+1}function Se(n,r){const e=n<0?"-":"",t=Math.abs(n).toString().padStart(r,"0");return e+t}const tn={y(n,r){const e=n.getFullYear(),t=e>0?e:1-e;return Se(r==="yy"?t%100:t,r.length)},M(n,r){const e=n.getMonth();return r==="M"?String(e+1):Se(e+1,2)},d(n,r){return Se(n.getDate(),r.length)},a(n,r){const e=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,r){return Se(n.getHours()%12||12,r.length)},H(n,r){return Se(n.getHours(),r.length)},m(n,r){return Se(n.getMinutes(),r.length)},s(n,r){return Se(n.getSeconds(),r.length)},S(n,r){const e=r.length,t=n.getMilliseconds(),o=Math.trunc(t*Math.pow(10,e-3));return Se(o,r.length)}},Un={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sd={G:function(n,r,e){const t=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(t,{width:"abbreviated"});case"GGGGG":return e.era(t,{width:"narrow"});case"GGGG":default:return e.era(t,{width:"wide"})}},y:function(n,r,e){if(r==="yo"){const t=n.getFullYear(),o=t>0?t:1-t;return e.ordinalNumber(o,{unit:"year"})}return tn.y(n,r)},Y:function(n,r,e,t){const o=Ui(n,t),a=o>0?o:1-o;if(r==="YY"){const i=a%100;return Se(i,2)}return r==="Yo"?e.ordinalNumber(a,{unit:"year"}):Se(a,r.length)},R:function(n,r){const e=Kc(n);return Se(e,r.length)},u:function(n,r){const e=n.getFullYear();return Se(e,r.length)},Q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(t);case"QQ":return Se(t,2);case"Qo":return e.ordinalNumber(t,{unit:"quarter"});case"QQQ":return e.quarter(t,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(t,{width:"wide",context:"formatting"})}},q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(t);case"qq":return Se(t,2);case"qo":return e.ordinalNumber(t,{unit:"quarter"});case"qqq":return e.quarter(t,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(t,{width:"wide",context:"standalone"})}},M:function(n,r,e){const t=n.getMonth();switch(r){case"M":case"MM":return tn.M(n,r);case"Mo":return e.ordinalNumber(t+1,{unit:"month"});case"MMM":return e.month(t,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(t,{width:"wide",context:"formatting"})}},L:function(n,r,e){const t=n.getMonth();switch(r){case"L":return String(t+1);case"LL":return Se(t+1,2);case"Lo":return e.ordinalNumber(t+1,{unit:"month"});case"LLL":return e.month(t,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(t,{width:"wide",context:"standalone"})}},w:function(n,r,e,t){const o=id(n,t);return r==="wo"?e.ordinalNumber(o,{unit:"week"}):Se(o,r.length)},I:function(n,r,e){const t=qi(n);return r==="Io"?e.ordinalNumber(t,{unit:"week"}):Se(t,r.length)},d:function(n,r,e){return r==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):tn.d(n,r)},D:function(n,r,e){const t=my(n);return r==="Do"?e.ordinalNumber(t,{unit:"dayOfYear"}):Se(t,r.length)},E:function(n,r,e){const t=n.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(t,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(t,{width:"short",context:"formatting"});case"EEEE":default:return e.day(t,{width:"wide",context:"formatting"})}},e:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"e":return String(a);case"ee":return Se(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"c":return String(a);case"cc":return Se(a,r.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,r,e){const t=n.getDay(),o=t===0?7:t;switch(r){case"i":return String(o);case"ii":return Se(o,r.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(t,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(t,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(t,{width:"short",context:"formatting"});case"iiii":default:return e.day(t,{width:"wide",context:"formatting"})}},a:function(n,r,e){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,r,e){const t=n.getHours();let o;switch(t===12?o=Un.noon:t===0?o=Un.midnight:o=t/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,r,e){const t=n.getHours();let o;switch(t>=17?o=Un.evening:t>=12?o=Un.afternoon:t>=4?o=Un.morning:o=Un.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,r,e){if(r==="ho"){let t=n.getHours()%12;return t===0&&(t=12),e.ordinalNumber(t,{unit:"hour"})}return tn.h(n,r)},H:function(n,r,e){return r==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):tn.H(n,r)},K:function(n,r,e){const t=n.getHours()%12;return r==="Ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},k:function(n,r,e){let t=n.getHours();return t===0&&(t=24),r==="ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},m:function(n,r,e){return r==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):tn.m(n,r)},s:function(n,r,e){return r==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):tn.s(n,r)},S:function(n,r){return tn.S(n,r)},X:function(n,r,e){const t=n.getTimezoneOffset();if(t===0)return"Z";switch(r){case"X":return ud(t);case"XXXX":case"XX":return wn(t);case"XXXXX":case"XXX":default:return wn(t,":")}},x:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"x":return ud(t);case"xxxx":case"xx":return wn(t);case"xxxxx":case"xxx":default:return wn(t,":")}},O:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+ld(t,":");case"OOOO":default:return"GMT"+wn(t,":")}},z:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+ld(t,":");case"zzzz":default:return"GMT"+wn(t,":")}},t:function(n,r,e){const t=Math.trunc(+n/1e3);return Se(t,r.length)},T:function(n,r,e){return Se(+n,r.length)}};function ld(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Math.trunc(t/60),a=t%60;return a===0?e+String(o):e+String(o)+r+Se(a,2)}function ud(n,r){return n%60===0?(n>0?"-":"+")+Se(Math.abs(n)/60,2):wn(n,r)}function wn(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Se(Math.trunc(t/60),2),a=Se(t%60,2);return e+o+r+a}const cd=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},dd=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Qi={p:dd,P:(n,r)=>{const e=n.match(/(P+)(p+)?/)||[],t=e[1],o=e[2];if(!o)return cd(n,r);let a;switch(t){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",cd(t,r)).replace("{{time}}",dd(o,r))}},gy=/^D+$/,by=/^Y+$/,yy=["D","DD","YY","YYYY"];function wy(n){return gy.test(n)}function xy(n){return by.test(n)}function Ey(n,r,e){const t=Dy(n,r,e);if(console.warn(t),yy.includes(n))throw new RangeError(t)}function Dy(n,r,e){const t=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Sy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ky=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_y=/^'([^]*?)'?$/,Cy=/''/g,Oy=/[a-zA-Z]/;function fd(n,r,e){var c,f,h,p,m,v,g,x;const t=gn(),o=(e==null?void 0:e.locale)??t.locale??ad,a=(e==null?void 0:e.firstWeekContainsDate)??((f=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??t.firstWeekContainsDate??((p=(h=t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=(e==null?void 0:e.weekStartsOn)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??t.weekStartsOn??((x=(g=t.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,s=ae(n,e==null?void 0:e.in);if(!$o(s))throw new RangeError("Invalid time value");let l=r.match(ky).map(E=>{const w=E[0];if(w==="p"||w==="P"){const k=Qi[w];return k(E,o.formatLong)}return E}).join("").match(Sy).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const w=E[0];if(w==="'")return{isToken:!1,value:My(E)};if(sd[w])return{isToken:!0,value:E};if(w.match(Oy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:E}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(E=>{if(!E.isToken)return E.value;const w=E.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&xy(w)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&wy(w))&&Ey(w,r,String(n));const k=sd[w[0]];return k(s,w,o.localize,u)}).join("")}function My(n){const r=n.match(_y);return r?r[1].replace(Cy,"'"):n}function pd(n,r){return ae(n,r==null?void 0:r.in).getDate()}function Ty(n,r){return ae(n,r==null?void 0:r.in).getDay()}function Py(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=e.getMonth(),a=De(e,0);return a.setFullYear(t,o+1,0),a.setHours(0,0,0,0),a.getDate()}function Iy(){return Object.assign({},gn())}function Ht(n,r){return ae(n,r==null?void 0:r.in).getHours()}function Ny(n,r){const e=ae(n,r==null?void 0:r.in).getDay();return e===0?7:e}function Bt(n,r){return ae(n,r==null?void 0:r.in).getMinutes()}function qe(n,r){return ae(n,r==null?void 0:r.in).getMonth()}function nn(n){return ae(n).getSeconds()}function Gi(n){return+ae(n)}function le(n,r){return ae(n,r==null?void 0:r.in).getFullYear()}function rn(n,r){return+ae(n)>+ae(r)}function xn(n,r){return+ae(n)<+ae(r)}function Ly(n,r){return+ae(n)==+ae(r)}function Fy(n,r){const e=$y(r)?new r(0):De(r,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function $y(n){var r;return typeof n=="function"&&((r=n.prototype)==null?void 0:r.constructor)===n}const Ay=10;class hd{constructor(){Z(this,"subPriority",0)}validate(r,e){return!0}}class Yy extends hd{constructor(r,e,t,o,a){super(),this.value=r,this.validateValue=e,this.setValue=t,this.priority=o,a&&(this.subPriority=a)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,t){return this.setValue(r,e,this.value,t)}}class Ry extends hd{constructor(e,t){super();Z(this,"priority",Ay);Z(this,"subPriority",-1);this.context=e||(o=>De(t,o))}set(e,t){return t.timestampIsSet?e:De(e,Fy(e,this.context))}}class ge{run(r,e,t,o){const a=this.parse(r,e,t,o);return a?{setter:new Yy(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,e,t){return!0}}class jy extends ge{constructor(){super(...arguments);Z(this,"priority",140);Z(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,o){switch(t){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});case"GGGG":default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,t,o){return t.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}const $e={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Et={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ae(n,r){return n&&{value:r(n.value),rest:n.rest}}function Te(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function Dt(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const t=e[1]==="+"?1:-1,o=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:t*(o*No+a*Io+i*Pb),rest:r.slice(e[0].length)}}function md(n){return Te($e.anyDigitsSigned,n)}function Ie(n,r){switch(n){case 1:return Te($e.singleDigit,r);case 2:return Te($e.twoDigits,r);case 3:return Te($e.threeDigits,r);case 4:return Te($e.fourDigits,r);default:return Te(new RegExp("^\\d{1,"+n+"}"),r)}}function Wo(n,r){switch(n){case 1:return Te($e.singleDigitSigned,r);case 2:return Te($e.twoDigitsSigned,r);case 3:return Te($e.threeDigitsSigned,r);case 4:return Te($e.fourDigitsSigned,r);default:return Te(new RegExp("^-?\\d{1,"+n+"}"),r)}}function Ki(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function vd(n,r){const e=r>0,t=e?r:1-r;let o;if(t<=50)o=n||100;else{const a=t+50,i=Math.trunc(a/100)*100,s=n>=a%100;o=n+i-(s?100:0)}return e?o:1-o}function gd(n){return n%400===0||n%4===0&&n%100!==0}class Wy extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="yy"});switch(t){case"y":return Ae(Ie(4,e),a);case"yo":return Ae(o.ordinalNumber(e,{unit:"year"}),a);default:return Ae(Ie(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o){const a=e.getFullYear();if(o.isTwoDigitYear){const s=vd(o.year,a);return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}const i=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class Hy extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="YY"});switch(t){case"Y":return Ae(Ie(4,e),a);case"Yo":return Ae(o.ordinalNumber(e,{unit:"year"}),a);default:return Ae(Ie(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o,a){const i=Ui(e,a);if(o.isTwoDigitYear){const l=vd(o.year,i);return e.setFullYear(l,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Yt(e,a)}const s=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(s,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Yt(e,a)}}class By extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return Wo(t==="R"?4:t.length,e)}set(e,t,o){const a=De(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Vn(a)}}class Vy extends ge{constructor(){super(...arguments);Z(this,"priority",130);Z(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return Wo(t==="u"?4:t.length,e)}set(e,t,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class zy extends ge{constructor(){super(...arguments);Z(this,"priority",120);Z(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"Q":case"QQ":return Ie(t.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class qy extends ge{constructor(){super(...arguments);Z(this,"priority",120);Z(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"q":case"qq":return Ie(t.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class Uy extends ge{constructor(){super(...arguments);Z(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Z(this,"priority",110)}parse(e,t,o){const a=i=>i-1;switch(t){case"M":return Ae(Te($e.month,e),a);case"MM":return Ae(Ie(2,e),a);case"Mo":return Ae(o.ordinalNumber(e,{unit:"month"}),a);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class Qy extends ge{constructor(){super(...arguments);Z(this,"priority",110);Z(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,o){const a=i=>i-1;switch(t){case"L":return Ae(Te($e.month,e),a);case"LL":return Ae(Ie(2,e),a);case"Lo":return Ae(o.ordinalNumber(e,{unit:"month"}),a);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}function Gy(n,r,e){const t=ae(n,e==null?void 0:e.in),o=id(t,e)-r;return t.setDate(t.getDate()-o*7),ae(t,e==null?void 0:e.in)}class Ky extends ge{constructor(){super(...arguments);Z(this,"priority",100);Z(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,o){switch(t){case"w":return Te($e.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o,a){return Yt(Gy(e,o,a),a)}}function Xy(n,r,e){const t=ae(n,e==null?void 0:e.in),o=qi(t,e)-r;return t.setDate(t.getDate()-o*7),t}class Jy extends ge{constructor(){super(...arguments);Z(this,"priority",100);Z(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,o){switch(t){case"I":return Te($e.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o){return Vn(Xy(e,o))}}const Zy=[31,28,31,30,31,30,31,31,30,31,30,31],ew=[31,29,31,30,31,30,31,31,30,31,30,31];class tw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"subPriority",1);Z(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"d":return Te($e.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return Ie(t.length,e)}}validate(e,t){const o=e.getFullYear(),a=gd(o),i=e.getMonth();return a?t>=1&&t<=ew[i]:t>=1&&t<=Zy[i]}set(e,t,o){return e.setDate(o),e.setHours(0,0,0,0),e}}class nw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"subpriority",1);Z(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,o){switch(t){case"D":case"DD":return Te($e.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return Ie(t.length,e)}}validate(e,t){const o=e.getFullYear();return gd(o)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}}function Xi(n,r,e){var f,h,p,m;const t=gn(),o=(e==null?void 0:e.weekStartsOn)??((h=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,a=ae(n,e==null?void 0:e.in),i=a.getDay(),l=(r%7+7)%7,u=7-o,c=r<0||r>6?r-(i+u)%7:(l+u)%7-(i+u)%7;return ft(a,c,e)}class rw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Xi(e,o,a),e.setHours(0,0,0,0),e}}class ow extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"e":case"ee":return Ae(Ie(t.length,e),i);case"eo":return Ae(o.ordinalNumber(e,{unit:"day"}),i);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Xi(e,o,a),e.setHours(0,0,0,0),e}}class aw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"c":case"cc":return Ae(Ie(t.length,e),i);case"co":return Ae(o.ordinalNumber(e,{unit:"day"}),i);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Xi(e,o,a),e.setHours(0,0,0,0),e}}function iw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Ny(t,e),a=r-o;return ft(t,a,e)}class sw extends ge{constructor(){super(...arguments);Z(this,"priority",90);Z(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,o){const a=i=>i===0?7:i;switch(t){case"i":case"ii":return Ie(t.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Ae(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ae(o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ae(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Ae(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,o){return e=iw(e,o),e.setHours(0,0,0,0),e}}class lw extends ge{constructor(){super(...arguments);Z(this,"priority",80);Z(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,o){switch(t){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(Ki(o),0,0,0),e}}class uw extends ge{constructor(){super(...arguments);Z(this,"priority",80);Z(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,t,o){switch(t){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(Ki(o),0,0,0),e}}class cw extends ge{constructor(){super(...arguments);Z(this,"priority",80);Z(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,o){switch(t){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(Ki(o),0,0,0),e}}class dw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,o){switch(t){case"h":return Te($e.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,o){const a=e.getHours()>=12;return a&&o<12?e.setHours(o+12,0,0,0):!a&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}}class fw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,o){switch(t){case"H":return Te($e.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,o){return e.setHours(o,0,0,0),e}}class pw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,o){switch(t){case"K":return Te($e.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}}class hw extends ge{constructor(){super(...arguments);Z(this,"priority",70);Z(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,o){switch(t){case"k":return Te($e.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return Ie(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,o){const a=o<=24?o%24:o;return e.setHours(a,0,0,0),e}}class mw extends ge{constructor(){super(...arguments);Z(this,"priority",60);Z(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"m":return Te($e.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setMinutes(o,0,0),e}}class vw extends ge{constructor(){super(...arguments);Z(this,"priority",50);Z(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"s":return Te($e.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return Ie(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setSeconds(o,0),e}}class gw extends ge{constructor(){super(...arguments);Z(this,"priority",30);Z(this,"incompatibleTokens",["t","T"])}parse(e,t){const o=a=>Math.trunc(a*Math.pow(10,-t.length+3));return Ae(Ie(t.length,e),o)}set(e,t,o){return e.setMilliseconds(o),e}}class bw extends ge{constructor(){super(...arguments);Z(this,"priority",10);Z(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return Dt(Et.basicOptionalMinutes,e);case"XX":return Dt(Et.basic,e);case"XXXX":return Dt(Et.basicOptionalSeconds,e);case"XXXXX":return Dt(Et.extendedOptionalSeconds,e);case"XXX":default:return Dt(Et.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-Lo(e)-o)}}class yw extends ge{constructor(){super(...arguments);Z(this,"priority",10);Z(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return Dt(Et.basicOptionalMinutes,e);case"xx":return Dt(Et.basic,e);case"xxxx":return Dt(Et.basicOptionalSeconds,e);case"xxxxx":return Dt(Et.extendedOptionalSeconds,e);case"xxx":default:return Dt(Et.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-Lo(e)-o)}}class ww extends ge{constructor(){super(...arguments);Z(this,"priority",40);Z(this,"incompatibleTokens","*")}parse(e){return md(e)}set(e,t,o){return[De(e,o*1e3),{timestampIsSet:!0}]}}class xw extends ge{constructor(){super(...arguments);Z(this,"priority",20);Z(this,"incompatibleTokens","*")}parse(e){return md(e)}set(e,t,o){return[De(e,o),{timestampIsSet:!0}]}}const Ew={G:new jy,y:new Wy,Y:new Hy,R:new By,u:new Vy,Q:new zy,q:new qy,M:new Uy,L:new Qy,w:new Ky,I:new Jy,d:new tw,D:new nw,E:new rw,e:new ow,c:new aw,i:new sw,a:new lw,b:new uw,B:new cw,h:new dw,H:new fw,K:new pw,k:new hw,m:new mw,s:new vw,S:new gw,X:new bw,x:new yw,t:new ww,T:new xw},Dw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,kw=/^'([^]*?)'?$/,_w=/''/g,Cw=/\S/,Ow=/[a-zA-Z]/;function Mw(n,r,e,t){var g,x,E,w,k,D,T,$;const o=()=>De((t==null?void 0:t.in)||e,NaN),a=Iy(),i=(t==null?void 0:t.locale)??a.locale??ad,s=(t==null?void 0:t.firstWeekContainsDate)??((x=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??a.firstWeekContainsDate??((w=(E=a.locale)==null?void 0:E.options)==null?void 0:w.firstWeekContainsDate)??1,l=(t==null?void 0:t.weekStartsOn)??((D=(k=t==null?void 0:t.locale)==null?void 0:k.options)==null?void 0:D.weekStartsOn)??a.weekStartsOn??(($=(T=a.locale)==null?void 0:T.options)==null?void 0:$.weekStartsOn)??0;if(!r)return n?o():ae(e,t==null?void 0:t.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:i},c=[new Ry(t==null?void 0:t.in,e)],f=r.match(Sw).map(_=>{const C=_[0];if(C in Qi){const O=Qi[C];return O(_,i.formatLong)}return _}).join("").match(Dw),h=[];for(let _ of f){const C=_[0],O=Ew[C];if(O){const{incompatibleTokens:R}=O;if(Array.isArray(R)){const S=h.find(L=>R.includes(L.token)||L.token===C);if(S)throw new RangeError(`The format string mustn't contain \`${S.fullToken}\` and \`${_}\` at the same time`)}else if(O.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);h.push({token:C,fullToken:_});const b=O.run(n,_,i.match,u);if(!b)return o();c.push(b.setter),n=b.rest}else{if(C.match(Ow))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(_==="''"?_="'":C==="'"&&(_=Tw(_)),n.indexOf(_)===0)n=n.slice(_.length);else return o()}}if(n.length>0&&Cw.test(n))return o();const p=c.map(_=>_.priority).sort((_,C)=>C-_).filter((_,C,O)=>O.indexOf(_)===C).map(_=>c.filter(C=>C.priority===_).sort((C,O)=>O.subPriority-C.subPriority)).map(_=>_[0]);let m=ae(e,t==null?void 0:t.in);if(isNaN(+m))return o();const v={};for(const _ of p){if(!_.validate(m,u))return o();const C=_.set(m,v,u);Array.isArray(C)?(m=C[0],Object.assign(v,C[1])):m=C}return m}function Tw(n){return n.match(kw)[1].replace(_w,"'")}function Pw(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()}function Iw(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return+zi(t)==+zi(o)}function Nw(n,r,e){const[t,o]=Rt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()}function Ir(n,r,e){const t=+ae(n,e==null?void 0:e.in),[o,a]=[+ae(r.start,e==null?void 0:e.in),+ae(r.end,e==null?void 0:e.in)].sort((i,s)=>i-s);return t>=o&&t<=a}function Lw(n,r,e){return ft(n,-1,e)}function Fw(n,r){const e=()=>De(r==null?void 0:r.in,NaN),o=Rw(n);let a;if(o.date){const u=jw(o.date,2);a=Ww(u.restDateString,u.year)}if(!a||isNaN(+a))return e();const i=+a;let s=0,l;if(o.time&&(s=Hw(o.time),isNaN(s)))return e();if(o.timezone){if(l=Bw(o.timezone),isNaN(l))return e()}else{const u=new Date(i+s),c=ae(0,r==null?void 0:r.in);return c.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),c.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),c}return ae(i+s+l,r==null?void 0:r.in)}const Ho={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},$w=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Aw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Yw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Rw(n){const r={},e=n.split(Ho.dateTimeDelimiter);let t;if(e.length>2)return r;if(/:/.test(e[0])?t=e[0]:(r.date=e[0],t=e[1],Ho.timeZoneDelimiter.test(r.date)&&(r.date=n.split(Ho.timeZoneDelimiter)[0],t=n.substr(r.date.length,n.length))),t){const o=Ho.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function jw(n,r){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),t=n.match(e);if(!t)return{year:NaN,restDateString:""};const o=t[1]?parseInt(t[1]):null,a=t[2]?parseInt(t[2]):null;return{year:a===null?o:a*100,restDateString:n.slice((t[1]||t[2]).length)}}function Ww(n,r){if(r===null)return new Date(NaN);const e=n.match($w);if(!e)return new Date(NaN);const t=!!e[4],o=Nr(e[1]),a=Nr(e[2])-1,i=Nr(e[3]),s=Nr(e[4]),l=Nr(e[5])-1;if(t)return Qw(r,s,l)?Vw(r,s,l):new Date(NaN);{const u=new Date(0);return!qw(r,a,i)||!Uw(r,o)?new Date(NaN):(u.setUTCFullYear(r,a,Math.max(o,i)),u)}}function Nr(n){return n?parseInt(n):1}function Hw(n){const r=n.match(Aw);if(!r)return NaN;const e=Ji(r[1]),t=Ji(r[2]),o=Ji(r[3]);return Gw(e,t,o)?e*No+t*Io+o*1e3:NaN}function Ji(n){return n&&parseFloat(n.replace(",","."))||0}function Bw(n){if(n==="Z")return 0;const r=n.match(Yw);if(!r)return 0;const e=r[1]==="+"?-1:1,t=parseInt(r[2]),o=r[3]&&parseInt(r[3])||0;return Kw(t,o)?e*(t*No+o*Io):NaN}function Vw(n,r,e){const t=new Date(0);t.setUTCFullYear(n,0,4);const o=t.getUTCDay()||7,a=(r-1)*7+e+1-o;return t.setUTCDate(t.getUTCDate()+a),t}const zw=[31,null,31,30,31,30,31,31,30,31,30,31];function bd(n){return n%400===0||n%4===0&&n%100!==0}function qw(n,r,e){return r>=0&&r<=11&&e>=1&&e<=(zw[r]||(bd(n)?29:28))}function Uw(n,r){return r>=1&&r<=(bd(n)?366:365)}function Qw(n,r,e){return r>=1&&r<=53&&e>=0&&e<=6}function Gw(n,r,e){return n===24?r===0&&e===0:e>=0&&e<60&&r>=0&&r<60&&n>=0&&n<25}function Kw(n,r){return r>=0&&r<=59}function it(n,r,e){const t=ae(n,e==null?void 0:e.in),o=t.getFullYear(),a=t.getDate(),i=De(n,0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);const s=Py(i);return t.setMonth(r,Math.min(a,s)),t}function Bo(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setHours(r),t}function Vo(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setMinutes(r),t}function Qn(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Math.trunc(t.getMonth()/3)+1,a=r-o;return it(t,t.getMonth()+a*3)}function zo(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setSeconds(r),t}function St(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(+t)?De(n,NaN):(t.setFullYear(r),t)}function En(n,r,e){return pt(n,-r,e)}function yd(n,r,e){return Vi(n,-1,e)}function wd(n,r,e){return Fo(n,-1,e)}function Gn(n,r,e){return jt(n,-r,e)}const Xw={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},Jw=(n,r,e)=>{let t;const o=Xw[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?t+" 후":t+" 전":t},Zw={full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},e0={full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},t0={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},n0={date:qn({formats:Zw,defaultWidth:"full"}),time:qn({formats:e0,defaultWidth:"full"}),dateTime:qn({formats:t0,defaultWidth:"full"})},r0={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},o0=(n,r,e,t)=>r0[n],a0={narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},i0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},s0={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},l0={narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},u0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},c0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},d0={ordinalNumber:(n,r)=>{const e=Number(n);switch(String(r==null?void 0:r.unit)){case"minute":case"second":return String(e);case"date":return e+"일";default:return e+"번째"}},era:wt({values:a0,defaultWidth:"wide"}),quarter:wt({values:i0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:s0,defaultWidth:"wide"}),day:wt({values:l0,defaultWidth:"wide"}),dayPeriod:wt({values:u0,defaultWidth:"wide",formattingValues:c0,defaultFormattingWidth:"wide"})},f0=/^(\d+)(일|번째)?/i,p0=/\d+/i,h0={narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},m0={any:[/^(bc|기원전)/i,/^(ad|서기)/i]},v0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},g0={any:[/1/i,/2/i,/3/i,/4/i]},b0={narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},y0={any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},w0={narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},x0={any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},E0={any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},D0={any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},S0={ordinalNumber:od({matchPattern:f0,parsePattern:p0,valueCallback:n=>parseInt(n,10)}),era:xt({matchPatterns:h0,defaultMatchWidth:"wide",parsePatterns:m0,defaultParseWidth:"any"}),quarter:xt({matchPatterns:v0,defaultMatchWidth:"wide",parsePatterns:g0,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xt({matchPatterns:b0,defaultMatchWidth:"wide",parsePatterns:y0,defaultParseWidth:"any"}),day:xt({matchPatterns:w0,defaultMatchWidth:"wide",parsePatterns:x0,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:E0,defaultMatchWidth:"any",parsePatterns:D0,defaultParseWidth:"any"})},k0={code:"ko",formatDistance:Jw,formatLong:n0,formatRelative:o0,localize:d0,match:S0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var qo=typeof document<"u"?d.useLayoutEffect:d.useEffect;const _0={...V}.useInsertionEffect||(n=>n());function C0(n){const r=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _0(()=>{r.current=n}),V.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}const O0={...V};let xd=!1,M0=0;const Ed=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+M0++;function T0(){const[n,r]=V.useState(()=>xd?Ed():void 0);return qo(()=>{n==null&&r(Ed())},[]),V.useEffect(()=>{xd=!0},[]),n}const Dd=O0.useId||T0;let Lr;process.env.NODE_ENV!=="production"&&(Lr=new Set);function P0(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.warn(o)}}function I0(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.error(o)}}const N0=V.forwardRef(function(r,e){const{context:{placement:t,elements:{floating:o},middlewareData:{arrow:a,shift:i}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:f,stroke:h,d:p,style:{transform:m,...v}={},...g}=r;process.env.NODE_ENV!=="production"&&(e||P0("The `ref` prop is required for `FloatingArrow`."));const x=Dd(),[E,w]=V.useState(!1);if(qo(()=>{if(!o)return;at(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const[k,D]=t.split("-"),T=k==="top"||k==="bottom";let $=f;(T&&i!=null&&i.x||!T&&i!=null&&i.y)&&($=null);const _=c*2,C=_/2,O=s/2*(u/-8+1),R=l/2*u/4,b=!!p,S=$&&D==="end"?"bottom":"top";let L=$&&D==="end"?"right":"left";$&&E&&(L=D==="end"?"left":"right");const P=(a==null?void 0:a.x)!=null?$||a.x:"",N=(a==null?void 0:a.y)!=null?$||a.y:"",z=p||"M0,0"+(" H"+s)+(" L"+(s-O)+","+(l-R))+(" Q"+s/2+","+l+" "+O+","+(l-R))+" Z",I={top:b?"rotate(180deg)":"",left:b?"rotate(90deg)":"rotate(-90deg)",bottom:b?"":"rotate(180deg)",right:b?"rotate(-90deg)":"rotate(90deg)"}[k];return Y.jsxs("svg",{...g,"aria-hidden":!0,ref:e,width:b?s:s+_,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[L]:P,[S]:N,[k]:T||b?"100%":"calc(100% - "+_/2+"px)",transform:[I,m].filter(te=>!!te).join(" "),...v},children:[_>0&&Y.jsx("path",{clipPath:"url(#"+x+")",fill:"none",stroke:h,strokeWidth:_+(p?0:1),d:z}),Y.jsx("path",{stroke:_&&!p?g.fill:"none",d:z}),Y.jsx("clipPath",{id:x,children:Y.jsx("rect",{x:-C,y:C*(b?-1:1),width:s+_,height:s})})]})});function L0(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.has(r)||n.set(r,new Set),n.get(r).add(e)},off(r,e){var t;(t=n.get(r))==null||t.delete(e)}}}const F0=V.createContext(null),$0=V.createContext(null),A0=()=>{var n;return((n=V.useContext(F0))==null?void 0:n.id)||null},Y0=()=>V.useContext($0);function R0(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=Dd(),a=V.useRef({}),[i]=V.useState(()=>L0()),s=A0()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!Fe(p)&&I0("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=V.useState(t.reference),c=C0((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=V.useMemo(()=>({setPositionReference:u}),[]),h=V.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return V.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function j0(n){n===void 0&&(n={});const{nodeId:r}=n,e=R0({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=V.useState(null),[s,l]=V.useState(null),c=(o==null?void 0:o.domReference)||a,f=V.useRef(null),h=Y0();qo(()=>{c&&(f.current=c)},[c]);const p=ju({...n,elements:{...o,...s&&{reference:s}}}),m=V.useCallback(w=>{const k=Fe(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(k),p.refs.setReference(k)},[p.refs]),v=V.useCallback(w=>{(Fe(w)||w===null)&&(f.current=w,i(w)),(Fe(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!Fe(w))&&p.refs.setReference(w)},[p.refs]),g=V.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),x=V.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=V.useMemo(()=>({...p,...t,refs:g,elements:x,nodeId:r}),[p,g,x,r,t]);return qo(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(k=>k.id===r);w&&(w.context=E)}),V.useMemo(()=>({...p,context:E,refs:g,elements:x}),[p,g,x,E])}/*!
|
|
77
77
|
react-datepicker v8.4.0
|
|
78
78
|
https://github.com/Hacker0x01/react-datepicker
|
|
79
79
|
Released under the MIT License.
|