@deslop/deploy 0.1.1335 → 0.1.1342
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/client/assets/{(home)-BDvqkF2z.js → (home)-CZRd3iM_.js} +17 -17
- package/dist/client/assets/{dist-BlsWFKii.js → dist-BdaiJgHG.js} +1 -1
- package/dist/client/assets/dropdown-menu-Bidg_ly-.js +1 -0
- package/dist/client/assets/effect-DkzSA5-A.js +17 -0
- package/dist/client/assets/fleet-CZbYVlm8.js +2 -0
- package/dist/client/assets/index-q430L-8Q.js +2 -0
- package/dist/client/assets/{react-BPjvcVqE.js → react-DLGSahv8.js} +3 -3
- package/dist/client/assets/result-error-Ddsi7au1.js +1 -0
- package/dist/client/assets/route-H03JopqM.js +1 -0
- package/dist/client/index.html +8 -5
- package/dist/server.js +45 -31
- package/package.json +2 -2
- package/dist/client/assets/dropdown-menu-CYOanbDJ.js +0 -1
- package/dist/client/assets/effect-DgUBIlsv.js +0 -17
- package/dist/client/assets/index-CTldnN8v.js +0 -2
- package/dist/client/assets/result-error-d7x0fvzb.js +0 -1
- package/dist/client/assets/route-BIbCPeuW.js +0 -1
- package/dist/client/assets/schema-D8D8ZFxG.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-BIbCPeuW.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-BPjvcVqE.js","assets/schema-D8D8ZFxG.js","assets/dist-BlsWFKii.js","assets/effect-DgUBIlsv.js","assets/result-error-d7x0fvzb.js","assets/(home)-BDvqkF2z.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,B as n,D as r,G as i,H as a,K as o,L as s,M as c,Q as l,R as u,T as d,U as f,V as p,W as ee,X as m,Z as h,_ as te,at as g,ct as ne,d as re,dt as ie,et as _,ft as ae,h as v,it as y,lt as b,m as x,n as S,nt as C,ot as w,pt as T,q as E,rt as D,s as O,st as k,tt as A,ut as j,w as M,z as oe}from"./schema-D8D8ZFxG.js";import{D as se,Da as N,Di as ce,Fa as le,G as ue,Ht as de,I as fe,Ia as pe,Mt as me,Pa as he,St as P,Tt as ge,Ui as _e,_t as ve,fa as ye,ga as be,gi as xe,j as Se,ja as Ce,jt as we,ka as Te,mr as Ee,nr as De,qi as Oe,qr as ke,ra as Ae,sa as je,va as Me}from"./effect-DgUBIlsv.js";import{a as Ne,n as Pe,o as Fe,r as Ie}from"./react-BPjvcVqE.js";import{R as Le,t as F}from"./dist-BlsWFKii.js";var Re=`Error preloading route! ☝️`,ze=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=h:this.parentRoute||g();let r=n?h:t?.path;r&&r!==`/`&&(r=D(r));let i=t?.id||r,a=n?h:A((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:A(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=y(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>m({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Be=class{constructor({id:e}){this.notFound=e=>_({routeId:this.id,...e}),this.redirect=e=>m({from:this.id,...e}),this.id=e}},Ve=class extends ze{constructor(e){super(e)}},I=e(Fe(),1),L=Ne();function He(...e){let t=I.useRef(e),n=t.current;return e.forEach((e,t)=>{w(n[t],e,!1,!0)||(n[t]=e)}),t.current}function R(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Re)})}function Ue(e,t){let n=typeof e==`string`&&ne(e);if(n)return t.has(n)?e:null}function We(e,t,n,r){let i=C(e.pathname,r),a=C(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!w(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function Ge(e,t,n){let r=p(),a=I.useRef(null),o=I.useCallback(e=>{if(a.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:s,to:c,preload:l,preloadDelay:u,disabled:d,target:ee,onClick:m,onBlur:h,onFocus:te,onMouseEnter:g,onMouseLeave:re,onTouchStart:ie}=e,[_,ae,v]=He(e.search,e.params,s),y=I.useContext(i),b=(r.stores._linkScopes??={})[y]??=f(r,y),[x,S,C]=I.useMemo(()=>{let t=Ue(c,r.protocolAllowlist);if(t!==void 0){let n=[t??void 0];return[e,()=>n]}let n={...e},i,a,o,s=()=>{let e=b[0]();if(e!==i){n._fromLocation=e;let t=r.buildLocation(n),o=Ze(t,r,d),s=d||o&&!ne(o)?We(e,t,v,r.basepath):void 0;a&&a[0]===o&&a[1]===s||(a=[o,s]),i=e}return a};return[n,s,v?.includeHash&&(()=>{let e=s();return e[1]?o??=[e[0],!1]:e})]},[r,b,e.from,e.hash,e.href,c,_,ae,e.state,e.mask,e.unsafeRelative,v,d]),[w,T]=I.useSyncExternalStore(b[1],S,C||S),E=T===void 0&&w,D=d||w===void 0,O=I.useRef(!1),k=e.reloadDocument||E||D?!1:l??r.options.defaultPreload,A=u??r.options.defaultPreloadDelay??0,j=I.useCallback(e=>{let t=e?.isIntersecting;t??k===`intent`?A?a.t??=setTimeout(()=>{a.t=void 0,R(r,x)},A):R(r,x):t===!1&&z(a)},[r,x,a,k,A]);I.useEffect(()=>{if(!k)return;k===`render`&&!O.current&&(O.current=!0,R(r,x));let e=!0,t;return k===`viewport`&&a.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&j(t.pop())},{rootMargin:`100px`}),t.observe(a.current)),()=>{e=!1,t?.disconnect(),z(a)}},[r,x,k,j,a]);let M=Ye(e,n);if(M.ref=t?o:a,E)return M.href=E,M;let oe=t=>{let n=ee??t.currentTarget.getAttribute(`target`);D||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||n&&n!==`_self`||t.button!==0||(t.preventDefault(),z(a),r.navigate({...e,_fromLocation:x._fromLocation}))},se=()=>{k===`intent`&&R(r,x)},N=()=>{k===`intent`&&z(a)};return M.onClick=B(m,oe),M.onBlur=B(h,N),M.onFocus=B(te,j),M.onMouseEnter=B(g,j),M.onMouseLeave=B(re,N),M.onTouchStart=B(ie,se),Xe(M,e,T,w,D,n)}var Ke={},qe={className:`active`},Je=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Ye(e,t){let n={};for(let r in e)Je.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Xe(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=k(n?o:s,{})??(n?qe:Ke);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var z=e=>{clearTimeout(e.t),e.t=void 0},B=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function Ze(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!j(i,t.protocolAllowlist))return i}var V=I.memo(I.forwardRef((e,t)=>{let n=e._asChild||`a`,r=Ge(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return I.createElement(n,r,i)}),Qe);function Qe(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Je.has(r)||!w(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}function $e({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function et(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var H=[],U=0,{link:tt,unlink:nt,propagate:rt,checkDirty:it,shallowPropagate:at}=$e({update(e){return e._update()},notify(e){H[G++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,J(e))}}),W=0,G=0,K,q=0;function ot(e){try{++q,e()}finally{--q||st()}}function J(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=nt(n,e)}function st(){if(!(q>0)){for(;W<G;){let e=H[W];H[W++]=void 0,e.notify()}W=0,G=0}}function ct(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return K!==void 0&&tt(i,K,U),i._snapshot},subscribe(e){let t=et(e),n={current:!1},r=lt(()=>{i.get(),n.current?(K=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=K,o=t?.compare??Object.is;if(n)K=i,++U,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{K=a,n&&(i.flags&=-5),J(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&it(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&at(e)}}else e&32&&(i.flags=e&-33);return K!==void 0&&tt(i,K,U),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(rt(e),at(e),st())}},i}function lt(e){let t=()=>{let t=K;K=n,++U,n.depsTail=void 0,n.flags=6;try{return e()}finally{K=t,n.flags&=-5,J(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&it(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,J(this)}};return t(),n}var ut={};function dt(e,t){let n=I.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ae(n.current,i):i}}function Y(e){let t=p(),r=I.useContext(e.from?ee:i),a=e.from??r,o=t.stores.getMatchStore(a),s=dt(e,t),c=n(o,e=>e?s(e):ut);if(c!==ut)return c;(e.shouldThrow??!0)&&g()}function X(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ft(e){let{select:t,...n}=e;return Y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function pt(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function mt(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}var ht=I.use,gt=I.useLayoutEffect;function _t(e){let t=p();return I.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function vt(e){return Y({...e,select:t=>e.select?e.select(t.context):t.context})}function yt(e){return new bt({id:e})}var bt=class extends Be{constructor({id:e}){super({id:e}),this.useMatch=e=>Y({...e,from:this.id}),this.useRouteContext=e=>vt({...e,from:this.id}),this.useSearch=e=>mt({...e,from:this.id}),this.useParams=e=>pt({...e,from:this.id}),this.useLoaderDeps=e=>ft({...e,from:this.id,strict:!1}),this.useLoaderData=e=>X({...e,from:this.id,strict:!1}),this.useNavigate=()=>_t({from:p().routesById[this.id].fullPath}),this.notFound=e=>_({routeId:this.id,...e}),this.Link=I.forwardRef((e,t)=>{let n=p().routesById[this.id].fullPath;return(0,L.jsx)(V,{ref:t,from:n,...e})})}},xt=class extends ze{constructor(e){super(e),this.useMatch=e=>Y({...e,from:this.id}),this.useRouteContext=e=>vt({...e,from:this.id}),this.useSearch=e=>mt({...e,from:this.id}),this.useParams=e=>pt({...e,from:this.id}),this.useLoaderDeps=e=>ft({...e,from:this.id}),this.useLoaderData=e=>X({...e,from:this.id}),this.useNavigate=()=>_t({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,L.jsx)(V,{ref:t,from:this.fullPath,...e}))}};function St(e){return new xt(e)}var Ct=class extends Ve{constructor(e){super(e),this.useMatch=e=>Y({...e,from:this.id}),this.useRouteContext=e=>vt({...e,from:this.id}),this.useSearch=e=>mt({...e,from:this.id}),this.useParams=e=>pt({...e,from:this.id}),this.useLoaderDeps=e=>ft({...e,from:this.id}),this.useLoaderData=e=>X({...e,from:this.id}),this.useNavigate=()=>_t({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,L.jsx)(V,{ref:t,from:this.fullPath,...e}))}};function wt(e){return new Ct(e)}function Tt(e){return e=>{let t=St(e);return t.isRoot=!1,t}}function Et(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(ie(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(ht)ht(a());else throw a()}return I.createElement(r,e)};return o.preload=a,o}var Dt=()=>!0,Ot=()=>!1;function kt({children:e,fallback:t=null}){return(0,L.jsx)(I.Fragment,{children:At()?e:t})}function At(e=!0){return I.useSyncExternalStore(jt,Dt,e?Ot:Dt)}function jt(){return()=>{}}function Mt(e){let r=p(),i=`not-found-${n(r.stores.location,e=>e.pathname)}-${n(r.stores.status)}`;return(0,L.jsx)(T,{getResetKey:()=>i,onCatch:(n,r)=>{if(t(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(t(n))return e.fallback?.(n);throw n},children:e.children})}function Nt(){return(0,L.jsx)(`p`,{children:`Not Found`})}function Pt(e,t,n){return t.options.notFoundComponent?(0,L.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,L.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,L.jsx)(Nt,{})}function Z(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,L.jsx)(n,{}):null}var Ft=(e,t)=>e[0]===t[0]&&e[1]===t[1],It=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Lt=I.memo(function({routeId:e}){let t=p(),r=t.stores.getMatchStore(e);return Rt(t,n(r))});function Rt(e,n){let r=e.routesById[n.routeId],a=Z(e,r),o=r.options.errorComponent??e.options.defaultErrorComponent,s=r.options.onCatch??e.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??e.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=It(e,r,n.ssr)&&(r.options.wrapInSuspense??a??(r.options.errorComponent?.preload||l)),d=(0,L.jsx)(zt,{match:n});l&&(d=(0,L.jsx)(kt,{fallback:a,children:d})),c&&(d=(0,L.jsx)(Mt,{fallback:e=>{if(e.routeId??=n.routeId,e.routeId!==n.routeId)throw e;return I.createElement(c,e)},children:d})),o&&(d=(0,L.jsx)(T,{getResetKey:()=>n,errorComponent:o,onCatch:(e,r)=>{if(t(e))throw e.routeId??=n.routeId,e;s?.(e,r)},children:d})),u&&(d=(0,L.jsx)(I.Suspense,{fallback:a,children:d}));let f=r.isRoot&&r.options.shellComponent;return f?(0,L.jsx)(i.Provider,{value:n.routeId,children:(0,L.jsxs)(f,{children:[d,null]})}):(0,L.jsxs)(i.Provider,{value:n.routeId,children:[d,null]})}var zt=I.memo(function({match:e}){let t=p(),n=e.routeId,r=t.routesById[n],i=I.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=I.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,L.jsx)(e,{},i):(0,L.jsx)(Bt,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!It(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Z(t,r)}if(e.status===`notFound`)return Pt(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Bt=I.memo(function(){let e=p(),t=I.useContext(i),r,a,o;{let i=e.stores.getMatchStore(t);[r,a]=n(i,e=>[!!e._notFound,e.error],{compare:Ft}),o=n(e.stores.ids,e=>e[e.indexOf(t)+1])}if(r)return Pt(e,e.routesById[t],a);if(!o)return null;let s=(0,L.jsx)(Lt,{routeId:o});return t===`__root__`?(0,L.jsx)(I.Suspense,{fallback:Z(e),children:s}):s}),Vt=e=>({createMutableStore:ct,createReadonlyStore:ct,batch:ot}),Ht=e=>new Ut(e),Ut=class extends o{constructor(e){super(e,Vt)}};function Wt(e,t){let n=e[1];e.length=0,n?.(t)}function Gt({t:e}){let t=p(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Wt(n,!1),n.push(i,a),e(t),I.startTransition(r)}),gt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(y(r.publicHref)!==y(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...E(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Kt(){let e=p(),t=e.routesById[h],n=Z(e,t),r=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Gt,{t:I.useState()[1]}),e.ssr?(0,L.jsx)(qt,{}):(0,L.jsx)(I.Suspense,{fallback:n,children:(0,L.jsx)(qt,{})})]});return e.options.InnerWrap?(0,L.jsx)(e.options.InnerWrap,{children:r}):r}function qt(){let e=p(),t=e._rendered,r=n(e.stores.matches,e=>t[0]??e),i=r[0],a=i?.routeId;gt(()=>{t[0]===r&&Wt(t,!0)},[t,r]);let o=a?(0,L.jsx)(Lt,{routeId:a}):null;return e.options.disableGlobalCatchBoundary?o:(0,L.jsx)(T,{getResetKey:()=>i,onCatch:void 0,children:o})}function Jt({router:e,children:t,...n}){b(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,L.jsx)(a.Provider,{value:e,children:t});return e.options.Wrap?(0,L.jsx)(e.options.Wrap,{children:r}):r}function Yt({router:e,...t}){return(0,L.jsx)(Jt,{router:e,...t,children:(0,L.jsx)(Kt,{})})}var Xt=new Map([[`bold`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),I.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),Zt=I.forwardRef((e,t)=>I.createElement(Le,{ref:t,...e,weights:Xt}));Zt.displayName=`ArrowClockwiseIcon`;var Qt=new Map([[`bold`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M222.14,105.85l-80-80a20,20,0,0,0-28.28,0l-80,80A19.86,19.86,0,0,0,28,120v96a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V164h24v52a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V120A19.86,19.86,0,0,0,222.14,105.85ZM204,204H164V152a12,12,0,0,0-12-12H104a12,12,0,0,0-12,12v52H52V121.65l76-76,76,76Z`}))],[`duotone`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M216,120v96H152V152H104v64H40V120a8,8,0,0,1,2.34-5.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,216,120Z`,opacity:`0.2`}),I.createElement(`path`,{d:`M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z`}))],[`fill`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M224,120v96a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V164a4,4,0,0,0-4-4H108a4,4,0,0,0-4,4v52a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V120a16,16,0,0,1,4.69-11.31l80-80a16,16,0,0,1,22.62,0l80,80A16,16,0,0,1,224,120Z`}))],[`light`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M217.9,110.1l-80-80a14,14,0,0,0-19.8,0l-80,80A13.92,13.92,0,0,0,34,120v96a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V158h36v58a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V120A13.92,13.92,0,0,0,217.9,110.1ZM210,210H158V152a6,6,0,0,0-6-6H104a6,6,0,0,0-6,6v58H46V120a2,2,0,0,1,.58-1.42l80-80a2,2,0,0,1,2.84,0l80,80A2,2,0,0,1,210,120Z`}))],[`regular`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z`}))],[`thin`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M216.49,111.51l-80-80a12,12,0,0,0-17,0l-80,80A12,12,0,0,0,36,120v96a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V156h40v60a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V120A12,12,0,0,0,216.49,111.51ZM212,212H156V152a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v60H44V120a4,4,0,0,1,1.17-2.83l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,212,120Z`}))]]),$t=I.forwardRef((e,t)=>I.createElement(Le,{ref:t,...e,weights:Qt}));$t.displayName=`HouseIcon`;var en=new Map([[`bold`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M208,76H180V56A52,52,0,0,0,76,56V76H48A20,20,0,0,0,28,96V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V96A20,20,0,0,0,208,76ZM100,56a28,28,0,0,1,56,0V76H100ZM204,204H52V100H204Zm-60-52a16,16,0,1,1-16-16A16,16,0,0,1,144,152Z`}))],[`duotone`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M216,96V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V96a8,8,0,0,1,8-8H208A8,8,0,0,1,216,96Z`,opacity:`0.2`}),I.createElement(`path`,{d:`M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Zm-68-56a12,12,0,1,1-12-12A12,12,0,0,1,140,152Z`}))],[`fill`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80Zm-80,84a12,12,0,1,1,12-12A12,12,0,0,1,128,164Zm32-84H96V56a32,32,0,0,1,64,0Z`}))],[`light`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M208,82H174V56a46,46,0,0,0-92,0V82H48A14,14,0,0,0,34,96V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V96A14,14,0,0,0,208,82ZM94,56a34,34,0,0,1,68,0V82H94ZM210,208a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V96a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Zm-72-56a10,10,0,1,1-10-10A10,10,0,0,1,138,152Z`}))],[`regular`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Zm-68-56a12,12,0,1,1-12-12A12,12,0,0,1,140,152Z`}))],[`thin`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M208,84H172V56a44,44,0,0,0-88,0V84H48A12,12,0,0,0,36,96V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V96A12,12,0,0,0,208,84ZM92,56a36,36,0,0,1,72,0V84H92ZM212,208a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V96a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-76-56a8,8,0,1,1-8-8A8,8,0,0,1,136,152Z`}))]]),tn=I.forwardRef((e,t)=>I.createElement(Le,{ref:t,...e,weights:en}));tn.displayName=`LockIcon`;var nn=Ie(),Q=Pe();function $(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-none border-dashed p-6 text-center text-balance`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,L.jsx)(`div`,{"data-slot":`empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function rn(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex max-w-sm flex-col items-center gap-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,L.jsx)(`div`,{"data-slot":`empty-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var an=v(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-none bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function on(e){let t=(0,Q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]!==n||t[5]!==a?(o=F(an({variant:a,className:n})),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o||t[9]!==a?(s=(0,L.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":a,className:o,...r}),t[7]=r,t[8]=o,t[9]=a,t[10]=s):s=t[10],s}function sn(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`font-heading text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,L.jsx)(`div`,{"data-slot":`empty-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cn(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,L.jsx)(`a`,{href:`/`,"aria-label":`Home`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,L.jsx)($,{"aria-label":`Page not found`,children:(0,L.jsxs)(x,{variant:`outline`,size:`sm`,render:t,nativeButton:!1,children:[(0,L.jsx)($t,{}),`Home`]})}),e[1]=n):n=e[1],n}var ln=se(e=>Se(De(()=>location.replace(e))));function un(e){let t=(0,Q.c)(2),n;return t[0]===e.href?n=t[1]:(n=ln(e.href),t[0]=e.href,t[1]=n),M(n),null}function dn(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,L.jsx)($,{role:`status`,children:(0,L.jsxs)(rn,{children:[(0,L.jsx)(on,{variant:`icon`,children:(0,L.jsx)(tn,{})}),(0,L.jsx)(sn,{children:`Access denied`})]})}),e[0]=t):t=e[0],t}function fn(e){let t=(0,Q.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,L.jsx)(Zt,{}),t[0]=n):n=t[0];let r=e.label??`Can’t load this view`,i;return t[1]!==e.reset||t[2]!==r?(i=(0,L.jsx)($,{role:`alert`,children:(0,L.jsxs)(x,{variant:`destructive`,size:`sm`,onClick:e.reset,children:[n,r]})}),t[1]=e.reset,t[2]=r,t[3]=i):i=t[3],i}function pn(e){let t=(0,Q.c)(4);if(u(e.error)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(un,{href:oe(location.href)}),t[0]=e):e=t[0],e}if(s(e.error)){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(dn,{}),t[1]=e):e=t[1],e}let n;return t[2]===e.reset?n=t[3]:(n=(0,L.jsx)(fn,{reset:e.reset}),t[2]=e.reset,t[3]=n),n}function mn(e){let t=(0,Q.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={includeFailure:!0},t[0]=n):n=t[0];let i=r(e.atom,n),a=d(e.atom),o=e.frame??le,s;if(t[1]!==o||t[2]!==e.children||t[3]!==a||t[4]!==i){let n;t[6]!==e.children||t[7]!==i?(n=()=>be(ue(i),{onNone:Ce,onSome:e.children}),t[6]=e.children,t[7]=i,t[8]=n):n=t[8];let r;t[9]!==o||t[10]!==a?(r=e=>o((0,L.jsx)(pn,{error:ke(e),reset:a})),t[9]=o,t[10]=a,t[11]=r):r=t[11],s=be(te(i),{onNone:n,onSome:r}),t[1]=o,t[2]=e.children,t[3]=a,t[4]=i,t[5]=s}else s=t[5];return s}var hn=new WeakSet;function gn(e){let t=document.querySelector(`#root`);if(N(t))throw TypeError(`Missing application mount element with id "root"`);let n=Ht({context:{},defaultErrorComponent:pn,defaultNotFoundComponent:cn,defaultPreload:`intent`,routeTree:e,scrollRestoration:!0}),r=fe();function i(e,t,i){if(Te(e)){if(hn.has(e))return;hn.add(e)}r.set(c,{error:e,route:pe(xe(n.state.matches,t=>t.error===e),Me(()=>ce(n.state.matches)),Ae(e=>ye(e.routeId,Ee)),je(he(`__root__`))),source:t,stack:i})}return n.update({defaultOnCatch:(e,t)=>i(e,`route`,t.componentStack)}),(0,nn.createRoot)(t,{onCaughtError:(e,t)=>i(e,`caught`,t.componentStack),onUncaughtError:(e,t)=>i(e,`uncaught`,t.componentStack)}).render((0,L.jsx)(I.StrictMode,{children:(0,L.jsx)(Yt,{router:n})})),n}function _n(e,t){return n=>{if(!me(e)(n))return t(n);let r=we(e)(n);return t({..._e(n,(t,n)=>!Oe(e.fields,n)||Oe(r,n)),...r})}}var vn=wt({shellComponent:e=>(0,L.jsx)(`div`,{className:`bg-background text-foreground pt-safe-top pr-safe-right pl-safe-left flex h-dvh w-dvw flex-col`,children:e.children})}),yn=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),bn=function(e){return`/`+e},xn={},Sn=function(e){return e.pathname.endsWith(`.css`)},Cn=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},wn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=bn(t,n);let r=s(t),i=Sn(r);return Cn(xn,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:yn,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Tn=Tt(`/(home)`)({component:Et(()=>wn(()=>import(`./route-BIbCPeuW.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`component`)}),En=ve([`apps`,`process`]),Dn=ge({app:P(O),machine:P(re),pane:P(En),range:P(S.fields.minutes)}),On=Tt(`/(home)/`)({component:Et(()=>wn(()=>import(`./(home)-BDvqkF2z.js`).then(e=>e.t),__vite__mapDeps([7,1,2,3,4,5,6])),`component`),validateSearch:de(Dn)}),kn=Tn.update({id:`/(home)`,getParentRoute:()=>vn}),An={homeIndexRoute:On.update({id:`/`,path:`/`,getParentRoute:()=>kn})},jn={homeRouteRoute:kn._addFileChildren(An)},Mn=gn(vn._addFileChildren(jn)._addFileTypes());Mn.update({...Mn.options,stringifySearch:_n(Dn,l)});export{$ as a,sn as c,yt as d,V as f,pn as i,Zt as l,wn as n,rn as o,mn as r,on as s,Dn as t,Bt as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,i as n,n as r,o as i}from"./react-BPjvcVqE.js";import{A as a,F as o,I as s,N as c,S as l,a as u,b as d,c as f,d as p,h as m,j as h,l as g,n as _,o as v,r as y,v as b,x,y as S}from"./schema-D8D8ZFxG.js";import{A as C,B as w,C as T,D as E,E as D,M as O,N as k,P as A,_ as j,a as M,c as N,d as P,f as F,g as I,h as L,i as R,j as z,k as B,l as V,o as H,p as ee,r as U,s as te,t as W,v as ne,y as re,z as ie}from"./dist-BlsWFKii.js";import{$n as G,A as K,D as ae,Dt as q,E as oe,Gt as se,Hn as ce,Ia as le,It as ue,L as de,Lt as fe,Na as pe,Nt as me,P as he,Pt as ge,Tt as _e,_ as ve,_a as ye,_t as be,at as xe,cr as Se,ei as Ce,f as we,ha as Te,i as Ee,j as De,la as Oe,mt as ke,nr as Ae,o as je,ot as Me,rr as Ne,t as Pe,tt as Fe,wt as Ie,ya as Le}from"./effect-DgUBIlsv.js";var J=e(i(),1);function Y(e){return e?.ownerDocument||document}var X=t(),Re=w(),ze=ie(),Be=e(n(),1),Ve=[],He=void 0;function Ue(){return He}function We(e){Ve.push(e)}function Ge(e){let t=(t,n)=>{let r=j(qe).current,i;try{He=r;for(let e of Ve)e.before(r);i=e(t,n);for(let e of Ve)e.after(r);r.didInitialize=!0}finally{He=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ke(e){return J.forwardRef(Ge(e))}function qe(){return{didInitialize:!1}}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Je(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ye(e){let t=j(Xe,e).current;return t.next=e,L(t.effect),t}function Xe(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ze(e){J.useEffect(e,R)}var Qe=0,$e=class e{static create(){return new e}currentId=Qe;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Qe,t()},e)}isStarted(){return this.currentId!==Qe}clear=()=>{this.currentId!==Qe&&(clearTimeout(this.currentId),this.currentId=Qe)};disposeEffect=()=>this.clear};function et(){let e=j($e.create).current;return Ze(e.disposeEffect),e}function tt(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:nt,platform:rt,maxTouchPoints:it}=tt(),at=nt.toLowerCase(),ot=rt.toLowerCase(),st=/^i(os$|p)/.test(ot)||ot===`macintel`&&it>1,ct=`android`,lt=ot===ct||at.includes(ct),ut=!st&&ot.startsWith(`mac`);ot.startsWith(`win`),!lt&&/^(linux|chrome os)/.test(ot);var dt=ut||st,ft=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ft&&at.includes(`firefox`),!ft&&at.includes(`chrom`);var pt=dt,mt=/jsdom|happydom/.test(at),ht=null;globalThis.requestAnimationFrame;var gt=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.callbacks[t]=null,--this.callbacksCount)}},_t=class e{static create(){return new e}static request(e){return gt.request(e)}static cancel(e){return gt.cancel(e)}currentId=ht;request(e){this.cancel(),this.currentId=gt.request(()=>{this.currentId=ht,e()})}cancel=()=>{this.currentId!==ht&&(gt.cancel(this.currentId),this.currentId=ht)};disposeEffect=()=>this.cancel};function vt(){let e=j(_t.create).current;return Ze(e.disposeEffect),e}var yt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},bt={...yt,position:`fixed`,margin:0,top:0,left:0};({...yt});var xt=J.forwardRef(function(e,t){let[n,r]=J.useState();L(()=>{pt&&ft&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,{...e,ref:t,style:bt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Q(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&A(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function St(e,t){let n=e;for(;n;){if(B(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(A(n)?n.host:null)}return null}function Ct(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var wt=`data-base-ui-focusable`,Tt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Et=`ArrowLeft`,Dt=`ArrowRight`,Ot=`ArrowUp`,kt=`ArrowDown`,At=`data-starting-style`,jt=`data-ending-style`,Mt={[At]:``},Nt={[jt]:``},Pt={transitionStatus(e){return e===`starting`?Mt:e===`ending`?Nt:null}},Ft=`data-open`,It=`data-closed`,Lt=At,Rt=jt,zt=`data-anchor-hidden`,Bt=`data-popup-open`,Vt=`data-pressed`,Ht={[Bt]:``},Ut={[Bt]:``,[Vt]:``},Wt={[Ft]:``},Gt={[It]:``},Kt={[zt]:``},qt={open(e){return e?Ht:null}},Jt={open(e){return e?Ut:null}},Yt={open(e){return e?Wt:Gt},anchorHidden(e){return e?Kt:null}},Xt={...Yt,...Pt},Zt=`data-trigger-disabled`;function Qt(e,t){if(!B(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Zt);for(let[,e]of t.entries())if($(e,n))return!e.hasAttribute(Zt);return!1}function $t(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 en(e){return e.matches(`html,body`)}function tn(e){return C(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function nn(e){return St(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Tt}`)!=null}function rn(e){return e?e.getAttribute(`role`)===`combobox`&&tn(e):!1}function an(e){if(!e||mt)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function on(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function sn(e){e.preventDefault(),e.stopPropagation()}function cn(e){return`nativeEvent`in e}function ln(e){return e.pointerType===``&&e.isTrusted?!0:lt&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function un(e){return mt?!1:!lt&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(lt||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function dn(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function fn(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function pn(e,t){return t<0||t>=e.length}function mn(e,t){return _n(e.current,{disabledIndices:t})}function hn(e,t){return _n(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function gn(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>_n(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:pn(e,u)?-1:u,wrapped:d}}function _n(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&&vn(e,a,r));return a}function vn(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!bn(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function yn(e){return e.visibility===`hidden`||e.visibility===`collapse`}function bn(e,t=e?re(e):null){return!e||!e.isConnected||!t||yn(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var xn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Sn(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return A(n)?n.host:null}function Cn(e){for(let t of Array.from(e.children))if(T(t)===`summary`)return t;return null}function wn(e,t){let n=Cn(t);return!!n&&(e===n||$(n,e))}function Tn(e){let t=e?T(e):``;return e!=null&&e.matches(xn)&&(t!==`summary`||e.parentElement!=null&&T(e.parentElement)===`details`&&Cn(e.parentElement)===e)&&(t!==`details`||Cn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function En(e){if(!Tn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Sn(t)){let n=t!==e,r=T(t)===`slot`;if(t.hasAttribute(`inert`)||n&&T(t)===`details`&&!t.open&&!wn(e,t)||t.hasAttribute(`hidden`)||!r&&!Dn(t,n))return!1}return!0}function Dn(e,t){let n=re(e);return t?n.display!==`none`:bn(e,n)}function On(e){let t=e.tabIndex;if(t<0){let t=T(e);if(t===`details`||t===`audio`||t===`video`||C(e)&&e.isContentEditable)return 0}return t}function kn(e){if(T(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function An(e,t){let n=kn(e);if(!n)return!0;let r=t.find(e=>{let t=kn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=kn(e);return t?.name===n.name&&t.form===n.form})===n}function jn(e){if(C(e)&&T(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return C(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Mn(e,t){jn(e).forEach(e=>{Tn(e)&&t.push(e),Mn(e,t)})}function Nn(e,t,n){jn(e).forEach(e=>{C(e)&&e.matches(t)&&n.push(e),Nn(e,t,n)})}function Pn(e){return En(e)&&On(e)>=0}function Fn(e){let t=[];return Mn(e,t),t.filter(En)}function In(e){let t=Fn(e);return t.filter(e=>On(e)>=0&&An(e,t))}function Ln(e,t){let n=In(e),r=n.length;if(r===0)return;let i=Q(Y(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Rn(e){return Ln(Y(e).body,1)||e}function zn(e){return Ln(Y(e).body,-1)||e}function Bn(e,t,n){if(!e)return null;let r=[];Mn(Y(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(En);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!$(n,o)&&Pn(o)&&An(o,a))return o}return r[i]}function Vn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$(n,r)}function Hn(e){In(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Un(e){let t=[];Nn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Wn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Wn(e,t.id,n)])}function Gn(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 Kn(e,t,n,r){let i=!1,a=!1,o=r??M;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}}function qn(e,t,n){let r=n??M;return{reason:e,event:t??new Event(`base-ui`),...r}}var Jn=`none`,Yn=`trigger-press`,Xn=`trigger-hover`,Zn=`trigger-focus`,Qn=`outside-press`,$n=`item-press`,er=`close-press`,tr=`focus-out`,nr=`escape-key`,rr=`list-navigation`,ir=`keyboard`,ar=`pointer`,or=`cancel-open`,sr=`sibling-open`,cr=`disabled`,lr=`missing`,ur=`initial`,dr=`imperative-action`;function fr(e){return`data-base-ui-${e}`}var pr=0;function mr(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(pr);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),H;let o=requestAnimationFrame(a);return pr=o,()=>{pr===o&&(cancelAnimationFrame(o),pr=0)}}var hr=`data-base-ui-inert`,gr=new WeakMap,_r=new WeakSet,vr=new WeakMap,yr=0;function br(e){return e?A(e)?e.host:br(e.parentNode):null}var xr=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=br(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,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{T(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function wr(e,t,n,{mark:r=!0}){let i=xr(t,e),a=r?Cr(t,Sr(i),new Set(i)):[],o=[],s=[];if(n){let e=xr(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Cr(t,Sr(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(gr.get(e)||0)+1;gr.set(e,r),o.push(e),r===1&&n&&_r.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(vr.get(e)||0)+1;vr.set(e,t),s.push(e),t===1&&e.setAttribute(hr,``)}),yr+=1,()=>{o.forEach(e=>{let t=(gr.get(e)||0)-1;gr.set(e,t),t||(_r.has(e)||e.removeAttribute(`aria-hidden`),_r.delete(e))}),r&&s.forEach(e=>{let t=(vr.get(e)||0)-1;vr.set(e,t),t||e.removeAttribute(hr)}),--yr,yr||(gr=new WeakMap,_r=new WeakSet,vr=new WeakMap)}}function Tr(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Y(e[0]).body;return wr(e,i,n,{mark:r})}function Er(){let[,e]=J.useState({});return J.useCallback(()=>{e({})},[])}var Dr=0;function Or(e,t=`mui`){let n=J.useRef(void 0),r=Er(),i=e??n.current;return J.useEffect(()=>{n.current??(Dr+=1,n.current=`${t}-${Dr}`,e??r())},[e,t,r]),i}var kr=ne.useId;function Ar(e,t){if(kr!==void 0){let n=kr();return e??(t?`${t}-${n}`:n)}return Or(e,t)}var jr={style:{transition:`none`}},Mr=`data-base-ui-click-trigger`,Nr={fallbackAxisSide:`none`},Pr={fallbackAxisSide:`end`},Fr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ir=J.createContext(null),Lr=()=>J.useContext(Ir),Rr=fr(`portal`);function zr(e={}){let{ref:t,container:n,componentProps:r=M,elementProps:i}=e,a=Ar(),o=Lr()?.portalNode,[s,c]=J.useState(null),[l,u]=J.useState(null),d=I(e=>{e!==null&&u(e)}),f=J.useRef(null);L(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(O(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=U(`div`,r,{ref:[t,d],props:[{id:a,[Rr]:``},i]}),m=s&&p?Be.createPortal(p,s):null;return{node:l,nodeId:J.isValidElement(p)?p.props.id:void 0,subtree:m}}var Br=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=zr({container:o,ref:t,componentProps:e,elementProps:c}),f=J.useRef(null),p=J.useRef(null),m=J.useRef(null),h=J.useRef(null),[g,_]=J.useState(null),v=J.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;J.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Vn(e)&&(e.type===`focusin`?v.current&&=(Un(l),!1):(Hn(l),v.current=!0))}return Je(Z(l,`focusin`,e,!0),Z(l,`focusout`,e,!0))},[l,y]),L(()=>{l&&b===!0&&v.current&&(Un(l),v.current=!1)},[b,l]);let S=J.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,X.jsxs)(J.Fragment,{children:[d,(0,X.jsxs)(Ir.Provider,{value:S,children:[x&&l&&(0,X.jsx)(xt,{"data-type":`outside`,ref:f,onFocus:e=>{Vn(e,l)?m.current?.focus():zn(g?g.domReference:null)?.focus()}}),x&&l&&(0,X.jsx)(`span`,{role:s,"aria-owns":u,style:Fr}),l&&Be.createPortal(a,l),x&&l&&(0,X.jsx)(xt,{"data-type":`outside`,ref:p,onFocus:e=>{Vn(e,l)?h.current?.focus():(Rn(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Kn(`focus-out`,e.nativeEvent)))}})]})]})});function Vr(){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 Hr=class{nodesRef={current:[]};events=Vr();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)}},Ur=J.createContext(null),Wr=J.createContext(null),Gr=()=>J.useContext(Ur)?.id||null,Kr=e=>{let t=J.useContext(Wr);return e??t};function qr(e){let t=Ar(),n=Kr(e),r=Gr();return L(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Jr(e){let{children:t,id:n}=e,r=Gr();return(0,X.jsx)(Ur.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Yr(e){let{children:t,externalTree:n}=e,r=j(()=>n??new Hr).current;return(0,X.jsx)(Wr.Provider,{value:r,children:t})}function Xr(e){return e==null?e:`current`in e?e.current:e}function Zr(e,t){let n=E(Ct(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(ln(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Qr=20,$r=[];function ei(){$r=$r.filter(e=>e.deref()?.isConnected)}function ti(e){ei(),e&&T(e)!==`body`&&($r.push(new WeakRef(e)),$r.length>Qr&&($r=$r.slice(-20)))}function ni(){return ei(),$r[$r.length-1]?.deref()}function ri(e){return e?Pn(e)?e:In(e)[0]||e:null}function ii(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Fn(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Pn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ai(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=I(()=>b.current.floatingContext?.nodeId),S=i===!1,w=rn(_)&&S,E=Ye(i),D=Ye(a),O=Ye(o),k=Ye(u),A=Ye(g),j=Kr(m),M=Lr(),P=J.useRef(!1),F=J.useRef(!1),R=J.useRef(!1),z=J.useRef(null),B=J.useRef(``),V=J.useRef(``),H=J.useRef(null),ee=J.useRef(null),U=N(H,p,M?.beforeInsideRef),te=N(ee,M?.afterInsideRef),W=et(),ne=et(),re=vt(),ie=M!=null,G=on(v),K=I((e=G)=>e?In(e):[]),ae=I(()=>h?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&$(G,Q(Y(G)))&&K().length===0&&!w&&sn(e)}return Z(Y(G),`keydown`,e)},[r,G,c,w,K]),J.useEffect(()=>{if(r||!g)return;let e=Y(G);function t(){R.current=!1}function n(e){let t=Ct(e),n=ae(),r=$(v,t)||$(_,t)||$(M?.portalNode,t)||n.some(e=>e===t||$(e,t));R.current=!r,V.current=e.pointerType||`keyboard`,St(t,`[data-base-ui-click-trigger]`)&&(F.current=!0,ne.start(0,()=>{F.current=!1}))}function i(){V.current=`keyboard`}return Je(Z(e,`pointerdown`,n,!0),Z(e,`pointerup`,t,!0),Z(e,`pointercancel`,t,!0),Z(e,`keydown`,i,!0),t)},[r,v,_,G,g,M,ne,ae]),J.useEffect(()=>{if(r||!l)return;let e=Y(G);function n(){F.current=!0,ne.start(0,()=>{F.current=!1})}function i(e){let t=Ct(e);Pn(t)&&(z.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Ct(n);c&&r==null&&a!=null&&$(v,a)&&ti(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(fr(`focus-guard`))&&[H.current,ee.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Xr(f),Xr(d)].includes(r),m=!($(_,r)||$(v,r)||$(r,v)||$(M?.portalNode,r)||u.some(e=>e===r||$(e,r))||l.hasMatchingElement(e=>$(e,r))||p||j&&(Wn(j.nodesRef.current,o).find(e=>$(e.context?.elements.floating,r)||$(e.context?.elements.domReference,r))||Gn(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,on(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&G&&ii(G),s&&i!==_&&!bn(a)&&Q(e)===e.body){if(C(G)&&(G.focus(),s===`popup`)){re.request(()=>{G.focus()});return}let e=K(),t=z.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||G;C(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(w||!c)&&r&&m&&!F.current&&(w||r!==ni())&&(P.current=!0,t.setOpen(!1,Kn(tr,n)))})}function o(){R.current||(b.current.insideReactTree=!0,W.start(0,()=>{b.current.insideReactTree=!1}))}let u=C(_)?_:null;if(v||u)return Je(u&&Z(u,`focusout`,a),u&&Z(u,`pointerdown`,n),v&&Z(v,`focusin`,i),v&&Z(v,`focusout`,a),v&&M&&Z(v,`focusout`,o,!0))},[r,_,v,G,c,j,M,t,l,s,K,w,x,b,W,ne,re,d,f,ae]),J.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${fr(`portal`)}]`)||[]),t=(j?Gn(j.nodesRef.current,x()):[]).find(e=>rn(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Tr([v,...e,H.current,ee.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...ae(),t,Xr(f),Xr(d),w?_:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Tr([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,M,w,j,x,d,f,ae]),L(()=>{if(!g||r||!C(G))return;B.current=``,V.current=``;let e=Y(G),t=Q(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||$(G,t))return;let i=null,a=()=>(i??=K(G),i[0]||G),o;o=r===!0||r===null?a():Xr(r),o||=a();let s=$(G,Q(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&ln(c);mr(o,{sync:l,preventScroll:o===G,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=Q(e);return!(t!==o&&$(G,t))}})})},[r,g,G,K,E,k,A,b]);let q=J.useRef(null);L(()=>{if(r||!G){q.current=null;return}q.current&&=(q.current.cancelled=!0,null);let e=Y(G),t=Q(e),n=k.current==null;ti(t);function i(e){if(e.open||(B.current=Zr(e.nativeEvent,V.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(fr(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(P.current=!0),e.reason===`outside-press`){if(e.nested)P.current=!1;else if(ln(e.nativeEvent)||un(e.nativeEvent))P.current=!1;else{let e=!1;Y(G).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}}y.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&T(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ni()||null,typeof i==`boolean`?s:Xr(i)||s||null}return()=>{y.off(`openchange`,i);let t=Q(e),n=ae(),r=$(v,t)||n.some(e=>e===t||$(e,t))||j&&Wn(j.nodesRef.current,x(),!1).some(e=>$(e.context?.elements.floating,t)),o=D.current,s=B.current,c=a(s),l={cancelled:!1};q.current=l,queueMicrotask(()=>{q.current===l&&(q.current=null);let n=ri(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!P.current&&C(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}P.current=!1})}},[r,v,G,D,O,k,y,j,_,x,ae]),L(()=>{if(!ft||g||!v)return;let e=Q(Y(v));C(e)&&tn(e)&&$(v,e)&&e.blur()},[g,v]),L(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,c,g,t,l,_]),L(()=>{if(!r&&G)return ii(G),()=>{queueMicrotask(ei)}},[r,G]);let oe=!r&&(!c||!w)&&(ie||c);return(0,X.jsxs)(J.Fragment,{children:[oe&&(0,X.jsx)(xt,{"data-type":`inside`,ref:U,onFocus:e=>{if(c){let e=K();mr(e[e.length-1])}else M?.portalNode&&(P.current=!1,Vn(e,M.portalNode)?Rn(_)?.focus():Xr(f??M.beforeOutsideRef)?.focus())}}),n,oe&&(0,X.jsx)(xt,{"data-type":`inside`,ref:te,onFocus:e=>{c?mr(K()[0]):M?.portalNode&&(l&&(P.current=!0),Vn(e,M.portalNode)?zn(_)?.focus():Xr(d??M.afterOutsideRef)?.focus())}})]})}function oi(){return!1}function si(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ci(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=oi,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Kr(c),m=I(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=I(()=>a),{escapeKey:v,outsidePress:y}=si(s),b=J.useRef(!1),x=J.useRef(!1),S=J.useRef(!1),w=J.useRef(!1),T=J.useRef(!1),E=J.useRef(``),O=J.useRef(null),k=et(),j=et(),M=et(),N=I(()=>{j.clear(),d.current.insideReactTree=!1}),P=I(e=>{let t=d.current.floatingContext?.nodeId;return(p?Wn(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),F=I(t=>$t(t,e.select(`floatingElement`))||$t(t,e.select(`domReferenceElement`))),L=I(t=>{o()&&e.setOpen(!1,Kn(Yn,t.nativeEvent))}),R=I(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=cn(t)?t.nativeEvent:t;if(T.current||i.isComposing||!v&&P(`__escapeKeyBubbles`))return;let a=Kn(nr,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),V=I(()=>{d.current.insideReactTree=!0,j.start(0,N)}),H=I(t=>{if(!l||!n||t.button!==0)return;let r=Ct(t.nativeEvent);$(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),ee=I(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});J.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),J.useEffect(()=>N,[N]),J.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,O.current=null),N;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new $e,i=Y(u);function a(){M.clear(),T.current=!0}function o(){T.current=!0,M.start(ft?5:0,()=>{T.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function j(e){let t=d.current.floatingContext?.nodeId,n=p&&Wn(p.nodesRef.current,t).some(t=>$t(e,t.context?.elements.floating));return F(e)||n}function I(n){if(m(n)){n.type!==`click`&&!F(n)&&(t.clear(),S.current=!1),N();return}if(d.current.insideReactTree){N();return}let r=Ct(n),i=`[${fr(`inert`)}]`,a=B(r)?r.getRootNode():null,o=Array.from((A(a)?a:Y(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>$(e,r))))return;let c=B(r)?r:null;for(;c&&!z(c);){let e=D(c);if(z(e)||!B(e))break;c=e}if(!(o.length&&B(r)&&!en(r)&&!$(r,e.select(`floatingElement`))&&o.every(e=>!$(c,e)))){if(C(r)&&!(`touches`in n)){let e=z(r),t=re(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!j(n)){if(f()===`intentional`){if(n.detail!==0&&!ln(n)&&!w.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||P(`__outsidePressBubbles`)||(e.setOpen(!1,Kn(Qn,n)),N())}}}function L(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!F(t)&&I(t)}function V(t){if(f()!==`sloppy`||!e.select(`open`)||!n||F(t))return;let r=t.touches[0];r&&(O.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function H(e,t){let n=Ct(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function ee(e){E.current=`touch`,H(e,V)}function U(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&H(e,e=>{e.type===`pointerdown`?L(e):I(e)})}function te(e){if(e.type===`pointercancel`&&(w.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():j(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,N())))}function W(e){if(f()!==`sloppy`||!O.current||F(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(I(e),k.clear(),O.current=null)}function ne(e){H(e,W)}function ie(e){f()===`sloppy`&&O.current&&!F(e)&&(O.current.dismissOnTouchEnd&&I(e),k.clear(),O.current=null)}function G(e){H(e,ie)}let K=Je(r&&Je(Z(i,`keydown`,R),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),g&&Je(Z(i,`click`,U,!0),Z(i,`pointerdown`,U,!0),Z(i,`pointerup`,te,!0),Z(i,`pointercancel`,te,!0),Z(i,`mousedown`,U,!0),Z(i,`mouseup`,te,!0),Z(i,`touchstart`,ee,{capture:!0,passive:!0}),Z(i,`touchmove`,ne,{capture:!0,passive:!0}),Z(i,`touchend`,G,{capture:!0,passive:!0})));return()=>{K(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,R,N,_,P,F,p,e,k,M]);let U=J.useMemo(()=>({onKeyDown:R,onPointerDown:L,onClick:L}),[R,L]),te=J.useMemo(()=>({onKeyDown:R,onPointerDown:ee,onMouseDown:ee,onClickCapture:V,onMouseDownCapture(e){V(),H(e)},onPointerDownCapture(e){V(),H(e)},onMouseUpCapture:V,onTouchEndCapture:V,onTouchMoveCapture:V}),[R,V,H,ee]);return J.useMemo(()=>n?{reference:U,floating:te,trigger:U}:{},[n,U,te])}function li(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),L(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};B(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}var ui=te(19)?pi:mi;function di(e,t,n,r,i){return ui(e,t,n,r,i)}function fi(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Re.useSyncExternalStore)(e.subscribe,a,a)}We({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);Object.is(r.value,i)||(t=!0,r.value=i)}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,Re.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function pi(e,t,n,r,i){let a=Ue();if(!a)return fi(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.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function mi(e,t,n,r,i){return(0,ze.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var hi=class{static create(e){return new this(e)}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 di(this,e,t,n,r)}},gi=class extends hi{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){J.useDebugValue(e);let n=this;L(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;L(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);L(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){J.useDebugValue(e);let n=this,r=t!==void 0;L(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return J.useDebugValue(e),di(this,this.selectors[e],t,n,r)}useContextCallback(e,t){J.useDebugValue(e);let n=I(t??H);this.context[e]=n}useStateSetter(e){let t=J.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)}})}};function _i(e,t=!1,n=!1,r=!1){let[i,a]=J.useState(e&&t?`idle`:void 0),[o,s]=J.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),L(()=>{if(!e&&o&&i!==`ending`&&n){let e=_t.request(()=>{a(`ending`)});return()=>{_t.cancel(e)}}},[e,o,i,n]),L(()=>{if(!e||t||i===void 0)return;let n=_t.request(()=>{a(void 0)});return()=>{_t.cancel(n)}},[t,e,i]),L(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=_t.request(()=>{a(`idle`)});return()=>{_t.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function vi(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var yi=null;function bi(e){if(!yi){let e=[];yi=e,queueMicrotask(()=>{yi=null,Be.flushSync(()=>{for(let t of e)t()})})}yi.push(e)}function xi(e,t=!1,n=!1){let r=vt();return I((i,a=null)=>{r.cancel();let o=Xr(e);if(o==null)return;let s=o,c=()=>{n?bi(()=>{a?.aborted||i()}):Be.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(vi(s).map(e=>e.finished.then(H))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(vi(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=At;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})}else r.request(l)})}function Si(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=I(a),s=xi(r,n,i);J.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Ci(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=I(i),{mounted:c,setMounted:l,transitionStatus:u}=_i(t,!1,!1,o),d=!t&&r;L(()=>{t&&s(!1)},[t,s]);let f=J.useRef(c),p=J.useRef(!1),m=Er(),h=()=>{f.current=!1,l(!1),a()};L(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=I(()=>{f.current&&(t?(p.current=!0,m()):h())});return Si({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var wi={tabIndex:-1,[wt]:``};function Ti(e){return t=>t!==`touch`||e.current}function Ei(e,t=!1){let n=Ar(),r=Gr()!=null,i=j(()=>e(n,r)).current;return li({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Di({handle:e,store:t}){return L(()=>e.attachStore(t),[e,t]),null}function Oi(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function ki(e,t){let n=J.useRef(null);return I(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Oi(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Oi(t))})}function Ai(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function ji(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Mi(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ki(e,n),o=I(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=I(e=>{a(e),e&&o(e)});return L(()=>(s(t.current),()=>s(null)),[s,t,n,e]),L(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ni(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=J.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);L(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Kn(Jn);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Pi(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Ci({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return j(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Fi(e,t){e.useSyncedValues(t),L(()=>()=>{e.update({activeTriggerProps:M,inactiveTriggerProps:M,popupProps:M})},[e])}function Ii(e,t){L(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),L(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Li=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Ri={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},zi=class extends gi{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:Vr(),nested:n,triggerElements:i},Ri),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&fn(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)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Bi(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new zi({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:M,inactiveTriggerProps:M,popupProps:M}}var Vi=e=>e.triggerIdProp??e.activeTriggerId,Hi=e=>e.openProp??e.open,Ui=e=>(e.popupElement?.id??e.floatingId)||void 0;function Wi(e,t){return t!==void 0&&Hi(e)&&Vi(e)===t}function Gi(e,t){return Wi(e,t)?!0:t!==void 0&&Hi(e)&&Vi(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Ki={open:Hi,mounted:e=>e.mounted,transitionStatus:e=>Hi(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Vi,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ui,isTriggerActive:(e,t)=>t!==void 0&&Vi(e)===t,isOpenedByTrigger:(e,t)=>Wi(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Vi(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Gi(e,t)?Ui(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function qi(e){return Ar(e,`base-ui`)}function Ji(e,t){let n=J.useRef(e),r=I(t);L(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Yi(e){return te(19)?e:e?`true`:void 0}var Xi=J.createContext(void 0);function Zi(){return J.useContext(Xi)?.direction??`ltr`}var Qi=J.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,X.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),$i={},ea={},ta=``;function na(e,t){return k(e)?e:t}function ra(e,t,n){return/hidden|clip/.test(e.getComputedStyle(na(t,n)).overflowY)}function ia(e){if(typeof document>`u`)return!1;let t=Y(e);return E(t).innerWidth-t.documentElement.clientWidth>0}function aa(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Y(e),n=t.documentElement,r=t.body,i=na(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function oa(e){let t=Y(e),n=t.documentElement,r=t.body,i=na(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 sa(e){let t=Y(e),n=t.documentElement,r=t.body,i=E(n),a=0,o=0,s=!1,c=_t.create();if(ft&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,$i={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ta=n.style.scrollBehavior,ea={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=na(n,r);s=aa(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,$i),Object.assign(r.style,ea),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ta)}function d(){u(),c.request(l)}l();let f=Z(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ca=new class{lockCount=0;restore=null;timeoutLock=$e.create();timeoutUnlock=$e.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=Y(e),n=t.documentElement,r=t.body,i=E(n);if(ra(i,n,r)){let t=new i.MutationObserver(()=>{ra(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=st||!ia(e);this.restore=a?oa(e):sa(e)}};function la(e=!0,t=null){L(()=>{if(e)return ca.acquire(t)},[e,t])}var ua=`ArrowUp`,da=`ArrowDown`,fa=`ArrowLeft`,pa=`ArrowRight`,ma=new Set([ua,da,fa,pa,`Home`,`End`]),ha=[`Shift`,`Control`,`Alt`,`Meta`];function ga(e){return C(e)&&e.tagName===`INPUT`}function _a(e){return!!(ga(e)&&e.selectionStart!=null||C(e)&&e.tagName===`TEXTAREA`)}function va(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=ya(e,t,`left`),a=ba(e),o=ba(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=ya(e,t,`top`),r=ba(e),i=ba(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function ya(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function ba(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function xa({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=J.useRef(e!==void 0),[a,o]=J.useState(()=>t);return[i&&e!==void 0?e:a,J.useCallback(e=>{i||o(e)},[])]}var Sa=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Ca(){return J.useContext(Sa)}function wa(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=I(i),[,o]=J.useState(0),s=j(Ea).current,c=j(Ta).current,l=J.useRef(0),u=J.useRef(!0),d=J.useRef(null),f=J.useRef(null),p=I(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=I((e,t)=>{c.set(e,t),p()}),h=I(e=>{c.delete(e),p()}),g=I(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ka(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Aa(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Oa(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=I(()=>{let[e,t]=Da(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});L(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),L(()=>{u.current&&v()}),L(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=I(e=>(s.add(e),()=>{s.delete(e)})),b=J.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,X.jsx)(Sa.Provider,{value:b,children:t})}function Ta(){return new Map}function Ea(){return new Set}function Da(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Aa(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Oa(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ka(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Aa(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var ja=J.createContext(void 0);function Ma(){let e=J.useContext(ja);if(e===void 0)throw Error(ee(64));return e}var Na=`data-activation-direction`,Pa={tabActivationDirection:e=>({[Na]:e})},Fa=J.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=J.useRef([]),[f,p]=J.useState(()=>new Map),[m,h]=xa({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=J.useState(()=>new Map),y=J.useRef(void 0),b=J.useCallback(e=>Ia(_,e),[_]),[x,S]=J.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=La(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;L(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=I((e,t)=>{t.activationDirection=La(m,e,a,_),i?.(e,t),t.isCanceled||h(()=>e)}),A=I((e,t)=>{i?.(e,Kn(t,void 0,void 0,{activationDirection:`none`}))}),j=I((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=J.useCallback(e=>f.get(e),[f]),N=J.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=J.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=J.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),R=J.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),z=J.useRef(!u),B=J.useRef(r),V=J.useRef(u),H=J.useRef(!1);L(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),z.current=!1}if(_.size===0){H.current&&m!==null&&!y.current?.isConnected&&e(null,lr);return}H.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===B.current&&(V.current=!1),V.current&&t&&m===B.current)return;let r=z.current;if(t||n){let n=R??null;if(m===n){z.current=!1;return}let i=lr;r?i=ur:t&&(i=cr),e(n,i)}else r&&F!=null&&(A(m,ur),z.current=!1)},[R,g,A,F,h,_,m]);let ee=U(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:Pa});return(0,X.jsx)(ja.Provider,{value:P,children:(0,X.jsx)(wa,{elementsRef:d,children:ee})})});function Ia(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function La(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=Ia(r,e),c=Ia(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var Ra=`data-composite-item-active`;function za(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Ca(),u=J.useRef(-1),[d,f]=J.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=J.useRef(null),h=J.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return L(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function Ba(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=F(),{ref:i,index:a}=za(e),o=n===a,s=J.useRef(null),c=N(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var Va=J.createContext(void 0);function Ha(){let e=J.useContext(Va);if(e===void 0)throw Error(ee(65));return e}var Ua=J.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=Ma(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=Ha(),{highlightedIndex:v,onHighlightedIndexChange:y}=F(),b=qi(o),{compositeProps:x,compositeRef:S,index:C}=Ba({metadata:J.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=J.useRef(!1),E=J.useRef(null),D=I(e=>{E.current?.(),E.current=e?g(e):null});L(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=Q(Y(e));if(t&&$(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=V({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=J.useRef(!1),M=J.useRef(!1);function N(e){f(a,Kn(Jn,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function R(e){w||r||h&&(!j.current||M.current)&&N(e)}function z(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=Y(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return U(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:R,onPointerDown:z,[Ra]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:Pa})}),Wa=`data-index`,Ga={...Pa,...Pt},Ka=J.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=Ma(),p=qi(),{ref:m,index:h}=za(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=_i(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=J.useRef(null),w=U(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:Yi(!g),[Wa]:h},s],stateAttributesMapping:Ga});return Si({open:g,ref:C,onComplete(){g||y(!1)}}),L(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null});function qa(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Ja(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=R}=e,[p,m]=J.useState(0),h=r!=null,g=J.useRef(null),_=N(g,c),v=J.useRef([]),y=J.useRef(!1),b=J.useRef(null),x=o??p,S=I((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];va(g.current,t,a,n)}}),C=I(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||vn(e,x,d)?S(Ya(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(vn(t,x,d)){let e=_n(t,{disabledIndices:d});pn(t,e)||S(e)}va(g.current,r,a,n)});L(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(vn(e,x,d)){let t=_n(e,{disabledIndices:d});pn(e,t)||S(t)}},[d,o,x,v,S]);let w=I((e,t,n)=>i?i(e,t,n,v):n),T=I(e=>{let o=e.key===`Home`||e.key===`End`;if(!ma.has(e.key)||!l&&o||Xa(e,f)||!g.current)return;let s=a===`rtl`,c=s?fa:pa,p=s?pa:fa,m=n===`vertical`?da:c,_=n===`vertical`?ua:p,y=Ct(e.nativeEvent);if(y!=null&&_a(y)&&!qa(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=mn(v,d),T=hn(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=_n(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!pn(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=Ct(e.nativeEvent);t&&n!=null&&_a(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function Ya(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!vn(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Xa(e,t){for(let n of ha)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Za(e){let{render:t,className:n,style:r,refs:i=R,props:a=R,state:o=M,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=Ja({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:Zi(),disabledIndices:v,modifierKeys:y}),k=U(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=J.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,X.jsx)(P.Provider,{value:A,children:(0,X.jsx)(wa,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var Qa=J.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=Ma(),[d,f]=J.useState(0),[p,m]=J.useState(null),h=J.useRef(new Set),g=J.useRef(new Set),_=J.useRef(null);L(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=I(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=I(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=J.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,X.jsx)(Va.Provider,{value:S,children:(0,X.jsx)(Za,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:Pa,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:R})})}),$a=r();function eo(e){let t=(0,$a.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`horizontal`:i,o;t[4]===n?o=t[5]:(o=W(`group/tabs flex gap-2 data-horizontal:flex-col`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,X.jsx)(Fa,{"data-slot":`tabs`,"data-orientation":a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var to=m(`group/tabs-list inline-flex w-fit items-center justify-center rounded-none p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function no(e){let t=(0,$a.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]!==n||t[5]!==a?(o=W(to({variant:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o||t[9]!==a?(s=(0,X.jsx)(Qa,{"data-slot":`tabs-list`,"data-variant":a,className:o,...r}),t[7]=r,t[8]=o,t[9]=a,t[10]=s):s=t[10],s}function ro(e){let t=(0,$a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-none border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:py-[calc(--spacing(1.25))] hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Ua,{"data-slot":`tabs-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function io(e){let t=(0,$a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`flex-1 text-xs/relaxed outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Ka,{"data-slot":`tabs-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var ao=class extends Pe(`Exposure`)({hostname:Ie.check(ge(253),fe(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/u)),kind:be([`tailnet`,`public`]),name:v.check(ue(),ge(260)),port:ke.check(me({maximum:65535,minimum:1024}))}){static table=`exposures`},oo=_e({...ao.fields,publicAccess:Me}),so=_e({...oo.fields,worker:p}),co=_e({name:v,worker:p}),lo=class extends Ee()(`@deslop/deploy/rpcs/PeerRpcAuth`,{error:o}){},uo=class extends je(ve(`metrics.watch`,{error:q([o,u]),payload:_,stream:!0,success:xe(y)}),ve(`metrics.history`,{error:q([o,u]),payload:_,success:y}),ve(`inventory.watch`,{error:q([o,u]),stream:!0,success:g}),ve(`inventory.snapshot`,{error:q([o,u]),success:g}),ve(`exposures.expose`,{error:q([o,u]),payload:so,success:Ie}),ve(`exposures.hide`,{error:q([o,u]),payload:co}),ve(`inventory.run`,{error:q([o,u]),payload:f}),ve(`exposures.apply`,{error:u,payload:oo,success:Ie}).middleware(lo),ve(`exposures.remove`,{error:u,payload:_e({name:v})}).middleware(lo),ve(`inventory.start`,{error:u,payload:f.mapFields(e=>se(e,[`worker`]))}).middleware(lo)).middleware(s){};a(`@deslop/deploy`);var fo=class extends we()(`@deslop/deploy/lib/fleet/RpcClient`,{group:uo.middleware(c),protocol:h}){},po=De(ye()),mo=K(fo.runtime.atom(e=>S(e,Fe(x(fo,`inventory.watch`),t=>Ae(()=>{b(t)&&e.set(po,ye())})),l))),ho=fo.runtime.fn((e,t)=>le(fo,ce(t=>t(`exposures.expose`,e)),Ne(()=>Ae(()=>t.set(po,ye()))))),go=he(pe,(e,t)=>{e.set(ho,oe),e.set(po,Le(t))}),_o=ae(e=>fo.runtime.fn(e=>le(fo,ce(t=>t(`inventory.run`,e)),Se(G(Ce(10)),{concurrent:!0})))),vo=ae(e=>d(fo,`metrics.watch`,{minutes:e}));function yo(e){let t=(0,$a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`label`,{"data-slot":`label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bo(e){let t=(0,$a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`field-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var xo=m(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function So(e){let t=(0,$a.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]!==n||t[5]!==a?(o=W(xo({orientation:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,X.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":a,className:o,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function Co(e){let t=(0,$a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-1 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(yo,{"data-slot":`field-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function wo(e){let t=(0,$a.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,errors:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;bb0:{if(n){o=n;break bb0}if(!i?.length){o=null;break bb0}let e;t[5]===i?e=t[6]:(e=[...new Map(i.map(Eo)).values()],t[5]=i,t[6]=e);let r=e;if(r?.length==1){o=r[0]?.message;break bb0}let a;t[7]===r?a=t[8]:(a=(0,X.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(To)}),t[7]=r,t[8]=a),o=a}let s=o;if(!s)return null;let c;t[9]===r?c=t[10]:(c=W(`text-xs font-normal text-destructive`,r),t[9]=r,t[10]=c);let l;return t[11]!==s||t[12]!==a||t[13]!==c?(l=(0,X.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:c,...a,children:s}),t[11]=s,t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function To(e,t){return e?.message&&(0,X.jsx)(`li`,{children:e.message},t)}function Eo(e){return[e?.message,e]}function Do(e){let t=(0,$a.c)(4),n;t[0]===e.result?n=t[1]:(n=Oe(Te(de(e.result),Oo)),t[0]=e.result,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(wo,{children:n}),t[2]=n,t[3]=r),r}function Oo(e){return e.message}export{Kr as $,kt as $t,Di as A,gn as At,ki as B,Qt as Bt,Yi as C,Kn as Ct,Ki as D,Vn as Dt,Bi as E,Bn as Et,Pi as F,ln as Ft,gi as G,Xt as Gt,xi as H,tn as Ht,Fi as I,un as It,ai as J,It as Jt,li as K,Jt as Kt,Ei as L,sn as Lt,Ti as M,pn as Mt,Ai as N,vn as Nt,Li as O,hn as Ot,Ni as P,dn as Pt,Gr as Q,Pt as Qt,Ii as R,on as Rt,Zi as S,Y as Sn,Yn as St,qi as T,Wn as Tt,vi as U,an as Ut,Si as V,rn as Vt,_i as W,Yt as Wt,Yr as X,Ft as Xt,Jr as Y,Rt as Yt,qr as Z,Lt as Zt,wa as _,Ye as _n,Qn as _t,ho as a,$ as an,Pr as at,la as b,Ge as bn,Zn as bt,vo as c,vt as cn,or as ct,eo as d,ft as dn,tr as dt,Et as en,Hr as et,io as f,st as fn,dr as ft,za as g,Ze as gn,Jn as gt,Ba as h,et as hn,rr as ht,Co as i,St as in,Nr as it,ji as j,bn as jt,wi as k,mn as kt,go as l,mt as ln,er as lt,ro as m,$e as mn,ir as mt,So as n,Ot as nn,Mr as nt,po as o,Ct as on,mr as ot,no as p,ut as pn,$n as pt,ci as q,qt,bo as r,Q as rn,jr as rt,mo as s,xt as sn,fr as st,Do as t,Dt as tn,Br as tt,_o as u,pt as un,nr as ut,xa as v,Je as vn,ar as vt,Ji as w,qn as wt,Qi as x,Ke as xn,Xn as xt,ma as y,Z as yn,sr as yt,Mi as z,nn as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,n,o as r}from"./react-BPjvcVqE.js";import{u as i}from"./index-CTldnN8v.js";import{C as a,O as o,m as s,o as c}from"./schema-D8D8ZFxG.js";import{$i as l,Ai as u,Cr as d,G as f,Ia as p,Mt as m,Pa as h,W as g,_a as _,_t as v,ca as y,ea as b,fr as x,ga as S,hi as ee,ja as C,la as w,li as T,ra as te,sa as ne}from"./effect-DgUBIlsv.js";import{A as E,C as D,Ct as O,D as k,E as A,F as j,G as M,Gt as N,I as P,J as F,L as I,M as L,N as re,O as ie,P as ae,Qt as R,R as z,T as B,V,Wt as oe,a as se,an as H,b as U,bn as W,d as ce,f as le,ft as G,gt as ue,hn as de,i as fe,k as pe,lt as me,m as he,n as ge,o as _e,on as ve,p as ye,q as be,r as xe,s as Se,t as Ce,tt as we,w as Te,x as Ee,y as De}from"./result-error-d7x0fvzb.js";import{R as Oe,_ as ke,a as Ae,g as je,h as K,l as Me,o as q,p as Ne,r as J,t as Y}from"./dist-BlsWFKii.js";var X=e(r(),1),Pe=new Map([[`bold`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),X.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),Fe=X.forwardRef((e,t)=>X.createElement(Oe,{ref:t,...e,weights:Pe}));Fe.displayName=`XIcon`;var Ie=X.createContext(void 0);function Z(e){let t=X.useContext(Ie);if(!e&&t===void 0)throw Error(Ne(27));return t}var Le=X.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Z(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return J(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:N,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Re=X.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Z(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Me({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,O(me,e.nativeEvent))}return J(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),ze=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Z(),c=B(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),J(`p`,e,{ref:t,props:[{id:c},o]})}),Be=X.createContext(void 0);function Ve(){let e=X.useContext(Be);if(e===void 0)throw Error(Ne(26));return e}var He=`--nested-dialogs`,Ue=`data-nested-dialog-open`,We={...oe,...R,nestedDialogOpen(e){return e?{[Ue]:``}:null}},Q=t(),Ge=X.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Z(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Ve(),V({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let ee=o===void 0?L(c.context.popupRef):o,C=g>0,w=c.useStateSetter(`popupElement`),T=J(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:C},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...pe,hidden:!m,onKeyDown(e){De.has(e.key)&&e.stopPropagation()},style:{[He]:g}},s],ref:[t,c.context.popupRef,w],stateAttributesMapping:We});return(0,Q.jsx)(F,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:ee,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:T})}),Ke=X.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Z(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(Be.Provider,{value:n,children:(0,Q.jsxs)(we,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(Ee,{ref:i.context.internalBackdropRef,inert:D(!s)}),e.children]})}):null});function qe({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=X.useState(0),[d,f]=X.useState(0),p=l===0,m=be(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=ve(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||H(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return U(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),K(()=>{!r&&!i&&(u(0),f(0))},[r,i]),K(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),P(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Je={...k,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Ye=class extends M{constructor(e,t,n){let r=new ie,i=Xe(e,r,t,n);super(i,Ze(r),Je)}setOpen=(e,t)=>{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||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(re(this.state,e,t.trigger)))}};function Xe(e,t,n,r=!1){return{...A(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Ze(e){return{popupRef:X.createRef(),backdropRef:X.createRef(),internalBackdropRef:X.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Qe(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Z(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=I((e,t)=>new Ye({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),ee=b.useState(`payload`);z(b,x),ae(b);let{forceUnmount:C}=j(x,b);X.useImperativeHandle(l,()=>({unmount:C,close:()=>b.setOpen(!1,O(G))}),[C,b]);let w=x||S||u!=null;return(0,Q.jsxs)(Ie.Provider,{value:b,children:[u&&(0,Q.jsx)(E,{handle:u,store:b}),w&&(0,Q.jsx)(qe,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:ee}):n]})}var $e=W(function(e){return Qe(`dialog`,e)}),et=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Z(),c=B(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),J(`h2`,e,{ref:t,props:[{id:c},o]})}),$=n();function tt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)($e,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function nt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Ke,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function rt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Re,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function it(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Le,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function at(e){let t=(0,$.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0||a,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(it,{}),t[5]=c):c=t[5];let l;t[6]===r?l=t[7]:(l=Y(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-none bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[6]=r,t[7]=l);let u;t[8]===o?u=t[9]:(u=o&&(0,Q.jsxs)(Re,{"data-slot":`dialog-close`,render:(0,Q.jsx)(s,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(Fe,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=o,t[9]=u);let d;return t[10]!==n||t[11]!==i||t[12]!==l||t[13]!==u?(d=(0,Q.jsxs)(nt,{children:[c,(0,Q.jsxs)(Ge,{"data-slot":`dialog-content`,className:l,...i,children:[n,u]})]}),t[10]=n,t[11]=i,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function ot(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex flex-col gap-1 text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function st(e){let t=(0,$.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a!==void 0&&a,c;t[5]===r?c=t[6]:(c=Y(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=c);let l;t[7]===o?l=t[8]:(l=o&&(0,Q.jsx)(Re,{render:(0,Q.jsx)(s,{variant:`outline`}),children:`Close`}),t[7]=o,t[8]=l);let u;return t[9]!==n||t[10]!==i||t[11]!==c||t[12]!==l?(u=(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:c,...i,children:[n,l]}),t[9]=n,t[10]=i,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function ct(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`font-heading text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(et,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lt(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(ze,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var ut=`data-valid`,dt=`data-invalid`,ft={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},pt={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},mt={valid(e){return e===null?null:e?{[ut]:``}:{[dt]:``}}},ht={invalid:void 0,name:void 0,validityData:{state:ft,errors:[],error:``,value:``,initialValue:null},setValidityData:q,disabled:void 0,setTouched:q,setDirty:q,setFilled:q,setFocused:q,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:pt,registerFieldControl:q,validation:{getValidationProps:(e,t=Ae)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:q,getInputControl:()=>null,commit:async()=>{},change:q}},gt=X.createContext(ht);function _t(e=!0){let t=X.useContext(gt);if(t.setValidityData===q&&!e)throw Error(Ne(28));return t}var vt=X.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:q,validationMode:`onSubmit`,submitCountRef:{current:0}});function yt(){return X.useContext(vt)}var bt=X.createContext({controlId:void 0,registerControlId:q,resetControlId:q,labelId:void 0,setLabelId:q,messageIds:[],setMessageIds:q,getDescriptionProps:e=>e});function xt(){return X.useContext(bt)}function St(e,t,n){let{setFocused:r,focusOwnerRef:i}=_t(),a=je(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return K(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Ct(e,t,n,r,i=!0,a){let{registerFieldControl:o}=_t(),s=ke(()=>Symbol());K(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),K(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function wt(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=xt(),o=B(),s=ke(()=>Symbol()),c=X.useRef(!1),l=X.useRef(!1),u=je(()=>{c.current&&i!==q&&(c.current=!1,i(s.current,void 0))});return K(()=>{if(!n||i===q){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),K(()=>u,[u]),(n?r:void 0)??t??o}var Tt=X.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=_t(),{clearErrors:S,elementRef:ee,submitCountRef:C}=yt(),w=h||s,T=m??a,te={...p,disabled:w},{labelId:ne}=xt(),E=wt({id:i}),D=o!==void 0,k=o==null?void 0:String(o),A=je(()=>x.inputRef.current?.value);Ct(x.inputRef,E,k,A,!w,a),K(()=>{let e=k??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[k,l,x.inputRef,y]),Te(k,()=>{k!==void 0&&(S(T),_(k!==(v.initialValue??``)),x.change(k))});let j=X.useRef(null),M=St(w,j),N=de();return J(`input`,e,{ref:[t,j],state:te,props:[{id:E,disabled:w,name:T,ref:x.inputRef,"aria-labelledby":ne,autoFocus:u,...D?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=O(ue,e.nativeEvent);c?.(t,n),D||(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(T),x.change(t)))},onFocus(){M(!0)},onBlur(e){if(g(!0),M(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),D&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===ee.current&&!e.defaultPrevented){let t=e.currentTarget,n=C.current;N.start(0,()=>{C.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(w,e)],stateAttributesMapping:mt})}),Et=X.forwardRef(function(e,t){return(0,Q.jsx)(Tt,{ref:t,...e})});function Dt(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Y(`h-8 w-full min-w-0 rounded-none border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,Q.jsx)(Et,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}var Ot=v([`tailnet`,`public`]);function kt(e){let t=(0,$.c)(70),[n,r]=a(se),[i,o]=(0,X.useState)(`tailnet`),[l,f]=(0,X.useState)(``),_;if(t[0]!==e.items||t[1]!==e.port.worker){let n;t[3]===e.port.worker?n=t[4]:(n=t=>b(t.self,!0)&&t.worker===e.port.worker,t[3]=e.port.worker,t[4]=n),_=ne(p(e.items,ee(n),te(At)),h(``)),t[0]=e.items,t[1]=e.port.worker,t[2]=_}else _=t[2];let v=_,S;t[5]===n?S=t[6]:(S=g(n),t[5]=n,t[6]=S);let C=S,E;t[7]!==r||t[8]!==l||t[9]!==i||t[10]!==e.port.port||t[11]!==e.port.worker||t[12]!==v?(E=t=>{t.preventDefault(),r({hostname:T(i===`public`,{onFalse:()=>v,onTrue:()=>l}),kind:i,name:c.make(T(i===`public`,{onFalse:()=>`tailnet:${y(e.port.port)}`,onTrue:()=>`public:${l}`})),port:y(e.port.port),publicAccess:i===`public`,worker:e.port.worker})},t[7]=r,t[8]=l,t[9]=i,t[10]=e.port.port,t[11]=e.port.worker,t[12]=v,t[13]=E):E=t[13];let D;if(t[14]!==e.port.name||t[15]!==e.port.process){let n;t[17]===e.port.name?n=t[18]:(n=()=>e.port.name,t[17]=e.port.name,t[18]=n),D=ne(e.port.process,n),t[14]=e.port.name,t[15]=e.port.process,t[16]=D}else D=t[16];let O;t[19]===D?O=t[20]:(O=(0,Q.jsx)(ct,{children:D}),t[19]=D,t[20]=O);let k;t[21]===e.port.port?k=t[22]:(k=w(e.port.port),t[21]=e.port.port,t[22]=k);let A;t[23]===k?A=t[24]:(A=(0,Q.jsxs)(lt,{children:[`Port `,k]}),t[23]=k,t[24]=A);let j;t[25]!==O||t[26]!==A?(j=(0,Q.jsxs)(ot,{children:[O,A]}),t[25]=O,t[26]=A,t[27]=j):j=t[27];let M;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{m(Ot)(e)&&o(e)},t[28]=M):M=t[28];let N;t[29]===C?N=t[30]:(N=u(Ot.literals,e=>(0,Q.jsx)(he,{value:e,disabled:C,children:x(e)},e)),t[29]=C,t[30]=N);let P;t[31]===N?P=t[32]:(P=(0,Q.jsx)(ye,{className:`w-full`,children:N}),t[31]=N,t[32]=P);let F;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(fe,{htmlFor:`expose-tailnet`,children:`Address`}),t[33]=F):F=t[33];let I;t[34]!==e.port.port||t[35]!==v?(I=T(v===``,{onFalse:()=>`https://${v}:${w(e.port.port)}`,onTrue:h(``)}),t[34]=e.port.port,t[35]=v,t[36]=I):I=t[36];let L;t[37]===I?L=t[38]:(L=(0,Q.jsx)(le,{value:`tailnet`,children:(0,Q.jsxs)(ge,{children:[F,(0,Q.jsx)(Dt,{id:`expose-tailnet`,readOnly:!0,value:I})]})}),t[37]=I,t[38]=L);let re;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(fe,{htmlFor:`expose-public`,children:`Hostname`}),t[39]=re):re=t[39];let ie=i===`public`,ae;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>f(d(e.target.value)),t[40]=ae):ae=t[40];let R;t[41]!==l||t[42]!==C||t[43]!==ie?(R=(0,Q.jsx)(le,{value:`public`,children:(0,Q.jsxs)(ge,{children:[re,(0,Q.jsx)(Dt,{id:`expose-public`,required:ie,placeholder:`app.example.com`,autoCapitalize:`none`,spellCheck:!1,value:l,disabled:C,onChange:ae})]})}),t[41]=l,t[42]=C,t[43]=ie,t[44]=R):R=t[44];let z;t[45]!==i||t[46]!==P||t[47]!==L||t[48]!==R?(z=(0,Q.jsxs)(ce,{value:i,onValueChange:M,children:[P,L,R]}),t[45]=i,t[46]=P,t[47]=L,t[48]=R,t[49]=z):z=t[49];let B;t[50]===n?B=t[51]:(B=(0,Q.jsx)(Ce,{result:n}),t[50]=n,t[51]=B);let V;t[52]===C?V=t[53]:(V=(0,Q.jsx)(rt,{render:(0,Q.jsx)(s,{variant:`outline`,type:`button`,disabled:C}),children:`Cancel`}),t[52]=C,t[53]=V);let oe=C||i===`tailnet`&&v===``||i===`public`&&l===``,H;t[54]===C?H=t[55]:(H=T(C,{onFalse:h(`Expose`),onTrue:h(`Exposing…`)}),t[54]=C,t[55]=H);let U;t[56]!==oe||t[57]!==H?(U=(0,Q.jsx)(s,{type:`submit`,disabled:oe,children:H}),t[56]=oe,t[57]=H,t[58]=U):U=t[58];let W;t[59]!==V||t[60]!==U?(W=(0,Q.jsxs)(st,{children:[V,U]}),t[59]=V,t[60]=U,t[61]=W):W=t[61];let G;t[62]!==z||t[63]!==B||t[64]!==W||t[65]!==j?(G=(0,Q.jsxs)(xe,{children:[j,z,B,W]}),t[62]=z,t[63]=B,t[64]=W,t[65]=j,t[66]=G):G=t[66];let ue;return t[67]!==E||t[68]!==G?(ue=(0,Q.jsx)(`form`,{onSubmit:E,children:G}),t[67]=E,t[68]=G,t[69]=ue):ue=t[69],ue}function At(e){return e.hostname}function jt(){let e=(0,$.c)(2),[t,n]=a(_e),r;return e[0]===n?r=e[1]:(r=e=>(0,Q.jsx)(tt,{open:!0,onOpenChange:e=>{e||n(_())},children:(0,Q.jsx)(at,{showCloseButton:!1,children:(0,Q.jsx)(kt,{items:e.snapshot.items,port:e.port},e.port.id)})}),e[0]=n,e[1]=r),S(l({port:t,snapshot:f(o(Se))}),{onNone:C,onSome:r})}function Mt(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(jt,{}),(0,Q.jsx)(i,{})]}),e[0]=t):t=e[0],t}export{Mt as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,n,o as r,t as i}from"./react-BPjvcVqE.js";import{l as a,r as o,t as s,z as c}from"./dist-BlsWFKii.js";import{$ as l,$r as u,$t as d,Ai as f,Br as p,Bt as m,C as h,Cn as g,Ct as _,Dt as v,Et as y,F as b,Fa as x,Fn as S,Fr as C,Ft as w,Gn as ee,Gr as te,Gt as ne,Hn as re,Hr as ie,I as ae,Ia as T,In as oe,Ir as se,It as ce,J as le,Jn as ue,Jt as E,K as de,Kn as fe,Kr as pe,Kt as me,Lr as he,Lt as ge,Mn as _e,Mr as ve,Mt as ye,N as be,Nr as xe,O as Se,Ot as D,Pa as Ce,Pn as we,Pr as Te,Q as Ee,Qi as De,Qn as Oe,Qt as ke,R as Ae,Rn as je,Rr as Me,Rt as Ne,S as Pe,St as O,T as Fe,Tn as Ie,Tt as k,Ur as Le,Ut as Re,V as ze,Vr as Be,Vt as Ve,Wn as He,Wr as Ue,Wt as A,Xt as We,Y as Ge,Yn as Ke,Yr as qe,Yt as Je,Zn as Ye,Zr as Xe,Zt as Ze,_a as Qe,_t as j,a as $e,aa as et,ai as tt,ar as nt,at as M,b as rt,ba as it,bt as at,c as ot,ci as st,ct,d as lt,da as ut,dt,ei as ft,en as pt,er as mt,et as ht,fa as gt,ft as N,g as _t,ga as vt,gt as yt,h as bt,ht as xt,i as St,ia as Ct,ii as wt,ir as Tt,jn as Et,k as Dt,kr as Ot,kt as P,l as kt,la as At,lr as jt,lt as Mt,m as Nt,mi as Pt,mt as F,n as Ft,na as It,nr as Lt,or as Rt,ot as I,p as zt,pr as Bt,pt as L,q as Vt,qn as Ht,qr as Ut,qt as Wt,r as Gt,ra as Kt,rt as qt,s as Jt,sa as Yt,si as Xt,sr as Zt,st as Qt,t as $t,ta as en,tn,tr as R,tt as nn,u as rn,ua as an,ui as on,ur as sn,ut as cn,v as ln,va as un,vt as dn,w as fn,wi as pn,wt as z,x as mn,xt as hn,y as gn,ya as _n,yt as vn,z as yn,zi as bn,zn as xn,zr as Sn,zt as Cn}from"./effect-DgUBIlsv.js";var B=e(r(),1),V=t(),wn=class extends B.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?B.createElement(this.props.errorComponent??Tn,{error:e[0],reset:this.reset}):this.props.children}};function Tn({error:e}){let[t,n]=B.useState(!1);return(0,V.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,V.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,V.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,V.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,V.jsx)(`div`,{children:(0,V.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,V.jsx)(`code`,{children:e.message}):null})}):null]})}function H(e){return e[e.length-1]}function En(e,t){return typeof e==`function`?e(t):e}var Dn=Object.prototype.hasOwnProperty;function On(e){for(let t in e)if(Dn.call(e,t))return!0;return!1}var kn=()=>Object.create(null),An=(e,t)=>U(e,t,!0);function U(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(jn(e)&&jn(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&H(a)!==`${o-1}`||c&&H(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?U(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?U(d,o,n,r):o,i&&=u===d&&(a[l]===f||Dn.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?kn():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?U(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function jn(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function Mn(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!Mn(a,o,n,r))return!1}return!0}if(jn(e)&&jn(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!Mn(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!Mn(e[a],t[a],n,r)))return!1;return i===0}return!1}function Nn(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var Pn=/[\x00-\x1f\x7f"<>`{}]/g;function Fn(e){return e.replace(Pn,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function In(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Fn(t)}var Ln=[`http:`,`https:`,`mailto:`,`tel:`];function Rn(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var zn=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Bn(e,t){if(!e)return!1;if(zn.test(e))return!0;let n=Rn(e);return n?!t.has(n):!1}function Vn(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=In(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=In(r?e.slice(r):e)}return t}function Hn(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Un(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Wn(){throw Error(`Invariant failed`)}function Gn(e){return e.replace(/\/{2,}/g,`/`)}function Kn(e){return e===`/`?e:e.replace(/^\/+/,``)}function W(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function qn(e){return W(Kn(e))}function Jn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Yn(e,t,n=`never`,r){if(t.includes(`//`)&&(t=Gn(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Gn(e)),o=e.split(`/`);o.length>1&&H(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(H(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Gn(s):s)||`/`;return a&&r&&r.set(a,c),c}function Xn(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function Zn(e){return e==null||e===``}function Qn(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function $n(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&Zn(f)){if(c===`/`&&!d)continue;f=``}o+=c+Qn(s,f,r)+(d||``)}}return o+a||`/`}function er(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function tr(e){return e?.isNotFound===!0}function nr(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function rr(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ir(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=rr(r):Array.isArray(t)?t.push(rr(r)):n[e]=[t,rr(r)]}return n}var ar=/^(?:\s|["[{\d-]|fa|nu|tr)/,or=cr(JSON.parse),sr=lr(JSON.stringify,JSON.parse);function cr(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=ir(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!ar.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function lr(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!ar.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=nr(e,r);return t?`?${t}`:``}}var ur=`__root__`;function dr(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function fr(e){return e instanceof Response&&!!e.options}function pr(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var G=4,mr=5;function hr(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function gr(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function _r(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=H(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=gr(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=yr(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.slice(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=yr(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.slice(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=yr(r,mr);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=yr(r,G);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function vr(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function yr(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function br(e,t){let n=yr(),r=[];function i(e,t,n,a){let[o,s,c]=_r(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(vr);t.masksTree=n,t.flatCache=pr(1e3)}function xr(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Tr(e,t.masksTree);return t.flatCache.set(e,r),r}function Sr(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=yr(),_r(t,{from:e},1,o),i.singleCache.set(a,o)),Tr(r,o,n)}function Cr(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Tr(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Dr(a.route)),t.matchCache.set(r,a),a}function wr(e,t=!1){let n=yr(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&Wn(),i[e.id]=e,o!==0&&e.path){let t=W(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=_r(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(vr);return{processedTree:{segmentTree:n,singleCache:pr(1e3),matchCache:pr(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Tr(e,t,n=!1){let r=e.split(`/`),i=kr(e,r,t,n);if(!i)return null;let[a]=Er(e,r,i);return{route:i.node.route,rawParams:a}}function Er(e,t,n){let r=Or(n.node),i=n.node.data&&hr(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===G)break;if(u.kind===mr){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Dr(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Or(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function kr(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!H(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Nr(l,n))continue;if(i.parse){if(!Mr(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==G&&Nr(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===G||i.kind===2)&&Nr(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Mr(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&jr(f,o))return n;Nr(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Ar(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Ar(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Ar(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Ar(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Ar(e,t){return 2**(e-t-1)}function jr(e,t){return e===2**(t-1)-1}function Mr(e,t,n){let r,i;try{[r,i]=Er(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Nr(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===G)>(e.node.kind===G)||t.node.kind===G==(e.node.kind===G)&&t.node.depth>e.node.depth)))}function Pr(){try{return sessionStorage}catch{return}}var Fr=`tsr-scroll-restoration-v1_3`,Ir=Pr();function Lr(){try{return JSON.parse(Ir?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Rr=Lr(),zr=`data-scroll-restoration-id`,Br=e=>e.state.__TSR_key||e.href;function Vr(e){let t=e.getAttribute(zr);if(t)return`[${zr}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Hr=!1,Ur=`window`;function Wr(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Gr(e){let t=new Set;for(let n of e){if(n===Ur)continue;let e=Wr(n);e&&t.add(e)}return t}function Kr(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Br,a=new Set,o=e=>{let t=Rr[e]||={};for(let e of a)e===document?t[Ur]={scrollX,scrollY}:e.isConnected&&(t[Vr(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Hr=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Hr||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{Ir?.setItem(Fr,JSON.stringify(Rr))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),r.r||(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=Rr[d];if(e){let t=Rr[u];for(let n in e){if(n===Ur){if(s)continue}else{let e=Wr(n);if(!e||s&&o&&(l??=Gr(o),l.has(e)))continue}t||=Rr[u]={},t[n]??=e[n]}}}Hr=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Gr(o));let t=e&&i&&c,s=r.e?Rr[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Ur){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Wr(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Hr=!1}}))}function qr(e,t,n){let r=qn(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=Gn(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>Jr(n,s.input({url:e})),output:({url:e})=>s.output({url:Yr(n,e)})}:s}function Jr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Yr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Xr(e){let t=e;return{get(){return t},set(e){t=En(e,t)}}}function Zr(e){return{get(){return e()}}}function Qr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{Un(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var K=`__TSR_index`,$r=`popstate`,ei=`beforeunload`,ti=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function ni(e){let t=ti.exec(e);return t?`/`+e.slice(t[0].length):e}function ri(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
2
|
-
\r`.includes(e)?``:encodeURIComponent(e))),ni(e)}function ii(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=si(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[K];i=ai(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[K];i=ai(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[K]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function ai(e,t){let n=ci();return{...t,key:n,__TSR_key:n,[K]:e}}function oi(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>ri(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>si(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ci();t.history.replaceState({[K]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=si(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[K]-l.state[K],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=ii({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ei,x,{capture:!0}),t.removeEventListener($r,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(ei,x,{capture:!0}),t.addEventListener($r,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function si(e,t){let n=ri(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=ci();t={[K]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function ci(){return(Math.random()+1).toString(36).slice(7)}function li(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function ui(e){return e.pathname+e.search+e.hash}function di(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function fi(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function pi({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function mi(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function hi(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var gi=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:oi()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&qn(n)?qr(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Qr(this.latestLocation,e),Kr(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=wr(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&br(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:pr(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Vn(e),external:!1,searchStr:o,search:An(t?.search,i),hash:Vn(r.slice(1)),state:U(t?.state,a)}}let o=Jr(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:Vn(ni(o.pathname)),external:!!this.rewrite&&li(o,this.origin),searchStr:c,search:An(t?.search,s),hash:Vn(o.hash.slice(1)),state:U(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Cr(W(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=si(n.href,{});n={...n,to:Jr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=Yn(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[W(c)],u=c.includes(`$`),d;if(l)d=l._branch??=Dr(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??_r(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=xi(n.params,e),!On(p))break;p===e&&(p=Object.assign(kn(),p));try{Object.assign(p,t(p))}catch{}}}p??=xi(n.params,Si(n.params,f)?o()[3]:Ci);let m=e.leaveParams?c:ni(Vn(f?$n(c,f,p,this.pathParamsDecoder):c)),h=wi(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,bi(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Ti(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Ci,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Ci,S=`${m}${v}${b}`,C,w,ee=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=Yr(this.rewrite,e);C=ui(e),li(n,t)?(w=n.href,ee=!0):w=ni(ui(n))}else C=Hn(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=xr(r.pathname,this.processedTree);if(t){let i=Object.assign(kn(),t.rawParams),{from:a,params:o,...s}=t.route,c=xi(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return _i(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=W(this.latestLocation.href)===W(n.href)&&Mn(pi(n.state),pi(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?Rn(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return _i(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await fa(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(fi(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&di(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(zn.test(n)||(r=Rn(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:li(e,this.origin)||(n=ui(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Ai,this.preloadRoute=e=>pa(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?Yn(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Sr(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Mn(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Mn(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=Xn(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??sr,parseSearch:e.parseSearch??or,protocolAllowlist:e.protocolAllowlist??Ln}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=_r(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:W(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ei(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=bi(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof vi||(r=new vi(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=kn(),_=i._interpolation?$n(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{Di(i,d)}catch(e){if(x=tr(e)||fr(e)?e:new yi(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:An(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=di(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?An(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?U(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?An(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=H(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=H(a),c={...e.search};for(let e of a)try{Object.assign(c,bi(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Di(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function _i(e,t,{replace:n,ignoreBlocker:r}){if(!Bn(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var vi=class extends Error{},yi=class extends Error{};function bi(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new vi(`Async validation not supported`);if(n.issues)throw new vi(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function xi(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Si(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!Dn.call(e,t[1]))}var Ci=Object.freeze({});function wi(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=bi(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Ti(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=En(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Ei(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return ur}function Di(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Oi(e,t){return e.options[t]?.preload?.()}function ki(e,t){let n=Oi(e,`component`),r=Oi(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Ai(e,t,n){let r=()=>t===!1?void 0:t?Oi(e,t):ki(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function ji(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Mi(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var q=0,J=1,Ni=2,Y=3,X=[4];function Pi(e){return typeof e[0]==`number`}function Fi(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function Ii(e,t){return e.routesById[t.routeId]}function Li(e,t,n){return fr(e)?[Y,e]:tr(e)?(e.routeId||=n,[Ni,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[J,e]):[q,e]}function Ri(e,t){let n=Li(t,!0,e.id);if(n[0]!==J)return n;try{e.options.onError?.(n[1])}catch(t){n=Li(t,!0,e.id)}return n}function zi(e,t,n,r,i){return i[0].signal.aborted?X:$i(e,t,n,Ri(n,r),i)}async function Bi(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Ii(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Z(e,r),[i,zi(e,t,u,a,n)]}if(c.aborted)return[i,X];let p=r.paramsError??r.searchError;if(p!==void 0)return Z(e,r),[i,zi(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{Ui(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Fi(a,c):a);if(c.aborted)return[i,X];let s=$i(e,t,u,Li(o,!1,u.id),n);if(s[0]!==q)return Z(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Z(e,r),[i,zi(e,t,u,a,n)]}finally{r.status=h,Ui(e,r,!1,n[0])}}i()}function Vi(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Z(e,t){let n=t._flight;t._flight=void 0,Vi(e,t,n)?.abort()}function Q(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Vi(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Hi(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Ui(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Wi(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Gi(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return X;if(!i)return[q,void 0];let l=n._flight;Ui(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Wi(e,t,n,r,s,a,!!o[3]))).then(e=>Li(e,!1,r.id),e=>Li(e,!0,r.id)).then(t=>(t[0]!==q&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===J&&l[2]?Ri(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],$i(e,t,r,await Fi(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Z(e,n),X}finally{Ui(e,n,!1,s)}}function Ki(e,t,n){t[0]!==Y&&(e.status=`success`,e.error=void 0,t[0]===q?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function qi(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Z(e,r)}function Ji(e,t){return t[0]===J||t[0]===Ni?{...e,status:t[0]===J?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Yi(e,t,n,r,i,a,o){let s=t[1][n],c=Ii(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Wi(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=X)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Z(e,s),p=zi(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Vi(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Gi(e,t,s,c,g,i,a).then(t=>(Ki(s,t,l),t[0]===q&&(m&&!a[0].signal.aborted&&qi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[q,s.loaderData]),ee=(async()=>{try{let e=Ai(c,void 0,C);e&&await Fi(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,zi(e,t,c,r,a)]}let r=await w;x&&r[0]===q&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,ee]),!y)return w.then(e=>Ji(s,e));let te={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ne=Gi(e,t,te,c,g,i,a).then(e=>(s.isFetching=!1,Ki(te,e,!1),e));return(t[2]??=[]).push([n,ne,ee,te]),ne.then(e=>Ji(te,e))}async function Xi(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Ii(e,t[n]);try{let e=Ai(i,!1);e&&await Fi(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Zi(e,t){t[2]&&=(Q(e,t[2].map(e=>e[3])),void 0)}async function Qi(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Y)throw[a,t];!i&&t[0]!==q&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Y)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function $i(e,t,n,r,i,a){for(;r[0]===Y;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[Y,t]:[Y,t,a]}return[Y,o,n]}catch(e){r=a?[J,e]:Ri(n,e),a=!0}}return r}async function ea(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ni?Xi(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Y)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==q&&t[0]<Y&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Y){let n=s[1];if(n[0]!==Y||n[1].options.reloadDocument||n[2])return Zi(e,t),n;c=!0,s=[0,[J,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===J?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Ii(e,u);try{await Fi(i?Promise.resolve().then(()=>Ai(m,l===J?`errorComponent`:`notFoundComponent`)):Promise.all([Ai(m),Ai(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Zi(e,t),X}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Zi(e,t),Q(e,o),p()):u.status=`success`}return t}async function ta(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Ii(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Fi(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function na(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Xi(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Yi(e,i,t,u,f,r,l)},m=await Bi(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Ni){let t=await Xi(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Y&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=ea(e,i,u,r[0],Qi(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Qi(i[2],void 0,void 0,h.then(e=>Pi(e)?0:ji(n).length,()=>0))),o=await h}catch(t){if(Zi(e,i),t===a&&a.aborted)return X;throw t}return Pi(o)?o:ta(e,o,a,r[6]===n.length?r[6]:0)}function ra(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Ii(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>ra(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function ia(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function aa(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!ji(t[3]).some(e=>e.id===n[1]))return;let i;try{await Fi(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function oa(e,t){e._committed=t,e.stores.setMatches(t)}function sa(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=ji(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Ii(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=mi(n);oa(e,n),Q(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),hi(e,i,n,a,l,t)}async function ca(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function la(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function ua(e,t,n,r,i){let a=n.map(e=>({...e}));Hi(a);for(let t of r)Z(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await ea(e,o,r,t[0],i)}catch(t){throw Q(e,a),t}if(Pi(s))Q(e,a),s[0]===Y&&e._tx===t&&e._committed===n&&await la(e,t,s);else if(await ta(e,s,t[0].signal),e._tx!==t||e._committed!==n)Q(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Z(e,n))}oa(e,a),Q(e,n,a)}}async function da(e,t,n,r,i,a){let o=await na(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Pi(o)){let n=o[0]===Y&&e._tx===t;if((!n||o[1].options.reloadDocument)&&ia(e,t),Q(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){ia(e,t);return}await la(e,t,o);return}let s=o[1];if(e._tx===t&&await aa(e,t),e._tx!==t){ia(e,t),Q(e,s),Zi(e,o);return}let c=t[2],l=fi(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await aa(e,t),e._tx!==t){ia(e,t),Q(e,s),Zi(e,o);return}let n=await e.startTransition(()=>{ia(e,t),sa(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&ua(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):Zi(e,o)})}async function fa(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=fi(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await ca(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Hi(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){Q(e,m),await ca(e,n);return}e._preflight=void 0;let g,_=()=>da(e,y,f,()=>ra(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>ca(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Ui(e,t,!1)}n[0].abort(),Q(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&ra(e,y),g?.(_()),await y[5]):(Q(e,y[3]),y[3]=[],g?.(),await ca(e,y))}async function pa(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Hi(a),o=(e._preloads??=new Map).set(i,a),s=await na(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),Q(e,a)),i.abort()}if(!Pi(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){tr(e)||console.error(e);return}}}function ma(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Mi(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var ha=B.createContext(void 0),ga=B.createContext(void 0),_a=B.createContext(null);function va(e){return B.useContext(_a)}var ya=c();function ba(e,t){return e===t}function xa(e,t=e=>e,n){let r=n?.compare??ba,i=(0,B.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,B.useCallback)(()=>e.get(),[e]);return(0,ya.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Sa=class extends y()(`AuthError`,{cause:Cn(Mt()),error:m(j([`access_denied`,`temporarily_unavailable`])),message:z}){get name(){return this.error===`temporarily_unavailable`?`AuthUnavailable`:`AuthError`}},Ca=T(dn,D(`UserId`)),wa=T(F,D(`GitHubId`));T(L,P(wa));var Ta=k({admin:I,id:Ca,name:dn});k({address:O(dn),onBehalfOf:O(Ca),session:O(dn)}),Ca.make(`github:0`);function Ea(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}function Da(e){return ye(Sa)(e)&&e.error===void 0}function Oa(e){return ye(Sa)(e)&&e.error!==`temporarily_unavailable`}Xt()(`@deslop/runtime/shared/auth/CurrentUser`);var ka=class extends St()(`@deslop/runtime/shared/auth/RpcAuth`,{error:Sa}){},Aa=z.check(Ne(e=>en(De(Fe(e)),e=>on([`http:`,`https:`],e.protocol)&&e.username===``&&e.password===``&&e.hash===``),{expected:`an HTTP(S) URL without credentials or a fragment`})).check(Ne(e=>en(De(Fe(e)),e=>e.pathname===`/`&&e.search===``),{expected:`an HTTP(S) origin without a path or query`})),ja=Aa.check(Ne(e=>en(De(Fe(e)),e=>e.protocol===`https:`||on([`localhost`,`127.0.0.1`,`[::1]`],e.hostname)),{expected:`HTTPS outside loopback`}));z.check(ge(/^\d{1,5}$/u),Ne(e=>en(Ot(e),e=>e>=1&&e<=65535),{expected:`a port between 1 and 65535`}));var Ma=z.check(ge(/^0\.1\.\d+$/u)),Na=`/api/runtime`,Pa=k({auth:O(Aa),name:z,traces:z,version:Ma}),Fa=`/api/rpc`,Ia=k({...Ta.fields,signOut:I});k({config:k({port:F}),name:z,version:Ma}),j([`web`,`mobile`,`server`]);function La(e,t,n,r){return ve(p(He(function*(){let i=`${yield*ie}`,a=yield*We,o={attributes:{"scope.run.started_unix_nano":i,"scope.runtime":n,"service.instance.id":i},serviceName:e,serviceVersion:At(gt(r,e=>e!==`0.1.0`))};return se(C(Jt({resource:o,url:new URL(`/v1/traces`,t).href}),ot({resource:o,url:new URL(`/v1/logs`,t).href}),Me(We,[...a,`code`,`state`,`request`,`access_token`,`refresh_token`,`id_token`,`client_secret`,`client_assertion`,`code_verifier`,`session`,`token`])),[kt,lt])})),e=>te(e)?xe(ee):xe(Ht(`Telemetry is unavailable`)))}function Ra(e){return p(He(function*(){let t=yield*T((yield*mn).get(Na),re(h),re(fn(Pa)),nt(`3 seconds`),Tt(e=>Ht(`Telemetry is off: the runtime config did not load`,e)),Ke);return vt(t,{onNone:()=>Te,onSome:t=>t.traces===``?Te:La(`${e}-client`,t.traces,`web`,t.version)})}))}var za=class extends St()(`@deslop/runtime/shared/rpc/RpcStream`){};Me(za,za.of((e,t)=>ln(t.rpc.successSchema)?S(oe(`rpc.stream`,!0),e):e));var Ba=$e(za,e=>He(function*(){return ln(e.rpc.successSchema)&&(yield*oe(`rpc.stream`,!0)),yield*e.next(e.request)}));function Va(e,t=rt){return T(zt({pingTimeout:`15 seconds`,retryTransientErrors:!0}),se(se(gn(e),t)),he(Nt()),he(Ba))}var Ha=d(Qe());j([`route`,`caught`,`uncaught`]);var Ua=Se(e=>{let t=fe(`Web error`,Le(e.error),...it(et(e.stack)));return vt(Ze(Ha),{onNone:()=>t,onSome:n=>Ye(T(t,S(je(e.error)),Zt(`Web.error`,{attributes:{"web.error.source":e.source,"web.route.id":e.route},root:!0}),xn),n)})}),Wa=be(lt).atom(T(Pe(`/api/account`),re(h),re(fn(Ia)))),Ga=Va(Lt(()=>`${location.origin}${Fa}`));function Ka(e){be.addGlobalLayer(T(Ra(e),se(lt),Sn(e=>an(st(e,rn))?Rt:we(Lt(()=>pt(Ha,_n(e))),()=>Lt(()=>tn(Ha,It(t=>t!==e)))))))}var qa=e(i(),1);function Ja(e){let t=qa.unstable_scheduleCallback(4,e);return()=>qa.unstable_cancelCallback(t)}var Ya=B.createContext(ae({scheduleTask:Ja,defaultIdleTTL:400})),Xa=new WeakMap,Za=0,Qa=new Set;function $a(e){Za++;try{return e()}finally{Za--}}function eo(e){if(Za===0)return e();Qa.size===0&&queueMicrotask(to),Qa.add(e)}function to(){for(let e of Qa)Qa.delete(e),e()}function no(e,t){let n=Xa.get(e);n===void 0&&(n=new WeakMap,Xa.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i=0,a,o={subscribe(n){i++;let r=e.subscribe(t,()=>eo(n));return()=>{i--,Qa.delete(n),r()}},snapshot(){return $a(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:$a(()=>Dt(t,e))}),a.value}};return n.set(t,o),o}function ro(e,t){let n=no(e,t);return B.useEffect(to),B.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function io(e,t,n){let r=no(e,t),i=B.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return B.useEffect(to),B.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var ao=(e,t)=>{let n=B.useContext(Ya);return t?io(n,e,t):ro(n,e)};function oo(e,t){B.useEffect(()=>e.mount(t),[t,e])}function so(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?B.useCallback(r=>{e.set(t,r);let i=Oe(b(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(co):i},[e,t,n.mode]):B.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var co=e=>{if(Be(e))return e.value;throw Ut(e.cause)},lo=e=>{oo(B.useContext(Ya),e)},uo=(e,t)=>{let n=B.useContext(Ya);return oo(n,e),so(n,e,t)},fo=e=>{let t=B.useContext(Ya);return oo(t,e),B.useCallback(()=>{t.refresh(e)},[t,e])},po=(e,t)=>{let n=B.useContext(Ya);return[ro(n,e),so(n,e,t)]},mo={suspendOnWaiting:new WeakMap,default:new WeakMap};function ho(e,t,n){let r=n?mo.suspendOnWaiting:mo.default,i=r.get(e);i===void 0&&(i=new WeakMap,r.set(e,i));let a=i.get(t);return a===void 0&&(a=new Promise(r=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),r(),i.delete(t))})}),i.set(t,a)),a}function go(e,t,n){let r=ro(e,t);if(r._tag===`Initial`||n&&r.waiting)throw ho(e,t,n);return r}var _o=(e,t)=>{let n=go(B.useContext(Ya),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw Ut(n.cause);return n};function vo(e){return bn(e.reasons,e=>pe(e)&&Oa(e.error))}function yo(e){return!ze(e)||!vo(e.cause)&&ut(e.previousSuccess)?Qe():_n(e.cause)}function bo(e,t,n=x){function r(e){let t=Pt(e.reasons,e=>pe(e)&&Oa(e.error));return pn(t)?Qe():_n(Ue(t))}let i=d(T(e.self(),It(ze),Kt(e=>r(e.cause))));function a(e){return vt(Ze(i),{onNone:()=>e,onSome:t=>Ue([...t.reasons,...Pt(e.reasons,e=>!pe(e)||!Oa(e.error))])})}let o=d(0),s=nn(t,t=>Lt(()=>{tn(i,e=>un(r(t),()=>e));let n=a(t);ut(Ze(i))?e.setSelf(Ae(n)):ke(o)<2||e.setSelf(yn(n,{previous:e.self()}))}));return T(n(s),ht(()=>Lt(()=>{pt(i,Qe()),pt(o,0)})),de(e=>Ge(a(e))),Vt(l(()=>vt(Ze(i),{onNone:()=>le,onSome:Ge}))))}function xo(e){return Ee(e,e=>sn(e(jt(`1 second`)),e=>ye(Sa)(e.input)?e.input.error===`temporarily_unavailable`:ye(_t)(e.input)&&!ye(bt)(e.input.reason)))}function So(e,t,n){return qt(ue(e,e=>e(t,n)))}function Co(e,t,n){return e.runtime.atom(r=>bo(r,qt(ue(e,e=>e(t,n))),xo))}var wo=B.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:s=!1,nativeButton:c=!0,style:l,...u}=e,{getButtonProps:d,buttonRef:f}=a({disabled:i,focusableWhenDisabled:s,native:c});return o(`button`,e,{state:{disabled:i},ref:[t,f],props:[u,d]})}),To=n();function Eo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Eo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Do(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Eo(e))&&(r&&(r+=` `),r+=t);return r}var Oo=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ko=Do,Ao=(e,t)=>n=>{if(t?.variants==null)return ko(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Oo(t)||Oo(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ko(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},jo=Ao(`group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-none [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-none`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Mo(e){let t=(0,To.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,c=a===void 0?`default`:a,l;t[5]!==n||t[6]!==c||t[7]!==o?(l=s(jo({variant:o,size:c,className:n})),t[5]=n,t[6]=c,t[7]=o,t[8]=l):l=t[8];let u;return t[9]!==r||t[10]!==l?(u=(0,V.jsx)(wo,{"data-slot":`button`,className:l,...r}),t[9]=r,t[10]=l,t[11]=u):u=t[11],u}var No=j([`10m`,`1h`,`24h`,`7d`,`30d`]),Po={"1h":Xe(1),"7d":qe(7),"10m":u(10),"24h":qe(1),"30d":qe(30)};function Fo(e){return Po[e]}var Io=T(N,P(Qt,{decode:E(e=>Ie(g(0),()=>e)),encode:E(Et)})),Lo=T(N,P(dt));T(N,P(Qt,{decode:E(e=>Ie(g(0),()=>e*1e3)),encode:E(e=>Et(e)/1e3)})),T(F,P(Qt,{decode:E(e=>g(e*1e3)),encode:E(_e)}));var Ro=T(N,P(cn,{decode:E(ft),encode:E(tt)})),$=D(`DeployWorkerId`)(z),zo=D(`DeployItemId`)(z),Bo=D(`DeployAppId`)(z),Vo=D(`DeployUnitId`)(z),Ho=D(`DeployProcessId`)(F),Uo=D(`DeployContainerId`)(z),Wo=D(`DeployJobName`)(z),Go=D(`DeployExposureName`)(z);T(L,P(Ho)),M(L),T(L,P(N,{decode:E(e=>e*1024),encode:E(e=>e/1024)})),k({1:hn(L),2:L,3:L});var Ko=T(z,P(vn(z),{decode:E(e=>gt(e,Bt)),encode:E(e=>Yt(e,Ce(``)))})),qo=T(O(z),P(vn(z),{decode:E(e=>It(e,Bt)),encode:E(x)})),Jo=class extends y()(`DeployError`,{cause:Cn(Mt()),message:z}){},Yo=k({detail:z,name:z}),Xo=k({command:O(M(z)),cpu:O(N),label:Yo,memory:N,name:z,parent:Ho,pid:Ho}),Zo=k({active:T(I,A(mt(!1))),address:T(O(z),A(R)),bindings:T(O(M(k({address:z,port:F,protocol:j([`tcp`,`udp`])}))),A(R)),detail:z,failure:T(O(k({at:O(Io),reason:z})),A(R)),health:T(j([`quiet`,`warning`,`error`]),A(mt(`quiet`))),hostname:T(O(z),A(R)),http:T(O(I),A(R)),id:zo,kind:j([`service`,`container`,`port`,`exposure`,`peer`]),links:T(O(M(z)),A(R)),name:z,next:T(O(Io),A(R)),owned:T(O(I),A(R)),port:T(O(F),A(R)),process:T(qo,A(R)),processes:T(O(M(Xo)),A(R)),protocol:T(O(j([`tcp`,`udp`])),A(R)),publicAccess:T(O(I),A(R)),running:T(I,A(mt(!1))),scheduled:T(O(I),A(R)),scope:T(O(j([`user`,`system`])),A(R)),self:T(O(I),A(R)),state:z,ui:T(O(I),A(R)),unit:T(qo,P(vn(Vo)),A(R)),url:Ko,worker:$}),Qo=v([Zo.mapFields(e=>({...e,kind:yt(`service`),name:Vo})),Zo.mapFields(e=>({...e,kind:yt(`exposure`),name:Go})),Zo.mapFields(e=>({...e,kind:j([`container`,`peer`])}))]),$o=Zo.mapFields(e=>({...e,kind:yt(`port`),process:T(O(Ko),P(vn(z),{decode:E(Ct),encode:E(_n)}),A(R))}));v([...Qo.members,$o]),k({address:z,port:N,protocol:j([`tcp`,`udp`])}),k(me(Zo.fields,[`address`,`port`,`protocol`]));var es=k({items:M(v([...Qo.members,$o.mapFields(e=>({...e,unit:T(O(T(Ko,P(vn(Vo)))),P(vn(Re(Vo)),{decode:E(Ct),encode:E(_n)}),A(R))}))])),sources:M(k({error:Ko,name:z})),time:Io,workers:M($)});k({name:$.check(ce()),url:ja}),z.check(ge(/^[a-z\d](?:[a-z\d-]*[a-z\d])?(?:,[a-z\d](?:[a-z\d-]*[a-z\d])?)*$/u));var ts=k({DNSName:z,HostName:z,OS:z,Online:I,TailscaleIPs:M(z)});k({Peer:O(_(z,ts)),Self:O(ts)}),k({AllowFunnel:O(_(z,I)),TCP:O(_(z,xt)),Web:O(_(z,k({Handlers:_(z,k({Proxy:O(z)}))})))});var ns=k({name:Vo,scope:j([`system`,`user`]),worker:$});k({job:Wo.annotate({description:`A scheduled job name as list_apps shows it.`}),worker:O($.annotate({description:`The worker running the job, when several do.`}))}),k({app:O(z.annotate({description:`A substring of an app or unit name; returns that app's process tree.`})),failing:O(I.annotate({description:`Only failed or warning items.`})),worker:O($.annotate({description:`A configured worker name.`}))});var rs=k({children:O(M(Ve(()=>rs))),cpu:O(N),detail:O(z),mib:F,name:z}),is=k({failure:O(z),id:zo,name:z,ports:O(M(F)),processes:O(M(rs)),since:O(ct),state:z,url:O(z)}),as=k({failure:O(z),id:zo,name:Wo,next:O(ct),running:I,since:O(ct)}),os=k({access:j([`tailnet`,`public`]),id:zo,name:Go,port:O(F),url:z}),ss=k({apps:M(is),errors:O(M(z)),exposures:O(M(os)),jobs:O(M(as)),worker:$});M(ss),k({activates:at(Vo),next:at(T(N,P(Qt,{decode:E(e=>Ie(g(0),()=>e/1e3)),encode:E(e=>Et(e)*1e3)})))}),k({active:z,description:z,sub:z,unit:Vo}),k({ID:Uo,Labels:O(z),Names:z,Ports:z,State:z,Status:z});var cs=v([Bo,j([`other`,`system`])]);j([`idle`,`irq`,`nice`,`sys`,`user`]),M(L).check(w(5)),M(L),D(`DeployCgroupPath`)(z);var ls=j(f(No.literals,e=>wt(Fo(e)))),us=k({minutes:T(ls,P(cn,{decode:E(u),encode:Je(e=>T(e,wt,Wt(ls)))}))});k({...us.fields,worker:O($.annotate({description:`A configured worker name.`}))});var ds=M(at(N)),fs=k({cpu:O(N),mib:F,name:z}),ps=k({cpuPct:O(N),diskGiB:O(N),diskTotalGiB:O(N),load:O(M(N)),memoryGiB:N,memoryTotalGiB:N}),ms=k({apps:M(fs),cpuPct:ds,diskPct:ds,error:O(z),from:ct,memoryPct:ds,now:O(ps),stale:O(yt(!0)),stepSeconds:Ro,worker:$});M(ms),k({cpuIdle:Lo,cpuTotal:Lo,time:Io,uptime:Ro});var hs=k({cpu:O(N),id:Bo,memory:N}),gs=class extends $t(`MachineSample`)({cpu:Ft(N),memoryTotal:N,memoryUsed:N,since:T(F,P(Io)),step:T(F,P(Lo)),storageUsed:Ft(N),time:T(F,P(Io))}){static table=`samples`};$t(`AppHistory`)({app:Bo,cpu:Ft(N),memory:N,since:gs.fields.since,step:gs.fields.step});var _s=class extends $t(`Sample`)({...gs.fields,apps:Ft(Gt(M(hs)))}){};k(ne(_s.fields,[`since`,`step`]));var vs=k({mount:z,total:N,used:N}),ys=j([`linux`,`darwin`]),bs=k({disks:M(vs),error:Ko,load:M(N),platform:O(ys),samples:M(_s.json),stale:I,time:Io,worker:$});export{tr as $,Ka as A,xa as B,po as C,_o as D,uo as E,Sa as F,ha as G,_a as H,ka as I,Xr as J,gi as K,Oa as L,Ua as M,za as N,ao as O,Ia as P,sr as Q,Da as R,xo as S,fo as T,ma as U,va as V,ga as W,dr as X,Zr as Y,ur as Z,yo as _,Jo as a,Wn as at,Co as b,ns as c,Rn as ct,$ as d,Nn as dt,er as et,No as f,U as ft,Do as g,Ao as h,Bo as i,W as it,Ga as j,Wa as k,es as l,On as lt,Mo as m,Tn as mt,us as n,Jn as nt,Go as o,Mn as ot,Fo as p,wn as pt,fi as q,bs as r,Kn as rt,zo as s,En as st,cs as t,Gn as tt,Vo as u,Bn as ut,vo as v,lo as w,So as x,bo as y,Ea as z};
|