@deslop/deploy 0.1.1296 → 0.1.1300

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.
@@ -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{s as i}from"./index-BnBm9lDv.js";import{a,d as o,w as s,y as c}from"./schema-CIp4dRBI.js";import{Ki as l,U as u,W as d,Xi as f,di as p,ea as m,gr as ee,la as h,na as g,qi as _,ri as v,ta as y,ua as b,wa as x}from"./effect-BYYFLcwW.js";import{$t as S,At as C,C as w,Cn as T,D as E,E as D,F as O,Gt as k,H as A,M as j,O as M,P as N,T as P,Wt as F,_ as I,a as te,an as L,at as ne,b as re,c as R,ct as z,et as B,g as V,gn as H,h as ie,i as ae,it as oe,jt as U,k as W,l as G,ln as K,lt as se,m as ce,n as le,ot as ue,p as de,r as fe,rt as pe,s as me,t as he,tn as ge,v as _e,w as ve,wn as ye,xn as be,y as xe}from"./-marks-Dw4FEJpK.js";import{B as Se,_ as q,a as Ce,c as J,d as we,h as Te,s as Ee,t as Y,v as De,y as Oe}from"./classes-D4KMZ4wl.js";var X=e(r(),1),ke=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`}))]]),Ae=X.forwardRef((e,t)=>X.createElement(Se,{ref:t,...e,weights:ke}));Ae.displayName=`XIcon`;var je=X.createContext(void 0);function Z(e){let t=X.useContext(je);if(!e&&t===void 0)throw Error(Te(27));return t}var Me=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 Ce(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:U,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Ne=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}=we({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,H(ge,e.nativeEvent))}return Ce(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Pe=X.createContext(void 0);function Fe(){let e=X.useContext(Pe);if(e===void 0)throw Error(Te(26));return e}var Ie=`--nested-dialogs`,Le=`data-nested-dialog-open`,Re={...C,...T,nestedDialogOpen(e){return e?{[Le]:``}:null}},Q=t(),ze=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`);Fe(),ye({open:g,ref:c.context.popupRef,onComplete(){g&&c.context.onOpenChangeComplete?.(!0)}});let S=o===void 0?w(c.context.popupRef):o,C=h>0,T=c.useStateSetter(`popupElement`),E=Ce(`div`,e,{state:{open:g,nested:ee,transitionStatus:y,nestedDialogOpen:C},props:[f,{id:x,"aria-labelledby":v,"aria-describedby":l,role:b,...xe,hidden:!m,onKeyDown(e){z.has(e.key)&&e.stopPropagation()},style:{[Ie]:h}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Re});return(0,Q.jsx)(O,{context:d,openInteractionType:_,disabled:!m,closeOnFocusOut:!u,initialFocus:S,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),Be=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)(Pe.Provider,{value:n,children:(0,Q.jsxs)(A,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(ce,{ref:i.context.internalBackdropRef,inert:se(!s)}),e.children]})}):null});function Ve({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=N(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=k(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||F(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return de(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),q(()=>{!r&&!i&&(u(0),f(0))},[r,i]),q(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),E(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var He={...I,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},Ue=class extends j{constructor(e,t,n){let r=new _e,i=We(e,r,t,n);super(i,Ge(r),He)}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(ve(this.state,e,t.trigger)))}};function We(e,t,n,r=!1){return{...V(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 Ge(e){return{popupRef:X.createRef(),backdropRef:X.createRef(),internalBackdropRef:X.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Ke(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=M((e,t)=>new Ue({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`),S=y.useState(`payload`);W(y,b),P(y);let{forceUnmount:C}=D(b,y);X.useImperativeHandle(l,()=>({unmount:C,close:()=>y.setOpen(!1,H(L))}),[C,y]);let w=b||x||u!=null;return(0,Q.jsxs)(je.Provider,{value:y,children:[u&&(0,Q.jsx)(re,{handle:u,store:y}),w&&(0,Q.jsx)(Ve,{store:y,parentContext:_?.context,isDrawer:p}),typeof n==`function`?n({payload:S}):n]})}var qe=B(function(e){return Ke(`dialog`,e)}),Je=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Z(),c=S(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Ce(`h2`,e,{ref:t,props:[{id:c},o]})}),$=n();function Ye(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)(qe,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function Xe(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)(Be,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Ze(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)(Ne,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function Qe(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 supports-backdrop-filter:backdrop-blur-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Me,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $e(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)(Qe,{}),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 outline-none sm:max-w-sm`,r),t[6]=r,t[7]=l);let u;t[8]===s?u=t[9]:(u=s&&(0,Q.jsxs)(Ne,{"data-slot":`dialog-close`,render:(0,Q.jsx)(o,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(Ae,{}),(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)(Xe,{children:[c,(0,Q.jsxs)(ze,{"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 et(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 tt(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)(Ne,{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 nt(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)(Je,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var rt=`data-valid`,it=`data-invalid`,at={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ot={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},st={valid(e){return e===null?null:e?{[rt]:``}:{[it]:``}}},ct={invalid:void 0,name:void 0,validityData:{state:at,errors:[],error:``,value:``,initialValue:null},setValidityData:J,disabled:void 0,setTouched:J,setDirty:J,setFilled:J,setFocused:J,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:ot,registerFieldControl:J,validation:{getValidationProps:(e,t=Ee)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:J,getInputControl:()=>null,commit:async()=>{},change:J}},lt=X.createContext(ct);function ut(e=!0){let t=X.useContext(lt);if(t.setValidityData===J&&!e)throw Error(Te(28));return t}var dt=X.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:J,validationMode:`onSubmit`,submitCountRef:{current:0}});function ft(){return X.useContext(dt)}var pt=X.createContext({controlId:void 0,registerControlId:J,resetControlId:J,labelId:void 0,setLabelId:J,messageIds:[],setMessageIds:J,getDescriptionProps:e=>e});function mt(){return X.useContext(pt)}function ht(e,t,n){let{setFocused:r,focusOwnerRef:i}=ut(),a=De(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function gt(e,t,n,r,i=!0,a){let{registerFieldControl:o}=ut(),s=Oe(()=>Symbol());q(()=>{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]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function _t(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=mt(),o=S(),s=Oe(()=>Symbol()),c=X.useRef(!1),l=X.useRef(!1),u=De(()=>{c.current&&i!==J&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===J){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]),q(()=>u,[u]),(n?r:void 0)??t??o}var vt=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}=ut(),{clearErrors:x,elementRef:S,submitCountRef:C}=ft(),w=ee||s,T=m??a,E={...p,disabled:w},{labelId:D}=mt(),O=_t({id:i}),k=o!==void 0,A=o==null?void 0:String(o),j=De(()=>b.inputRef.current?.value);gt(b.inputRef,O,A,j,!w,a),q(()=>{let e=A??b.inputRef.current?.value;e!==void 0&&v(e!==``)},[A,l,b.inputRef,v]),ie(A,()=>{A!==void 0&&(x(T),g(A!==(_.initialValue??``)),b.change(A))});let M=X.useRef(null),N=ht(w,M),P=be();return Ce(`input`,e,{ref:[t,M],state:E,props:[{id:O,disabled:w,name:T,ref:b.inputRef,"aria-labelledby":D,autoFocus:u,...k?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=H(K,e.nativeEvent);c?.(t,n),k||(g(t!==(_.initialValue??``)),v(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(x(T),b.change(t)))},onFocus(){N(!0)},onBlur(e){if(h(!0),N(!1),y===`onBlur`){let t=e.currentTarget.value;b.commit(t),k&&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===S.current&&!e.defaultPrevented){let t=e.currentTarget,n=C.current;P.start(0,()=>{C.current===n&&b.commit(t.value)})}else b.commit(t)}}},f,e=>b.getValidationProps(w,e)],stateAttributesMapping:st})}),yt=X.forwardRef(function(e,t){return(0,Q.jsx)(vt,{ref:t,...e})});function bt(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 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)(yt,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function xt(e){let t=(0,$.c)(74),[n,r]=c(me),[i,s]=(0,X.useState)(`tailnet`),[l,d]=(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=>_(t.self,!0)&&t.worker===e.port.worker,t[3]=e.port.worker,t[4]=n),h=m(x(e.items,p(n),f(Et)),Tt),t[0]=e.items,t[1]=e.port.worker,t[2]=h}else h=t[2];let b=h,S;t[5]===n?S=t[6]:(S=u(n),t[5]=n,t[6]=S);let C=S,w;t[7]!==r||t[8]!==l||t[9]!==i||t[10]!==e.port.port||t[11]!==e.port.worker||t[12]!==b?(w=t=>{t.preventDefault(),r({hostname:v(i===`public`,{onFalse:()=>b,onTrue:()=>l}),kind:i,name:a.make(v(i===`public`,{onFalse:()=>`tailnet:${y(e.port.port)}`,onTrue:()=>`public:${l}`})),port:y(e.port.port),publicAccess:i===`public`,worker:e.port.worker})},t[7]=r,t[8]=l,t[9]=i,t[10]=e.port.port,t[11]=e.port.worker,t[12]=b,t[13]=w):w=t[13];let T;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),T=m(e.port.process,n),t[14]=e.port.name,t[15]=e.port.process,t[16]=T}else T=t[16];let E;t[19]===T?E=t[20]:(E=(0,Q.jsx)(he,{name:T,small:!0}),t[19]=T,t[20]=E);let D;if(t[21]!==e.port.name||t[22]!==e.port.process){let n;t[24]===e.port.name?n=t[25]:(n=()=>e.port.name,t[24]=e.port.name,t[25]=n),D=m(e.port.process,n),t[21]=e.port.name,t[22]=e.port.process,t[23]=D}else D=t[23];let O;t[26]===D?O=t[27]:(O=(0,Q.jsx)(nt,{children:D}),t[26]=D,t[27]=O);let k;t[28]===e.port.port?k=t[29]:(k=g(e.port.port),t[28]=e.port.port,t[29]=k);let A;t[30]===k?A=t[31]:(A=(0,Q.jsxs)(le,{variant:`outline`,children:[`:`,k]}),t[30]=k,t[31]=A);let j;t[32]!==E||t[33]!==O||t[34]!==A?(j=(0,Q.jsx)(et,{children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[E,O,A]})}),t[32]=E,t[33]=O,t[34]=A,t[35]=j):j=t[35];let M;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{(e===`public`||e===`tailnet`)&&s(e)},t[36]=M):M=t[36];let N;t[37]===C?N=t[38]:(N=(0,Q.jsxs)(ne,{className:`w-full max-sm:group-data-horizontal/tabs:h-auto`,children:[(0,Q.jsx)(ue,{value:`tailnet`,disabled:C,className:`max-sm:h-11`,children:`Tailnet`}),(0,Q.jsx)(ue,{value:`public`,disabled:C,className:`max-sm:h-11`,children:`Public`})]}),t[37]=C,t[38]=N);let P;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(te,{htmlFor:`expose-tailnet`,children:`Address`}),t[39]=P):P=t[39];let F;t[40]!==e.port.port||t[41]!==b?(F=v(b===``,{onFalse:()=>`https://${b}:${g(e.port.port)}`,onTrue:wt}),t[40]=e.port.port,t[41]=b,t[42]=F):F=t[42];let I;t[43]===F?I=t[44]:(I=(0,Q.jsx)(oe,{value:`tailnet`,children:(0,Q.jsxs)(ae,{children:[P,(0,Q.jsx)(bt,{id:`expose-tailnet`,className:`max-sm:h-11`,readOnly:!0,value:F})]})}),t[43]=F,t[44]=I);let L;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(te,{htmlFor:`expose-public`,children:`Hostname`}),t[45]=L):L=t[45];let re=i===`public`,R;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>d(ee(e.target.value)),t[46]=R):R=t[46];let z;t[47]!==l||t[48]!==C||t[49]!==re?(z=(0,Q.jsx)(oe,{value:`public`,children:(0,Q.jsxs)(ae,{children:[L,(0,Q.jsx)(bt,{id:`expose-public`,className:`max-sm:h-11`,required:re,placeholder:`app.example.com`,autoCapitalize:`none`,spellCheck:!1,value:l,disabled:C,onChange:R})]})}),t[47]=l,t[48]=C,t[49]=re,t[50]=z):z=t[50];let B;t[51]!==i||t[52]!==N||t[53]!==I||t[54]!==z?(B=(0,Q.jsxs)(pe,{value:i,onValueChange:M,children:[N,I,z]}),t[51]=i,t[52]=N,t[53]=I,t[54]=z,t[55]=B):B=t[55];let V;t[56]===n?V=t[57]:(V=(0,Q.jsx)(fe,{result:n}),t[56]=n,t[57]=V);let H;t[58]===C?H=t[59]:(H=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(o,{variant:`ghost`,type:`button`,disabled:C,className:`max-sm:h-11`}),children:`Cancel`}),t[58]=C,t[59]=H);let ie=C||i===`tailnet`&&b===``||i===`public`&&l===``,U;t[60]===C?U=t[61]:(U=v(C,{onFalse:Ct,onTrue:St}),t[60]=C,t[61]=U);let W;t[62]!==ie||t[63]!==U?(W=(0,Q.jsx)(o,{type:`submit`,className:`max-sm:h-11`,disabled:ie,children:U}),t[62]=ie,t[63]=U,t[64]=W):W=t[64];let G;t[65]!==H||t[66]!==W?(G=(0,Q.jsxs)(tt,{children:[H,W]}),t[65]=H,t[66]=W,t[67]=G):G=t[67];let K;return t[68]!==B||t[69]!==w||t[70]!==V||t[71]!==G||t[72]!==j?(K=(0,Q.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:w,children:[j,B,V,G]}),t[68]=B,t[69]=w,t[70]=V,t[71]=G,t[72]=j,t[73]=K):K=t[73],K}function St(){return`Exposing…`}function Ct(){return`Expose`}function wt(){return``}function Tt(){return``}function Et(e){return e.hostname}function Dt(){let e=(0,$.c)(2),[t,n]=c(R),r;return e[0]===n?r=e[1]:(r=e=>(0,Q.jsx)(Ye,{open:!0,onOpenChange:e=>{e||n(b())},children:(0,Q.jsx)($e,{showCloseButton:!1,children:(0,Q.jsx)(xt,{items:e.snapshot.items,port:e.port},e.port.id)})}),e[0]=n,e[1]=r),h(l({port:t,snapshot:d(s(G))}),{onNone:Ot,onSome:r})}function Ot(){return null}function kt(){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)(Dt,{}),(0,Q.jsx)(i,{})]}),e[0]=t):t=e[0],t}export{kt 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{V as a,a as o,d as s,r as c,t as l}from"./classes-D4KMZ4wl.js";import{$ as u,$n as d,$r as f,$t as p,An as m,Ar as h,At as g,B as _,Bn as v,Br as y,Bt as b,C as x,Ca as S,Cn as C,Ct as w,D as ee,Dr as te,Dt as ne,Er as re,Et as ie,F as ae,Fn as oe,Fr as se,Ft as ce,G as le,Gi as ue,Gr as de,Hn as fe,In as pe,Ir as me,It as he,J as ge,Ji as _e,Jt as ve,K as ye,Kn as be,Kr as xe,Kt as Se,L as Ce,Ln as we,Lr as Te,Lt as Ee,M as De,Mn as Oe,Mr as ke,Mt as Ae,Ni as je,Nn as Me,Nr as Ne,O as Pe,Or as Fe,Ot as T,P as Ie,Pn as Le,Pr as Re,Pt as ze,Q as Be,Qi as Ve,Qr as He,Qt as Ue,R as We,Rr as Ge,Rt as Ke,S as qe,Sr as Je,St as E,Tr as Ye,Tt as D,Un as Xe,Ut as Ze,Vn as Qe,Vr as $e,Vt as et,Wn as tt,Wt as O,Xi as nt,Xn as k,Xt as rt,Yi as it,Yn as at,Yt as ot,Z as st,Zi as ct,Zn as lt,Zt as ut,_ as dt,_t as ft,a as pt,aa as mt,ar as ht,at as A,b as gt,bi as _t,bt as vt,c as yt,ct as bt,d as xt,da as St,dt as j,ea as Ct,en as wt,er as Tt,et as Et,fa as Dt,ft as M,gt as N,h as Ot,hi as kt,ht as At,i as jt,ia as Mt,ii as Nt,ir as Pt,it as P,jr as Ft,kn as It,kr as Lt,l as Rt,la as zt,li as Bt,lt as Vt,m as Ht,mr as Ut,mt as Wt,n as Gt,na as Kt,ni as qt,nr as Jt,nt as Yt,or as Xt,ot as Zt,p as Qt,pa as $t,pt as F,q as en,qn as tn,qt as I,r as nn,ra as rn,s as an,st as on,t as sn,ti as cn,tr as ln,u as un,ua as dn,ui as fn,ut as pn,v as mn,vt as L,w as hn,wa as R,wt as z,x as gn,xn as _n,xt as vn,y as yn,yt as bn,zn as xn,zr as Sn,zt as Cn}from"./effect-BYYFLcwW.js";var B=e(r(),1),V=t(),wn=class extends B.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?B.createElement(this.props.errorComponent??Tn,{error:e[0],reset:this.reset}):this.props.children}};function Tn({error:e}){let[t,n]=B.useState(!1);return(0,V.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,V.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,V.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,V.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,V.jsx)(`div`,{children:(0,V.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,V.jsx)(`code`,{children:e.message}):null})}):null]})}function H(e){return e[e.length-1]}function En(e,t){return typeof e==`function`?e(t):e}var Dn=Object.prototype.hasOwnProperty;function On(e){for(let t in e)if(Dn.call(e,t))return!0;return!1}var kn=()=>Object.create(null),An=(e,t)=>U(e,t,!0);function U(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(jn(e)&&jn(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&H(a)!==`${o-1}`||c&&H(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?U(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?U(d,o,n,r):o,i&&=u===d&&(a[l]===f||Dn.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?kn():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?U(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function jn(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function Mn(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!Mn(a,o,n,r))return!1}return!0}if(jn(e)&&jn(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!Mn(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!Mn(e[a],t[a],n,r)))return!1;return i===0}return!1}function Nn(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var Pn=/[\x00-\x1f\x7f"<>`{}]/g;function Fn(e){return e.replace(Pn,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function In(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Fn(t)}var Ln=[`http:`,`https:`,`mailto:`,`tel:`];function Rn(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var zn=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Bn(e,t){if(!e)return!1;if(zn.test(e))return!0;let n=Rn(e);return n?!t.has(n):!1}function Vn(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=In(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=In(r?e.slice(r):e)}return t}function Hn(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Un(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Wn(){throw Error(`Invariant failed`)}function Gn(e){return e.replace(/\/{2,}/g,`/`)}function Kn(e){return e===`/`?e:e.replace(/^\/+/,``)}function W(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function qn(e){return W(Kn(e))}function Jn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Yn(e,t,n=`never`,r){if(t.includes(`//`)&&(t=Gn(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Gn(e)),o=e.split(`/`);o.length>1&&H(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(H(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Gn(s):s)||`/`;return a&&r&&r.set(a,c),c}function Xn(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function Zn(e){return e==null||e===``}function Qn(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function $n(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&Zn(f)){if(c===`/`&&!d)continue;f=``}o+=c+Qn(s,f,r)+(d||``)}}return o+a||`/`}function er(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function tr(e){return e?.isNotFound===!0}function nr(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function rr(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ir(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=rr(r):Array.isArray(t)?t.push(rr(r)):n[e]=[t,rr(r)]}return n}var ar=/^(?:\s|["[{\d-]|fa|nu|tr)/,or=cr(JSON.parse),sr=lr(JSON.stringify,JSON.parse);function cr(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=ir(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!ar.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function lr(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!ar.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=nr(e,r);return t?`?${t}`:``}}var ur=`__root__`;function dr(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function fr(e){return e instanceof Response&&!!e.options}function pr(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var G=4,mr=5;function hr(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function gr(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function _r(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=H(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=gr(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=yr(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.slice(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=yr(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.slice(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=yr(r,mr);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=yr(r,G);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function vr(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function yr(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function br(e,t){let n=yr(),r=[];function i(e,t,n,a){let[o,s,c]=_r(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(vr);t.masksTree=n,t.flatCache=pr(1e3)}function xr(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Tr(e,t.masksTree);return t.flatCache.set(e,r),r}function Sr(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=yr(),_r(t,{from:e},1,o),i.singleCache.set(a,o)),Tr(r,o,n)}function Cr(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Tr(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Dr(a.route)),t.matchCache.set(r,a),a}function wr(e,t=!1){let n=yr(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&Wn(),i[e.id]=e,o!==0&&e.path){let t=W(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=_r(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(vr);return{processedTree:{segmentTree:n,singleCache:pr(1e3),matchCache:pr(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Tr(e,t,n=!1){let r=e.split(`/`),i=kr(e,r,t,n);if(!i)return null;let[a]=Er(e,r,i);return{route:i.node.route,rawParams:a}}function Er(e,t,n){let r=Or(n.node),i=n.node.data&&hr(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===G)break;if(u.kind===mr){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Dr(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Or(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function kr(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!H(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Nr(l,n))continue;if(i.parse){if(!Mr(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==G&&Nr(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===G||i.kind===2)&&Nr(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Mr(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&jr(f,o))return n;Nr(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Ar(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Ar(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Ar(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Ar(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Ar(e,t){return 2**(e-t-1)}function jr(e,t){return e===2**(t-1)-1}function Mr(e,t,n){let r,i;try{[r,i]=Er(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Nr(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===G)>(e.node.kind===G)||t.node.kind===G==(e.node.kind===G)&&t.node.depth>e.node.depth)))}function Pr(){try{return sessionStorage}catch{return}}var Fr=`tsr-scroll-restoration-v1_3`,Ir=Pr();function Lr(){try{return JSON.parse(Ir?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Rr=Lr(),zr=`data-scroll-restoration-id`,Br=e=>e.state.__TSR_key||e.href;function Vr(e){let t=e.getAttribute(zr);if(t)return`[${zr}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Hr=!1,Ur=`window`;function Wr(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Gr(e){let t=new Set;for(let n of e){if(n===Ur)continue;let e=Wr(n);e&&t.add(e)}return t}function Kr(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Br,a=new Set,o=e=>{let t=Rr[e]||={};for(let e of a)e===document?t[Ur]={scrollX,scrollY}:e.isConnected&&(t[Vr(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Hr=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Hr||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{Ir?.setItem(Fr,JSON.stringify(Rr))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),r.r||(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=Rr[d];if(e){let t=Rr[u];for(let n in e){if(n===Ur){if(s)continue}else{let e=Wr(n);if(!e||s&&o&&(l??=Gr(o),l.has(e)))continue}t||=Rr[u]={},t[n]??=e[n]}}}Hr=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Gr(o));let t=e&&i&&c,s=r.e?Rr[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Ur){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Wr(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Hr=!1}}))}function qr(e,t,n){let r=qn(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=Gn(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>Jr(n,s.input({url:e})),output:({url:e})=>s.output({url:Yr(n,e)})}:s}function Jr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Yr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Xr(e){let t=e;return{get(){return t},set(e){t=En(e,t)}}}function Zr(e){return{get(){return e()}}}function Qr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{Un(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var K=`__TSR_index`,$r=`popstate`,ei=`beforeunload`,ti=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function ni(e){let t=ti.exec(e);return t?`/`+e.slice(t[0].length):e}function ri(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
2
+ \r`.includes(e)?``:encodeURIComponent(e))),ni(e)}function ii(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=si(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[K];i=ai(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[K];i=ai(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[K]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function ai(e,t){let n=ci();return{...t,key:n,__TSR_key:n,[K]:e}}function oi(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>ri(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>si(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ci();t.history.replaceState({[K]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=si(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[K]-l.state[K],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=ii({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ei,x,{capture:!0}),t.removeEventListener($r,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(ei,x,{capture:!0}),t.addEventListener($r,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function si(e,t){let n=ri(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=ci();t={[K]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function ci(){return(Math.random()+1).toString(36).slice(7)}function li(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function ui(e){return e.pathname+e.search+e.hash}function di(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function fi(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function pi({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function mi(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function hi(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var gi=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:oi()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&qn(n)?qr(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Qr(this.latestLocation,e),Kr(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=wr(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&br(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:pr(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Vn(e),external:!1,searchStr:o,search:An(t?.search,i),hash:Vn(r.slice(1)),state:U(t?.state,a)}}let o=Jr(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:Vn(ni(o.pathname)),external:!!this.rewrite&&li(o,this.origin),searchStr:c,search:An(t?.search,s),hash:Vn(o.hash.slice(1)),state:U(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Cr(W(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=si(n.href,{});n={...n,to:Jr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=Yn(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[W(c)],u=c.includes(`$`),d;if(l)d=l._branch??=Dr(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??_r(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=xi(n.params,e),!On(p))break;p===e&&(p=Object.assign(kn(),p));try{Object.assign(p,t(p))}catch{}}}p??=xi(n.params,Si(n.params,f)?o()[3]:Ci);let m=e.leaveParams?c:ni(Vn(f?$n(c,f,p,this.pathParamsDecoder):c)),h=wi(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,bi(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Ti(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Ci,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Ci,S=`${m}${v}${b}`,C,w,ee=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=Yr(this.rewrite,e);C=ui(e),li(n,t)?(w=n.href,ee=!0):w=ni(ui(n))}else C=Hn(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=xr(r.pathname,this.processedTree);if(t){let i=Object.assign(kn(),t.rawParams),{from:a,params:o,...s}=t.route,c=xi(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return _i(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=W(this.latestLocation.href)===W(n.href)&&Mn(pi(n.state),pi(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?Rn(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return _i(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await fa(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(fi(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&di(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(zn.test(n)||(r=Rn(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:li(e,this.origin)||(n=ui(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Ai,this.preloadRoute=e=>pa(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?Yn(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Sr(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Mn(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Mn(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=Xn(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??sr,parseSearch:e.parseSearch??or,protocolAllowlist:e.protocolAllowlist??Ln}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=_r(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:W(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ei(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=bi(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof vi||(r=new vi(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=kn(),_=i._interpolation?$n(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{Di(i,d)}catch(e){if(x=tr(e)||fr(e)?e:new yi(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:An(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=di(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?An(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?U(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?An(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=H(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=H(a),c={...e.search};for(let e of a)try{Object.assign(c,bi(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Di(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function _i(e,t,{replace:n,ignoreBlocker:r}){if(!Bn(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var vi=class extends Error{},yi=class extends Error{};function bi(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new vi(`Async validation not supported`);if(n.issues)throw new vi(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function xi(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Si(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!Dn.call(e,t[1]))}var Ci=Object.freeze({});function wi(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=bi(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Ti(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=En(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Ei(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return ur}function Di(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Oi(e,t){return e.options[t]?.preload?.()}function ki(e,t){let n=Oi(e,`component`),r=Oi(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Ai(e,t,n){let r=()=>t===!1?void 0:t?Oi(e,t):ki(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function ji(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Mi(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var q=0,J=1,Ni=2,Y=3,X=[4];function Pi(e){return typeof e[0]==`number`}function Fi(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function Ii(e,t){return e.routesById[t.routeId]}function Li(e,t,n){return fr(e)?[Y,e]:tr(e)?(e.routeId||=n,[Ni,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[J,e]):[q,e]}function Ri(e,t){let n=Li(t,!0,e.id);if(n[0]!==J)return n;try{e.options.onError?.(n[1])}catch(t){n=Li(t,!0,e.id)}return n}function zi(e,t,n,r,i){return i[0].signal.aborted?X:$i(e,t,n,Ri(n,r),i)}async function Bi(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Ii(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Z(e,r),[i,zi(e,t,u,a,n)]}if(c.aborted)return[i,X];let p=r.paramsError??r.searchError;if(p!==void 0)return Z(e,r),[i,zi(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{Ui(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Fi(a,c):a);if(c.aborted)return[i,X];let s=$i(e,t,u,Li(o,!1,u.id),n);if(s[0]!==q)return Z(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Z(e,r),[i,zi(e,t,u,a,n)]}finally{r.status=h,Ui(e,r,!1,n[0])}}i()}function Vi(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Z(e,t){let n=t._flight;t._flight=void 0,Vi(e,t,n)?.abort()}function Q(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Vi(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Hi(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Ui(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Wi(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Gi(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return X;if(!i)return[q,void 0];let l=n._flight;Ui(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Wi(e,t,n,r,s,a,!!o[3]))).then(e=>Li(e,!1,r.id),e=>Li(e,!0,r.id)).then(t=>(t[0]!==q&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===J&&l[2]?Ri(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],$i(e,t,r,await Fi(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Z(e,n),X}finally{Ui(e,n,!1,s)}}function Ki(e,t,n){t[0]!==Y&&(e.status=`success`,e.error=void 0,t[0]===q?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function qi(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Z(e,r)}function Ji(e,t){return t[0]===J||t[0]===Ni?{...e,status:t[0]===J?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Yi(e,t,n,r,i,a,o){let s=t[1][n],c=Ii(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Wi(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=X)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Z(e,s),p=zi(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Vi(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Gi(e,t,s,c,g,i,a).then(t=>(Ki(s,t,l),t[0]===q&&(m&&!a[0].signal.aborted&&qi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[q,s.loaderData]),ee=(async()=>{try{let e=Ai(c,void 0,C);e&&await Fi(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,zi(e,t,c,r,a)]}let r=await w;x&&r[0]===q&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,ee]),!y)return w.then(e=>Ji(s,e));let te={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ne=Gi(e,t,te,c,g,i,a).then(e=>(s.isFetching=!1,Ki(te,e,!1),e));return(t[2]??=[]).push([n,ne,ee,te]),ne.then(e=>Ji(te,e))}async function Xi(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Ii(e,t[n]);try{let e=Ai(i,!1);e&&await Fi(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Zi(e,t){t[2]&&=(Q(e,t[2].map(e=>e[3])),void 0)}async function Qi(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Y)throw[a,t];!i&&t[0]!==q&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Y)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function $i(e,t,n,r,i,a){for(;r[0]===Y;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[Y,t]:[Y,t,a]}return[Y,o,n]}catch(e){r=a?[J,e]:Ri(n,e),a=!0}}return r}async function ea(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ni?Xi(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Y)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==q&&t[0]<Y&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Y){let n=s[1];if(n[0]!==Y||n[1].options.reloadDocument||n[2])return Zi(e,t),n;c=!0,s=[0,[J,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===J?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Ii(e,u);try{await Fi(i?Promise.resolve().then(()=>Ai(m,l===J?`errorComponent`:`notFoundComponent`)):Promise.all([Ai(m),Ai(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Zi(e,t),X}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Zi(e,t),Q(e,o),p()):u.status=`success`}return t}async function ta(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Ii(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Fi(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function na(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Xi(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Yi(e,i,t,u,f,r,l)},m=await Bi(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Ni){let t=await Xi(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Y&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=ea(e,i,u,r[0],Qi(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Qi(i[2],void 0,void 0,h.then(e=>Pi(e)?0:ji(n).length,()=>0))),o=await h}catch(t){if(Zi(e,i),t===a&&a.aborted)return X;throw t}return Pi(o)?o:ta(e,o,a,r[6]===n.length?r[6]:0)}function ra(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Ii(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>ra(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function ia(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function aa(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!ji(t[3]).some(e=>e.id===n[1]))return;let i;try{await Fi(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function oa(e,t){e._committed=t,e.stores.setMatches(t)}function sa(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=ji(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Ii(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=mi(n);oa(e,n),Q(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),hi(e,i,n,a,l,t)}async function ca(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function la(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function ua(e,t,n,r,i){let a=n.map(e=>({...e}));Hi(a);for(let t of r)Z(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await ea(e,o,r,t[0],i)}catch(t){throw Q(e,a),t}if(Pi(s))Q(e,a),s[0]===Y&&e._tx===t&&e._committed===n&&await la(e,t,s);else if(await ta(e,s,t[0].signal),e._tx!==t||e._committed!==n)Q(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Z(e,n))}oa(e,a),Q(e,n,a)}}async function da(e,t,n,r,i,a){let o=await na(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Pi(o)){let n=o[0]===Y&&e._tx===t;if((!n||o[1].options.reloadDocument)&&ia(e,t),Q(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){ia(e,t);return}await la(e,t,o);return}let s=o[1];if(e._tx===t&&await aa(e,t),e._tx!==t){ia(e,t),Q(e,s),Zi(e,o);return}let c=t[2],l=fi(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await aa(e,t),e._tx!==t){ia(e,t),Q(e,s),Zi(e,o);return}let n=await e.startTransition(()=>{ia(e,t),sa(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&ua(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):Zi(e,o)})}async function fa(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=fi(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await ca(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Hi(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){Q(e,m),await ca(e,n);return}e._preflight=void 0;let g,_=()=>da(e,y,f,()=>ra(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>ca(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Ui(e,t,!1)}n[0].abort(),Q(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&ra(e,y),g?.(_()),await y[5]):(Q(e,y[3]),y[3]=[],g?.(),await ca(e,y))}async function pa(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Hi(a),o=(e._preloads??=new Map).set(i,a),s=await na(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),Q(e,a)),i.abort()}if(!Pi(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){tr(e)||console.error(e);return}}}function ma(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Mi(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var ha=B.createContext(void 0),ga=B.createContext(void 0),_a=B.createContext(null);function va(e){return B.useContext(_a)}var ya=a();function ba(e,t){return e===t}function xa(e,t=e=>e,n){let r=n?.compare??ba,i=(0,B.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,B.useCallback)(()=>e.get(),[e]);return(0,ya.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Sa=R(j,g(Zt,{decode:I(e=>C(_n(0),()=>e)),encode:I(It)})),Ca=R(j,g(pn));R(j,g(Zt,{decode:I(e=>C(_n(0),()=>e*1e3)),encode:I(e=>It(e)/1e3)}));var wa=R(F,g(Zt,{decode:I(e=>_n(e*1e3)),encode:I(m)})),Ta=R(j,g(Vt,{decode:I(xe),encode:I(f)})),Ea=class extends ie()(`AuthError`,{cause:Cn(bt()),error:b(N([`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:z}){get name(){return this.error===`temporarily_unavailable`?`AuthUnavailable`:`AuthError`}},Da=R(L,T(`UserId`)),Oa=R(L,T(`SignInFamily`)),ka=R(L,T(`SessionId`)),Aa=R(z,T(`ClientId`)),ja=R(F,T(`GitHubId`));R(M,g(ja));var Ma=D({id:Da,name:L});D({aud:At(`deslop`),azp:L,exp:wa,iat:wa,iss:L,name:L,sid:Oa,sub:Da}),D({name:z,redirects:ft(L.check(ze(200))).check(ze(4))}),D({client_id:Aa.check(he()),code:L,code_verifier:L,redirect_uri:L}),D({session:ka}),D({access_token:L,expires_in:Ta,refresh_token:L}),de(10),$e(30),Da.make(`github:0`);function Na(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}function Pa(e){return Ae(Ea)(e)&&e.error!==`temporarily_unavailable`&&e.error!==`access_denied`}function Fa(e){return Ae(Ea)(e)&&e.error!==`temporarily_unavailable`}cn()(`@deslop/runtime/shared/auth/CurrentUser`);var Ia=class extends jt()(`@deslop/runtime/shared/auth/RpcAuth`,{error:Ea}){},La=z.check(Ke(e=>_e(ue(hn(e)),e=>Nt([`http:`,`https:`],e.protocol)&&e.username===``&&e.password===``&&e.hash===``),{expected:`an HTTP(S) URL without credentials or a fragment`})).check(Ke(e=>_e(ue(hn(e)),e=>e.pathname===`/`&&e.search===``),{expected:`an HTTP(S) origin without a path or query`})),Ra=La.check(Ke(e=>_e(ue(hn(e)),e=>e.protocol===`https:`||Nt([`localhost`,`127.0.0.1`,`[::1]`],e.hostname)),{expected:`HTTPS outside loopback`}));z.check(Ee(/^\d{1,5}$/u),Ke(e=>_e(Je(e),e=>e>=1&&e<=65535),{expected:`a port between 1 and 65535`}));var za=z.check(Ee(/^0\.1\.\d+$/u)),Ba=`/api/runtime`,Va=D({auth:E(La),name:z,traces:z,version:za}),Ha=`/api/rpc`,Ua=D({...Ma.fields,signOut:A});D({config:D({port:F}),name:z,version:za});function Wa(e,t,n,r){return Ye(Ne(xn(function*(){let i=`${yield*se}`,a=yield*ot,o={attributes:{"scope.run.started_unix_nano":i,"scope.runtime":n,"service.instance.id":i},serviceName:e,serviceVersion:Kt(mt(r,e=>e!==`0.1.0`))};return Lt(Fe(an({resource:o,url:new URL(`/v1/traces`,t).href}),yt({resource:o,url:new URL(`/v1/logs`,t).href}),Ft(ot,[...a,`code`,`state`,`request`,`access_token`,`refresh_token`,`id_token`,`client_secret`,`client_assertion`,`code_verifier`,`session`,`token`])),[Rt,xt])})),e=>Ge(e)?re(v):re(fe(`Telemetry is unavailable`)))}function Ga(e){return Ne(xn(function*(){let t=yield*R((yield*gt).get(Ba),we(qe),we(x(Va)),Tt(`3 seconds`),d(e=>fe(`Telemetry is off: the runtime config did not load`,e)),tt);return zt(t,{onNone:()=>te,onSome:t=>t.traces===``?te:Wa(`${e}-client`,t.traces,`web`,t.version)})}))}var Ka=class extends jt()(`@deslop/runtime/shared/rpc/RpcStream`){};Ft(Ka,Ka.of((e,t)=>dt(t.rpc.successSchema)?Me(Le(`rpc.stream`,!0),e):e));var qa=pt(Ka,e=>xn(function*(){return dt(e.rpc.successSchema)&&(yield*Le(`rpc.stream`,!0)),yield*e.next(e.request)}));function Ja(e){return R(Qt({pingTimeout:`15 seconds`,retryTransientErrors:!0}),Lt(Lt(mn(e),yn)),h(Ht()),h(qa))}var Ya=Ue(dn()),Xa=ee(e=>{let t=Qe(`Web error`,me(e.error),...$t(Ve(e.stack)));return zt(rt(Ya),{onNone:()=>t,onSome:n=>be(R(t,Me(oe(e.error)),Jt(`Web.error`,{attributes:{"web.error.source":e.source,"web.route.id":e.route},root:!0}),pe),n)})}),Za=De(xt).atom(R(gn(`/api/account`),we(qe),we(x(Ua)))),Qa=Ja(lt(()=>`${location.origin}${Ha}`));function $a(e){De.addGlobalLayer(R(Ga(e),Lt(xt),ke(e=>rn(qt(e,un))?ln:Oe(lt(()=>p(Ya,Dt(e))),()=>lt(()=>wt(Ya,it(t=>t!==e)))))))}var eo=e(i(),1);function to(e){let t=eo.unstable_scheduleCallback(4,e);return()=>eo.unstable_cancelCallback(t)}var no=B.createContext(ae({scheduleTask:to,defaultIdleTTL:400})),ro=new WeakMap,io=0,ao=new Set;function oo(e){io++;try{return e()}finally{io--}}function so(e){if(io===0)return e();ao.size===0&&queueMicrotask(co),ao.add(e)}function co(){for(let e of ao)ao.delete(e),e()}function lo(e,t){let n=ro.get(e);n===void 0&&(n=new WeakMap,ro.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,()=>so(n));return()=>{i--,ao.delete(n),r()}},snapshot(){return oo(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:oo(()=>Pe(t,e))}),a.value}};return n.set(t,o),o}function uo(e,t){let n=lo(e,t);return B.useEffect(co),B.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function fo(e,t,n){let r=lo(e,t),i=B.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return B.useEffect(co),B.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var po=(e,t)=>{let n=B.useContext(no);return t?fo(n,e,t):uo(n,e)};function mo(e,t){B.useEffect(()=>e.mount(t),[t,e])}function ho(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?B.useCallback(r=>{e.set(t,r);let i=tn(Ie(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(go):i},[e,t,n.mode]):B.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var go=e=>{if(Re(e))return e.value;throw y(e.cause)},_o=e=>{mo(B.useContext(no),e)},vo=(e,t)=>{let n=B.useContext(no);return mo(n,e),ho(n,e,t)},yo=e=>{let t=B.useContext(no);return mo(t,e),B.useCallback(()=>{t.refresh(e)},[t,e])},bo=(e,t)=>{let n=B.useContext(no);return[uo(n,e),ho(n,e,t)]},xo={suspendOnWaiting:new WeakMap,default:new WeakMap};function So(e,t,n){let r=n?xo.suspendOnWaiting:xo.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 Co(e,t,n){let r=uo(e,t);if(r._tag===`Initial`||n&&r.waiting)throw So(e,t,n);return r}var wo=(e,t)=>{let n=Co(B.useContext(no),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw y(n.cause);return n};function To(e){return je(e.reasons,e=>Sn(e)&&Fa(e.error))}function Eo(e){return!_(e)||!To(e.cause)&&Mt(e.previousSuccess)?dn():Dt(e.cause)}function Do(e,t,n=S){function r(e){let t=fn(e.reasons,e=>Sn(e)&&Fa(e.error));return _t(t)?dn():Dt(Te(t))}let i=Ue(R(e.self(),it(_),nt(e=>r(e.cause))));function a(e){return zt(rt(i),{onNone:()=>e,onSome:t=>Te([...t.reasons,...fn(e.reasons,e=>!Sn(e)||!Fa(e.error))])})}let o=Ue(0),s=Et(t,t=>lt(()=>{wt(i,e=>St(r(t),()=>e));let n=a(t);Mt(rt(i))?e.setSelf(Ce(n)):ut(o)<2||e.setSelf(We(n,{previous:e.self()}))}));return R(n(s),u(()=>lt(()=>{p(i,dn()),p(o,0)})),le(e=>ge(a(e))),ye(Be(()=>zt(rt(i),{onNone:()=>en,onSome:ge}))))}function Oo(e){return st(e,e=>ht(e(Pt(`1 second`)),e=>Ae(Ea)(e.input)?e.input.error===`temporarily_unavailable`:Ae(Ot)(e.input)&&e.input.reason._tag!==`RpcClientDefect`))}function ko(e,t,n){return Yt(Xe(e,e=>e(t,n)))}function Ao(e,t,n){return e.runtime.atom(r=>Do(r,Yt(Xe(e,e=>e(t,n))),Oo))}var jo=B.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:c=!0,style:l,...u}=e,{getButtonProps:d,buttonRef:f}=s({disabled:i,focusableWhenDisabled:a,native:c});return o(`button`,e,{state:{disabled:i},ref:[t,f],props:[u,d]})}),Mo=n(),No=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Po=c,Fo=(e,t)=>n=>{if(t?.variants==null)return Po(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=No(t)||No(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 Po(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)},Io=Fo(`group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 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`,bare:`bg-transparent hover:bg-transparent dark:hover:bg-transparent`,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 Lo(e){let t=(0,Mo.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,s=a===void 0?`default`:a,c;t[5]!==n||t[6]!==s||t[7]!==o?(c=l(Io({variant:o,size:s,className:n})),t[5]=n,t[6]=s,t[7]=o,t[8]=c):c=t[8];let u;return t[9]!==r||t[10]!==c?(u=(0,V.jsx)(jo,{"data-slot":`button`,className:c,...r}),t[9]=r,t[10]=c,t[11]=u):u=t[11],u}var $=T(`DeployWorkerId`)(z),Ro=T(`DeployItemId`)(z),zo=T(`DeployAppId`)(z),Bo=T(`DeployUnitId`)(z),Vo=T(`DeployProcessId`)(F),Ho=T(`DeployContainerId`)(z),Uo=T(`DeployJobName`)(z),Wo=T(`DeployExposureName`)(z);R(M,g(Vo)),P(M),R(M,g(j,{decode:I(e=>e*1024),encode:I(e=>e/1024)})),D({1:vn(M),2:M,3:M});var Go=R(z,g(bn(z),{decode:I(e=>mt(e,Xt)),encode:I(e=>Ct(e,()=>``))})),Ko=R(E(z),g(bn(z),{decode:I(e=>it(e,Xt)),encode:I(S)})),qo=class extends ie()(`DeployError`,{cause:Cn(bt()),message:z}){},Jo=D({detail:z,name:z}),Yo=D({command:E(P(z)),cpu:E(j),label:Jo,memory:j,name:z,parent:Vo,pid:Vo}),Xo=D({active:R(A,O(at(!1))),address:R(E(z),O(k)),bindings:R(E(P(D({address:z,port:F,protocol:N([`tcp`,`udp`])}))),O(k)),detail:z,failure:R(E(D({at:E(Sa),reason:z})),O(k)),health:R(N([`quiet`,`warning`,`error`]),O(at(`quiet`))),hostname:R(E(z),O(k)),http:R(E(A),O(k)),id:Ro,kind:N([`service`,`container`,`port`,`exposure`,`peer`]),links:R(E(P(z)),O(k)),name:z,next:R(E(Sa),O(k)),owned:R(E(A),O(k)),port:R(E(F),O(k)),process:R(Ko,O(k)),processes:R(E(P(Yo)),O(k)),protocol:R(E(N([`tcp`,`udp`])),O(k)),publicAccess:R(E(A),O(k)),running:R(A,O(at(!1))),scheduled:R(E(A),O(k)),scope:R(E(N([`user`,`system`])),O(k)),self:R(E(A),O(k)),state:z,ui:R(E(A),O(k)),unit:R(Ko,g(bn(Bo)),O(k)),url:Go,worker:$}),Zo=ne([Xo.mapFields(e=>({...e,kind:At(`service`),name:Bo})),Xo.mapFields(e=>({...e,kind:At(`exposure`),name:Wo})),Xo.mapFields(e=>({...e,kind:N([`container`,`peer`])}))]),Qo=Xo.mapFields(e=>({...e,kind:At(`port`),process:R(E(Go),g(bn(z),{decode:I(ct),encode:I(Dt)}),O(k))}));ne([...Zo.members,Qo]);var $o=D({items:P(ne([...Zo.members,Qo.mapFields(e=>({...e,unit:R(E(R(Go,g(bn(Bo)))),g(bn(Ze(Bo)),{decode:I(ct),encode:I(Dt)}),O(k))}))])),sources:P(D({error:Go,name:z})),time:Sa,workers:P($)});D({name:$.check(he()),url:Ra}),z.check(Ee(/^[\w-]+=https?:\/\/[^,=\s]+(?:,[\w-]+=https?:\/\/[^,=\s]+)*$/u),Ke(e=>R(e,Ut(`,`),Bt(e=>_e(R(e,Ut(`=`),kt(1)),Ae(Ra)))),{expected:`named HTTPS origins, or loopback HTTP origins`}));var es=D({DNSName:z,HostName:z,OS:z,Online:A,TailscaleIPs:P(z)});D({Peer:E(w(z,es)),Self:E(es)}),D({AllowFunnel:E(w(z,A)),TCP:E(w(z,Wt)),Web:E(w(z,D({Handlers:w(z,D({Proxy:E(z)}))})))});var ts=D({name:Bo,scope:N([`system`,`user`]),worker:$});D({job:Uo.annotate({description:`A scheduled job name as list_apps shows it.`}),worker:E($.annotate({description:`The worker running the job, when several do.`}))}),D({app:E(z.annotate({description:`A substring of an app or unit name; returns that app's process tree.`})),failing:E(A.annotate({description:`Only failed or warning items.`})),worker:E($.annotate({description:`A configured worker name.`}))});var ns=D({children:E(P(et(()=>ns))),cpu:E(j),detail:E(z),mib:F,name:z}),rs=D({failure:E(z),id:Ro,name:z,ports:E(P(F)),processes:E(P(ns)),since:E(on),state:z,url:E(z)}),is=D({failure:E(z),id:Ro,name:Uo,next:E(on),running:A,since:E(on)}),as=D({access:N([`tailnet`,`public`]),id:Ro,name:Wo,port:E(F),url:z}),os=D({apps:P(rs),errors:E(P(z)),exposures:E(P(as)),jobs:E(P(is)),worker:$});P(os),D({activates:vt(Bo),next:vt(R(j,g(Zt,{decode:I(e=>C(_n(0),()=>e/1e3)),encode:I(e=>It(e)*1e3)})))}),D({active:z,description:z,sub:z,unit:Bo}),D({ID:Ho,Labels:E(z),Names:z,Ports:z,State:z,Status:z}),P(M).check(ce(5)),P(M),T(`DeployCgroupPath`)(z);var ss=N([1,10,60,1440,10080]),cs=D({minutes:R(ss,g(Vt,{decode:I(de),encode:ve(e=>R(e,He,Se(ss)))}))});D({...cs.fields,worker:E($.annotate({description:`A configured worker name.`}))});var ls=P(vt(j)),us=D({cpu:E(j),mib:F,name:z}),ds=D({cpuPct:E(j),diskGiB:E(j),diskTotalGiB:E(j),load:E(P(j)),memoryGiB:j,memoryTotalGiB:j}),fs=D({apps:P(us),cpuPct:ls,diskPct:ls,error:E(z),from:on,memoryPct:ls,now:E(ds),stale:E(At(!0)),stepSeconds:Ta,worker:$});P(fs),D({cpuIdle:Ca,cpuTotal:Ca,time:Sa,uptime:Ta});var ps=D({cpu:E(j),id:zo,memory:j}),ms=class extends sn(`Sample`)({apps:Gt(nn(P(ps))),cpu:Gt(j),memoryTotal:j,memoryUsed:j,since:R(F,g(Sa)),step:R(F,g(Ca)),storageUsed:Gt(j),time:R(F,g(Sa))}){static table=`samples`},hs=D({mount:z,total:j,used:j}),gs=D({disks:P(hs),error:Go,load:P(j),samples:P(ms.json),stale:A,time:Sa,worker:$});export{W as $,Ea as A,ha as B,wo as C,Qa as D,$a as E,xa as F,dr as G,fi as H,va as I,tr as J,ur as K,_a as L,Fa as M,Pa as N,Xa as O,Na as P,Kn as Q,ma as R,vo as S,Za as T,Xr as U,gi as V,Zr as W,Gn as X,er as Y,Jn as Z,ko as _,Wo as a,Bn as at,_o as b,$o as c,wn as ct,Lo as d,Wn as et,Fo as f,Ao as g,Do as h,qo as i,On as it,Ia as j,Ka as k,Bo as l,Tn as lt,To as m,gs as n,En as nt,Ro as o,Nn as ot,Eo as p,sr as q,zo as r,Rn as rt,ts as s,U as st,cs as t,Mn as tt,$ as u,Oo as v,po as w,yo as x,bo as y,ga as z};
@@ -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-BKWpGXRr.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-BnBm9lDv.js"></script>
19
19
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
20
- <link rel="modulepreload" crossorigin href="/assets/react-CUZAqdXP.js">
21
- <link rel="modulepreload" crossorigin href="/assets/effect-r9fOwH_L.js">
22
- <link rel="modulepreload" crossorigin href="/assets/utils-USd0nOYy.js">
23
- <link rel="modulepreload" crossorigin href="/assets/schema-BkrFEFT3.js">
24
- <link rel="stylesheet" crossorigin href="/assets/index-Dl_kgG-T.css">
20
+ <link rel="modulepreload" crossorigin href="/assets/react-BPjvcVqE.js">
21
+ <link rel="modulepreload" crossorigin href="/assets/effect-BYYFLcwW.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/classes-D4KMZ4wl.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/schema-CIp4dRBI.js">
24
+ <link rel="stylesheet" crossorigin href="/assets/index-CcSNgzCE.css">
25
25
  </head>
26
26
  <body>
27
27
  <div id="root"></div>