github-stars-organizer 1.2.1 → 1.3.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/app/assets/{backups-r4Hq-y_s.js → backups-DrK5WGqD.js} +1 -1
- package/dist/app/assets/badge-Drt9JvOu.js +1 -0
- package/dist/app/assets/{button-C0MQwO-R.js → button-r9cVFa0_.js} +3 -3
- package/dist/app/assets/coerce-Cxjr6MIU.js +1 -0
- package/dist/app/assets/{esm-Cyyp48ez.js → esm-CVXsiVX8.js} +1 -1
- package/dist/app/assets/explore-Da5fm3tF.js +33 -0
- package/dist/app/assets/{history-OZ9l4TiG.js → history-CN5yGwhZ.js} +1 -1
- package/dist/app/assets/index-dVYqSW2P.css +2 -0
- package/dist/app/assets/index-mzNFlFJk.js +10 -0
- package/dist/app/assets/list._listId-CNuYrPaQ.js +2 -0
- package/dist/app/assets/list._listId-DBB3l--n.js +1 -0
- package/dist/app/assets/{local-backups-BGSAd5Gu.js → local-backups-DLhiWDk4.js} +1 -1
- package/dist/app/assets/{local-sync-Dd3hEb9I.js → local-sync-DiQe8mhd.js} +1 -1
- package/dist/app/assets/registry-BKf8LDk2.js +4 -0
- package/dist/app/assets/routes-BYr-dng4.js +3 -0
- package/dist/app/assets/routes-DaKmAWCG.js +2 -0
- package/dist/app/assets/{schemas-B0gCwksU.js → schemas-DVvZEnxp.js} +1 -1
- package/dist/app/assets/star-BPue5Y4t.js +7 -0
- package/dist/app/assets/{triangle-alert-Cgw2r-Xm.js → triangle-alert-BL8M65pd.js} +1 -1
- package/dist/app/index.html +10 -10
- package/dist/cli.js +475 -1
- package/package.json +1 -1
- package/dist/app/assets/badge-DWmLT6OI.js +0 -1
- package/dist/app/assets/coerce-D595RIhb.js +0 -1
- package/dist/app/assets/explore-Cizp4zKW.js +0 -33
- package/dist/app/assets/index-CTD9BpPN.js +0 -10
- package/dist/app/assets/index-DR-cW8P1.css +0 -2
- package/dist/app/assets/list._listId-C5TBL1sd.js +0 -2
- package/dist/app/assets/list._listId-Cq8rSqKM.js +0 -1
- package/dist/app/assets/registry-DZ4hp3Pl.js +0 -4
- package/dist/app/assets/routes-CqMycHWV.js +0 -2
- package/dist/app/assets/routes-DcRfe2TL.js +0 -3
- package/dist/app/assets/star-BoN7NVgv.js +0 -7
- /package/dist/app/assets/{sync-persistence-f8LlQoHO.js → sync-persistence-BJbWXISF.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,L as i,M as a,N as o,P as s,R as c,_ as l,a as u,c as d,d as f,et as p,g as m,h,it as g,j as _,k as v,l as y,nt as b,p as x,rt as S,s as C,st as w,tt as ee,u as te,v as T,y as ne}from"./button-C0MQwO-R.js";var re=c(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),E=w(g()),ie=0;function ae(e,t=`mui`){let[n,r]=E.useState(e),i=e||n;return E.useEffect(()=>{n??(ie+=1,r(`${t}-${ie}`))},[n,t]),i}var D=m.useId;function O(e,t){if(D!==void 0){let n=D();return e??(t?`${t}-${n}`:n)}return ae(e,t)}function k(e){return O(e,`base-ui`)}function A(e){return e?.ownerDocument||document}var j=typeof navigator<`u`,oe=fe(),se=F(),M=pe(),ce=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),N=oe.platform===`MacIntel`&&oe.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(oe.platform);j&&/firefox/i.test(M);var le=j&&/apple/i.test(navigator.vendor);j&&/Edg/i.test(M);var P=j&&/android/i.test(se)||/android/i.test(M),ue=j&&se.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,de=M.includes(`jsdom/`);function fe(){if(!j)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function pe(){if(!j)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function F(){if(!j)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var I=b(),me=`data-base-ui-focusable`,L=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,he=`ArrowLeft`,ge=`ArrowRight`,_e=`ArrowUp`,ve=`ArrowDown`;function ye(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function R(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&s(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function be(e){return`composedPath`in e?e.composedPath()[0]:e.target}function xe(e,t){if(!v(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(R(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function z(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Se(e){return e.matches(`html,body`)}function Ce(t){return e(t)&&t.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function we(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${L}`)!=null}function Te(e){return e?e.getAttribute(`role`)===`combobox`&&Ce(e):!1}function Ee(e){if(!e||de)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function De(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Oe(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Oe(e,t.id,n)])}function ke(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Ae(e){e.preventDefault(),e.stopPropagation()}function je(e){return`nativeEvent`in e}function Me(e){return e.pointerType===``&&e.isTrusted?!0:P&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ne(e){return de?!1:!P&&e.width===0&&e.height===0||P&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Pe(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Fe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Ie=[`top`,`right`,`bottom`,`left`],Le=Math.min,Re=Math.max,ze=Math.round,Be=Math.floor,Ve=e=>({x:e,y:e}),He={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ue(e,t,n){return Re(e,Le(t,n))}function We(e,t){return typeof e==`function`?e(t):e}function Ge(e){return e.split(`-`)[0]}function Ke(e){return e.split(`-`)[1]}function qe(e){return e===`x`?`y`:`x`}function Je(e){return e===`y`?`height`:`width`}function Ye(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Xe(e){return qe(Ye(e))}function Ze(e,t,n){n===void 0&&(n=!1);let r=Ke(e),i=Xe(e),a=Je(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ot(o)),[o,ot(o)]}function Qe(e){let t=ot(e);return[$e(e),t,$e(t)]}function $e(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var et=[`left`,`right`],tt=[`right`,`left`],nt=[`top`,`bottom`],rt=[`bottom`,`top`];function it(e,t,n){switch(e){case`top`:case`bottom`:return n?t?tt:et:t?et:tt;case`left`:case`right`:return t?nt:rt;default:return[]}}function at(e,t,n,r){let i=Ke(e),a=it(Ge(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($e)))),a}function ot(e){let t=Ge(e);return He[t]+e.slice(t.length)}function st(e){return{top:0,right:0,bottom:0,left:0,...e}}function ct(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:st(e)}function lt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ut(e,t,n){return Math.floor(e/t)!==n}function dt(e,t){return t<0||t>=e.length}function ft(e,t){return B(e.current,{disabledIndices:t})}function pt(e,t){return B(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function B(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&vt(e,a,r));return a}function mt(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1);o=a[i(t,u,n[o][e]??n[o][0])]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!vt(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Be(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!vt(e,r,s))return r}};d&&Ae(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=B(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=B(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}dt(e,f)&&(f=u)}if(n===`both`){let n=Be(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Ae(t),u%o===o-1?r&&(f=B(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=B(e,{startingIndex:u,disabledIndices:s}),r&&ut(f,o,n)&&(f=B(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),ut(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Ae(t),u%o===0?r&&(f=B(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=B(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&ut(f,o,n)&&(f=B(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),ut(f,o,n)&&(f=u));let c=Be(l/o)===n;dt(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:B(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function ht(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function gt(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function _t(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function vt(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?bt(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function yt(e){return e.visibility===`hidden`||e.visibility===`collapse`}function bt(e,t=e?ne(e):null){return!e||!e.isConnected||!t||yt(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var xt=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function St(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return s(n)?n.host:null}function Ct(e){for(let n of Array.from(e.children))if(t(n)===`summary`)return n;return null}function wt(e,t){let n=Ct(t);return!!n&&(e===n||R(n,e))}function Tt(e){let n=e?t(e):``;return e!=null&&e.matches(xt)&&(n!==`summary`||e.parentElement!=null&&t(e.parentElement)===`details`&&Ct(e.parentElement)===e)&&(n!==`details`||Ct(e)==null)&&(n!==`input`||e.type!==`hidden`)}function Et(e){if(!Tt(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let n=e;n;n=St(n)){let r=n!==e,i=t(n)===`slot`;if(n.hasAttribute(`inert`)||r&&t(n)===`details`&&!n.open&&!wt(e,n)||n.hasAttribute(`hidden`)||!i&&!Dt(n,r))return!1}return!0}function Dt(e,t){let n=ne(e);return t?n.display!==`none`:bt(e,n)}function Ot(n){let r=n.tabIndex;if(r<0){let r=t(n);if(r===`details`||r===`audio`||r===`video`||e(n)&&n.isContentEditable)return 0}return r}function kt(e){if(t(e)!==`input`)return null;let n=e;return n.type===`radio`&&n.name!==``?n:null}function At(e,t){let n=kt(e);if(!n)return!0;let r=t.find(e=>{let t=kt(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=kt(e);return t?.name===n.name&&t.form===n.form})===n}function jt(n){if(e(n)&&t(n)===`slot`){let e=n.assignedElements({flatten:!0});if(e.length>0)return e}return e(n)&&n.shadowRoot?Array.from(n.shadowRoot.children):Array.from(n.children)}function Mt(e,t){jt(e).forEach(e=>{Tt(e)&&t.push(e),Mt(e,t)})}function Nt(t,n,r){jt(t).forEach(t=>{e(t)&&t.matches(n)&&r.push(t),Nt(t,n,r)})}function Pt(e){return Et(e)&&Ot(e)>=0}function Ft(e){let t=[];return Mt(e,t),t.filter(Et)}function It(e){let t=Ft(e);return t.filter(e=>Ot(e)>=0&&At(e,t))}function Lt(e,t){let n=It(e),r=n.length;if(r===0)return;let i=ye(A(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Rt(e){return Lt(A(e).body,1)||e}function zt(e){return Lt(A(e).body,-1)||e}function Bt(e,t){if(!e)return null;let n=It(A(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Vt(e){return Bt(e,1)}function Ht(e){return Bt(e,-1)}function Ut(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!R(n,r)}function Wt(e){It(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Gt(e){let t=[];Nt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Kt=[];function qt(e){E.useEffect(e,Kt)}var Jt=0,Yt=class e{static create(){return new e}currentId=Jt;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Jt,t()},e)}isStarted(){return this.currentId!==Jt}clear=()=>{this.currentId!==Jt&&(clearTimeout(this.currentId),this.currentId=Jt)};disposeEffect=()=>this.clear};function Xt(){let e=T(Yt.create).current;return qt(e.disposeEffect),e}var Zt=null;globalThis.requestAnimationFrame;var Qt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},$t=class e{static create(){return new e}static request(e){return Qt.request(e)}static cancel(e){return Qt.cancel(e)}currentId=Zt;request(e){this.cancel(),this.currentId=Qt.request(()=>{this.currentId=Zt,e()})}cancel=()=>{this.currentId!==Zt&&(Qt.cancel(this.currentId),this.currentId=Zt)};disposeEffect=()=>this.cancel};function en(){let e=T($t.create).current;return qt(e.disposeEffect),e}var tn=w(S());function nn(e){return e==null?e:`current`in e?e.current:e}var rn=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),an={[rn.startingStyle]:``},on={[rn.endingStyle]:``},sn={transitionStatus(e){return e===`starting`?an:e===`ending`?on:null}},cn=ee(),ln=p();function un(e,t=!1,n=!0){let r=en();return l((i,a=null)=>{r.cancel();let o=nn(e);if(o==null)return;let s=o,c=()=>{tn.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=rn.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function dn(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=l(i),o=un(r,n,!1);E.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function fn(e,t=!1,n=!1){let[r,i]=E.useState(e&&t?`idle`:void 0),[a,o]=E.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),h(()=>{if(!e&&a&&r!==`ending`&&n){let e=$t.request(()=>{i(`ending`)});return()=>{$t.cancel(e)}}},[e,a,r,n]),h(()=>{if(!e||t)return;let n=$t.request(()=>{i(void 0)});return()=>{$t.cancel(n)}},[t,e]),h(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=$t.request(()=>{i(`idle`)});return()=>{$t.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var pn=`none`,mn=`trigger-press`,hn=`trigger-hover`,gn=`trigger-focus`,_n=`outside-press`,vn=`item-press`,yn=`close-press`,bn=`focus-out`,xn=`escape-key`,Sn=`list-navigation`,Cn=`cancel-open`,wn=`sibling-open`,Tn=`imperative-action`;function En(e,t,n,r){let i=!1,a=!1,o=r??C;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var Dn=E.createContext(void 0);function On(e){let t=E.useContext(Dn);if(e===!1&&t===void 0)throw Error(x(27));return t}var kn=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=rn.startingStyle]=`startingStyle`,e[e.endingStyle=rn.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),An=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),jn={[An.popupOpen]:``},Mn={[An.popupOpen]:``,[An.pressed]:``},Nn={[kn.open]:``},Pn={[kn.closed]:``},Fn={[kn.anchorHidden]:``},In={open(e){return e?jn:null}},Ln={open(e){return e?Mn:null}},Rn={open(e){return e?Nn:Pn},anchorHidden(e){return e?Fn:null}},zn={...Rn,...sn},Bn=E.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=On(),c=s.useState(`open`),l=s.useState(`nested`),d=s.useState(`mounted`);return u(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:zn,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Vn=E.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=On(),l=c.useState(`open`);function d(e){l&&c.setOpen(!1,En(yn,e.nativeEvent))}let{getButtonProps:p,buttonRef:m}=f({disabled:i,native:a});return u(`button`,e,{state:{disabled:i},ref:[t,m],props:[{onClick:d},s,p]})}),Hn=E.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=On(),c=k(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),u(`p`,e,{ref:t,props:[{id:c},o]})});function V(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Un(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Wn(e){let t=T(Gn,e).current;return t.next=e,h(t.effect),t}function Gn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Kn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},qn={...Kn,position:`fixed`,top:0,left:0},Jn={...Kn,position:`absolute`},Yn=E.forwardRef(function(e,t){let[n,r]=E.useState();h(()=>{le&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,I.jsx)(`span`,{...e,ref:t,style:qn,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});function Xn(e){return`data-base-ui-${e}`}var Zn=0;function Qn(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Zn);let a=()=>e?.focus({preventScroll:n});if(i)return a(),d;let o=requestAnimationFrame(a);return Zn=o,()=>{Zn===o&&(cancelAnimationFrame(o),Zn=0)}}var $n={inert:new WeakMap,"aria-hidden":new WeakMap},er=`data-base-ui-inert`,tr={inert:new WeakSet,"aria-hidden":new WeakSet},nr=new WeakMap,rr=0;function ir(e){return tr[e]}function ar(e){return e?s(e)?e.host:ar(e.parentNode):null}var or=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ar(t);return e.contains(n)?n:null}).filter(e=>e!=null),sr=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},cr=(e,n,r)=>{let i=[],a=e=>{!e||r.has(e)||Array.from(e.children).forEach(e=>{t(e)!==`script`&&(n.has(e)?a(e):i.push(e))})};return a(e),i};function lr(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=or(t,e),u=i?or(t,a):[],d=new Set(u),f=i?cr(t,sr(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=$n[o],n=ir(o);c=n,s=e;let r=or(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);cr(t,sr(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(nr.get(e)||0)+1;nr.set(e,t),m.push(e),t===1&&e.setAttribute(er,``)}),rr+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(nr.get(e)||0)-1;nr.set(e,t),t||e.removeAttribute(er)}),--rr,rr||($n.inert=new WeakMap,$n[`aria-hidden`]=new WeakMap,tr.inert=new WeakSet,tr[`aria-hidden`]=new WeakSet,nr=new WeakMap)}}function ur(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=A(e[0]).body;return lr(e,o,n,r,{mark:i,markerIgnoreElements:a})}var dr={style:{transition:`none`}},fr=`data-base-ui-click-trigger`,pr={fallbackAxisSide:`none`},mr={fallbackAxisSide:`end`},hr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},gr=E.createContext(null),_r=()=>E.useContext(gr),vr=Xn(`portal`);function yr(e={}){let{ref:t,container:n,componentProps:r=C,elementProps:i}=e,o=O(),s=_r()?.portalNode,[c,d]=E.useState(null),[f,p]=E.useState(null),m=l(e=>{e!==null&&p(e)}),g=E.useRef(null);h(()=>{if(n===null){g.current&&(g.current=null,p(null),d(null));return}if(o==null)return;let e=(n&&(a(n)?n:n.current))??s??document.body;if(e==null){g.current&&(g.current=null,p(null),d(null));return}g.current!==e&&(g.current=e,p(null),d(e))},[n,s,o]);let _=u(`div`,r,{ref:[t,m],props:[{id:o,[vr]:``},i]});return{portalNode:f,portalSubtree:c&&_?tn.createPortal(_,c):null}}var br=E.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,style:s,...c}=e,{portalNode:l,portalSubtree:u}=yr({container:r,ref:t,componentProps:e,elementProps:c}),d=E.useRef(null),f=E.useRef(null),p=E.useRef(null),m=E.useRef(null),[h,g]=E.useState(null),_=E.useRef(!1),v=h?.modal,y=h?.open,b=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!l;E.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&Ut(e)&&(e.type===`focusin`?_.current&&=(Gt(l),!1):(Wt(l),_.current=!0))}return Un(V(l,`focusin`,e,!0),V(l,`focusout`,e,!0))},[l,v]),E.useEffect(()=>{!l||y!==!1||(Gt(l),_.current=!1)},[y,l]);let x=E.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,I.jsxs)(E.Fragment,{children:[u,(0,I.jsxs)(gr.Provider,{value:x,children:[b&&l&&(0,I.jsx)(Yn,{"data-type":`outside`,ref:d,onFocus:e=>{Ut(e,l)?p.current?.focus():zt(h?h.domReference:null)?.focus()}}),b&&l&&(0,I.jsx)(`span`,{"aria-owns":l.id,style:hr}),l&&tn.createPortal(n,l),b&&l&&(0,I.jsx)(Yn,{"data-type":`outside`,ref:f,onFocus:e=>{Ut(e,l)?m.current?.focus():(Rt(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,En(`focus-out`,e.nativeEvent)))}})]})]})});function xr(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Sr=class{nodesRef={current:[]};events=xr();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Cr=E.createContext(null),wr=E.createContext(null),Tr=()=>E.useContext(Cr)?.id||null,Er=e=>{let t=E.useContext(wr);return e??t};function Dr(e){let t=O(),n=Er(e),r=Tr();return h(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Or(e){let{children:t,id:n}=e,r=Tr();return(0,I.jsx)(Cr.Provider,{value:E.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kr(e){let{children:t,externalTree:n}=e,r=T(()=>n??new Sr).current;return(0,I.jsx)(wr.Provider,{value:r,children:t})}function Ar(e,t){let r=n(be(e));return e instanceof r.KeyboardEvent?`keyboard`:e instanceof r.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof r.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var jr=20,Mr=[];function Nr(){Mr=Mr.filter(e=>e.deref()?.isConnected)}function Pr(e){Nr(),e&&t(e)!==`body`&&(Mr.push(new WeakRef(e)),Mr.length>jr&&(Mr=Mr.slice(-jr)))}function Fr(){return Nr(),Mr[Mr.length-1]?.deref()}function Ir(e){return e?Pt(e)?e:It(e)[0]||e:null}function Lr(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Ft(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Pt(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Rr(t){let{context:n,children:r,disabled:i=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:g,getInsideElements:_}=t,v=`rootStore`in n?n.rootStore:n,y=v.useState(`open`),b=v.useState(`domReferenceElement`),x=v.useState(`floatingElement`),{events:S,dataRef:C}=v.context,w=l(()=>C.current.floatingContext?.nodeId),ee=a===!1,T=Te(b)&&ee,ne=E.useRef([`content`]),re=Wn(a),ie=Wn(o),ae=Wn(d),D=Er(g),O=_r(),k=E.useRef(!1),j=E.useRef(!1),oe=E.useRef(!1),se=E.useRef(null),M=E.useRef(``),N=E.useRef(``),le=E.useRef(null),P=E.useRef(null),ue=te(le,m,O?.beforeInsideRef),de=te(P,O?.afterInsideRef),fe=Xt(),pe=Xt(),F=en(),me=O!=null,L=De(x),he=l((e=L)=>e?It(e):[]),ge=l(()=>_?.().filter(e=>e!=null)??[]);E.useEffect(()=>{if(i||!c)return;function e(e){e.key===`Tab`&&R(L,ye(A(L)))&&he().length===0&&!T&&Ae(e)}return V(A(L),`keydown`,e)},[i,b,L,c,ne,T,he]),E.useEffect(()=>{if(i||!y)return;let e=A(L);function t(){oe.current=!1}function n(e){let t=be(e),n=ge();oe.current=!(R(x,t)||R(b,t)||R(O?.portalNode,t)||n.some(e=>e===t||R(e,t))),N.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0)}function r(){N.current=`keyboard`}return Un(V(e,`pointerdown`,n,!0),V(e,`pointerup`,t,!0),V(e,`pointercancel`,t,!0),V(e,`keydown`,r,!0))},[i,x,b,L,y,O,ge]),E.useEffect(()=>{if(i||!u)return;let t=A(L);function n(){j.current=!0,pe.start(0,()=>{j.current=!1})}function r(e){let t=be(e);Pt(t)&&(se.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=be(n);queueMicrotask(()=>{let o=w(),l=v.context.triggerElements,u=ge(),d=r?.hasAttribute(Xn(`focus-guard`))&&[le.current,P.current,O?.beforeInsideRef.current,O?.afterInsideRef.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,nn(p),nn(f)].includes(r),m=!(R(b,r)||R(x,r)||R(r,x)||R(O?.portalNode,r)||u.some(e=>e===r||R(e,r))||r!=null&&l.hasElement(r)||l.hasMatchingElement(e=>R(e,r))||d||D&&(Oe(D.nodesRef.current,o).find(e=>R(e.context?.elements.floating,r)||R(e.context?.elements.domReference,r))||ke(D.nodesRef.current,o).find(e=>[e.context?.elements.floating,De(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===b&&L&&Lr(L,ne),s&&i!==b&&!bt(a)&&ye(t)===t.body){if(e(L)&&(L.focus(),s===`popup`)){F.request(()=>{L.focus()});return}let t=he(),n=se.current,r=(n&&t.includes(n)?n:null)||t[t.length-1]||L;e(r)&&r.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(T||!c)&&r&&m&&!j.current&&(T||r!==Fr())&&(k.current=!0,v.setOpen(!1,En(bn,n)))})}function o(){oe.current||(C.current.insideReactTree=!0,fe.start(0,()=>{C.current.insideReactTree=!1}))}let l=e(b)?b:null;if(!(!x&&!l))return Un(l&&V(l,`focusout`,a),l&&V(l,`pointerdown`,n),x&&V(x,`focusin`,r),x&&V(x,`focusout`,a),x&&O&&V(x,`focusout`,o,!0))},[i,b,x,L,c,D,O,v,u,s,he,T,w,ne,C,fe,pe,F,f,p,ge]),E.useEffect(()=>{if(i||!x||!y)return;let e=Array.from(O?.portalNode?.querySelectorAll(`[${Xn(`portal`)}]`)||[]),t=(D?ke(D.nodesRef.current,w()):[]).find(e=>Te(e.context?.elements.domReference||null))?.context?.elements.domReference,n=ur([...[x,...e,le.current,P.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,...ge()],t,nn(p),nn(f),T?b:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),r=ur([x,...e].filter(e=>e!=null));return()=>{r(),n()}},[y,i,b,x,c,ne,O,T,D,w,f,p,ge]),h(()=>{if(!y||i||!e(L))return;let t=ye(A(L));queueMicrotask(()=>{let e=re.current,n=typeof e==`function`?e(ae.current||``):e;if(n===void 0||n===!1||R(L,t))return;let r=null,i=()=>(r??=he(L),r[0]||L),a;a=n===!0||n===null?i():nn(n),a||=i(),Qn(a,{preventScroll:a===L})})},[i,y,L,ee,he,re,ae]),h(()=>{if(i||!L)return;let t=A(L);Pr(ye(t));function n(e){if(e.open||(M.current=Ar(e.nativeEvent,N.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(k.current=!0),e.reason===`outside-press`)if(e.nested)k.current=!1;else if(Me(e.nativeEvent)||Ne(e.nativeEvent))k.current=!1;else{let e=!1;A(L).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?k.current=!1:k.current=!0}}S.on(`openchange`,n);function r(){let e=ie.current,t=typeof e==`function`?e(M.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=b||Fr();return e&&e.isConnected?e:null}let n=b||Fr();return nn(t)||n||null}return()=>{S.off(`openchange`,n);let i=ye(t),a=ge(),o=R(x,i)||a.some(e=>e===i||R(e,i))||D&&Oe(D.nodesRef.current,w(),!1).some(e=>R(e.context?.elements.floating,i)),s=ie.current,c=r();queueMicrotask(()=>{let n=Ir(c),r=typeof s!=`boolean`;s&&!k.current&&e(n)&&(!(!r&&n!==i&&i!==t.body)||o)&&n.focus({preventScroll:!0}),k.current=!1})}},[i,x,L,ie,C,S,D,b,w,ge]),h(()=>{if(!ce||y||!x)return;let t=ye(A(x));!e(t)||!Ce(t)||R(x,t)&&t.blur()},[y,x]),h(()=>{if(!(i||!O))return O.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:v.setOpen,domReference:b}),()=>{O.setFocusManagerState(null)}},[i,O,c,y,v,u,b]),h(()=>{if(!(i||!L))return Lr(L,ne),()=>{queueMicrotask(Nr)}},[i,L,ne]);let _e=!i&&(c?!T:!0)&&(me||c);return(0,I.jsxs)(E.Fragment,{children:[_e&&(0,I.jsx)(Yn,{"data-type":`inside`,ref:ue,onFocus:e=>{if(c){let e=he();Qn(e[e.length-1])}else O?.portalNode&&(k.current=!1,Ut(e,O.portalNode)?Rt(b)?.focus():nn(p??O.beforeOutsideRef)?.focus())}}),r,_e&&(0,I.jsx)(Yn,{"data-type":`inside`,ref:de,onFocus:e=>{c?Qn(he()[0]):O?.portalNode&&(u&&(k.current=!0),Ut(e,O.portalNode)?zt(b)?.focus():nn(f??O.afterOutsideRef)?.focus())}})]})}var zr={intentional:`onClick`,sloppy:`onPointerDown`};function Br(){return!1}function Vr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Hr(t,n={}){let a=`rootStore`in t?t.rootStore:t,o=a.useState(`open`),c=a.useState(`floatingElement`),{dataRef:u}=a.context,{enabled:d=!0,escapeKey:f=!0,outsidePress:p=!0,outsidePressEvent:m=`sloppy`,referencePress:h=Br,referencePressEvent:g=`sloppy`,bubbles:y,externalTree:b}=n,x=Er(b),S=l(typeof p==`function`?p:()=>!1),C=typeof p==`function`?S:p,w=C!==!1,ee=l(()=>m),te=E.useRef(!1),T=E.useRef(!1),re=E.useRef(!1),{escapeKey:ie,outsidePress:ae}=Vr(y),D=E.useRef(null),O=Xt(),k=Xt(),j=l(()=>{k.clear(),u.current.insideReactTree=!1}),oe=E.useRef(!1),se=E.useRef(``),M=l(h),ce=l(e=>{if(!o||!d||!f||e.key!==`Escape`||oe.current)return;let t=u.current.floatingContext?.nodeId,n=x?Oe(x.nodesRef.current,t):[];if(!ie&&n.length>0){let e=!0;if(n.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let r=En(xn,je(e)?e.nativeEvent:e);a.setOpen(!1,r),!ie&&!r.isPropagationAllowed&&e.stopPropagation()}),N=l(()=>{u.current.insideReactTree=!0,k.start(0,j)});E.useEffect(()=>{if(!o||!d)return;u.current.__escapeKeyBubbles=ie,u.current.__outsidePressBubbles=ae;let t=new Yt,n=new Yt;function l(){t.clear(),oe.current=!0}function p(){t.start(i()?5:0,()=>{oe.current=!1})}function m(){re.current=!0,n.start(0,()=>{re.current=!1})}function h(){te.current=!1,T.current=!1}function g(){let e=se.current,t=e===`pen`||!e?`mouse`:e,n=ee(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function y(e){let t=g();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function b(e){let t=u.current.floatingContext?.nodeId,n=x&&Oe(x.nodesRef.current,t).some(t=>z(e,t.context?.elements.floating));return z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`))||n}function S(t){if(y(t)){j();return}if(u.current.insideReactTree){j();return}let i=be(t),o=`[${Xn(`inert`)}]`,c=v(i)?i.getRootNode():null,l=Array.from((s(c)?c:A(a.select(`floatingElement`))).querySelectorAll(o)),d=a.context.triggerElements;if(i&&(d.hasElement(i)||d.hasMatchingElement(e=>R(e,i))))return;let f=v(i)?i:null;for(;f&&!_(f);){let e=r(f);if(_(e)||!v(e))break;f=e}if(l.length&&v(i)&&!Se(i)&&!R(i,a.select(`floatingElement`))&&l.every(e=>!R(f,e)))return;if(e(i)&&!(`touches`in t)){let e=_(i),n=ne(i),r=/auto|scroll/,a=e||r.test(n.overflowX),o=e||r.test(n.overflowY),s=a&&i.clientWidth>0&&i.scrollWidth>i.clientWidth,c=o&&i.clientHeight>0&&i.scrollHeight>i.clientHeight,l=n.direction===`rtl`,u=c&&(l?t.offsetX<=i.offsetWidth-i.clientWidth:t.offsetX>i.clientWidth),d=s&&t.offsetY>i.clientHeight;if(u||d)return}if(b(t))return;if(g()===`intentional`&&re.current){n.clear(),re.current=!1;return}if(typeof C==`function`&&!C(t))return;let p=u.current.floatingContext?.nodeId,m=x?Oe(x.nodesRef.current,p):[];if(m.length>0){let e=!0;if(m.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}a.setOpen(!1,En(_n,t)),j()}function E(e){g()!==`sloppy`||e.pointerType===`touch`||!a.select(`open`)||!d||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`))||S(e)}function k(e){if(g()!==`sloppy`||!a.select(`open`)||!d||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function M(e,t){let n=be(e);if(!n)return;let r=V(n,e.type,()=>{t(e),r()})}function N(e){se.current=`touch`,M(e,k)}function le(e){O.clear(),e.type===`pointerdown`&&(se.current=e.pointerType),!(e.type===`mousedown`&&D.current&&!D.current.dismissOnMouseDown)&&M(e,e=>{e.type===`pointerdown`?E(e):S(e)})}function P(e){if(!te.current)return;let t=T.current;if(h(),g()===`intentional`){if(e.type===`pointercancel`){t&&m();return}if(!b(e)){if(t){m();return}typeof C==`function`&&!C(e)||(n.clear(),re.current=!0,j())}}}function ue(e){if(g()!==`sloppy`||!D.current||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(S(e),O.clear(),D.current=null)}function de(e){M(e,ue)}function fe(e){g()!==`sloppy`||!D.current||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`))||(D.current.dismissOnTouchEnd&&S(e),O.clear(),D.current=null)}function pe(e){M(e,fe)}let F=A(c),I=Un(f&&Un(V(F,`keydown`,ce),V(F,`compositionstart`,l),V(F,`compositionend`,p)),w&&Un(V(F,`click`,le,!0),V(F,`pointerdown`,le,!0),V(F,`pointerup`,P,!0),V(F,`pointercancel`,P,!0),V(F,`mousedown`,le,!0),V(F,`mouseup`,P,!0),V(F,`touchstart`,N,!0),V(F,`touchmove`,de,!0),V(F,`touchend`,pe,!0)));return()=>{I(),t.clear(),n.clear(),h(),re.current=!1}},[u,c,f,w,C,o,d,ie,ae,ce,j,ee,x,a,O]),E.useEffect(j,[C,j]);let le=E.useMemo(()=>({onKeyDown:ce,[zr[g]]:e=>{M()&&a.setOpen(!1,En(mn,e.nativeEvent))},...g!==`intentional`&&{onClick(e){M()&&a.setOpen(!1,En(`trigger-press`,e.nativeEvent))}}}),[ce,a,g,M]),P=l(e=>{if(!o||!d||e.button!==0)return;let t=be(e.nativeEvent);R(a.select(`floatingElement`),t)&&(te.current||(te.current=!0,T.current=!1))}),ue=l(e=>{!o||!d||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&te.current&&(T.current=!0)}),de=E.useMemo(()=>({onKeyDown:ce,onPointerDown:ue,onMouseDown:ue,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[ce,N,P,ue]);return E.useMemo(()=>d?{reference:le,floating:de,trigger:le}:{},[d,le,de])}var H=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(x(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Ur=[],Wr=void 0;function Gr(){return Wr}function Kr(e){Ur.push(e)}function qr(e){let t=(t,n)=>{let r=T(Yr).current,i;try{Wr=r;for(let e of Ur)e.before(r);i=e(t,n);for(let e of Ur)e.after(r);r.didInitialize=!0}finally{Wr=void 0}return i};return t.displayName=e.displayName||e.name,t}function Jr(e){return E.forwardRef(qr(e))}function Yr(){return{didInitialize:!1}}var Xr=y(19)?$r:ei;function Zr(e,t,n,r,i){return Xr(e,t,n,r,i)}function Qr(e,t,n,r,i){let a=E.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,cn.useSyncExternalStore)(e.subscribe,a,a)}Kr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,cn.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function $r(e,t,n,r,i){let a=Gr();if(!a)return Qr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function ei(e,t,n,r,i){return(0,ln.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var ti=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Zr(this,e,t,n,r)}},ni=class extends ti{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){E.useDebugValue(e),h(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;h(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;h(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){E.useDebugValue(e);let n=t!==void 0;h(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return E.useDebugValue(e),Zr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){E.useDebugValue(e);let n=l(t??d);this.context[e]=n}useStateSetter(e){let t=E.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},ri={open:H(e=>e.open),transitionStatus:H(e=>e.transitionStatus),domReferenceElement:H(e=>e.domReferenceElement),referenceElement:H(e=>e.positionReference??e.referenceElement),floatingElement:H(e=>e.floatingElement),floatingId:H(e=>e.floatingId)},ii=class extends ni{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:xr(),nested:n,triggerElements:i},ri),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Fe(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function ai(e,t){let n=E.useRef(null),r=E.useRef(null);return E.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function oi(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ai(e,n),o=l(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return h(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function si(e){let t=e.useState(`open`);h(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function ci(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=fn(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=l(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return dn({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var li=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function ui(){return new ii({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new li,floatingId:``,syncOnly:!1,nested:!1,onOpenChange:void 0})}function di(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ui(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:C,inactiveTriggerProps:C,popupProps:C}}var fi=H(e=>e.triggerIdProp??e.activeTriggerId),pi={open:H(e=>e.openProp??e.open),mounted:H(e=>e.mounted),transitionStatus:H(e=>e.transitionStatus),floatingRootContext:H(e=>e.floatingRootContext),preventUnmountingOnClose:H(e=>e.preventUnmountingOnClose),payload:H(e=>e.payload),activeTriggerId:fi,activeTriggerElement:H(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:H((e,t)=>t!==void 0&&fi(e)===t),isOpenedByTrigger:H((e,t)=>t!==void 0&&fi(e)===t&&e.open),isMountedByTrigger:H((e,t)=>t!==void 0&&fi(e)===t&&e.mounted),triggerProps:H((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:H(e=>e.popupProps),popupElement:H(e=>e.popupElement),positionerElement:H(e=>e.positionerElement)};function mi(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=O(),a=Tr()!=null,o=t.useState(`open`),s=t.useState(`activeTriggerElement`),c=t.useState(n?`popupElement`:`positionerElement`),l=t.context.triggerElements,u=T(()=>new ii({open:o,transitionStatus:void 0,referenceElement:s,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:i,syncOnly:!0,nested:a})).current;return h(()=>{let e={open:o,floatingId:i,referenceElement:s,floatingElement:c};v(s)&&(e.domReferenceElement=s),u.state.positionReference===u.state.referenceElement&&(e.positionReference=s),u.update(e)},[o,i,s,c,u]),u.context.onOpenChange=r,u.context.nested=a,u}function hi(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=E.useCallback(t=>gi(t,e,`reference`),t),o=E.useCallback(t=>gi(t,e,`floating`),n),s=E.useCallback(t=>gi(t,e,`item`),r),c=E.useCallback(t=>gi(t,e,`trigger`),i);return E.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function gi(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[me]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&_i(a,s,i,r)}return _i(a,e,i,r),a}function _i(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var vi=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function yi(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=O(),l=a?.id||c,u=E.useMemo(()=>De(o)?.id||i,[o,i]),d=vi.get(s)??s,f=Tr()!=null,p=E.useMemo(()=>d===`tooltip`||s===`label`?C:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=E.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=E.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=E.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return E.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}var bi=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),xi=function(e){return e[e.open=kn.open]=`open`,e[e.closed=kn.closed]=`closed`,e[e.startingStyle=kn.startingStyle]=`startingStyle`,e[e.endingStyle=kn.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Si=E.createContext(void 0);function Ci(){let e=E.useContext(Si);if(e===void 0)throw Error(x(26));return e}var wi=`ArrowUp`,Ti=`ArrowDown`,Ei=`ArrowLeft`,Di=`ArrowRight`,Oi=`Home`,ki=new Set([Ei,Di]),Ai=new Set([wi,Ti]),ji=new Set([...ki,...Ai]);new Set([...ji,Oi,`End`]);var Mi=new Set([wi,Ti,Ei,Di,Oi,`End`]),Ni={...Rn,...sn,nestedDialogOpen(e){return e?{[xi.nestedDialogOpen]:``}:null}},Pi=E.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=On(),l=c.useState(`descriptionElementId`),d=c.useState(`disablePointerDismissal`),f=c.useState(`floatingRootContext`),p=c.useState(`popupProps`),m=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`);Ci(),dn({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});function C(e){return e===`touch`?c.context.popupRef.current:!0}let w=i===void 0?C:i,ee=u(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:_>0},props:[p,{"aria-labelledby":b??void 0,"aria-describedby":l??void 0,role:S,tabIndex:-1,hidden:!h,onKeyDown(e){Mi.has(e.key)&&e.stopPropagation()},style:{[bi.nestedDialogs]:_}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:Ni});return(0,I.jsx)(Rr,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!d,initialFocus:w,returnFocus:r,modal:m!==!1,restoreFocus:`popup`,children:ee})});function Fi(e){return y(19)?e:e?`true`:void 0}var Ii=E.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,I.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Li=E.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=On(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,I.jsx)(Si.Provider,{value:n,children:(0,I.jsxs)(br,{ref:t,...r,children:[a&&o===!0&&(0,I.jsx)(Ii,{ref:i.context.internalBackdropRef,inert:Fi(!s)}),e.children]})}):null});function Ri(e){let t=E.useRef(!0);t.current&&(t.current=!1,e())}var zi={},Bi={},Vi=``;function Hi(e){if(typeof document>`u`)return!1;let t=A(e);return n(t).innerWidth-t.documentElement.clientWidth>0}function Ui(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=A(e),n=t.documentElement,r=t.body,i=o(n)?n:r,a=i.style.overflowY,s=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let c=i.offsetWidth;i.style.overflowY=`hidden`;let l=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=s,c===l}function Wi(e){let t=A(e),n=t.documentElement,r=t.body,i=o(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Gi(e){let t=A(e),r=t.documentElement,i=t.body,a=n(r),s=0,c=0,l=!1,u=$t.create();if(ce&&(a.visualViewport?.scale??1)!==1)return()=>{};function d(){let t=a.getComputedStyle(r),n=a.getComputedStyle(i),u=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;s=r.scrollTop,c=r.scrollLeft,zi={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},Vi=r.style.scrollBehavior,Bi={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};let d=r.scrollHeight>r.clientHeight,f=r.scrollWidth>r.clientWidth,p=t.overflowY===`scroll`||n.overflowY===`scroll`,m=t.overflowX===`scroll`||n.overflowX===`scroll`,h=Math.max(0,a.innerWidth-i.clientWidth),g=Math.max(0,a.innerHeight-i.clientHeight),_=parseFloat(n.marginTop)+parseFloat(n.marginBottom),v=parseFloat(n.marginLeft)+parseFloat(n.marginRight),y=o(r)?r:i;if(l=Ui(e),l){r.style.scrollbarGutter=u,y.style.overflowY=`hidden`,y.style.overflowX=`hidden`;return}Object.assign(r.style,{scrollbarGutter:u,overflowY:`hidden`,overflowX:`hidden`}),(d||p)&&(r.style.overflowY=`scroll`),(f||m)&&(r.style.overflowX=`scroll`),Object.assign(i.style,{position:`relative`,height:_||g?`calc(100dvh - ${_+g}px)`:`100dvh`,width:v||h?`calc(100vw - ${v+h}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),i.scrollTop=s,i.scrollLeft=c,r.setAttribute(`data-base-ui-scroll-locked`,``),r.style.scrollBehavior=`unset`}function f(){Object.assign(r.style,zi),Object.assign(i.style,Bi),l||(r.scrollTop=s,r.scrollLeft=c,r.removeAttribute(`data-base-ui-scroll-locked`),r.style.scrollBehavior=Vi)}function p(){f(),u.request(d)}d();let m=V(a,`resize`,p);return()=>{u.cancel(),f(),typeof a.removeEventListener==`function`&&m()}}var Ki=new class{lockCount=0;restore=null;timeoutLock=Yt.create();timeoutUnlock=Yt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=A(e).documentElement,r=n(t).getComputedStyle(t).overflowY;if(r===`hidden`||r===`clip`){this.restore=d;return}let i=N||!Hi(e);this.restore=i?Wi(e):Gi(e)}};function qi(e=!0,t=null){h(()=>{if(e)return Ki.acquire(t)},[e,t])}function Ji(e){let t=E.useRef(``),n=E.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:E.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Yi(e,t){let n=E.useRef(e),r=l(t);h(()=>{n.current!==e&&r(n.current)},[e,r]),h(()=>{n.current=e},[e])}function Xi(e){let[t,n]=E.useState(null),r=l((t,r)=>{e||n(r||(N?`touch`:``))});Yi(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=Ji(r);return E.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function Zi(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=Xi(a);si(t);let{forceUnmount:d}=ci(a,t),f=E.useCallback(()=>{t.setOpen(!1,En(Tn))},[t]);E.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]);let p=mi({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,h]=E.useState(0),[g,_]=E.useState(0),v=m===0,y=yi(p),b=Hr(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=be(e);if(v&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||R(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});qi(a&&s===!0,c);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=hi([y,b]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{h(e),_(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0),_(0)}),E.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(m+1,g+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,m,g,n]);let w=E.useMemo(()=>x(u),[x,u]),ee=E.useMemo(()=>C(u),[C,u]),te=E.useMemo(()=>S(),[S]);t.useSyncedValues({openMethod:l,activeTriggerProps:w,inactiveTriggerProps:ee,popupProps:te,floatingRootContext:p,nestedOpenDialogCount:m,nestedOpenDrawerCount:g})}var Qi={...pi,modal:H(e=>e.modal),nested:H(e=>e.nested),nestedOpenDialogCount:H(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:H(e=>e.nestedOpenDrawerCount),disablePointerDismissal:H(e=>e.disablePointerDismissal),openMethod:H(e=>e.openMethod),descriptionElementId:H(e=>e.descriptionElementId),titleElementId:H(e=>e.titleElementId),viewportElement:H(e=>e.viewportElement),role:H(e=>e.role)},$i=class e extends ni{constructor(e){super(ea(e),{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new li,onOpenChange:void 0,onOpenChangeComplete:void 0},Qi)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=T(()=>new e(n)).current;return t??r}};function ea(e={}){return{...di(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var ta=E.createContext(!1);function na(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=On(!0),p=E.useContext(ta),m=!!f,h=$i.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});Ri(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);Zi({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=E.useMemo(()=>({store:h}),[h]);return(0,I.jsx)(ta.Provider,{value:!1,children:(0,I.jsx)(Dn.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}var ra=E.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=On(),c=k(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),u(`h2`,e,{ref:t,props:[{id:c},o]})});Object.freeze({status:`aborted`});function U(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var ia=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},aa=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},oa={};function sa(e){return e&&Object.assign(oa,e),oa}function ca(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function la(e,t){return typeof t==`bigint`?t.toString():t}function ua(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function da(e){return e==null}function fa(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function pa(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var ma=Symbol(`evaluating`);function W(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ma)return r===void 0&&(r=ma,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ha(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ga(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function _a(e){return JSON.stringify(e)}function va(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ya=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ba(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var xa=ua(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Sa(e){if(ba(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ba(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ca(e){return Sa(e)?{...e}:Array.isArray(e)?[...e]:e}var wa=new Set([`string`,`number`,`symbol`]);function Ta(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ea(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Da(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Oa={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ka(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ea(e,ga(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ha(this,`shape`,e),e},checks:[]}))}function Aa(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ea(e,ga(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ha(this,`shape`,r),r},checks:[]}))}function ja(e,t){if(!Sa(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ea(e,ga(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ha(this,`shape`,n),n}}))}function Ma(e,t){if(!Sa(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ea(e,ga(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ha(this,`shape`,n),n}}))}function Na(e,t){return Ea(e,ga(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ha(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Pa(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ea(t,ga(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ha(this,`shape`,i),i},checks:[]}))}function Fa(e,t,n){return Ea(t,ga(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return ha(this,`shape`,i),i}}))}function Ia(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function La(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ra(e){return typeof e==`string`?e:e?.message}function za(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Ra(e.inst?._zod.def?.error?.(e))??Ra(t?.error?.(e))??Ra(n.customError?.(e))??Ra(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ba(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Va(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ha=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,la,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ua=U(`$ZodError`,Ha),Wa=U(`$ZodError`,Ha,{Parent:Error});function Ga(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ka(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var qa=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ia;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>za(e,a,sa())));throw ya(t,i?.callee),t}return o.value},Ja=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>za(e,a,sa())));throw ya(t,i?.callee),t}return o.value},Ya=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ia;return a.issues.length?{success:!1,error:new(e??Ua)(a.issues.map(e=>za(e,i,sa())))}:{success:!0,data:a.value}},Xa=Ya(Wa),Za=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>za(e,i,sa())))}:{success:!0,data:a.value}},Qa=Za(Wa),$a=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return qa(e)(t,n,i)},eo=e=>(t,n,r)=>qa(e)(t,n,r),to=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ja(e)(t,n,i)},no=e=>async(t,n,r)=>Ja(e)(t,n,r),ro=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ya(e)(t,n,i)},io=e=>(t,n,r)=>Ya(e)(t,n,r),ao=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Za(e)(t,n,i)},oo=e=>async(t,n,r)=>Za(e)(t,n,r),so=/^[cC][^\s-]{8,}$/,co=/^[0-9a-z]+$/,lo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uo=/^[0-9a-vA-V]{20}$/,fo=/^[A-Za-z0-9]{27}$/,po=/^[a-zA-Z0-9_-]{21}$/,mo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ho=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,go=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_o=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vo=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function yo(){return new RegExp(vo,`u`)}var bo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,So=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Co=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,To=/^[A-Za-z0-9_-]*$/,Eo=/^\+[1-9]\d{6,14}$/,Do=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Oo=RegExp(`^${Do}$`);function ko(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ao(e){return RegExp(`^${ko(e)}$`)}function jo(e){let t=ko({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Do}T(?:${r})$`)}var Mo=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},No=/^-?\d+$/,Po=/^-?\d+(?:\.\d+)?$/,Fo=/^(?:true|false)$/i,Io=/^[^A-Z]*$/,Lo=/^[^a-z]*$/,K=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ro={number:`number`,bigint:`bigint`,object:`date`},zo=U(`$ZodCheckLessThan`,(e,t)=>{K.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bo=U(`$ZodCheckGreaterThan`,(e,t)=>{K.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vo=U(`$ZodCheckMultipleOf`,(e,t)=>{K.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):pa(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ho=U(`$ZodCheckNumberFormat`,(e,t)=>{K.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Oa[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=No)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Uo=U(`$ZodCheckMaxLength`,(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!da(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ba(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wo=U(`$ZodCheckMinLength`,(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!da(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ba(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Go=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!da(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ba(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ko=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;K.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),qo=U(`$ZodCheckRegex`,(e,t)=>{Ko.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jo=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Io,Ko.init(e,t)}),Yo=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Lo,Ko.init(e,t)}),Xo=U(`$ZodCheckIncludes`,(e,t)=>{K.init(e,t);let n=Ta(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Zo=U(`$ZodCheckStartsWith`,(e,t)=>{K.init(e,t);let n=RegExp(`^${Ta(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Qo=U(`$ZodCheckEndsWith`,(e,t)=>{K.init(e,t);let n=RegExp(`.*${Ta(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$o=U(`$ZodCheckOverwrite`,(e,t)=>{K.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),es=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
1
|
+
import{A as e,C as t,D as n,E as r,L as i,M as a,N as o,P as s,R as c,_ as l,a as u,c as d,d as f,et as p,g as m,h,it as g,j as _,k as v,l as y,nt as b,p as x,rt as S,s as C,st as w,tt as ee,u as te,v as T,y as ne}from"./button-r9cVFa0_.js";var re=c(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),E=w(g()),ie=0;function ae(e,t=`mui`){let[n,r]=E.useState(e),i=e||n;return E.useEffect(()=>{n??(ie+=1,r(`${t}-${ie}`))},[n,t]),i}var D=m.useId;function O(e,t){if(D!==void 0){let n=D();return e??(t?`${t}-${n}`:n)}return ae(e,t)}function k(e){return O(e,`base-ui`)}function A(e){return e?.ownerDocument||document}var j=typeof navigator<`u`,oe=fe(),se=F(),M=pe(),ce=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),N=oe.platform===`MacIntel`&&oe.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(oe.platform);j&&/firefox/i.test(M);var le=j&&/apple/i.test(navigator.vendor);j&&/Edg/i.test(M);var P=j&&/android/i.test(se)||/android/i.test(M),ue=j&&se.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,de=M.includes(`jsdom/`);function fe(){if(!j)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function pe(){if(!j)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function F(){if(!j)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var I=b(),me=`data-base-ui-focusable`,L=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,he=`ArrowLeft`,ge=`ArrowRight`,_e=`ArrowUp`,ve=`ArrowDown`;function ye(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function R(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&s(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function be(e){return`composedPath`in e?e.composedPath()[0]:e.target}function xe(e,t){if(!v(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(R(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function z(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Se(e){return e.matches(`html,body`)}function Ce(t){return e(t)&&t.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function we(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${L}`)!=null}function Te(e){return e?e.getAttribute(`role`)===`combobox`&&Ce(e):!1}function Ee(e){if(!e||de)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function De(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Oe(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Oe(e,t.id,n)])}function ke(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Ae(e){e.preventDefault(),e.stopPropagation()}function je(e){return`nativeEvent`in e}function Me(e){return e.pointerType===``&&e.isTrusted?!0:P&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ne(e){return de?!1:!P&&e.width===0&&e.height===0||P&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Pe(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Fe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Ie=[`top`,`right`,`bottom`,`left`],Le=Math.min,Re=Math.max,ze=Math.round,Be=Math.floor,Ve=e=>({x:e,y:e}),He={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ue(e,t,n){return Re(e,Le(t,n))}function We(e,t){return typeof e==`function`?e(t):e}function Ge(e){return e.split(`-`)[0]}function Ke(e){return e.split(`-`)[1]}function qe(e){return e===`x`?`y`:`x`}function Je(e){return e===`y`?`height`:`width`}function Ye(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Xe(e){return qe(Ye(e))}function Ze(e,t,n){n===void 0&&(n=!1);let r=Ke(e),i=Xe(e),a=Je(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ot(o)),[o,ot(o)]}function Qe(e){let t=ot(e);return[$e(e),t,$e(t)]}function $e(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var et=[`left`,`right`],tt=[`right`,`left`],nt=[`top`,`bottom`],rt=[`bottom`,`top`];function it(e,t,n){switch(e){case`top`:case`bottom`:return n?t?tt:et:t?et:tt;case`left`:case`right`:return t?nt:rt;default:return[]}}function at(e,t,n,r){let i=Ke(e),a=it(Ge(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($e)))),a}function ot(e){let t=Ge(e);return He[t]+e.slice(t.length)}function st(e){return{top:0,right:0,bottom:0,left:0,...e}}function ct(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:st(e)}function lt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ut(e,t,n){return Math.floor(e/t)!==n}function dt(e,t){return t<0||t>=e.length}function ft(e,t){return B(e.current,{disabledIndices:t})}function pt(e,t){return B(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function B(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&vt(e,a,r));return a}function mt(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1);o=a[i(t,u,n[o][e]??n[o][0])]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!vt(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Be(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!vt(e,r,s))return r}};d&&Ae(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=B(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=B(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}dt(e,f)&&(f=u)}if(n===`both`){let n=Be(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Ae(t),u%o===o-1?r&&(f=B(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=B(e,{startingIndex:u,disabledIndices:s}),r&&ut(f,o,n)&&(f=B(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),ut(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Ae(t),u%o===0?r&&(f=B(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=B(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&ut(f,o,n)&&(f=B(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),ut(f,o,n)&&(f=u));let c=Be(l/o)===n;dt(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:B(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function ht(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function gt(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function _t(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function vt(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?bt(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function yt(e){return e.visibility===`hidden`||e.visibility===`collapse`}function bt(e,t=e?ne(e):null){return!e||!e.isConnected||!t||yt(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var xt=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function St(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return s(n)?n.host:null}function Ct(e){for(let n of Array.from(e.children))if(t(n)===`summary`)return n;return null}function wt(e,t){let n=Ct(t);return!!n&&(e===n||R(n,e))}function Tt(e){let n=e?t(e):``;return e!=null&&e.matches(xt)&&(n!==`summary`||e.parentElement!=null&&t(e.parentElement)===`details`&&Ct(e.parentElement)===e)&&(n!==`details`||Ct(e)==null)&&(n!==`input`||e.type!==`hidden`)}function Et(e){if(!Tt(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let n=e;n;n=St(n)){let r=n!==e,i=t(n)===`slot`;if(n.hasAttribute(`inert`)||r&&t(n)===`details`&&!n.open&&!wt(e,n)||n.hasAttribute(`hidden`)||!i&&!Dt(n,r))return!1}return!0}function Dt(e,t){let n=ne(e);return t?n.display!==`none`:bt(e,n)}function Ot(n){let r=n.tabIndex;if(r<0){let r=t(n);if(r===`details`||r===`audio`||r===`video`||e(n)&&n.isContentEditable)return 0}return r}function kt(e){if(t(e)!==`input`)return null;let n=e;return n.type===`radio`&&n.name!==``?n:null}function At(e,t){let n=kt(e);if(!n)return!0;let r=t.find(e=>{let t=kt(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=kt(e);return t?.name===n.name&&t.form===n.form})===n}function jt(n){if(e(n)&&t(n)===`slot`){let e=n.assignedElements({flatten:!0});if(e.length>0)return e}return e(n)&&n.shadowRoot?Array.from(n.shadowRoot.children):Array.from(n.children)}function Mt(e,t){jt(e).forEach(e=>{Tt(e)&&t.push(e),Mt(e,t)})}function Nt(t,n,r){jt(t).forEach(t=>{e(t)&&t.matches(n)&&r.push(t),Nt(t,n,r)})}function Pt(e){return Et(e)&&Ot(e)>=0}function Ft(e){let t=[];return Mt(e,t),t.filter(Et)}function It(e){let t=Ft(e);return t.filter(e=>Ot(e)>=0&&At(e,t))}function Lt(e,t){let n=It(e),r=n.length;if(r===0)return;let i=ye(A(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Rt(e){return Lt(A(e).body,1)||e}function zt(e){return Lt(A(e).body,-1)||e}function Bt(e,t){if(!e)return null;let n=It(A(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Vt(e){return Bt(e,1)}function Ht(e){return Bt(e,-1)}function Ut(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!R(n,r)}function Wt(e){It(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Gt(e){let t=[];Nt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Kt=[];function qt(e){E.useEffect(e,Kt)}var Jt=0,Yt=class e{static create(){return new e}currentId=Jt;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Jt,t()},e)}isStarted(){return this.currentId!==Jt}clear=()=>{this.currentId!==Jt&&(clearTimeout(this.currentId),this.currentId=Jt)};disposeEffect=()=>this.clear};function Xt(){let e=T(Yt.create).current;return qt(e.disposeEffect),e}var Zt=null;globalThis.requestAnimationFrame;var Qt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},$t=class e{static create(){return new e}static request(e){return Qt.request(e)}static cancel(e){return Qt.cancel(e)}currentId=Zt;request(e){this.cancel(),this.currentId=Qt.request(()=>{this.currentId=Zt,e()})}cancel=()=>{this.currentId!==Zt&&(Qt.cancel(this.currentId),this.currentId=Zt)};disposeEffect=()=>this.cancel};function en(){let e=T($t.create).current;return qt(e.disposeEffect),e}var tn=w(S());function nn(e){return e==null?e:`current`in e?e.current:e}var rn=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),an={[rn.startingStyle]:``},on={[rn.endingStyle]:``},sn={transitionStatus(e){return e===`starting`?an:e===`ending`?on:null}},cn=ee(),ln=p();function un(e,t=!1,n=!0){let r=en();return l((i,a=null)=>{r.cancel();let o=nn(e);if(o==null)return;let s=o,c=()=>{tn.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=rn.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function dn(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=l(i),o=un(r,n,!1);E.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function fn(e,t=!1,n=!1){let[r,i]=E.useState(e&&t?`idle`:void 0),[a,o]=E.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),h(()=>{if(!e&&a&&r!==`ending`&&n){let e=$t.request(()=>{i(`ending`)});return()=>{$t.cancel(e)}}},[e,a,r,n]),h(()=>{if(!e||t)return;let n=$t.request(()=>{i(void 0)});return()=>{$t.cancel(n)}},[t,e]),h(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=$t.request(()=>{i(`idle`)});return()=>{$t.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var pn=`none`,mn=`trigger-press`,hn=`trigger-hover`,gn=`trigger-focus`,_n=`outside-press`,vn=`item-press`,yn=`close-press`,bn=`focus-out`,xn=`escape-key`,Sn=`list-navigation`,Cn=`cancel-open`,wn=`sibling-open`,Tn=`imperative-action`;function En(e,t,n,r){let i=!1,a=!1,o=r??C;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var Dn=E.createContext(void 0);function On(e){let t=E.useContext(Dn);if(e===!1&&t===void 0)throw Error(x(27));return t}var kn=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=rn.startingStyle]=`startingStyle`,e[e.endingStyle=rn.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),An=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),jn={[An.popupOpen]:``},Mn={[An.popupOpen]:``,[An.pressed]:``},Nn={[kn.open]:``},Pn={[kn.closed]:``},Fn={[kn.anchorHidden]:``},In={open(e){return e?jn:null}},Ln={open(e){return e?Mn:null}},Rn={open(e){return e?Nn:Pn},anchorHidden(e){return e?Fn:null}},zn={...Rn,...sn},Bn=E.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=On(),c=s.useState(`open`),l=s.useState(`nested`),d=s.useState(`mounted`);return u(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:zn,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Vn=E.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=On(),l=c.useState(`open`);function d(e){l&&c.setOpen(!1,En(yn,e.nativeEvent))}let{getButtonProps:p,buttonRef:m}=f({disabled:i,native:a});return u(`button`,e,{state:{disabled:i},ref:[t,m],props:[{onClick:d},s,p]})}),Hn=E.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=On(),c=k(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),u(`p`,e,{ref:t,props:[{id:c},o]})});function V(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Un(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Wn(e){let t=T(Gn,e).current;return t.next=e,h(t.effect),t}function Gn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Kn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},qn={...Kn,position:`fixed`,top:0,left:0},Jn={...Kn,position:`absolute`},Yn=E.forwardRef(function(e,t){let[n,r]=E.useState();h(()=>{le&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,I.jsx)(`span`,{...e,ref:t,style:qn,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});function Xn(e){return`data-base-ui-${e}`}var Zn=0;function Qn(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Zn);let a=()=>e?.focus({preventScroll:n});if(i)return a(),d;let o=requestAnimationFrame(a);return Zn=o,()=>{Zn===o&&(cancelAnimationFrame(o),Zn=0)}}var $n={inert:new WeakMap,"aria-hidden":new WeakMap},er=`data-base-ui-inert`,tr={inert:new WeakSet,"aria-hidden":new WeakSet},nr=new WeakMap,rr=0;function ir(e){return tr[e]}function ar(e){return e?s(e)?e.host:ar(e.parentNode):null}var or=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ar(t);return e.contains(n)?n:null}).filter(e=>e!=null),sr=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},cr=(e,n,r)=>{let i=[],a=e=>{!e||r.has(e)||Array.from(e.children).forEach(e=>{t(e)!==`script`&&(n.has(e)?a(e):i.push(e))})};return a(e),i};function lr(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=or(t,e),u=i?or(t,a):[],d=new Set(u),f=i?cr(t,sr(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=$n[o],n=ir(o);c=n,s=e;let r=or(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);cr(t,sr(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(nr.get(e)||0)+1;nr.set(e,t),m.push(e),t===1&&e.setAttribute(er,``)}),rr+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(nr.get(e)||0)-1;nr.set(e,t),t||e.removeAttribute(er)}),--rr,rr||($n.inert=new WeakMap,$n[`aria-hidden`]=new WeakMap,tr.inert=new WeakSet,tr[`aria-hidden`]=new WeakSet,nr=new WeakMap)}}function ur(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=A(e[0]).body;return lr(e,o,n,r,{mark:i,markerIgnoreElements:a})}var dr={style:{transition:`none`}},fr=`data-base-ui-click-trigger`,pr={fallbackAxisSide:`none`},mr={fallbackAxisSide:`end`},hr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},gr=E.createContext(null),_r=()=>E.useContext(gr),vr=Xn(`portal`);function yr(e={}){let{ref:t,container:n,componentProps:r=C,elementProps:i}=e,o=O(),s=_r()?.portalNode,[c,d]=E.useState(null),[f,p]=E.useState(null),m=l(e=>{e!==null&&p(e)}),g=E.useRef(null);h(()=>{if(n===null){g.current&&(g.current=null,p(null),d(null));return}if(o==null)return;let e=(n&&(a(n)?n:n.current))??s??document.body;if(e==null){g.current&&(g.current=null,p(null),d(null));return}g.current!==e&&(g.current=e,p(null),d(e))},[n,s,o]);let _=u(`div`,r,{ref:[t,m],props:[{id:o,[vr]:``},i]});return{portalNode:f,portalSubtree:c&&_?tn.createPortal(_,c):null}}var br=E.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,style:s,...c}=e,{portalNode:l,portalSubtree:u}=yr({container:r,ref:t,componentProps:e,elementProps:c}),d=E.useRef(null),f=E.useRef(null),p=E.useRef(null),m=E.useRef(null),[h,g]=E.useState(null),_=E.useRef(!1),v=h?.modal,y=h?.open,b=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!l;E.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&Ut(e)&&(e.type===`focusin`?_.current&&=(Gt(l),!1):(Wt(l),_.current=!0))}return Un(V(l,`focusin`,e,!0),V(l,`focusout`,e,!0))},[l,v]),E.useEffect(()=>{!l||y!==!1||(Gt(l),_.current=!1)},[y,l]);let x=E.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,I.jsxs)(E.Fragment,{children:[u,(0,I.jsxs)(gr.Provider,{value:x,children:[b&&l&&(0,I.jsx)(Yn,{"data-type":`outside`,ref:d,onFocus:e=>{Ut(e,l)?p.current?.focus():zt(h?h.domReference:null)?.focus()}}),b&&l&&(0,I.jsx)(`span`,{"aria-owns":l.id,style:hr}),l&&tn.createPortal(n,l),b&&l&&(0,I.jsx)(Yn,{"data-type":`outside`,ref:f,onFocus:e=>{Ut(e,l)?m.current?.focus():(Rt(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,En(`focus-out`,e.nativeEvent)))}})]})]})});function xr(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Sr=class{nodesRef={current:[]};events=xr();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Cr=E.createContext(null),wr=E.createContext(null),Tr=()=>E.useContext(Cr)?.id||null,Er=e=>{let t=E.useContext(wr);return e??t};function Dr(e){let t=O(),n=Er(e),r=Tr();return h(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Or(e){let{children:t,id:n}=e,r=Tr();return(0,I.jsx)(Cr.Provider,{value:E.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kr(e){let{children:t,externalTree:n}=e,r=T(()=>n??new Sr).current;return(0,I.jsx)(wr.Provider,{value:r,children:t})}function Ar(e,t){let r=n(be(e));return e instanceof r.KeyboardEvent?`keyboard`:e instanceof r.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof r.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var jr=20,Mr=[];function Nr(){Mr=Mr.filter(e=>e.deref()?.isConnected)}function Pr(e){Nr(),e&&t(e)!==`body`&&(Mr.push(new WeakRef(e)),Mr.length>jr&&(Mr=Mr.slice(-jr)))}function Fr(){return Nr(),Mr[Mr.length-1]?.deref()}function Ir(e){return e?Pt(e)?e:It(e)[0]||e:null}function Lr(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Ft(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Pt(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Rr(t){let{context:n,children:r,disabled:i=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:g,getInsideElements:_}=t,v=`rootStore`in n?n.rootStore:n,y=v.useState(`open`),b=v.useState(`domReferenceElement`),x=v.useState(`floatingElement`),{events:S,dataRef:C}=v.context,w=l(()=>C.current.floatingContext?.nodeId),ee=a===!1,T=Te(b)&&ee,ne=E.useRef([`content`]),re=Wn(a),ie=Wn(o),ae=Wn(d),D=Er(g),O=_r(),k=E.useRef(!1),j=E.useRef(!1),oe=E.useRef(!1),se=E.useRef(null),M=E.useRef(``),N=E.useRef(``),le=E.useRef(null),P=E.useRef(null),ue=te(le,m,O?.beforeInsideRef),de=te(P,O?.afterInsideRef),fe=Xt(),pe=Xt(),F=en(),me=O!=null,L=De(x),he=l((e=L)=>e?It(e):[]),ge=l(()=>_?.().filter(e=>e!=null)??[]);E.useEffect(()=>{if(i||!c)return;function e(e){e.key===`Tab`&&R(L,ye(A(L)))&&he().length===0&&!T&&Ae(e)}return V(A(L),`keydown`,e)},[i,b,L,c,ne,T,he]),E.useEffect(()=>{if(i||!y)return;let e=A(L);function t(){oe.current=!1}function n(e){let t=be(e),n=ge();oe.current=!(R(x,t)||R(b,t)||R(O?.portalNode,t)||n.some(e=>e===t||R(e,t))),N.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0)}function r(){N.current=`keyboard`}return Un(V(e,`pointerdown`,n,!0),V(e,`pointerup`,t,!0),V(e,`pointercancel`,t,!0),V(e,`keydown`,r,!0))},[i,x,b,L,y,O,ge]),E.useEffect(()=>{if(i||!u)return;let t=A(L);function n(){j.current=!0,pe.start(0,()=>{j.current=!1})}function r(e){let t=be(e);Pt(t)&&(se.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=be(n);queueMicrotask(()=>{let o=w(),l=v.context.triggerElements,u=ge(),d=r?.hasAttribute(Xn(`focus-guard`))&&[le.current,P.current,O?.beforeInsideRef.current,O?.afterInsideRef.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,nn(p),nn(f)].includes(r),m=!(R(b,r)||R(x,r)||R(r,x)||R(O?.portalNode,r)||u.some(e=>e===r||R(e,r))||r!=null&&l.hasElement(r)||l.hasMatchingElement(e=>R(e,r))||d||D&&(Oe(D.nodesRef.current,o).find(e=>R(e.context?.elements.floating,r)||R(e.context?.elements.domReference,r))||ke(D.nodesRef.current,o).find(e=>[e.context?.elements.floating,De(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===b&&L&&Lr(L,ne),s&&i!==b&&!bt(a)&&ye(t)===t.body){if(e(L)&&(L.focus(),s===`popup`)){F.request(()=>{L.focus()});return}let t=he(),n=se.current,r=(n&&t.includes(n)?n:null)||t[t.length-1]||L;e(r)&&r.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(T||!c)&&r&&m&&!j.current&&(T||r!==Fr())&&(k.current=!0,v.setOpen(!1,En(bn,n)))})}function o(){oe.current||(C.current.insideReactTree=!0,fe.start(0,()=>{C.current.insideReactTree=!1}))}let l=e(b)?b:null;if(!(!x&&!l))return Un(l&&V(l,`focusout`,a),l&&V(l,`pointerdown`,n),x&&V(x,`focusin`,r),x&&V(x,`focusout`,a),x&&O&&V(x,`focusout`,o,!0))},[i,b,x,L,c,D,O,v,u,s,he,T,w,ne,C,fe,pe,F,f,p,ge]),E.useEffect(()=>{if(i||!x||!y)return;let e=Array.from(O?.portalNode?.querySelectorAll(`[${Xn(`portal`)}]`)||[]),t=(D?ke(D.nodesRef.current,w()):[]).find(e=>Te(e.context?.elements.domReference||null))?.context?.elements.domReference,n=ur([...[x,...e,le.current,P.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,...ge()],t,nn(p),nn(f),T?b:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),r=ur([x,...e].filter(e=>e!=null));return()=>{r(),n()}},[y,i,b,x,c,ne,O,T,D,w,f,p,ge]),h(()=>{if(!y||i||!e(L))return;let t=ye(A(L));queueMicrotask(()=>{let e=re.current,n=typeof e==`function`?e(ae.current||``):e;if(n===void 0||n===!1||R(L,t))return;let r=null,i=()=>(r??=he(L),r[0]||L),a;a=n===!0||n===null?i():nn(n),a||=i(),Qn(a,{preventScroll:a===L})})},[i,y,L,ee,he,re,ae]),h(()=>{if(i||!L)return;let t=A(L);Pr(ye(t));function n(e){if(e.open||(M.current=Ar(e.nativeEvent,N.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(k.current=!0),e.reason===`outside-press`)if(e.nested)k.current=!1;else if(Me(e.nativeEvent)||Ne(e.nativeEvent))k.current=!1;else{let e=!1;A(L).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?k.current=!1:k.current=!0}}S.on(`openchange`,n);function r(){let e=ie.current,t=typeof e==`function`?e(M.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=b||Fr();return e&&e.isConnected?e:null}let n=b||Fr();return nn(t)||n||null}return()=>{S.off(`openchange`,n);let i=ye(t),a=ge(),o=R(x,i)||a.some(e=>e===i||R(e,i))||D&&Oe(D.nodesRef.current,w(),!1).some(e=>R(e.context?.elements.floating,i)),s=ie.current,c=r();queueMicrotask(()=>{let n=Ir(c),r=typeof s!=`boolean`;s&&!k.current&&e(n)&&(!(!r&&n!==i&&i!==t.body)||o)&&n.focus({preventScroll:!0}),k.current=!1})}},[i,x,L,ie,C,S,D,b,w,ge]),h(()=>{if(!ce||y||!x)return;let t=ye(A(x));!e(t)||!Ce(t)||R(x,t)&&t.blur()},[y,x]),h(()=>{if(!(i||!O))return O.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:v.setOpen,domReference:b}),()=>{O.setFocusManagerState(null)}},[i,O,c,y,v,u,b]),h(()=>{if(!(i||!L))return Lr(L,ne),()=>{queueMicrotask(Nr)}},[i,L,ne]);let _e=!i&&(c?!T:!0)&&(me||c);return(0,I.jsxs)(E.Fragment,{children:[_e&&(0,I.jsx)(Yn,{"data-type":`inside`,ref:ue,onFocus:e=>{if(c){let e=he();Qn(e[e.length-1])}else O?.portalNode&&(k.current=!1,Ut(e,O.portalNode)?Rt(b)?.focus():nn(p??O.beforeOutsideRef)?.focus())}}),r,_e&&(0,I.jsx)(Yn,{"data-type":`inside`,ref:de,onFocus:e=>{c?Qn(he()[0]):O?.portalNode&&(u&&(k.current=!0),Ut(e,O.portalNode)?zt(b)?.focus():nn(f??O.afterOutsideRef)?.focus())}})]})}var zr={intentional:`onClick`,sloppy:`onPointerDown`};function Br(){return!1}function Vr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Hr(t,n={}){let a=`rootStore`in t?t.rootStore:t,o=a.useState(`open`),c=a.useState(`floatingElement`),{dataRef:u}=a.context,{enabled:d=!0,escapeKey:f=!0,outsidePress:p=!0,outsidePressEvent:m=`sloppy`,referencePress:h=Br,referencePressEvent:g=`sloppy`,bubbles:y,externalTree:b}=n,x=Er(b),S=l(typeof p==`function`?p:()=>!1),C=typeof p==`function`?S:p,w=C!==!1,ee=l(()=>m),te=E.useRef(!1),T=E.useRef(!1),re=E.useRef(!1),{escapeKey:ie,outsidePress:ae}=Vr(y),D=E.useRef(null),O=Xt(),k=Xt(),j=l(()=>{k.clear(),u.current.insideReactTree=!1}),oe=E.useRef(!1),se=E.useRef(``),M=l(h),ce=l(e=>{if(!o||!d||!f||e.key!==`Escape`||oe.current)return;let t=u.current.floatingContext?.nodeId,n=x?Oe(x.nodesRef.current,t):[];if(!ie&&n.length>0){let e=!0;if(n.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let r=En(xn,je(e)?e.nativeEvent:e);a.setOpen(!1,r),!ie&&!r.isPropagationAllowed&&e.stopPropagation()}),N=l(()=>{u.current.insideReactTree=!0,k.start(0,j)});E.useEffect(()=>{if(!o||!d)return;u.current.__escapeKeyBubbles=ie,u.current.__outsidePressBubbles=ae;let t=new Yt,n=new Yt;function l(){t.clear(),oe.current=!0}function p(){t.start(i()?5:0,()=>{oe.current=!1})}function m(){re.current=!0,n.start(0,()=>{re.current=!1})}function h(){te.current=!1,T.current=!1}function g(){let e=se.current,t=e===`pen`||!e?`mouse`:e,n=ee(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function y(e){let t=g();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function b(e){let t=u.current.floatingContext?.nodeId,n=x&&Oe(x.nodesRef.current,t).some(t=>z(e,t.context?.elements.floating));return z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`))||n}function S(t){if(y(t)){j();return}if(u.current.insideReactTree){j();return}let i=be(t),o=`[${Xn(`inert`)}]`,c=v(i)?i.getRootNode():null,l=Array.from((s(c)?c:A(a.select(`floatingElement`))).querySelectorAll(o)),d=a.context.triggerElements;if(i&&(d.hasElement(i)||d.hasMatchingElement(e=>R(e,i))))return;let f=v(i)?i:null;for(;f&&!_(f);){let e=r(f);if(_(e)||!v(e))break;f=e}if(l.length&&v(i)&&!Se(i)&&!R(i,a.select(`floatingElement`))&&l.every(e=>!R(f,e)))return;if(e(i)&&!(`touches`in t)){let e=_(i),n=ne(i),r=/auto|scroll/,a=e||r.test(n.overflowX),o=e||r.test(n.overflowY),s=a&&i.clientWidth>0&&i.scrollWidth>i.clientWidth,c=o&&i.clientHeight>0&&i.scrollHeight>i.clientHeight,l=n.direction===`rtl`,u=c&&(l?t.offsetX<=i.offsetWidth-i.clientWidth:t.offsetX>i.clientWidth),d=s&&t.offsetY>i.clientHeight;if(u||d)return}if(b(t))return;if(g()===`intentional`&&re.current){n.clear(),re.current=!1;return}if(typeof C==`function`&&!C(t))return;let p=u.current.floatingContext?.nodeId,m=x?Oe(x.nodesRef.current,p):[];if(m.length>0){let e=!0;if(m.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}a.setOpen(!1,En(_n,t)),j()}function E(e){g()!==`sloppy`||e.pointerType===`touch`||!a.select(`open`)||!d||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`))||S(e)}function k(e){if(g()!==`sloppy`||!a.select(`open`)||!d||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function M(e,t){let n=be(e);if(!n)return;let r=V(n,e.type,()=>{t(e),r()})}function N(e){se.current=`touch`,M(e,k)}function le(e){O.clear(),e.type===`pointerdown`&&(se.current=e.pointerType),!(e.type===`mousedown`&&D.current&&!D.current.dismissOnMouseDown)&&M(e,e=>{e.type===`pointerdown`?E(e):S(e)})}function P(e){if(!te.current)return;let t=T.current;if(h(),g()===`intentional`){if(e.type===`pointercancel`){t&&m();return}if(!b(e)){if(t){m();return}typeof C==`function`&&!C(e)||(n.clear(),re.current=!0,j())}}}function ue(e){if(g()!==`sloppy`||!D.current||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(S(e),O.clear(),D.current=null)}function de(e){M(e,ue)}function fe(e){g()!==`sloppy`||!D.current||z(e,a.select(`floatingElement`))||z(e,a.select(`domReferenceElement`))||(D.current.dismissOnTouchEnd&&S(e),O.clear(),D.current=null)}function pe(e){M(e,fe)}let F=A(c),I=Un(f&&Un(V(F,`keydown`,ce),V(F,`compositionstart`,l),V(F,`compositionend`,p)),w&&Un(V(F,`click`,le,!0),V(F,`pointerdown`,le,!0),V(F,`pointerup`,P,!0),V(F,`pointercancel`,P,!0),V(F,`mousedown`,le,!0),V(F,`mouseup`,P,!0),V(F,`touchstart`,N,!0),V(F,`touchmove`,de,!0),V(F,`touchend`,pe,!0)));return()=>{I(),t.clear(),n.clear(),h(),re.current=!1}},[u,c,f,w,C,o,d,ie,ae,ce,j,ee,x,a,O]),E.useEffect(j,[C,j]);let le=E.useMemo(()=>({onKeyDown:ce,[zr[g]]:e=>{M()&&a.setOpen(!1,En(mn,e.nativeEvent))},...g!==`intentional`&&{onClick(e){M()&&a.setOpen(!1,En(`trigger-press`,e.nativeEvent))}}}),[ce,a,g,M]),P=l(e=>{if(!o||!d||e.button!==0)return;let t=be(e.nativeEvent);R(a.select(`floatingElement`),t)&&(te.current||(te.current=!0,T.current=!1))}),ue=l(e=>{!o||!d||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&te.current&&(T.current=!0)}),de=E.useMemo(()=>({onKeyDown:ce,onPointerDown:ue,onMouseDown:ue,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[ce,N,P,ue]);return E.useMemo(()=>d?{reference:le,floating:de,trigger:le}:{},[d,le,de])}var H=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(x(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Ur=[],Wr=void 0;function Gr(){return Wr}function Kr(e){Ur.push(e)}function qr(e){let t=(t,n)=>{let r=T(Yr).current,i;try{Wr=r;for(let e of Ur)e.before(r);i=e(t,n);for(let e of Ur)e.after(r);r.didInitialize=!0}finally{Wr=void 0}return i};return t.displayName=e.displayName||e.name,t}function Jr(e){return E.forwardRef(qr(e))}function Yr(){return{didInitialize:!1}}var Xr=y(19)?$r:ei;function Zr(e,t,n,r,i){return Xr(e,t,n,r,i)}function Qr(e,t,n,r,i){let a=E.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,cn.useSyncExternalStore)(e.subscribe,a,a)}Kr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,cn.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function $r(e,t,n,r,i){let a=Gr();if(!a)return Qr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function ei(e,t,n,r,i){return(0,ln.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var ti=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Zr(this,e,t,n,r)}},ni=class extends ti{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){E.useDebugValue(e),h(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;h(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;h(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){E.useDebugValue(e);let n=t!==void 0;h(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return E.useDebugValue(e),Zr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){E.useDebugValue(e);let n=l(t??d);this.context[e]=n}useStateSetter(e){let t=E.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},ri={open:H(e=>e.open),transitionStatus:H(e=>e.transitionStatus),domReferenceElement:H(e=>e.domReferenceElement),referenceElement:H(e=>e.positionReference??e.referenceElement),floatingElement:H(e=>e.floatingElement),floatingId:H(e=>e.floatingId)},ii=class extends ni{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:xr(),nested:n,triggerElements:i},ri),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Fe(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function ai(e,t){let n=E.useRef(null),r=E.useRef(null);return E.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function oi(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ai(e,n),o=l(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return h(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function si(e){let t=e.useState(`open`);h(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function ci(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=fn(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=l(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return dn({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var li=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function ui(){return new ii({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new li,floatingId:``,syncOnly:!1,nested:!1,onOpenChange:void 0})}function di(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ui(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:C,inactiveTriggerProps:C,popupProps:C}}var fi=H(e=>e.triggerIdProp??e.activeTriggerId),pi={open:H(e=>e.openProp??e.open),mounted:H(e=>e.mounted),transitionStatus:H(e=>e.transitionStatus),floatingRootContext:H(e=>e.floatingRootContext),preventUnmountingOnClose:H(e=>e.preventUnmountingOnClose),payload:H(e=>e.payload),activeTriggerId:fi,activeTriggerElement:H(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:H((e,t)=>t!==void 0&&fi(e)===t),isOpenedByTrigger:H((e,t)=>t!==void 0&&fi(e)===t&&e.open),isMountedByTrigger:H((e,t)=>t!==void 0&&fi(e)===t&&e.mounted),triggerProps:H((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:H(e=>e.popupProps),popupElement:H(e=>e.popupElement),positionerElement:H(e=>e.positionerElement)};function mi(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=O(),a=Tr()!=null,o=t.useState(`open`),s=t.useState(`activeTriggerElement`),c=t.useState(n?`popupElement`:`positionerElement`),l=t.context.triggerElements,u=T(()=>new ii({open:o,transitionStatus:void 0,referenceElement:s,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:i,syncOnly:!0,nested:a})).current;return h(()=>{let e={open:o,floatingId:i,referenceElement:s,floatingElement:c};v(s)&&(e.domReferenceElement=s),u.state.positionReference===u.state.referenceElement&&(e.positionReference=s),u.update(e)},[o,i,s,c,u]),u.context.onOpenChange=r,u.context.nested=a,u}function hi(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=E.useCallback(t=>gi(t,e,`reference`),t),o=E.useCallback(t=>gi(t,e,`floating`),n),s=E.useCallback(t=>gi(t,e,`item`),r),c=E.useCallback(t=>gi(t,e,`trigger`),i);return E.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function gi(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[me]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&_i(a,s,i,r)}return _i(a,e,i,r),a}function _i(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var vi=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function yi(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=O(),l=a?.id||c,u=E.useMemo(()=>De(o)?.id||i,[o,i]),d=vi.get(s)??s,f=Tr()!=null,p=E.useMemo(()=>d===`tooltip`||s===`label`?C:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=E.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=E.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=E.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return E.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}var bi=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),xi=function(e){return e[e.open=kn.open]=`open`,e[e.closed=kn.closed]=`closed`,e[e.startingStyle=kn.startingStyle]=`startingStyle`,e[e.endingStyle=kn.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Si=E.createContext(void 0);function Ci(){let e=E.useContext(Si);if(e===void 0)throw Error(x(26));return e}var wi=`ArrowUp`,Ti=`ArrowDown`,Ei=`ArrowLeft`,Di=`ArrowRight`,Oi=`Home`,ki=new Set([Ei,Di]),Ai=new Set([wi,Ti]),ji=new Set([...ki,...Ai]);new Set([...ji,Oi,`End`]);var Mi=new Set([wi,Ti,Ei,Di,Oi,`End`]),Ni={...Rn,...sn,nestedDialogOpen(e){return e?{[xi.nestedDialogOpen]:``}:null}},Pi=E.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=On(),l=c.useState(`descriptionElementId`),d=c.useState(`disablePointerDismissal`),f=c.useState(`floatingRootContext`),p=c.useState(`popupProps`),m=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`);Ci(),dn({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});function C(e){return e===`touch`?c.context.popupRef.current:!0}let w=i===void 0?C:i,ee=u(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:_>0},props:[p,{"aria-labelledby":b??void 0,"aria-describedby":l??void 0,role:S,tabIndex:-1,hidden:!h,onKeyDown(e){Mi.has(e.key)&&e.stopPropagation()},style:{[bi.nestedDialogs]:_}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:Ni});return(0,I.jsx)(Rr,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!d,initialFocus:w,returnFocus:r,modal:m!==!1,restoreFocus:`popup`,children:ee})});function Fi(e){return y(19)?e:e?`true`:void 0}var Ii=E.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,I.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Li=E.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=On(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,I.jsx)(Si.Provider,{value:n,children:(0,I.jsxs)(br,{ref:t,...r,children:[a&&o===!0&&(0,I.jsx)(Ii,{ref:i.context.internalBackdropRef,inert:Fi(!s)}),e.children]})}):null});function Ri(e){let t=E.useRef(!0);t.current&&(t.current=!1,e())}var zi={},Bi={},Vi=``;function Hi(e){if(typeof document>`u`)return!1;let t=A(e);return n(t).innerWidth-t.documentElement.clientWidth>0}function Ui(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=A(e),n=t.documentElement,r=t.body,i=o(n)?n:r,a=i.style.overflowY,s=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let c=i.offsetWidth;i.style.overflowY=`hidden`;let l=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=s,c===l}function Wi(e){let t=A(e),n=t.documentElement,r=t.body,i=o(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Gi(e){let t=A(e),r=t.documentElement,i=t.body,a=n(r),s=0,c=0,l=!1,u=$t.create();if(ce&&(a.visualViewport?.scale??1)!==1)return()=>{};function d(){let t=a.getComputedStyle(r),n=a.getComputedStyle(i),u=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;s=r.scrollTop,c=r.scrollLeft,zi={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},Vi=r.style.scrollBehavior,Bi={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};let d=r.scrollHeight>r.clientHeight,f=r.scrollWidth>r.clientWidth,p=t.overflowY===`scroll`||n.overflowY===`scroll`,m=t.overflowX===`scroll`||n.overflowX===`scroll`,h=Math.max(0,a.innerWidth-i.clientWidth),g=Math.max(0,a.innerHeight-i.clientHeight),_=parseFloat(n.marginTop)+parseFloat(n.marginBottom),v=parseFloat(n.marginLeft)+parseFloat(n.marginRight),y=o(r)?r:i;if(l=Ui(e),l){r.style.scrollbarGutter=u,y.style.overflowY=`hidden`,y.style.overflowX=`hidden`;return}Object.assign(r.style,{scrollbarGutter:u,overflowY:`hidden`,overflowX:`hidden`}),(d||p)&&(r.style.overflowY=`scroll`),(f||m)&&(r.style.overflowX=`scroll`),Object.assign(i.style,{position:`relative`,height:_||g?`calc(100dvh - ${_+g}px)`:`100dvh`,width:v||h?`calc(100vw - ${v+h}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),i.scrollTop=s,i.scrollLeft=c,r.setAttribute(`data-base-ui-scroll-locked`,``),r.style.scrollBehavior=`unset`}function f(){Object.assign(r.style,zi),Object.assign(i.style,Bi),l||(r.scrollTop=s,r.scrollLeft=c,r.removeAttribute(`data-base-ui-scroll-locked`),r.style.scrollBehavior=Vi)}function p(){f(),u.request(d)}d();let m=V(a,`resize`,p);return()=>{u.cancel(),f(),typeof a.removeEventListener==`function`&&m()}}var Ki=new class{lockCount=0;restore=null;timeoutLock=Yt.create();timeoutUnlock=Yt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=A(e).documentElement,r=n(t).getComputedStyle(t).overflowY;if(r===`hidden`||r===`clip`){this.restore=d;return}let i=N||!Hi(e);this.restore=i?Wi(e):Gi(e)}};function qi(e=!0,t=null){h(()=>{if(e)return Ki.acquire(t)},[e,t])}function Ji(e){let t=E.useRef(``),n=E.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:E.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Yi(e,t){let n=E.useRef(e),r=l(t);h(()=>{n.current!==e&&r(n.current)},[e,r]),h(()=>{n.current=e},[e])}function Xi(e){let[t,n]=E.useState(null),r=l((t,r)=>{e||n(r||(N?`touch`:``))});Yi(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=Ji(r);return E.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function Zi(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=Xi(a);si(t);let{forceUnmount:d}=ci(a,t),f=E.useCallback(()=>{t.setOpen(!1,En(Tn))},[t]);E.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]);let p=mi({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,h]=E.useState(0),[g,_]=E.useState(0),v=m===0,y=yi(p),b=Hr(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=be(e);if(v&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||R(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});qi(a&&s===!0,c);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=hi([y,b]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{h(e),_(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0),_(0)}),E.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(m+1,g+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,m,g,n]);let w=E.useMemo(()=>x(u),[x,u]),ee=E.useMemo(()=>C(u),[C,u]),te=E.useMemo(()=>S(),[S]);t.useSyncedValues({openMethod:l,activeTriggerProps:w,inactiveTriggerProps:ee,popupProps:te,floatingRootContext:p,nestedOpenDialogCount:m,nestedOpenDrawerCount:g})}var Qi={...pi,modal:H(e=>e.modal),nested:H(e=>e.nested),nestedOpenDialogCount:H(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:H(e=>e.nestedOpenDrawerCount),disablePointerDismissal:H(e=>e.disablePointerDismissal),openMethod:H(e=>e.openMethod),descriptionElementId:H(e=>e.descriptionElementId),titleElementId:H(e=>e.titleElementId),viewportElement:H(e=>e.viewportElement),role:H(e=>e.role)},$i=class e extends ni{constructor(e){super(ea(e),{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new li,onOpenChange:void 0,onOpenChangeComplete:void 0},Qi)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=T(()=>new e(n)).current;return t??r}};function ea(e={}){return{...di(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var ta=E.createContext(!1);function na(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=On(!0),p=E.useContext(ta),m=!!f,h=$i.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});Ri(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);Zi({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=E.useMemo(()=>({store:h}),[h]);return(0,I.jsx)(ta.Provider,{value:!1,children:(0,I.jsx)(Dn.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}var ra=E.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=On(),c=k(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),u(`h2`,e,{ref:t,props:[{id:c},o]})});Object.freeze({status:`aborted`});function U(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var ia=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},aa=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},oa={};function sa(e){return e&&Object.assign(oa,e),oa}function ca(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function la(e,t){return typeof t==`bigint`?t.toString():t}function ua(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function da(e){return e==null}function fa(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function pa(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var ma=Symbol(`evaluating`);function W(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ma)return r===void 0&&(r=ma,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ha(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ga(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function _a(e){return JSON.stringify(e)}function va(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ya=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ba(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var xa=ua(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Sa(e){if(ba(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ba(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ca(e){return Sa(e)?{...e}:Array.isArray(e)?[...e]:e}var wa=new Set([`string`,`number`,`symbol`]);function Ta(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ea(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Da(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Oa={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ka(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ea(e,ga(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ha(this,`shape`,e),e},checks:[]}))}function Aa(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ea(e,ga(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ha(this,`shape`,r),r},checks:[]}))}function ja(e,t){if(!Sa(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ea(e,ga(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ha(this,`shape`,n),n}}))}function Ma(e,t){if(!Sa(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ea(e,ga(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ha(this,`shape`,n),n}}))}function Na(e,t){return Ea(e,ga(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ha(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Pa(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ea(t,ga(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ha(this,`shape`,i),i},checks:[]}))}function Fa(e,t,n){return Ea(t,ga(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return ha(this,`shape`,i),i}}))}function Ia(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function La(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ra(e){return typeof e==`string`?e:e?.message}function za(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Ra(e.inst?._zod.def?.error?.(e))??Ra(t?.error?.(e))??Ra(n.customError?.(e))??Ra(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ba(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Va(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ha=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,la,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ua=U(`$ZodError`,Ha),Wa=U(`$ZodError`,Ha,{Parent:Error});function Ga(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ka(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var qa=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ia;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>za(e,a,sa())));throw ya(t,i?.callee),t}return o.value},Ja=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>za(e,a,sa())));throw ya(t,i?.callee),t}return o.value},Ya=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ia;return a.issues.length?{success:!1,error:new(e??Ua)(a.issues.map(e=>za(e,i,sa())))}:{success:!0,data:a.value}},Xa=Ya(Wa),Za=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>za(e,i,sa())))}:{success:!0,data:a.value}},Qa=Za(Wa),$a=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return qa(e)(t,n,i)},eo=e=>(t,n,r)=>qa(e)(t,n,r),to=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ja(e)(t,n,i)},no=e=>async(t,n,r)=>Ja(e)(t,n,r),ro=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ya(e)(t,n,i)},io=e=>(t,n,r)=>Ya(e)(t,n,r),ao=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Za(e)(t,n,i)},oo=e=>async(t,n,r)=>Za(e)(t,n,r),so=/^[cC][^\s-]{8,}$/,co=/^[0-9a-z]+$/,lo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uo=/^[0-9a-vA-V]{20}$/,fo=/^[A-Za-z0-9]{27}$/,po=/^[a-zA-Z0-9_-]{21}$/,mo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ho=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,go=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_o=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vo=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function yo(){return new RegExp(vo,`u`)}var bo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,So=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Co=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,To=/^[A-Za-z0-9_-]*$/,Eo=/^\+[1-9]\d{6,14}$/,Do=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Oo=RegExp(`^${Do}$`);function ko(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ao(e){return RegExp(`^${ko(e)}$`)}function jo(e){let t=ko({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Do}T(?:${r})$`)}var Mo=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},No=/^-?\d+$/,Po=/^-?\d+(?:\.\d+)?$/,Fo=/^(?:true|false)$/i,Io=/^[^A-Z]*$/,Lo=/^[^a-z]*$/,K=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ro={number:`number`,bigint:`bigint`,object:`date`},zo=U(`$ZodCheckLessThan`,(e,t)=>{K.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bo=U(`$ZodCheckGreaterThan`,(e,t)=>{K.init(e,t);let n=Ro[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vo=U(`$ZodCheckMultipleOf`,(e,t)=>{K.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):pa(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ho=U(`$ZodCheckNumberFormat`,(e,t)=>{K.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Oa[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=No)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Uo=U(`$ZodCheckMaxLength`,(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!da(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ba(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wo=U(`$ZodCheckMinLength`,(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!da(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ba(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Go=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!da(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ba(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ko=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;K.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),qo=U(`$ZodCheckRegex`,(e,t)=>{Ko.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jo=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Io,Ko.init(e,t)}),Yo=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Lo,Ko.init(e,t)}),Xo=U(`$ZodCheckIncludes`,(e,t)=>{K.init(e,t);let n=Ta(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Zo=U(`$ZodCheckStartsWith`,(e,t)=>{K.init(e,t);let n=RegExp(`^${Ta(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Qo=U(`$ZodCheckEndsWith`,(e,t)=>{K.init(e,t);let n=RegExp(`.*${Ta(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$o=U(`$ZodCheckOverwrite`,(e,t)=>{K.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),es=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
2
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
3
|
`))}},ts={major:4,minor:3,patch:6},q=U(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ts;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Ia(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ia;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Ia(e,t))});else{if(e.issues.length===t)continue;r||=Ia(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Ia(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ia;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ia;return o.then(e=>t(e,r,a))}return t(o,r,a)}}W(e,`~standard`,()=>({validate:t=>{try{let n=Xa(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Qa(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),ns=U(`$ZodString`,(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Mo(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),J=U(`$ZodStringFormat`,(e,t)=>{Ko.init(e,t),ns.init(e,t)}),rs=U(`$ZodGUID`,(e,t)=>{t.pattern??=ho,J.init(e,t)}),is=U(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=go(e)}else t.pattern??=go();J.init(e,t)}),as=U(`$ZodEmail`,(e,t)=>{t.pattern??=_o,J.init(e,t)}),os=U(`$ZodURL`,(e,t)=>{J.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ss=U(`$ZodEmoji`,(e,t)=>{t.pattern??=yo(),J.init(e,t)}),cs=U(`$ZodNanoID`,(e,t)=>{t.pattern??=po,J.init(e,t)}),ls=U(`$ZodCUID`,(e,t)=>{t.pattern??=so,J.init(e,t)}),us=U(`$ZodCUID2`,(e,t)=>{t.pattern??=co,J.init(e,t)}),ds=U(`$ZodULID`,(e,t)=>{t.pattern??=lo,J.init(e,t)}),fs=U(`$ZodXID`,(e,t)=>{t.pattern??=uo,J.init(e,t)}),ps=U(`$ZodKSUID`,(e,t)=>{t.pattern??=fo,J.init(e,t)}),ms=U(`$ZodISODateTime`,(e,t)=>{t.pattern??=jo(t),J.init(e,t)}),hs=U(`$ZodISODate`,(e,t)=>{t.pattern??=Oo,J.init(e,t)}),gs=U(`$ZodISOTime`,(e,t)=>{t.pattern??=Ao(t),J.init(e,t)}),_s=U(`$ZodISODuration`,(e,t)=>{t.pattern??=mo,J.init(e,t)}),vs=U(`$ZodIPv4`,(e,t)=>{t.pattern??=bo,J.init(e,t),e._zod.bag.format=`ipv4`}),ys=U(`$ZodIPv6`,(e,t)=>{t.pattern??=xo,J.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),bs=U(`$ZodCIDRv4`,(e,t)=>{t.pattern??=So,J.init(e,t)}),xs=U(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Co,J.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Ss(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Cs=U(`$ZodBase64`,(e,t)=>{t.pattern??=wo,J.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Ss(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ws(e){if(!To.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ss(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Ts=U(`$ZodBase64URL`,(e,t)=>{t.pattern??=To,J.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ws(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Es=U(`$ZodE164`,(e,t)=>{t.pattern??=Eo,J.init(e,t)});function Ds(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Os=U(`$ZodJWT`,(e,t)=>{J.init(e,t),e._zod.check=n=>{Ds(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ks=U(`$ZodNumber`,(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??Po,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),As=U(`$ZodNumberFormat`,(e,t)=>{Ho.init(e,t),ks.init(e,t)}),js=U(`$ZodBoolean`,(e,t)=>{q.init(e,t),e._zod.pattern=Fo,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ms=U(`$ZodUnknown`,(e,t)=>{q.init(e,t),e._zod.parse=e=>e}),Ns=U(`$ZodNever`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ps(e,t,n){e.issues.length&&t.issues.push(...La(n,e.issues)),t.value[n]=e.value}var Fs=U(`$ZodArray`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Ps(t,n,e))):Ps(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Is(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...La(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Ls(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Da(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Rs(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Is(e,n,i,t,u))):Is(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var zs=U(`$ZodObject`,(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=ua(()=>Ls(t));W(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ba,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Is(n,t,e,s,r))):Is(i,t,e,s,r)}return i?Rs(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Bs=U(`$ZodObjectJIT`,(e,t)=>{zs.init(e,t);let n=e._zod.parse,r=ua(()=>Ls(t)),i=e=>{let t=new es([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=_a(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=_a(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
4
4
|
if (${n}.issues.length) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{R as e,it as t,nt as n,st as r}from"./button-r9cVFa0_.js";import{M as i,a,c as o,d as s,i as c,l,o as u,p as d,s as f,w as p}from"./sync-persistence-BJbWXISF.js";var m=r(t(),1),h=m.use,g=typeof window<`u`?m.useLayoutEffect:m.useEffect;function _(e){let t=m.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function v(e,t,n={},r={}){m.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function y(e){let t=m.useRef(null);return m.useImperativeHandle(e,()=>t.current,[]),t}var b=m.createContext(null);function x(e){return m.useContext(b)}function S(e){let t=x();return m.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}n();var C=(0,m.createContext)(void 0);function ee(){return(0,m.useContext)(C)}var w=Symbol(`liveQueryResultInfo`);function te(e,t){Object.defineProperty(e,w,{configurable:!0,value:t})}function T(e){try{return!1}catch{return!1}try{return{}[e]!==`1`}catch{return!0}}var E=new WeakMap,D=0;function O(e){let t=E.get(e);return t===void 0&&(t=++D,E.set(e,t)),t}function k(e,t,n){return a(e,!t&&n?e=>{throw Error(`[${n}] Collection descriptor "${e}" requires a DbClient when the query is consumed. Wrap this component in <DbProvider client={client}> or use a concrete Collection.`)}:void 0)}function A(){return{unscoped:new Map,byClient:new WeakMap}}function j(e,t,n,r,i){let a=n?e.byClient.get(n):e.unscoped,o=new Map;for(let e of k(t,n,r)){let t=O(e),n=o.get(e.id)??a?.get(e.id);if(n!==void 0&&n!==t)throw i(),Error(`[${r}] Source Collection "${e.id}" was replaced by a different Collection with the same ID while this hook is mounted. Unmount the hook and clean up its previous source and client scope before reusing the ID.`);o.set(e.id,t)}let s=a??new Map;for(let[e,t]of o)s.set(e,t);n&&e.byClient.set(n,s)}var M=1,N=5e3,P=16,F=10,I=50,L=new Set,R=new Set,z=new Set,B=Symbol(`unpreparedQueryValue`),V=new Map,H=new WeakMap;function U(e,t,n){let r=k(e,n,`useLiveSuspenseQuery`).map(O);return r.length===0?t:`${r.join(`,`)}:${t}`}function W(e){if(!e)return V;let t=H.get(e);return t||(t=new Map,H.set(e,t)),t}function G(e,t,n){let r=e.get(t);r?.collection===n&&(e.delete(t),r.removeStatusListeners())}function K(e=`useLiveQuery`){if(!T(`TANSTACK_DB_DISABLE_DEPRECATION_WARNINGS`))return;let t=J(4);L.has(t)||(L.add(t),console.warn(`[${e}] The dependency-array form is deprecated and will be removed in 1.0. Use ${e===`useLiveQuery`?`useLiveQuery({ query })`:`useLiveInfiniteQuery(query, { queryKey })`} instead. Provide queryKey only for functional/opaque queries or to avoid deriving identity from structured query IR on render.`))}function q(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function J(e){let t=Error().stack??`unknown`,n=t.split(`
|
|
2
|
+
`);return n.slice(1).find(e=>!e.includes(`useLiveQuery.ts`)&&!e.includes(`useLiveSuspenseQuery.ts`)&&!e.includes(`useLiveInfiniteQuery.ts`))?.trim()??n[e]?.trim()??t}function Y(e,t){if(e.warned||!T(`TANSTACK_DB_DISABLE_QUERY_IDENTITY_WARNINGS`))return;let n=t>=P,r=e.renderCount>=F&&e.totalMs>=I;if(!n&&!r)return;let i=J(5);if(R.has(i)){e.warned=!0;return}R.add(i),e.warned=!0;let a=n?`one render took ${t.toFixed(1)}ms`:`${e.renderCount} renders took ${e.totalMs.toFixed(1)}ms`;console.warn(`[useLiveQuery] Deriving live query identity from structured query IR is running on a hot render path (${a}, max ${e.maxMs.toFixed(1)}ms). Provide an explicit queryKey to skip rebuilding and hashing the IR on every render: useLiveQuery({ queryKey: [...], query }).`)}function X(e){return e&&typeof e==`object`&&Array.isArray(e.queryKey)?e.queryKey:void 0}function Z(e){return e&&typeof e==`object`&&`client`in e&&e.client!==void 0?e.client:void 0}function Q(e,t,n){return u(e,t,n)}function ne(e,t,n,r){let a=T(`TANSTACK_DB_DISABLE_QUERY_IDENTITY_WARNINGS`),o=a?q():0,s=Q(e,t,r);try{return{status:`hashable`,value:s,identityDeps:[`derived`,c(s)]}}catch(e){if(e instanceof i)return{status:`unhashable`,value:s,error:e};throw e}finally{if(a){let e=q()-o;n.renderCount+=1,n.totalMs+=e,n.maxMs=Math.max(n.maxMs,e),Y(n,e)}}}function $(e){if(!T(`TANSTACK_DB_DISABLE_QUERY_IDENTITY_WARNINGS`))return;let t=J(4);z.has(t)||(z.add(t),console.warn(`[useLiveQuery] This query cannot derive a stable identity because ${e.reason} at ${e.path}. It will keep the legacy mount-stable behavior for now. Add queryKey: [...] to make captured values reactive. Unhashable queries without queryKey will throw in 1.0.`))}function re(e,t){return ae(e,t)}function ie(e){return{collection:null,deps:null,config:null,client:e,legacyUnhashableIdentity:[`legacy-unhashable`],derivedIdentityProfiler:{renderCount:0,totalMs:0,maxMs:0,warned:!1},deferredCollections:new Set,sourceIds:A(),observer:null,queryHash:void 0,suspenseKey:void 0,identityError:void 0,subscribe:null}}function ae(e,t,n=!1){let r=ee(),a=s(e),u=a?r:Z(e)??r,h=t??[],g=(0,m.useRef)(null),_=g.current??=ie(u),v=()=>o(_.deferredCollections),y=a?void 0:X(e),b=B,x,S,C;if(y)x=y,S=[`queryKey`,y];else if(t!==void 0){if(x=h,u||n||T(`TANSTACK_DB_DISABLE_QUERY_IDENTITY_WARNINGS`))try{b=Q(e,u,_.deferredCollections),S=[`deps`,h,c(b)]}catch(e){if(!(e instanceof i))throw e;$(e),C=e}}else if(a)x=[],S=[`collection`,e.id];else{let t=ne(e,u,_.derivedIdentityProfiler,_.deferredCollections);b=t.value,t.status===`hashable`?(x=t.identityDeps,S=t.identityDeps):($(t.error),x=_.legacyUnhashableIdentity,C=t.error)}let w;if(S!==void 0)try{w=d(S,`queryKey`)}catch(e){if(e instanceof i){if(y!==void 0)throw e;C=e}else throw e}t!==void 0&&K(),y===void 0&&t===void 0&&b!==B&&j(_.sourceIds,b,u,`useLiveQuery`,v);let E=n&&!a&&w!==void 0&&_.collection!==null&&_.client===u&&_.queryHash===w&&_.suspenseKey!==void 0;n&&!a&&w&&!E&&b===B&&(b=Q(e,u,_.deferredCollections));let D=w&&n&&!a?E?_.suspenseKey:U(b,w,u):w,O=n&&!a&&D?W(u):void 0,A=(D?O?.get(D):void 0)?.collection,P=_.deps===null||(t===void 0?!p(_.deps,x):_.deps.length!==x.length||_.deps.some((e,t)=>e!==x[t])),F=!_.collection||a&&_.config!==e||!a&&(_.client!==u||P);if(F){if(a)e.config?.syncMode===`on-demand`&&T(`TANSTACK_DB_DISABLE_QUERY_IDENTITY_WARNINGS`)&&console.warn(`[useLiveQuery] Warning: Passing a collection with syncMode "on-demand" directly to useLiveQuery will not load any data. In on-demand mode, data is only loaded when queries with predicates request it.
|
|
3
|
+
|
|
4
|
+
Instead, use a query builder function:
|
|
5
|
+
const { data } = useLiveQuery({ query: (q) => q.from({ c: myCollection }).select(({ c }) => c) })
|
|
6
|
+
|
|
7
|
+
Or switch to syncMode "eager" if you want all data to sync automatically.`),e.startSyncImmediate(),_.collection=e,_.config=e;else{if(A)_.collection=A;else if(b===B&&(b=Q(e,u,_.deferredCollections)),u||k(b,u,`useLiveQuery`),_.collection=f(b,{gcTime:n?N:M,pool:!n&&!u,startSync:!n||u!==void 0}),O&&D&&_.collection){let e=_.collection,t=e.on(`status:cleaned-up`,()=>G(O,D,e)),n=e.on(`status:error`,()=>{setTimeout(()=>G(O,D,e),0)}),r={collection:e,removeStatusListeners:()=>{t(),n()}};O.set(D,r)}_.config=e,_.deps=[...x]}_.client=u,_.queryHash=w,_.suspenseKey=D,_.identityError=C}F&&(_.observer=l(_.collection,{mode:`wholesale`,client:u,queryHash:_.queryHash,onPreload:v}));let I=_.observer;n&&!u&&(_.collection?.status===`idle`||_.collection?.status===`cleaned-up`)&&I.preloadForInitialRender().catch(()=>{}),(!_.subscribe||F)&&(_.subscribe=e=>{let t=I.subscribe(e);return v(),t});let L=(0,m.useSyncExternalStore)(_.subscribe,()=>I.getSnapshot(),()=>I.getServerSnapshot());return n&&te(L,{client:u,queryHash:_.queryHash,identityError:_.identityError,observer:I}),L}var oe=e(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);export{b as a,v as c,x as i,g as l,re as n,h as o,S as r,y as s,oe as t,_ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as e}from"./button-
|
|
1
|
+
import{R as e}from"./button-r9cVFa0_.js";var t=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};
|
package/dist/app/index.html
CHANGED
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
<meta property="og:image:height" content="600" />
|
|
18
18
|
<meta property="og:image:alt" content="Stars Organizer: finally do something with your GitHub stars. Lists synced to GitHub, a health score per repo, tags, ratings and notes." />
|
|
19
19
|
<meta name="twitter:card" content="summary_large_image" />
|
|
20
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/sync-persistence-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/schemas-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/history-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/routes-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/list._listId-
|
|
29
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
20
|
+
<script type="module" crossorigin src="/assets/index-mzNFlFJk.js"></script>
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/sync-persistence-BJbWXISF.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/button-r9cVFa0_.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/schemas-DVvZEnxp.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/star-BPue5Y4t.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/coerce-Cxjr6MIU.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/history-CN5yGwhZ.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/routes-DaKmAWCG.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/list._listId-CNuYrPaQ.js">
|
|
29
|
+
<link rel="stylesheet" crossorigin href="/assets/index-dVYqSW2P.css">
|
|
30
30
|
</head>
|
|
31
31
|
<body>
|
|
32
32
|
<div id="root"></div>
|