@deslop/deploy 0.1.1310 → 0.1.1313
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)-DARr8b0u.js +61 -0
- package/dist/client/assets/dist-BlsWFKii.js +1 -0
- package/dist/client/assets/dropdown-menu-CQTPyail.js +1 -0
- package/dist/client/assets/effect-ClWYz7L0.js +17 -0
- package/dist/client/assets/index-CsRgPq05.js +2 -0
- package/dist/client/assets/index-g7JvLgjH.css +2 -0
- package/dist/client/assets/result-error-iP6odYd4.js +1 -0
- package/dist/client/assets/route-DlQVXL1a.js +1 -0
- package/dist/client/assets/schema-BKkL4EQn.js +2 -0
- package/dist/client/index.html +5 -5
- package/dist/server.js +156 -92
- package/package.json +2 -2
- package/dist/client/assets/(home)-C1Dq2yXR.js +0 -2
- package/dist/client/assets/-marks-UcXQAdhy.js +0 -1
- package/dist/client/assets/classes-HESWz-p5.js +0 -1
- package/dist/client/assets/dropdown-menu-DR5G55Ok.js +0 -1
- package/dist/client/assets/effect-D1Ze06LG.js +0 -17
- package/dist/client/assets/index-D9tfS5QU.js +0 -2
- package/dist/client/assets/index-DBxUm3wt.css +0 -2
- package/dist/client/assets/route-kZQHEkLr.js +0 -1
- package/dist/client/assets/schema-DDzbTLtv.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
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{N as a,O as o,P as s,_ as c,a as l,b as u,c as d,d as f,g as p,j as m,k as h,l as g,n as _,o as v,p as y,r as b,v as x,y as S}from"./schema-BKkL4EQn.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 ee,k as z,l as B,o as V,p as te,r as H,s as ne,t as U,v as re,y as ie,z as ae}from"./dist-BlsWFKii.js";import{A as W,D as G,E as oe,Et as K,Ft as se,Ia as ce,It as le,L as ue,Ot as de,P as fe,Rt as pe,Sa as me,Tt as he,Wn as ge,_ as q,_t as _e,ar as ve,at as ye,ba as be,f as xe,fa as Se,i as Ce,ir as we,j as Te,mt as Ee,ni as De,o as Oe,ot as ke,qt as Ae,t as je,tr as Me,tt as Ne,ur as Pe,va as Fe,za as Ie,zt as Le}from"./effect-ClWYz7L0.js";var J=e(i(),1);function Y(e){return e?.ownerDocument||document}var X=t(),Re=w(),ze=ae(),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(z(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(!z(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?ie(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=ie(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(),V;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=re.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=H(`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),ee=J.useRef(null),z=J.useRef(``),B=J.useRef(``),V=J.useRef(null),te=J.useRef(null),H=N(V,p,M?.beforeInsideRef),ne=N(te,M?.afterInsideRef),U=et(),re=et(),ie=vt(),ae=M!=null,W=on(v),G=I((e=W)=>e?In(e):[]),oe=I(()=>h?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&$(W,Q(Y(W)))&&G().length===0&&!w&&sn(e)}return Z(Y(W),`keydown`,e)},[r,W,c,w,G]),J.useEffect(()=>{if(r||!g)return;let e=Y(W);function t(){R.current=!1}function n(e){let t=Ct(e),n=oe(),r=$(v,t)||$(_,t)||$(M?.portalNode,t)||n.some(e=>e===t||$(e,t));R.current=!r,B.current=e.pointerType||`keyboard`,St(t,`[data-base-ui-click-trigger]`)&&(F.current=!0,re.start(0,()=>{F.current=!1}))}function i(){B.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,_,W,g,M,re,oe]),J.useEffect(()=>{if(r||!l)return;let e=Y(W);function n(){F.current=!0,re.start(0,()=>{F.current=!1})}function i(e){let t=Ct(e);Pn(t)&&(ee.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=oe(),p=r?.hasAttribute(fr(`focus-guard`))&&[V.current,te.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===_&&W&&ii(W),s&&i!==_&&!bn(a)&&Q(e)===e.body){if(C(W)&&(W.focus(),s===`popup`)){ie.request(()=>{W.focus()});return}let e=G(),t=ee.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;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,U.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,W,c,j,M,t,l,s,G,w,x,b,U,re,ie,d,f,oe]),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,V.current,te.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...oe(),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,oe]),L(()=>{if(!g||r||!C(W))return;z.current=``,B.current=``;let e=Y(W),t=Q(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||$(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():Xr(r),o||=a();let s=$(W,Q(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&ln(c);mr(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=Q(e);return!(t!==o&&$(W,t))}})})},[r,g,W,G,E,k,A,b]);let K=J.useRef(null);L(()=>{if(r||!W){K.current=null;return}K.current&&=(K.current.cancelled=!0,null);let e=Y(W),t=Q(e),n=k.current==null;ti(t);function i(e){if(e.open||(z.current=Zr(e.nativeEvent,B.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(W).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=oe(),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=z.current,c=a(s),l={cancelled:!1};K.current=l,queueMicrotask(()=>{K.current===l&&(K.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,W,D,O,k,y,j,_,x,oe]),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&&W)return ii(W),()=>{queueMicrotask(ei)}},[r,W]);let se=!r&&(!c||!w)&&(ae||c);return(0,X.jsxs)(J.Fragment,{children:[se&&(0,X.jsx)(xt,{"data-type":`inside`,ref:H,onFocus:e=>{if(c){let e=G();mr(e[e.length-1])}else M?.portalNode&&(P.current=!1,Vn(e,M.portalNode)?Rn(_)?.focus():Xr(f??M.beforeOutsideRef)?.focus())}}),n,se&&(0,X.jsx)(xt,{"data-type":`inside`,ref:ne,onFocus:e=>{c?mr(G()[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()}),B=I(()=>{d.current.insideReactTree=!0,j.start(0,N)}),V=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))}),te=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=z(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=z(r)?r:null;for(;c&&!ee(c);){let e=D(c);if(ee(e)||!z(e))break;c=e}if(!(o.length&&z(r)&&!en(r)&&!$(r,e.select(`floatingElement`))&&o.every(e=>!$(c,e)))){if(C(r)&&!(`touches`in n)){let e=ee(r),t=ie(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 B(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 V(e,t){let n=Ct(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function te(e){E.current=`touch`,V(e,B)}function H(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&V(e,e=>{e.type===`pointerdown`?L(e):I(e)})}function ne(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 U(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 re(e){V(e,U)}function ae(e){f()===`sloppy`&&O.current&&!F(e)&&(O.current.dismissOnTouchEnd&&I(e),k.clear(),O.current=null)}function W(e){V(e,ae)}let G=Je(r&&Je(Z(i,`keydown`,R),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),g&&Je(Z(i,`click`,H,!0),Z(i,`pointerdown`,H,!0),Z(i,`pointerup`,ne,!0),Z(i,`pointercancel`,ne,!0),Z(i,`mousedown`,H,!0),Z(i,`mouseup`,ne,!0),Z(i,`touchstart`,te,{capture:!0,passive:!0}),Z(i,`touchmove`,re,{capture:!0,passive:!0}),Z(i,`touchend`,W,{capture:!0,passive:!0})));return()=>{G(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,R,N,_,P,F,p,e,k,M]);let H=J.useMemo(()=>({onKeyDown:R,onPointerDown:L,onClick:L}),[R,L]),ne=J.useMemo(()=>({onKeyDown:R,onPointerDown:te,onMouseDown:te,onClickCapture:B,onMouseDownCapture(e){B(),V(e)},onPointerDownCapture(e){B(),V(e)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[R,B,V,te]);return J.useMemo(()=>n?{reference:H,floating:ne,trigger:H}:{},[n,H,ne])}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};z(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=ne(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??V);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(V))).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 ne(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(te(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},[_]),ee=J.useRef(!u),z=J.useRef(r),B=J.useRef(u),V=J.useRef(!1);L(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),ee.current=!1}if(_.size===0){V.current&&m!==null&&!y.current?.isConnected&&e(null,lr);return}V.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===z.current&&(B.current=!1),B.current&&t&&m===z.current)return;let r=ee.current;if(t||n){let n=R??null;if(m===n){ee.current=!1;return}let i=lr;r?i=ur:t&&(i=cr),e(n,i)}else r&&F!=null&&(A(m,ur),ee.current=!1)},[R,g,A,F,h,_,m]);let te=H(`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:te})})});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(te(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}=B({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 ee(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 H(`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:ee,[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=H(`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=H(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=U(`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=y(`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=U(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=U(`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=U(`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 je(`Exposure`)({hostname:he.check(le(253),Le(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/u)),kind:_e([`tailnet`,`public`]),name:v.check(pe(),le(260)),port:Ee.check(se({maximum:65535,minimum:1024}))}){static table=`exposures`},oo=K({...ao.fields,publicAccess:ke}),so=K({...oo.fields,worker:f}),co=K({name:v,worker:f}),lo=class extends Ce()(`@deslop/deploy/rpcs/PeerRpcAuth`,{error:a}){},uo=class extends Oe(q(`metrics.watch`,{error:de([a,l]),payload:_,stream:!0,success:ye(b)}),q(`metrics.history`,{error:de([a,l]),payload:_,success:b}),q(`inventory.watch`,{error:de([a,l]),stream:!0,success:g}),q(`inventory.snapshot`,{error:de([a,l]),success:g}),q(`exposures.expose`,{error:de([a,l]),payload:so,success:he}),q(`exposures.hide`,{error:de([a,l]),payload:co}),q(`inventory.run`,{error:de([a,l]),payload:d}),q(`exposures.apply`,{error:l,payload:oo,success:he}).middleware(lo),q(`exposures.remove`,{error:l,payload:K({name:v})}).middleware(lo),q(`inventory.start`,{error:l,payload:d.mapFields(e=>Ae(e,[`worker`]))}).middleware(lo)).middleware(s){};o(`@deslop/deploy`);var fo=class extends xe()(`@deslop/deploy/lib/fleet/RpcClient`,{group:uo.middleware(m),protocol:h}){},po=Te(be()),mo=W(fo.runtime.atom(e=>c(e,Ne(S(fo,`inventory.watch`),t=>we(()=>{p(t)&&e.set(po,be())})),u))),ho=fo.runtime.fn((e,t)=>Ie(fo,ge(t=>t(`exposures.expose`,e)),ve(()=>we(()=>t.set(po,be()))))),go=fe(ce,(e,t)=>{e.set(ho,oe),e.set(po,me(t))}),_o=G(e=>fo.runtime.fn(e=>Ie(fo,ge(t=>t(`inventory.run`,e)),Pe(Me(De(10)),{concurrent:!0})))),vo=G(e=>x(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=U(`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=U(`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=y(`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=U(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=U(`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=U(`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=Se(Fe(ue(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};
|
|
@@ -0,0 +1 @@
|
|
|
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-CsRgPq05.js";import{E as a,f as o,o as s,x as c}from"./schema-BKkL4EQn.js";import{G as l,La as u,Ni as d,Pa as f,Pt as p,Tr as m,W as ee,_t as h,ba as g,da as _,di as v,fa as y,mr as b,na as x,oa as te,ra as S,ua as C,vi as ne,ya as w,za as re}from"./effect-ClWYz7L0.js";import{A as T,C as E,Ct as D,D as O,E as k,F as A,G as j,Gt as M,I as N,J as P,L as F,M as I,N as L,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-iP6odYd4.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:M,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,D(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`),ee=c.useState(`nested`),h=c.useState(`nestedOpenDialogCount`),g=c.useState(`open`),_=c.useState(`openMethod`),v=c.useState(`titleElementId`),y=c.useState(`transitionStatus`),b=c.useState(`role`),x=d.useState(`floatingId`);Ve(),V({open:g,ref:c.context.popupRef,onComplete(){g&&c.context.onOpenChangeComplete?.(!0)}});let te=o===void 0?I(c.context.popupRef):o,S=h>0,C=c.useStateSetter(`popupElement`),ne=J(`div`,e,{state:{open:g,nested:ee,transitionStatus:y,nestedDialogOpen:S},props:[f,{id:x,"aria-labelledby":v,"aria-describedby":l,role:b,...pe,hidden:!m,onKeyDown(e){De.has(e.key)&&e.stopPropagation()},style:{[He]:h}},s],ref:[t,c.context.popupRef,C],stateAttributesMapping:We});return(0,Q.jsx)(P,{context:d,openInteractionType:_,disabled:!m,closeOnFocusOut:!u,initialFocus:te,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:ne})}),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:E(!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]),N(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Je={...O,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 j{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(L(this.state,e,t.trigger)))}};function Xe(e,t,n,r=!1){return{...k(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`,ee=m?!0:c,h=m||s,g=m?`alertdialog`:`dialog`,_=Z(!0),v={modal:ee,disablePointerDismissal:h,nested:_!=null,role:g},y=F((e,t)=>new Ye({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...v},e,t),!0);y.useControlledProp(`openProp`,r),y.useControlledProp(`triggerIdProp`,d),y.useSyncedValues(v),y.useContextCallback(`onOpenChange`,a),y.useContextCallback(`onOpenChangeComplete`,o);let b=y.useState(`open`),x=y.useState(`mounted`),te=y.useState(`payload`);z(y,b),ae(y);let{forceUnmount:S}=A(b,y);X.useImperativeHandle(l,()=>({unmount:S,close:()=>y.setOpen(!1,D(G))}),[S,y]);let C=b||x||u!=null;return(0,Q.jsxs)(Ie.Provider,{value:y,children:[u&&(0,Q.jsx)(T,{handle:u,store:y}),C&&(0,Q.jsx)(qe,{store:y,parentContext:_?.context,isDrawer:p}),typeof n==`function`?n({payload:te}):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 s=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]===s?u=t[9]:(u=s&&(0,Q.jsxs)(Re,{"data-slot":`dialog-close`,render:(0,Q.jsx)(o,{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]=s,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 s=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]===s?l=t[8]:(l=s&&(0,Q.jsx)(Re,{render:(0,Q.jsx)(o,{variant:`outline`}),children:`Close`}),t[7]=s,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:ee,setTouched:h,setDirty:g,validityData:_,setFilled:v,validationMode:y,validation:b}=_t(),{clearErrors:x,elementRef:te,submitCountRef:S}=yt(),C=ee||s,ne=m??a,w={...p,disabled:C},{labelId:re}=xt(),T=wt({id:i}),E=o!==void 0,O=o==null?void 0:String(o),k=je(()=>b.inputRef.current?.value);Ct(b.inputRef,T,O,k,!C,a),K(()=>{let e=O??b.inputRef.current?.value;e!==void 0&&v(e!==``)},[O,l,b.inputRef,v]),Te(O,()=>{O!==void 0&&(x(ne),g(O!==(_.initialValue??``)),b.change(O))});let A=X.useRef(null),j=St(C,A),M=de();return J(`input`,e,{ref:[t,A],state:w,props:[{id:T,disabled:C,name:ne,ref:b.inputRef,"aria-labelledby":re,autoFocus:u,...E?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=D(ue,e.nativeEvent);c?.(t,n),E||(g(t!==(_.initialValue??``)),v(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(x(ne),b.change(t)))},onFocus(){j(!0)},onBlur(e){if(h(!0),j(!1),y===`onBlur`){let t=e.currentTarget.value;b.commit(t),E&&queueMicrotask(()=>{let e=b.inputRef.current?.value;e!==void 0&&e!==t&&e!==(_.initialValue??``)&&b.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){h(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===te.current&&!e.defaultPrevented){let t=e.currentTarget,n=S.current;M.start(0,()=>{S.current===n&&b.commit(t.value)})}else b.commit(t)}}},f,e=>b.getValidationProps(C,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=h([`tailnet`,`public`]);function kt(e){let t=(0,$.c)(70),[n,r]=c(se),[i,a]=(0,X.useState)(`tailnet`),[l,f]=(0,X.useState)(``),h;if(t[0]!==e.items||t[1]!==e.port.worker){let n;t[3]===e.port.worker?n=t[4]:(n=t=>S(t.self,!0)&&t.worker===e.port.worker,t[3]=e.port.worker,t[4]=n),h=C(re(e.items,ne(n),te(At)),u(``)),t[0]=e.items,t[1]=e.port.worker,t[2]=h}else h=t[2];let g=h,x;t[5]===n?x=t[6]:(x=ee(n),t[5]=n,t[6]=x);let w=x,T;t[7]!==r||t[8]!==l||t[9]!==i||t[10]!==e.port.port||t[11]!==e.port.worker||t[12]!==g?(T=t=>{t.preventDefault(),r({hostname:v(i===`public`,{onFalse:()=>g,onTrue:()=>l}),kind:i,name:s.make(v(i===`public`,{onFalse:()=>`tailnet:${_(e.port.port)}`,onTrue:()=>`public:${l}`})),port:_(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]=g,t[13]=T):T=t[13];let E;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),E=C(e.port.process,n),t[14]=e.port.name,t[15]=e.port.process,t[16]=E}else E=t[16];let D;t[19]===E?D=t[20]:(D=(0,Q.jsx)(ct,{children:E}),t[19]=E,t[20]=D);let O;t[21]===e.port.port?O=t[22]:(O=y(e.port.port),t[21]=e.port.port,t[22]=O);let k;t[23]===O?k=t[24]:(k=(0,Q.jsxs)(lt,{children:[`Port `,O]}),t[23]=O,t[24]=k);let A;t[25]!==D||t[26]!==k?(A=(0,Q.jsxs)(ot,{children:[D,k]}),t[25]=D,t[26]=k,t[27]=A):A=t[27];let j;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{p(Ot)(e)&&a(e)},t[28]=j):j=t[28];let M;t[29]===w?M=t[30]:(M=d(Ot.literals,e=>(0,Q.jsx)(he,{value:e,disabled:w,children:b(e)},e)),t[29]=w,t[30]=M);let N;t[31]===M?N=t[32]:(N=(0,Q.jsx)(ye,{className:`w-full`,children:M}),t[31]=M,t[32]=N);let P;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(fe,{htmlFor:`expose-tailnet`,children:`Address`}),t[33]=P):P=t[33];let F;t[34]!==e.port.port||t[35]!==g?(F=v(g===``,{onFalse:()=>`https://${g}:${y(e.port.port)}`,onTrue:u(``)}),t[34]=e.port.port,t[35]=g,t[36]=F):F=t[36];let I;t[37]===F?I=t[38]:(I=(0,Q.jsx)(le,{value:`tailnet`,children:(0,Q.jsxs)(ge,{children:[P,(0,Q.jsx)(Dt,{id:`expose-tailnet`,readOnly:!0,value:F})]})}),t[37]=F,t[38]=I);let L;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(fe,{htmlFor:`expose-public`,children:`Hostname`}),t[39]=L):L=t[39];let ie=i===`public`,ae;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>f(m(e.target.value)),t[40]=ae):ae=t[40];let R;t[41]!==l||t[42]!==w||t[43]!==ie?(R=(0,Q.jsx)(le,{value:`public`,children:(0,Q.jsxs)(ge,{children:[L,(0,Q.jsx)(Dt,{id:`expose-public`,required:ie,placeholder:`app.example.com`,autoCapitalize:`none`,spellCheck:!1,value:l,disabled:w,onChange:ae})]})}),t[41]=l,t[42]=w,t[43]=ie,t[44]=R):R=t[44];let z;t[45]!==i||t[46]!==N||t[47]!==I||t[48]!==R?(z=(0,Q.jsxs)(ce,{value:i,onValueChange:j,children:[N,I,R]}),t[45]=i,t[46]=N,t[47]=I,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]===w?V=t[53]:(V=(0,Q.jsx)(rt,{render:(0,Q.jsx)(o,{variant:`outline`,type:`button`,disabled:w}),children:`Cancel`}),t[52]=w,t[53]=V);let oe=w||i===`tailnet`&&g===``||i===`public`&&l===``,H;t[54]===w?H=t[55]:(H=v(w,{onFalse:u(`Expose`),onTrue:u(`Exposing…`)}),t[54]=w,t[55]=H);let U;t[56]!==oe||t[57]!==H?(U=(0,Q.jsx)(o,{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]!==A?(G=(0,Q.jsxs)(xe,{children:[A,z,B,W]}),t[62]=z,t[63]=B,t[64]=W,t[65]=A,t[66]=G):G=t[66];let ue;return t[67]!==T||t[68]!==G?(ue=(0,Q.jsx)(`form`,{onSubmit:T,children:G}),t[67]=T,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]=c(_e),r;return e[0]===n?r=e[1]:(r=e=>(0,Q.jsx)(tt,{open:!0,onOpenChange:e=>{e||n(g())},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),w(x({port:t,snapshot:l(a(Se))}),{onNone:f,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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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,$n as u,$t as d,Bn as f,Br as p,Bt as m,C as h,Ca as g,Cr as _,Ct as v,Di as y,Dn as b,Dt as x,Et as S,F as C,Fr as w,Gr as ee,Gt as te,Hi as ne,Hr as re,Ht as ie,I as ae,In as oe,Ir as se,It as ce,J as le,Jn as ue,Jr as de,Jt as fe,K as pe,Kn as me,Kr as he,Kt as T,La as ge,Ln as _e,Lr as ve,Lt as ye,N as be,Nn as xe,O as Se,Ot as Ce,Pn as we,Pr as Te,Pt as Ee,Q as De,Qt as Oe,R as ke,Ra as Ae,Rn as je,Rr as Me,Rt as Ne,S as Pe,Sa as Fe,Si as Ie,St as Le,T as Re,Tn as ze,Tt as E,Ur as Be,Ut as Ve,V as He,Vn as Ue,Vr as We,Vt as Ge,Wn as Ke,Wr as qe,Xn as Je,Xt as D,Y as Ye,Yn as Xe,Yr as Ze,Yt as Qe,Zn as $e,Zr as et,Zt as tt,_i as nt,_t as O,a as rt,aa as it,at as k,b as at,ba as ot,bt as st,c as ct,ca as lt,cr as ut,ct as dt,d as ft,dr as pt,dt as mt,en as ht,er as gt,et as _t,fa as vt,fi as yt,fr as bt,ft as A,g as xt,gi as St,gt as Ct,h as wt,ha as Tt,hr as Et,ht as Dt,i as Ot,ia as kt,ir as At,jr as jt,jt as j,k as Mt,kt as M,l as Nt,li as Pt,lr as Ft,lt as It,m as Lt,ma as Rt,mt as N,n as zt,ni as Bt,nn as Vt,nr as Ht,oa as Ut,oi as Wt,or as Gt,ot as P,p as Kt,pa as qt,pt as F,q as Jt,qn as Yt,qr as Xt,qt as Zt,r as Qt,rn as $t,rr as I,rt as en,s as tn,sa as nn,si as rn,sr as an,st as on,t as sn,ta as cn,ti as ln,tn as un,tt as dn,u as fn,ua as pn,ui as mn,ut as hn,v as gn,vt as _n,w as vn,wt as yn,x as bn,xa as xn,xt as Sn,y as Cn,ya as wn,yt as L,z as Tn,za as R,zr as En,zt as Dn}from"./effect-ClWYz7L0.js";var z=e(r(),1),B=t(),On=class extends z.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?z.createElement(this.props.errorComponent??kn,{error:e[0],reset:this.reset}):this.props.children}};function kn({error:e}){let[t,n]=z.useState(!1);return(0,B.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,B.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,B.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,B.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,B.jsx)(`div`,{children:(0,B.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,B.jsx)(`code`,{children:e.message}):null})}):null]})}function V(e){return e[e.length-1]}function An(e,t){return typeof e==`function`?e(t):e}var jn=Object.prototype.hasOwnProperty;function Mn(e){for(let t in e)if(jn.call(e,t))return!0;return!1}var Nn=()=>Object.create(null),Pn=(e,t)=>H(e,t,!0);function H(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&&!(Fn(e)&&Fn(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&&V(a)!==`${o-1}`||c&&V(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`?H(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`?H(d,o,n,r):o,i&&=u===d&&(a[l]===f||jn.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?Nn():{};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`?H(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function Fn(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function In(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&&!In(a,o,n,r))return!1}return!0}if(Fn(e)&&Fn(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!In(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||!In(e[a],t[a],n,r)))return!1;return i===0}return!1}function Ln(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 Rn=/[\x00-\x1f\x7f"<>`{}]/g;function zn(e){return e.replace(Rn,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function Bn(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 zn(t)}var Vn=[`http:`,`https:`,`mailto:`,`tel:`];function Hn(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 Un=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Wn(e,t){if(!e)return!1;if(Un.test(e))return!0;let n=Hn(e);return n?!t.has(n):!1}function Gn(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+=Bn(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=Bn(r?e.slice(r):e)}return t}function Kn(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function qn(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 Jn(){throw Error(`Invariant failed`)}function Yn(e){return e.replace(/\/{2,}/g,`/`)}function Xn(e){return e===`/`?e:e.replace(/^\/+/,``)}function U(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function Zn(e){return U(Xn(e))}function Qn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function $n(e,t,n=`never`,r){if(t.includes(`//`)&&(t=Yn(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=Yn(e)),o=e.split(`/`);o.length>1&&V(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&&(V(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Yn(s):s)||`/`;return a&&r&&r.set(a,c),c}function er(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 tr(e){return e==null||e===``}function nr(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 rr(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&&tr(f)){if(c===`/`&&!d)continue;f=``}o+=c+nr(s,f,r)+(d||``)}}return o+a||`/`}function ir(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function ar(e){return e?.isNotFound===!0}function or(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 sr(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function cr(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]=sr(r):Array.isArray(t)?t.push(sr(r)):n[e]=[t,sr(r)]}return n}var lr=/^(?:\s|["[{\d-]|fa|nu|tr)/,ur=fr(JSON.parse),dr=pr(JSON.stringify,JSON.parse);function fr(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=cr(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!lr.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function pr(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&&!lr.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=or(e,r);return t?`?${t}`:``}}var mr=`__root__`;function hr(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 gr(e){return e instanceof Response&&!!e.options}function _r(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 W=4,vr=5;function yr(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 br(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 xr(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=V(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=br(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=Cr(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=Cr(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=Cr(r,vr);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=Cr(r,W);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 Sr(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 Cr(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 wr(e,t){let n=Cr(),r=[];function i(e,t,n,a){let[o,s,c]=xr(!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(Sr);t.masksTree=n,t.flatCache=_r(1e3)}function Tr(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=kr(e,t.masksTree);return t.flatCache.set(e,r),r}function Er(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Cr(),xr(t,{from:e},1,o),i.singleCache.set(a,o)),kr(r,o,n)}function Dr(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=kr(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=jr(a.route)),t.matchCache.set(r,a),a}function Or(e,t=!1){let n=Cr(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&Jn(),i[e.id]=e,o!==0&&e.path){let t=U(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=xr(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(Sr);return{processedTree:{segmentTree:n,singleCache:_r(1e3),matchCache:_r(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function kr(e,t,n=!1){let r=e.split(`/`),i=Nr(e,r,t,n);if(!i)return null;let[a]=Ar(e,r,i);return{route:i.node.route,rawParams:a}}function Ar(e,t,n){let r=Mr(n.node),i=n.node.data&&yr(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===W)break;if(u.kind===vr){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 jr(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Mr(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Nr(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!V(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&&!Lr(l,n))continue;if(i.parse){if(!Ir(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==W&&Lr(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===W||i.kind===2)&&Lr(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&&(Ir(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Fr(f,o))return n;Lr(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+Pr(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+Pr(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+Pr(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+Pr(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 Pr(e,t){return 2**(e-t-1)}function Fr(e,t){return e===2**(t-1)-1}function Ir(e,t,n){let r,i;try{[r,i]=Ar(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 Lr(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===W)>(e.node.kind===W)||t.node.kind===W==(e.node.kind===W)&&t.node.depth>e.node.depth)))}function Rr(){try{return sessionStorage}catch{return}}var zr=`tsr-scroll-restoration-v1_3`,Br=Rr();function Vr(){try{return JSON.parse(Br?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Hr=Vr(),Ur=`data-scroll-restoration-id`,Wr=e=>e.state.__TSR_key||e.href;function Gr(e){let t=e.getAttribute(Ur);if(t)return`[${Ur}="${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 Kr=!1,qr=`window`;function Jr(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Yr(e){let t=new Set;for(let n of e){if(n===qr)continue;let e=Jr(n);e&&t.add(e)}return t}function Xr(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Wr,a=new Set,o=e=>{let t=Hr[e]||={};for(let e of a)e===document?t[qr]={scrollX,scrollY}:e.isConnected&&(t[Gr(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Kr=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Kr||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{Br?.setItem(zr,JSON.stringify(Hr))}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=Hr[d];if(e){let t=Hr[u];for(let n in e){if(n===qr){if(s)continue}else{let e=Jr(n);if(!e||s&&o&&(l??=Yr(o),l.has(e)))continue}t||=Hr[u]={},t[n]??=e[n]}}}Kr=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Yr(o));let t=e&&i&&c,s=r.e?Hr[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===qr){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Jr(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{Kr=!1}}))}function Zr(e,t,n){let r=Zn(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=Yn(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>Qr(n,s.input({url:e})),output:({url:e})=>s.output({url:$r(n,e)})}:s}function Qr(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 $r(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 ei(e){let t=e;return{get(){return t},set(e){t=An(e,t)}}}function ti(e){return{get(){return e()}}}function ni(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(()=>{qn(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 G=`__TSR_index`,ri=`popstate`,ii=`beforeunload`,ai=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function oi(e){let t=ai.exec(e);return t?`/`+e.slice(t[0].length):e}function si(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
2
|
+
\r`.includes(e)?``:encodeURIComponent(e))),oi(e)}function ci(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=di(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[G];i=li(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[G];i=li(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[G]!==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 li(e,t){let n=fi();return{...t,key:n,__TSR_key:n,[G]:e}}function ui(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=>si(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>di(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=fi();t.history.replaceState({[G]: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=di(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[G]-l.state[G],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=ci({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(ii,x,{capture:!0}),t.removeEventListener(ri,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(ii,x,{capture:!0}),t.addEventListener(ri,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 di(e,t){let n=si(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=fi();t={[G]: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 fi(){return(Math.random()+1).toString(36).slice(7)}function pi(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function mi(e){return e.pathname+e.search+e.hash}function hi(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function gi(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function _i({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function vi(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function yi(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 bi=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:ui()),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!==`/`&&Zn(n)?Zr(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=ni(this.latestLocation,e),Xr(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Or(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&wr(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:_r(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:Gn(e),external:!1,searchStr:o,search:Pn(t?.search,i),hash:Gn(r.slice(1)),state:H(t?.state,a)}}let o=Qr(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:Gn(oi(o.pathname)),external:!!this.rewrite&&pi(o,this.origin),searchStr:c,search:Pn(t?.search,s),hash:Gn(o.hash.slice(1)),state:H(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=Dr(U(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=di(n.href,{});n={...n,to:Qr(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=$n(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[U(c)],u=c.includes(`$`),d;if(l)d=l._branch??=jr(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??xr(!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??=Ti(n.params,e),!Mn(p))break;p===e&&(p=Object.assign(Nn(),p));try{Object.assign(p,t(p))}catch{}}}p??=Ti(n.params,Ei(n.params,f)?o()[3]:Di);let m=e.leaveParams?c:oi(Gn(f?rr(c,f,p,this.pathParamsDecoder):c)),h=Oi(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,wi(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?ki(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Di,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:Di,S=`${m}${v}${b}`,C,w,ee=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=$r(this.rewrite,e);C=mi(e),pi(n,t)?(w=n.href,ee=!0):w=oi(mi(n))}else C=Kn(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=Tr(r.pathname,this.processedTree);if(t){let i=Object.assign(Nn(),t.rawParams),{from:a,params:o,...s}=t.route,c=Ti(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 xi(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=U(this.latestLocation.href)===U(n.href)&&In(_i(n.state),_i(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?Hn(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 xi(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 ga(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(gi(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`)&&hi(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(Un.test(n)||(r=Hn(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:pi(e,this.origin)||(n=mi(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=Pi,this.preloadRoute=e=>_a(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?$n(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=Er(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!In(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?In(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=er(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??dr,parseSearch:e.parseSearch??ur,protocolAllowlist:e.protocolAllowlist??Vn}),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=xr(!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[`**`]:U(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ai(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=wi(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof Si||(r=new Si(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=Nn(),_=i._interpolation?rr(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{ji(i,d)}catch(e){if(x=ar(e)||gr(e)?e:new Ci(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:Pn(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=hi(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?Pn(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?H(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`?Pn(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=V(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=V(a),c={...e.search};for(let e of a)try{Object.assign(c,wi(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{ji(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function xi(e,t,{replace:n,ignoreBlocker:r}){if(!Wn(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 Si=class extends Error{},Ci=class extends Error{};function wi(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Si(`Async validation not supported`);if(n.issues)throw new Si(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 Ti(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 Ei(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!jn.call(e,t[1]))}var Di=Object.freeze({});function Oi(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=wi(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 ki(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=An(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 Ai(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 mr}function ji(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Mi(e,t){return e.options[t]?.preload?.()}function Ni(e,t){let n=Mi(e,`component`),r=Mi(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Pi(e,t,n){let r=()=>t===!1?void 0:t?Mi(e,t):Ni(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 Fi(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Ii(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var K=0,q=1,Li=2,J=3,Y=[4];function Ri(e){return typeof e[0]==`number`}function zi(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 Bi(e,t){return e.routesById[t.routeId]}function Vi(e,t,n){return gr(e)?[J,e]:ar(e)?(e.routeId||=n,[Li,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[q,e]):[K,e]}function Hi(e,t){let n=Vi(t,!0,e.id);if(n[0]!==q)return n;try{e.options.onError?.(n[1])}catch(t){n=Vi(t,!0,e.id)}return n}function Ui(e,t,n,r,i){return i[0].signal.aborted?Y:ra(e,t,n,Hi(n,r),i)}async function Wi(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=Bi(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 X(e,r),[i,Ui(e,t,u,a,n)]}if(c.aborted)return[i,Y];let p=r.paramsError??r.searchError;if(p!==void 0)return X(e,r),[i,Ui(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{qi(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?zi(a,c):a);if(c.aborted)return[i,Y];let s=ra(e,t,u,Vi(o,!1,u.id),n);if(s[0]!==K)return X(e,r),[i,s];r.context={...r.context,...o}}catch(a){return X(e,r),[i,Ui(e,t,u,a,n)]}finally{r.status=h,qi(e,r,!1,n[0])}}i()}function Gi(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 X(e,t){let n=t._flight;t._flight=void 0,Gi(e,t,n)?.abort()}function Z(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=Gi(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Ki(e){for(let t of e){let e=t._flight;e&&e[2]++}}function qi(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 Ji(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 Yi(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Y;if(!i)return[K,void 0];let l=n._flight;qi(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ji(e,t,n,r,s,a,!!o[3]))).then(e=>Vi(e,!1,r.id),e=>Vi(e,!0,r.id)).then(t=>(t[0]!==K&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===q&&l[2]?Hi(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],ra(e,t,r,await zi(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return X(e,n),Y}finally{qi(e,n,!1,s)}}function Xi(e,t,n){t[0]!==J&&(e.status=`success`,e.error=void 0,t[0]===K?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Zi(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&&X(e,r)}function Qi(e,t){return t[0]===q||t[0]===Li?{...e,status:t[0]===q?`error`:`notFound`,error:t[1],_flight:void 0}:e}function $i(e,t,n,r,i,a,o){let s=t[1][n],c=Bi(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(Ji(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Y)),!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,X(e,s),p=Ui(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,Gi(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Yi(e,t,s,c,g,i,a).then(t=>(Xi(s,t,l),t[0]===K&&(m&&!a[0].signal.aborted&&Zi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[K,s.loaderData]),ee=(async()=>{try{let e=Pi(c,void 0,C);e&&await zi(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Ui(e,t,c,r,a)]}let r=await w;x&&r[0]===K&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,ee]),!y)return w.then(e=>Qi(s,e));let te={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ne=Yi(e,t,te,c,g,i,a).then(e=>(s.isFetching=!1,Xi(te,e,!1),e));return(t[2]??=[]).push([n,ne,ee,te]),ne.then(e=>Qi(te,e))}async function ea(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=Bi(e,t[n]);try{let e=Pi(i,!1);e&&await zi(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function ta(e,t){t[2]&&=(Z(e,t[2].map(e=>e[3])),void 0)}async function na(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]>=J)throw[a,t];!i&&t[0]!==K&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===J)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function ra(e,t,n,r,i,a){for(;r[0]===J;){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]?[J,t]:[J,t,a]}return[J,o,n]}catch(e){r=a?[q,e]:Hi(n,e),a=!0}}return r}async function ia(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]===Li?ea(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=J)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]!==K&&t[0]<J&&!(`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)>=J){let n=s[1];if(n[0]!==J||n[1].options.reloadDocument||n[2])return ta(e,t),n;c=!0,s=[0,[q,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===q?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=Bi(e,u);try{await zi(i?Promise.resolve().then(()=>Pi(m,l===q?`errorComponent`:`notFoundComponent`)):Promise.all([Pi(m),Pi(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return ta(e,t),Y}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),ta(e,t),Z(e,o),p()):u.status=`success`}return t}async function aa(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=Bi(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 zi(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 oa(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 ea(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=$i(e,i,t,u,f,r,l)},m=await Wi(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Li){let t=await ea(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=J&&(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=ia(e,i,u,r[0],na(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=na(i[2],void 0,void 0,h.then(e=>Ri(e)?0:Fi(n).length,()=>0))),o=await h}catch(t){if(ta(e,i),t===a&&a.aborted)return Y;throw t}return Ri(o)?o:aa(e,o,a,r[6]===n.length?r[6]:0)}function sa(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=Bi(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(()=>sa(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 ca(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 la(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Fi(t[3]).some(e=>e.id===n[1]))return;let i;try{await zi(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function ua(e,t){e._committed=t,e.stores.setMatches(t)}function da(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=Fi(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=Bi(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=vi(n);ua(e,n),Z(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),yi(e,i,n,a,l,t)}async function fa(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function pa(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 ma(e,t,n,r,i){let a=n.map(e=>({...e}));Ki(a);for(let t of r)X(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await ia(e,o,r,t[0],i)}catch(t){throw Z(e,a),t}if(Ri(s))Z(e,a),s[0]===J&&e._tx===t&&e._committed===n&&await pa(e,t,s);else if(await aa(e,s,t[0].signal),e._tx!==t||e._committed!==n)Z(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),X(e,n))}ua(e,a),Z(e,n,a)}}async function ha(e,t,n,r,i,a){let o=await oa(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Ri(o)){let n=o[0]===J&&e._tx===t;if((!n||o[1].options.reloadDocument)&&ca(e,t),Z(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){ca(e,t);return}await pa(e,t,o);return}let s=o[1];if(e._tx===t&&await la(e,t),e._tx!==t){ca(e,t),Z(e,s),ta(e,o);return}let c=t[2],l=gi(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await la(e,t),e._tx!==t){ca(e,t),Z(e,s),ta(e,o);return}let n=await e.startTransition(()=>{ca(e,t),da(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&&ma(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)):ta(e,o)})}async function ga(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=gi(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await fa(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Ki(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){Z(e,m),await fa(e,n);return}e._preflight=void 0;let g,_=()=>ha(e,y,f,()=>sa(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(()=>fa(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&qi(e,t,!1)}n[0].abort(),Z(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))&&sa(e,y),g?.(_()),await y[5]):(Z(e,y[3]),y[3]=[],g?.(),await fa(e,y))}async function _a(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}),Ki(a),o=(e._preloads??=new Map).set(i,a),s=await oa(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),Z(e,a)),i.abort()}if(!Ri(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){ar(e)||console.error(e);return}}}function va(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Ii(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 ya=z.createContext(void 0),ba=z.createContext(void 0),xa=z.createContext(null);function Sa(e){return z.useContext(xa)}var Ca=c();function wa(e,t){return e===t}function Ta(e,t=e=>e,n){let r=n?.compare??wa,i=(0,z.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,z.useCallback)(()=>e.get(),[e]);return(0,Ca.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Ea=R(A,j(on,{decode:D(e=>b(ze(0),()=>e)),encode:D(xe)})),Da=R(A,j(mt));R(A,j(on,{decode:D(e=>b(ze(0),()=>e*1e3)),encode:D(e=>xe(e)/1e3)}));var Oa=R(N,j(on,{decode:D(e=>ze(e*1e3)),encode:D(we)})),ka=R(A,j(hn,{decode:D(Bt),encode:D(rn)})),Aa=class extends x()(`AuthError`,{cause:Ge(It()),error:ie(O([`invalid_request`,`invalid_client`,`invalid_client_metadata`,`invalid_redirect_uri`,`invalid_grant`,`invalid_scope`,`unsupported_grant_type`,`unsupported_response_type`,`access_denied`,`authorization_pending`,`expired_token`,`temporarily_unavailable`])),message:E}){get name(){return this.error===`temporarily_unavailable`?`AuthUnavailable`:`AuthError`}},ja=R(L,M(`UserId`)),Ma=R(L,M(`SignInFamily`)),Na=R(L,M(`SessionId`)),Pa=R(E,M(`ClientId`)),Fa=R(N,M(`GitHubId`));R(F,j(Fa));var Ia=S({id:ja,name:L});S({aud:Ct(`deslop`),azp:L,exp:Oa,iat:Oa,iss:L,name:L,sid:Ma,sub:ja}),S({name:E,redirects:_n(L.check(ce(200))).check(ce(4))}),S({client_id:Pa.check(Ne()),code:L,code_verifier:L,redirect_uri:L}),S({session:Na}),S({access_token:L,expires_in:ka,refresh_token:L}),ln(10),et(30),ja.make(`github:0`);function La(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}function Ra(e){return Ee(Aa)(e)&&e.error!==`temporarily_unavailable`&&e.error!==`access_denied`}function za(e){return Ee(Aa)(e)&&e.error!==`temporarily_unavailable`}Pt()(`@deslop/runtime/shared/auth/CurrentUser`);var Ba=class extends Ot()(`@deslop/runtime/shared/auth/RpcAuth`,{error:Aa}){},Va=E.check(m(e=>kt(cn(Re(e)),e=>yt([`http:`,`https:`],e.protocol)&&e.username===``&&e.password===``&&e.hash===``),{expected:`an HTTP(S) URL without credentials or a fragment`})).check(m(e=>kt(cn(Re(e)),e=>e.pathname===`/`&&e.search===``),{expected:`an HTTP(S) origin without a path or query`})),Ha=Va.check(m(e=>kt(cn(Re(e)),e=>e.protocol===`https:`||yt([`localhost`,`127.0.0.1`,`[::1]`],e.hostname)),{expected:`HTTPS outside loopback`}));E.check(Dn(/^\d{1,5}$/u),m(e=>kt(jt(e),e=>e>=1&&e<=65535),{expected:`a port between 1 and 65535`}));var Ua=E.check(Dn(/^0\.1\.\d+$/u)),Wa=`/api/runtime`,Ga=S({auth:v(Va),name:E,traces:E,version:Ua}),Ka=`/api/rpc`,qa=S({...Ia.fields,signOut:P});S({config:S({port:N}),name:E,version:Ua}),O([`web`,`mobile`,`server`]);function Ja(e,t,n,r){return Te(re(me(function*(){let i=`${yield*qe}`,a=yield*Oe,o={attributes:{"scope.run.started_unix_nano":i,"scope.runtime":n,"service.instance.id":i},serviceName:e,serviceVersion:vt(Tt(r,e=>e!==`0.1.0`))};return Me(ve(tn({resource:o,url:new URL(`/v1/traces`,t).href}),ct({resource:o,url:new URL(`/v1/logs`,t).href}),p(Oe,[...a,`code`,`state`,`request`,`access_token`,`refresh_token`,`id_token`,`client_secret`,`client_assertion`,`code_verifier`,`session`,`token`])),[Nt,ft])})),e=>Xt(e)?w(Yt):w(Xe(`Telemetry is unavailable`)))}function Ya(e){return re(me(function*(){let t=yield*R((yield*bn).get(Wa),Ke(h),Ke(vn(Ga)),an(`3 seconds`),Gt(e=>Xe(`Telemetry is off: the runtime config did not load`,e)),$e);return wn(t,{onNone:()=>se,onSome:t=>t.traces===``?se:Ja(`${e}-client`,t.traces,`web`,t.version)})}))}var Xa=class extends Ot()(`@deslop/runtime/shared/rpc/RpcStream`){};p(Xa,Xa.of((e,t)=>gn(t.rpc.successSchema)?_e(je(`rpc.stream`,!0),e):e));var Za=rt(Xa,e=>me(function*(){return gn(e.rpc.successSchema)&&(yield*je(`rpc.stream`,!0)),yield*e.next(e.request)}));function Qa(e){return R(Kt({pingTimeout:`15 seconds`,retryTransientErrors:!0}),Me(Me(Cn(e),at)),En(Lt()),En(Za))}var $a=un(ot());O([`route`,`caught`,`uncaught`]);var eo=Se(e=>{let t=ue(`Web error`,ee(e.error),...g(lt(e.stack)));return wn(d($a),{onNone:()=>t,onSome:n=>u(R(t,_e(f(e.error)),Ft(`Web.error`,{attributes:{"web.error.source":e.source,"web.route.id":e.route},root:!0}),Ue),n)})}),to=be(ft).atom(R(Pe(`/api/account`),Ke(h),Ke(vn(qa)))),no=Qa(At(()=>`${location.origin}${Ka}`));function ro(e){be.addGlobalLayer(R(Ya(e),Me(ft),We(e=>qt(mn(e,fn))?ut:oe(At(()=>Vt($a,Fe(e))),()=>At(()=>$t($a,it(t=>t!==e)))))))}var io=e(i(),1);function ao(e){let t=io.unstable_scheduleCallback(4,e);return()=>io.unstable_cancelCallback(t)}var oo=z.createContext(ae({scheduleTask:ao,defaultIdleTTL:400})),so=new WeakMap,co=0,lo=new Set;function uo(e){co++;try{return e()}finally{co--}}function fo(e){if(co===0)return e();lo.size===0&&queueMicrotask(po),lo.add(e)}function po(){for(let e of lo)lo.delete(e),e()}function mo(e,t){let n=so.get(e);n===void 0&&(n=new WeakMap,so.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,()=>fo(n));return()=>{i--,lo.delete(n),r()}},snapshot(){return uo(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:uo(()=>Mt(t,e))}),a.value}};return n.set(t,o),o}function ho(e,t){let n=mo(e,t);return z.useEffect(po),z.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function go(e,t,n){let r=mo(e,t),i=z.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return z.useEffect(po),z.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var _o=(e,t)=>{let n=z.useContext(oo);return t?go(n,e,t):ho(n,e)};function vo(e,t){z.useEffect(()=>e.mount(t),[t,e])}function yo(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?z.useCallback(r=>{e.set(t,r);let i=gt(C(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(bo):i},[e,t,n.mode]):z.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var bo=e=>{if(Be(e))return e.value;throw Ze(e.cause)},xo=e=>{vo(z.useContext(oo),e)},So=(e,t)=>{let n=z.useContext(oo);return vo(n,e),yo(n,e,t)},Co=e=>{let t=z.useContext(oo);return vo(t,e),z.useCallback(()=>{t.refresh(e)},[t,e])},wo=(e,t)=>{let n=z.useContext(oo);return[ho(n,e),yo(n,e,t)]},To={suspendOnWaiting:new WeakMap,default:new WeakMap};function Eo(e,t,n){let r=n?To.suspendOnWaiting:To.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 Do(e,t,n){let r=ho(e,t);if(r._tag===`Initial`||n&&r.waiting)throw Eo(e,t,n);return r}var Oo=(e,t)=>{let n=Do(z.useContext(oo),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw Ze(n.cause);return n};function ko(e){return ne(e.reasons,e=>de(e)&&za(e.error))}function Ao(e){return!He(e)||!ko(e.cause)&&Rt(e.previousSuccess)?ot():Fe(e.cause)}function jo(e,t,n=Ae){function r(e){let t=nt(e.reasons,e=>de(e)&&za(e.error));return y(t)?ot():Fe(he(t))}let i=un(R(e.self(),it(He),Ut(e=>r(e.cause))));function a(e){return wn(d(i),{onNone:()=>e,onSome:t=>he([...t.reasons,...nt(e.reasons,e=>!de(e)||!za(e.error))])})}let o=un(0),s=dn(t,t=>At(()=>{$t(i,e=>xn(r(t),()=>e));let n=a(t);Rt(d(i))?e.setSelf(ke(n)):ht(o)<2||e.setSelf(Tn(n,{previous:e.self()}))}));return R(n(s),_t(()=>At(()=>{Vt(i,ot()),Vt(o,0)})),pe(e=>Ye(a(e))),Jt(l(()=>wn(d(i),{onNone:()=>le,onSome:Ye}))))}function Mo(e){return De(e,e=>bt(e(pt(`1 second`)),e=>Ee(Aa)(e.input)?e.input.error===`temporarily_unavailable`:Ee(xt)(e.input)&&!Ee(wt)(e.input.reason)))}function No(e,t,n){return en(Je(e,e=>e(t,n)))}function Po(e,t,n){return e.runtime.atom(r=>jo(r,en(Je(e,e=>e(t,n))),Mo))}var Fo=z.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]})}),Io=n();function Lo(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=Lo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Ro(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Lo(e))&&(r&&(r+=` `),r+=t);return r}var zo=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Bo=Ro,Vo=(e,t)=>n=>{if(t?.variants==null)return Bo(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=zo(t)||zo(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 Bo(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)},Ho=Vo(`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 Uo(e){let t=(0,Io.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(Ho({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,B.jsx)(Fo,{"data-slot":`button`,className:l,...r}),t[9]=r,t[10]=l,t[11]=u):u=t[11],u}var Q=M(`DeployWorkerId`)(E),Wo=M(`DeployItemId`)(E),Go=M(`DeployAppId`)(E),$=M(`DeployUnitId`)(E),Ko=M(`DeployProcessId`)(N),qo=M(`DeployContainerId`)(E),Jo=M(`DeployJobName`)(E),Yo=M(`DeployExposureName`)(E);R(F,j(Ko)),k(F),R(F,j(A,{decode:D(e=>e*1024),encode:D(e=>e/1024)})),S({1:Le(F),2:F,3:F});var Xo=R(E,j(st(E),{decode:D(e=>Tt(e,Et)),encode:D(e=>pn(e,ge(``)))})),Zo=R(v(E),j(st(E),{decode:D(e=>it(e,Et)),encode:D(Ae)})),Qo=class extends x()(`DeployError`,{cause:Ge(It()),message:E}){},$o=S({detail:E,name:E}),es=S({command:v(k(E)),cpu:v(A),label:$o,memory:A,name:E,parent:Ko,pid:Ko}),ts=S({active:R(P,T(Ht(!1))),address:R(v(E),T(I)),bindings:R(v(k(S({address:E,port:N,protocol:O([`tcp`,`udp`])}))),T(I)),detail:E,failure:R(v(S({at:v(Ea),reason:E})),T(I)),health:R(O([`quiet`,`warning`,`error`]),T(Ht(`quiet`))),hostname:R(v(E),T(I)),http:R(v(P),T(I)),id:Wo,kind:O([`service`,`container`,`port`,`exposure`,`peer`]),links:R(v(k(E)),T(I)),name:E,next:R(v(Ea),T(I)),owned:R(v(P),T(I)),port:R(v(N),T(I)),process:R(Zo,T(I)),processes:R(v(k(es)),T(I)),protocol:R(v(O([`tcp`,`udp`])),T(I)),publicAccess:R(v(P),T(I)),running:R(P,T(Ht(!1))),scheduled:R(v(P),T(I)),scope:R(v(O([`user`,`system`])),T(I)),self:R(v(P),T(I)),state:E,ui:R(v(P),T(I)),unit:R(Zo,j(st($)),T(I)),url:Xo,worker:Q}),ns=Ce([ts.mapFields(e=>({...e,kind:Ct(`service`),name:$})),ts.mapFields(e=>({...e,kind:Ct(`exposure`),name:Yo})),ts.mapFields(e=>({...e,kind:O([`container`,`peer`])}))]),rs=ts.mapFields(e=>({...e,kind:Ct(`port`),process:R(v(Xo),j(st(E),{decode:D(nn),encode:D(Fe)}),T(I))}));Ce([...ns.members,rs]),S({address:E,port:A,protocol:O([`tcp`,`udp`])}),S(fe(ts.fields,[`address`,`port`,`protocol`]));var is=S({items:k(Ce([...ns.members,rs.mapFields(e=>({...e,unit:R(v(R(Xo,j(st($)))),j(st(te($)),{decode:D(nn),encode:D(Fe)}),T(I))}))])),sources:k(S({error:Xo,name:E})),time:Ea,workers:k(Q)});S({name:Q.check(Ne()),url:Ha}),E.check(Dn(/^[\w-]+=https?:\/\/[^,=\s]+(?:,[\w-]+=https?:\/\/[^,=\s]+)*$/u),m(e=>R(e,_(`,`),St(e=>kt(R(e,_(`=`),Ie(1)),Ee(Ha)))),{expected:`named HTTPS origins, or loopback HTTP origins`}));var as=S({DNSName:E,HostName:E,OS:E,Online:P,TailscaleIPs:k(E)});S({Peer:v(yn(E,as)),Self:v(as)}),S({AllowFunnel:v(yn(E,P)),TCP:v(yn(E,Dt)),Web:v(yn(E,S({Handlers:yn(E,S({Proxy:v(E)}))})))});var os=S({name:$,scope:O([`system`,`user`]),worker:Q});S({job:Jo.annotate({description:`A scheduled job name as list_apps shows it.`}),worker:v(Q.annotate({description:`The worker running the job, when several do.`}))}),S({app:v(E.annotate({description:`A substring of an app or unit name; returns that app's process tree.`})),failing:v(P.annotate({description:`Only failed or warning items.`})),worker:v(Q.annotate({description:`A configured worker name.`}))});var ss=S({children:v(k(Ve(()=>ss))),cpu:v(A),detail:v(E),mib:N,name:E}),cs=S({failure:v(E),id:Wo,name:E,ports:v(k(N)),processes:v(k(ss)),since:v(dt),state:E,url:v(E)}),ls=S({failure:v(E),id:Wo,name:Jo,next:v(dt),running:P,since:v(dt)}),us=S({access:O([`tailnet`,`public`]),id:Wo,name:Yo,port:v(N),url:E}),ds=S({apps:k(cs),errors:v(k(E)),exposures:v(k(us)),jobs:v(k(ls)),worker:Q});k(ds),S({activates:Sn($),next:Sn(R(A,j(on,{decode:D(e=>b(ze(0),()=>e/1e3)),encode:D(e=>xe(e)*1e3)})))}),S({active:E,description:E,sub:E,unit:$}),S({ID:qo,Labels:v(E),Names:E,Ports:E,State:E,Status:E});var fs=Ce([Go,O([`other`,`system`])]);O([`idle`,`irq`,`nice`,`sys`,`user`]),k(F).check(ye(5)),k(F),M(`DeployCgroupPath`)(E);var ps=O([1,10,60,1440,10080]),ms=S({minutes:R(ps,j(hn,{decode:D(ln),encode:tt(e=>R(e,Wt,Qe(ps)))}))});S({...ms.fields,worker:v(Q.annotate({description:`A configured worker name.`}))});var hs=k(Sn(A)),gs=S({cpu:v(A),mib:N,name:E}),_s=S({cpuPct:v(A),diskGiB:v(A),diskTotalGiB:v(A),load:v(k(A)),memoryGiB:A,memoryTotalGiB:A}),vs=S({apps:k(gs),cpuPct:hs,diskPct:hs,error:v(E),from:dt,memoryPct:hs,now:v(_s),stale:v(Ct(!0)),stepSeconds:ka,worker:Q});k(vs),S({cpuIdle:Da,cpuTotal:Da,time:Ea,uptime:ka});var ys=S({cpu:v(A),id:Go,memory:A}),bs=class extends sn(`Sample`)({apps:zt(Qt(k(ys))),cpu:zt(A),memoryTotal:A,memoryUsed:A,since:R(N,j(Ea)),step:R(N,j(Da)),storageUsed:zt(A),time:R(N,j(Ea))}){static table=`samples`};S(Zt(bs.fields,[`since`,`step`]));var xs=S({mount:E,total:A,used:A}),Ss=S({disks:k(xs),error:Xo,load:k(A),samples:k(bs.json),stale:P,time:Ea,worker:Q});export{Yn as $,eo as A,xa as B,Co as C,to as D,_o as E,za as F,gi as G,ba as H,Ra as I,hr as J,ei as K,La as L,qa as M,Aa as N,ro as O,Ba as P,ir as Q,Ta as R,xo as S,Oo as T,ya as U,va as V,bi as W,dr as X,mr as Y,ar as Z,jo as _,Qo as a,An as at,Mo as b,os as c,Wn as ct,Q as d,On as dt,Qn as et,Uo as f,kn as ft,ko as g,Ao as h,Go as i,In as it,Xa as j,no as k,is as l,Ln as lt,Ro as m,ms as n,U as nt,Yo as o,Hn as ot,Vo as p,ti as q,Ss as r,Jn as rt,Wo as s,Mn as st,fs as t,Xn as tt,$ as u,H as ut,Po as v,So as w,wo as x,No as y,Sa as z};
|
package/dist/client/index.html
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
16
16
|
|
|
17
17
|
<title>Deploy</title>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-CsRgPq05.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/react-BPjvcVqE.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/schema-
|
|
24
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BlsWFKii.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/effect-ClWYz7L0.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/schema-BKkL4EQn.js">
|
|
24
|
+
<link rel="stylesheet" crossorigin href="/assets/index-g7JvLgjH.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
|
27
27
|
<div id="root"></div>
|