t(r,a,void 0,l));else{const r=Object.keys(e);o=new Array(r.length);for(let a=0,p=r.length;ae?ur(e)?Vs(e):po(e.parent):null,Fn=Be(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>po(e.parent),$root:e=>po(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Bi(e),$forceUpdate:e=>e.f||(e.f=()=>{Lo(e.update)}),$nextTick:e=>e.n||(e.n=Nt.bind(e.proxy)),$watch:e=>Ba.bind(e)}),Zs=(e,t)=>e!==Ee&&!e.__isScriptSetup&&we(e,t),iu={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:l,accessCache:i,type:r,appContext:a}=e;if(t[0]!=="$"){const _=i[t];if(_!==void 0)switch(_){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return l[t]}else{if(Zs(s,t))return i[t]=1,s[t];if(o!==Ee&&we(o,t))return i[t]=2,o[t];if(we(l,t))return i[t]=3,l[t];if(n!==Ee&&we(n,t))return i[t]=4,n[t];mo&&(i[t]=0)}}const p=Fn[t];let d,f;if(p)return t==="$attrs"&&Ge(e.attrs,"get",""),p(e);if((d=r.__cssModules)&&(d=d[t]))return d;if(n!==Ee&&we(n,t))return i[t]=4,n[t];if(f=a.config.globalProperties,we(f,t))return f[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:l}=e;return Zs(o,t)?(o[t]=n,!0):s!==Ee&&we(s,t)?(s[t]=n,!0):we(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:l,type:i}},r){let a;return!!(n[r]||e!==Ee&&r[0]!=="$"&&we(e,r)||Zs(t,r)||we(l,r)||we(s,r)||we(Fn,r)||we(o.config.globalProperties,r)||(a=i.__cssModules)&&a[r])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:we(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function fl(e){return ee(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let mo=!0;function ru(e){const t=Bi(e),n=e.proxy,s=e.ctx;mo=!1,t.beforeCreate&&dl(t.beforeCreate,e,"bc");const{data:o,computed:l,methods:i,watch:r,provide:a,inject:p,created:d,beforeMount:f,mounted:_,beforeUpdate:b,updated:P,activated:I,deactivated:B,beforeDestroy:Q,beforeUnmount:M,destroyed:z,unmounted:q,render:se,renderTracked:Re,renderTriggered:pe,errorCaptured:oe,serverPrefetch:le,expose:J,inheritAttrs:A,components:j,directives:O,filters:ve}=t;if(p&&au(p,s,null),i)for(const te in i){const de=i[te];re(de)&&(s[te]=de.bind(n))}if(o){const te=o.call(n,n);xe(te)&&(e.data=Xn(te))}if(mo=!0,l)for(const te in l){const de=l[te],ct=re(de)?de.bind(n,n):re(de.get)?de.get.bind(n,n):xt,ot=!re(de)&&re(de.set)?de.set.bind(n):xt,Qe=fe({get:ct,set:ot});Object.defineProperty(s,te,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:je=>Qe.value=je})}if(r)for(const te in r)Hi(r[te],s,n,te);if(a){const te=re(a)?a.call(n):a;Reflect.ownKeys(te).forEach(de=>{ds(de,te[de])})}d&&dl(d,e,"c");function Ce(te,de){ee(de)?de.forEach(ct=>te(ct.bind(n))):de&&te(de.bind(n))}if(Ce(za,f),Ce(Ms,_),Ce(Ya,b),Ce(Qa,P),Ce(Wa,I),Ce(qa,B),Ce(nu,oe),Ce(tu,Re),Ce(eu,pe),Ce(Xa,M),Ce(es,q),Ce(Za,le),ee(J))if(J.length){const te=e.exposed||(e.exposed={});J.forEach(de=>{Object.defineProperty(te,de,{get:()=>n[de],set:ct=>n[de]=ct,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===xt&&(e.render=se),A!=null&&(e.inheritAttrs=A),j&&(e.components=j),O&&(e.directives=O),le&&Ui(e)}function au(e,t,n=xt){ee(e)&&(e=vo(e));for(const s in e){const o=e[s];let l;xe(o)?"default"in o?l=rt(o.from||s,o.default,!0):l=rt(o.from||s):l=rt(o),Me(l)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>l.value,set:i=>l.value=i}):t[s]=l}}function dl(e,t,n){vt(ee(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Hi(e,t,n,s){let o=s.includes(".")?Li(n,s):()=>n[s];if($e(e)){const l=t[e];re(l)&&Vn(o,l)}else if(re(e))Vn(o,e.bind(n));else if(xe(e))if(ee(e))e.forEach(l=>Hi(l,t,n,s));else{const l=re(e.handler)?e.handler.bind(n):t[e.handler];re(l)&&Vn(o,l,e)}}function Bi(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:l,config:{optionMergeStrategies:i}}=e.appContext,r=l.get(t);let a;return r?a=r:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(p=>ys(a,p,i,!0)),ys(a,t,i)),xe(t)&&l.set(t,a),a}function ys(e,t,n,s=!1){const{mixins:o,extends:l}=t;l&&ys(e,l,n,!0),o&&o.forEach(i=>ys(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const r=uu[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}const uu={data:hl,props:pl,emits:pl,methods:Nn,computed:Nn,beforeCreate:qe,created:qe,beforeMount:qe,mounted:qe,beforeUpdate:qe,updated:qe,beforeDestroy:qe,beforeUnmount:qe,destroyed:qe,unmounted:qe,activated:qe,deactivated:qe,errorCaptured:qe,serverPrefetch:qe,components:Nn,directives:Nn,watch:fu,provide:hl,inject:cu};function hl(e,t){return t?e?function(){return Be(re(e)?e.call(this,this):e,re(t)?t.call(this,this):t)}:t:e}function cu(e,t){return Nn(vo(e),vo(t))}function vo(e){if(ee(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ye(t)}Modifiers`]||e[`${Yt(t)}Modifiers`];function mu(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Ee;let o=n;const l=t.startsWith("update:"),i=l&&pu(s,t.slice(7));i&&(i.trim&&(o=n.map(d=>$e(d)?d.trim():d)),i.number&&(o=n.map(Ts)));let r,a=s[r=qs(t)]||s[r=qs(Ye(t))];!a&&l&&(a=s[r=qs(Yt(t))]),a&&vt(a,e,6,o);const p=s[r+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,vt(p,e,6,o)}}const vu=new WeakMap;function Gi(e,t,n=!1){const s=n?vu:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const l=e.emits;let i={},r=!1;if(!re(e)){const a=p=>{const d=Gi(p,t,!0);d&&(r=!0,Be(i,d))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!l&&!r?(xe(e)&&s.set(e,null),null):(ee(l)?l.forEach(a=>i[a]=null):Be(i,l),xe(e)&&s.set(e,i),i)}function Ds(e,t){return!e||!Cs(t)?!1:(t=t.slice(2).replace(/Once$/,""),we(e,t[0].toLowerCase()+t.slice(1))||we(e,Yt(t))||we(e,t))}function ml(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[l],slots:i,attrs:r,emit:a,render:p,renderCache:d,props:f,data:_,setupState:b,ctx:P,inheritAttrs:I}=e,B=gs(e);let Q,M;try{if(n.shapeFlag&4){const q=o||s,se=q;Q=kt(p.call(se,q,d,f,b,_,P)),M=r}else{const q=t;Q=kt(q.length>1?q(f,{attrs:r,slots:i,emit:a}):q(f,null)),M=t.props?r:gu(r)}}catch(q){Hn.length=0,Ns(q,e,1),Q=Se(Jt)}let z=Q;if(M&&I!==!1){const q=Object.keys(M),{shapeFlag:se}=z;q.length&&se&7&&(l&&q.some(Es)&&(M=_u(M,l)),z=yn(z,M,!1,!0))}return n.dirs&&(z=yn(z,null,!1,!0),z.dirs=z.dirs?z.dirs.concat(n.dirs):n.dirs),n.transition&&Vo(z,n.transition),Q=z,gs(B),Q}const gu=e=>{let t;for(const n in e)(n==="class"||n==="style"||Cs(n))&&((t||(t={}))[n]=e[n]);return t},_u=(e,t)=>{const n={};for(const s in e)(!Es(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function yu(e,t,n){const{props:s,children:o,component:l}=e,{props:i,children:r,patchFlag:a}=t,p=l.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?vl(s,i,p):!!i;if(a&8){const d=t.dynamicProps;for(let f=0;fObject.create(qi),zi=e=>Object.getPrototypeOf(e)===qi;function ku(e,t,n,s=!1){const o={},l=Ji();e.propsDefaults=Object.create(null),Yi(e,t,o,l);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Ri(o):e.type.props?e.props=o:e.props=l,e.attrs=l}function wu(e,t,n,s){const{props:o,attrs:l,vnode:{patchFlag:i}}=e,r=_e(o),[a]=e.propsOptions;let p=!1;if((s||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let f=0;f{a=!0;const[_,b]=Qi(f,t,!0);Be(i,_),b&&r.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!l&&!a)return xe(e)&&s.set(e,pn),pn;if(ee(l))for(let d=0;de==="_"||e==="_ctx"||e==="$stable",jo=e=>ee(e)?e.map(kt):[kt(e)],Cu=(e,t,n)=>{if(t._n)return t;const s=fs((...o)=>jo(t(...o)),n);return s._c=!1,s},Xi=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Uo(o))continue;const l=e[o];if(re(l))t[o]=Cu(o,l,s);else if(l!=null){const i=jo(l);t[o]=()=>i}}},Zi=(e,t)=>{const n=jo(t);e.slots.default=()=>n},er=(e,t,n)=>{for(const s in t)(n||!Uo(s))&&(e[s]=t[s])},Eu=(e,t,n)=>{const s=e.slots=Ji();if(e.vnode.shapeFlag&32){const o=t._;o?(er(s,t,n),n&&ri(s,"_",o,!0)):Xi(t,s)}else t&&Zi(e,t)},Su=(e,t,n)=>{const{vnode:s,slots:o}=e;let l=!0,i=Ee;if(s.shapeFlag&32){const r=t._;r?n&&r===1?l=!1:er(o,t,n):(l=!t.$stable,Xi(t,o)),i=t}else t&&(Zi(e,t),i={default:1});if(l)for(const r in o)!Uo(r)&&i[r]==null&&delete o[r]},Ze=Pu;function Au(e){return Ru(e)}function Ru(e,t){const n=Os();n.__VUE__=!0;const{insert:s,remove:o,patchProp:l,createElement:i,createText:r,createComment:a,setText:p,setElementText:d,parentNode:f,nextSibling:_,setScopeId:b=xt,insertStaticContent:P}=e,I=(m,g,y,x=null,R=null,E=null,H=void 0,D=null,$=!!g.dynamicChildren)=>{if(m===g)return;m&&!Pn(m,g)&&(x=C(m),je(m,R,E,!0),m=null),g.patchFlag===-2&&($=!1,g.dynamicChildren=null);const{type:T,ref:Z,shapeFlag:U}=g;switch(T){case Ls:B(m,g,y,x);break;case Jt:Q(m,g,y,x);break;case to:m==null&&M(g,y,x,H);break;case K:j(m,g,y,x,R,E,H,D,$);break;default:U&1?se(m,g,y,x,R,E,H,D,$):U&6?O(m,g,y,x,R,E,H,D,$):(U&64||U&128)&&T.process(m,g,y,x,R,E,H,D,$,V)}Z!=null&&R?Un(Z,m&&m.ref,E,g||m,!g):Z==null&&m&&m.ref!=null&&Un(m.ref,null,E,m,!0)},B=(m,g,y,x)=>{if(m==null)s(g.el=r(g.children),y,x);else{const R=g.el=m.el;g.children!==m.children&&p(R,g.children)}},Q=(m,g,y,x)=>{m==null?s(g.el=a(g.children||""),y,x):g.el=m.el},M=(m,g,y,x)=>{[m.el,m.anchor]=P(m.children,g,y,x,m.el,m.anchor)},z=({el:m,anchor:g},y,x)=>{let R;for(;m&&m!==g;)R=_(m),s(m,y,x),m=R;s(g,y,x)},q=({el:m,anchor:g})=>{let y;for(;m&&m!==g;)y=_(m),o(m),m=y;o(g)},se=(m,g,y,x,R,E,H,D,$)=>{if(g.type==="svg"?H="svg":g.type==="math"&&(H="mathml"),m==null)Re(g,y,x,R,E,H,D,$);else{const T=m.el&&m.el._isVueCE?m.el:null;try{T&&T._beginPatch(),le(m,g,R,E,H,D,$)}finally{T&&T._endPatch()}}},Re=(m,g,y,x,R,E,H,D)=>{let $,T;const{props:Z,shapeFlag:U,transition:Y,dirs:X}=m;if($=m.el=i(m.type,E,Z&&Z.is,Z),U&8?d($,m.children):U&16&&oe(m.children,$,null,x,R,eo(m,E),H,D),X&&Zt(m,null,x,"created"),pe($,m,m.scopeId,H,x),Z){for(const ye in Z)ye!=="value"&&!Mn(ye)&&l($,ye,null,Z[ye],E,x);"value"in Z&&l($,"value",null,Z.value,E),(T=Z.onVnodeBeforeMount)&&_t(T,x,m)}X&&Zt(m,null,x,"beforeMount");const ue=Tu(R,Y);ue&&Y.beforeEnter($),s($,g,y),((T=Z&&Z.onVnodeMounted)||ue||X)&&Ze(()=>{try{T&&_t(T,x,m),ue&&Y.enter($),X&&Zt(m,null,x,"mounted")}finally{}},R)},pe=(m,g,y,x,R)=>{if(y&&b(m,y),x)for(let E=0;E{for(let T=$;T{const D=g.el=m.el;let{patchFlag:$,dynamicChildren:T,dirs:Z}=g;$|=m.patchFlag&16;const U=m.props||Ee,Y=g.props||Ee;let X;if(y&&en(y,!1),(X=Y.onVnodeBeforeUpdate)&&_t(X,y,g,m),Z&&Zt(g,m,y,"beforeUpdate"),y&&en(y,!0),(U.innerHTML&&Y.innerHTML==null||U.textContent&&Y.textContent==null)&&d(D,""),T?J(m.dynamicChildren,T,D,y,x,eo(g,R),E):H||de(m,g,D,null,y,x,eo(g,R),E,!1),$>0){if($&16)A(D,U,Y,y,R);else if($&2&&U.class!==Y.class&&l(D,"class",null,Y.class,R),$&4&&l(D,"style",U.style,Y.style,R),$&8){const ue=g.dynamicProps;for(let ye=0;ye{X&&_t(X,y,g,m),Z&&Zt(g,m,y,"updated")},x)},J=(m,g,y,x,R,E,H)=>{for(let D=0;D{if(g!==y){if(g!==Ee)for(const E in g)!Mn(E)&&!(E in y)&&l(m,E,g[E],null,R,x);for(const E in y){if(Mn(E))continue;const H=y[E],D=g[E];H!==D&&E!=="value"&&l(m,E,D,H,R,x)}"value"in y&&l(m,"value",g.value,y.value,R)}},j=(m,g,y,x,R,E,H,D,$)=>{const T=g.el=m?m.el:r(""),Z=g.anchor=m?m.anchor:r("");let{patchFlag:U,dynamicChildren:Y,slotScopeIds:X}=g;X&&(D=D?D.concat(X):X),m==null?(s(T,y,x),s(Z,y,x),oe(g.children||[],y,Z,R,E,H,D,$)):U>0&&U&64&&Y&&m.dynamicChildren&&m.dynamicChildren.length===Y.length?(J(m.dynamicChildren,Y,y,R,E,H,D),(g.key!=null||R&&g===R.subTree)&&tr(m,g,!0)):de(m,g,y,Z,R,E,H,D,$)},O=(m,g,y,x,R,E,H,D,$)=>{g.slotScopeIds=D,m==null?g.shapeFlag&512?R.ctx.activate(g,y,x,H,$):ve(g,y,x,R,E,H,$):Oe(m,g,$)},ve=(m,g,y,x,R,E,H)=>{const D=m.component=Vu(m,x,R);if(ji(m)&&(D.ctx.renderer=V),Uu(D,!1,H),D.asyncDep){if(R&&R.registerDep(D,Ce,H),!m.el){const $=D.subTree=Se(Jt);Q(null,$,g,y),m.placeholder=$.el}}else Ce(D,m,g,y,R,E,H)},Oe=(m,g,y)=>{const x=g.component=m.component;if(yu(m,g,y))if(x.asyncDep&&!x.asyncResolved){te(x,g,y);return}else x.next=g,x.update();else g.el=m.el,x.vnode=g},Ce=(m,g,y,x,R,E,H)=>{const D=()=>{if(m.isMounted){let{next:U,bu:Y,u:X,parent:ue,vnode:ye}=m;{const et=nr(m);if(et){U&&(U.el=ye.el,te(m,U,H)),et.asyncDep.then(()=>{Ze(()=>{m.isUnmounted||T()},R)});return}}let be=U,Pe;en(m,!1),U?(U.el=ye.el,te(m,U,H)):U=ye,Y&&cs(Y),(Pe=U.props&&U.props.onVnodeBeforeUpdate)&&_t(Pe,ue,U,ye),en(m,!0);const De=ml(m),lt=m.subTree;m.subTree=De,I(lt,De,f(lt.el),C(lt),m,R,E),U.el=De.el,be===null&&bu(m,De.el),X&&Ze(X,R),(Pe=U.props&&U.props.onVnodeUpdated)&&Ze(()=>_t(Pe,ue,U,ye),R)}else{let U;const{el:Y,props:X}=g,{bm:ue,m:ye,parent:be,root:Pe,type:De}=m,lt=jn(g);en(m,!1),ue&&cs(ue),!lt&&(U=X&&X.onVnodeBeforeMount)&&_t(U,be,g),en(m,!0);{Pe.ce&&Pe.ce._hasShadowRoot()&&Pe.ce._injectChildStyle(De,m.parent?m.parent.type:void 0);const et=m.subTree=ml(m);I(null,et,y,x,m,R,E),g.el=et.el}if(ye&&Ze(ye,R),!lt&&(U=X&&X.onVnodeMounted)){const et=g;Ze(()=>_t(U,be,et),R)}(g.shapeFlag&256||be&&jn(be.vnode)&&be.vnode.shapeFlag&256)&&m.a&&Ze(m.a,R),m.isMounted=!0,g=y=x=null}};m.scope.on();const $=m.effect=new pi(D);m.scope.off();const T=m.update=$.run.bind($),Z=m.job=$.runIfDirty.bind($);Z.i=m,Z.id=m.uid,$.scheduler=()=>Lo(Z),en(m,!0),T()},te=(m,g,y)=>{g.component=m;const x=m.vnode.props;m.vnode=g,m.next=null,wu(m,g.props,x,y),Su(m,g.children,y),$t(),il(m),Mt()},de=(m,g,y,x,R,E,H,D,$=!1)=>{const T=m&&m.children,Z=m?m.shapeFlag:0,U=g.children,{patchFlag:Y,shapeFlag:X}=g;if(Y>0){if(Y&128){ot(T,U,y,x,R,E,H,D,$);return}else if(Y&256){ct(T,U,y,x,R,E,H,D,$);return}}X&8?(Z&16&&Ue(T,R,E),U!==T&&d(y,U)):Z&16?X&16?ot(T,U,y,x,R,E,H,D,$):Ue(T,R,E,!0):(Z&8&&d(y,""),X&16&&oe(U,y,x,R,E,H,D,$))},ct=(m,g,y,x,R,E,H,D,$)=>{m=m||pn,g=g||pn;const T=m.length,Z=g.length,U=Math.min(T,Z);let Y;for(Y=0;YZ?Ue(m,R,E,!0,!1,U):oe(g,y,x,R,E,H,D,$,U)},ot=(m,g,y,x,R,E,H,D,$)=>{let T=0;const Z=g.length;let U=m.length-1,Y=Z-1;for(;T<=U&&T<=Y;){const X=m[T],ue=g[T]=$?Rt(g[T]):kt(g[T]);if(Pn(X,ue))I(X,ue,y,null,R,E,H,D,$);else break;T++}for(;T<=U&&T<=Y;){const X=m[U],ue=g[Y]=$?Rt(g[Y]):kt(g[Y]);if(Pn(X,ue))I(X,ue,y,null,R,E,H,D,$);else break;U--,Y--}if(T>U){if(T<=Y){const X=Y+1,ue=XY)for(;T<=U;)je(m[T],R,E,!0),T++;else{const X=T,ue=T,ye=new Map;for(T=ue;T<=Y;T++){const Ke=g[T]=$?Rt(g[T]):kt(g[T]);Ke.key!=null&&ye.set(Ke.key,T)}let be,Pe=0;const De=Y-ue+1;let lt=!1,et=0;const Vt=new Array(De);for(T=0;T=De){je(Ke,R,E,!0);continue}let it;if(Ke.key!=null)it=ye.get(Ke.key);else for(be=ue;be<=Y;be++)if(Vt[be-ue]===0&&Pn(Ke,g[be])){it=be;break}it===void 0?je(Ke,R,E,!0):(Vt[it-ue]=T+1,it>=et?et=it:lt=!0,I(Ke,g[it],y,null,R,E,H,D,$),Pe++)}const Cn=lt?Ou(Vt):pn;for(be=Cn.length-1,T=De-1;T>=0;T--){const Ke=ue+T,it=g[Ke],Qt=g[Ke+1],ss=Ke+1{const{el:E,type:H,transition:D,children:$,shapeFlag:T}=m;if(T&6){Qe(m.component.subTree,g,y,x);return}if(T&128){m.suspense.move(g,y,x);return}if(T&64){H.move(m,g,y,V);return}if(H===K){s(E,g,y);for(let U=0;U<$.length;U++)Qe($[U],g,y,x);s(m.anchor,g,y);return}if(H===to){z(m,g,y);return}if(x!==2&&T&1&&D)if(x===0)D.persisted&&!E[Xs]?s(E,g,y):(D.beforeEnter(E),s(E,g,y),Ze(()=>D.enter(E),R));else{const{leave:U,delayLeave:Y,afterLeave:X}=D,ue=()=>{m.ctx.isUnmounted?o(E):s(E,g,y)},ye=()=>{const be=E._isLeaving||!!E[Xs];E._isLeaving&&E[Xs](!0),D.persisted&&!be?ue():U(E,()=>{ue(),X&&X()})};Y?Y(E,ue,ye):ye()}else s(E,g,y)},je=(m,g,y,x=!1,R=!1)=>{const{type:E,props:H,ref:D,children:$,dynamicChildren:T,shapeFlag:Z,patchFlag:U,dirs:Y,cacheIndex:X,memo:ue}=m;if(U===-2&&(R=!1),D!=null&&($t(),Un(D,null,y,m,!0),Mt()),X!=null&&(g.renderCache[X]=void 0),Z&256){g.ctx.deactivate(m);return}const ye=Z&1&&Y,be=!jn(m);let Pe;if(be&&(Pe=H&&H.onVnodeBeforeUnmount)&&_t(Pe,g,m),Z&6)dt(m.component,y,x);else{if(Z&128){m.suspense.unmount(y,x);return}ye&&Zt(m,null,g,"beforeUnmount"),Z&64?m.type.remove(m,g,y,V,x):T&&!T.hasOnce&&(E!==K||U>0&&U&64)?Ue(T,g,y,!1,!0):(E===K&&U&384||!R&&Z&16)&&Ue($,g,y),x&&Ct(m)}const De=ue!=null&&X==null;(be&&(Pe=H&&H.onVnodeUnmounted)||ye||De)&&Ze(()=>{Pe&&_t(Pe,g,m),ye&&Zt(m,null,g,"unmounted"),De&&(m.el=null)},y)},Ct=m=>{const{type:g,el:y,anchor:x,transition:R}=m;if(g===K){ft(y,x);return}if(g===to){q(m);return}const E=()=>{o(y),R&&!R.persisted&&R.afterLeave&&R.afterLeave()};if(m.shapeFlag&1&&R&&!R.persisted){const{leave:H,delayLeave:D}=R,$=()=>H(y,E);D?D(m.el,E,$):$()}else E()},ft=(m,g)=>{let y;for(;m!==g;)y=_(m),o(m),m=y;o(g)},dt=(m,g,y)=>{const{bum:x,scope:R,job:E,subTree:H,um:D,m:$,a:T}=m;_l($),_l(T),x&&cs(x),R.stop(),E&&(E.flags|=8,je(H,m,g,y)),D&&Ze(D,g),Ze(()=>{m.isUnmounted=!0},g)},Ue=(m,g,y,x=!1,R=!1,E=0)=>{for(let H=E;H{if(m.shapeFlag&6)return C(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const g=_(m.anchor||m.el),y=g&&g[Ka];return y?_(y):g};let G=!1;const F=(m,g,y)=>{let x;m==null?g._vnode&&(je(g._vnode,null,null,!0),x=g._vnode.component):I(g._vnode||null,m,g,null,null,null,y),g._vnode=m,G||(G=!0,il(x),Ni(),G=!1)},V={p:I,um:je,m:Qe,r:Ct,mt:ve,mc:oe,pc:de,pbc:J,n:C,o:e};return{render:F,hydrate:void 0,createApp:hu(F)}}function eo({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function en({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Tu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function tr(e,t,n=!1){const s=e.children,o=t.children;if(ee(s)&&ee(o))for(let l=0;l>1,e[n[r]]0&&(t[s]=n[l-1]),n[l]=s)}}for(l=n.length,i=n[l-1];l-- >0;)n[l]=i,i=t[i];return n}function nr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:nr(t)}function _l(e){if(e)for(let t=0;te.__isSuspense;function Pu(e,t){t&&t.pendingBranch?ee(e)?t.effects.push(...e):t.effects.push(e):Ua(e)}const K=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),Jt=Symbol.for("v-cmt"),to=Symbol.for("v-stc"),Hn=[];let nt=null;function k(e=!1){Hn.push(nt=e?null:[])}function Iu(){Hn.pop(),nt=Hn[Hn.length-1]||null}let Jn=1;function bs(e,t=!1){Jn+=e,e<0&&nt&&t&&(nt.hasOnce=!0)}function lr(e){return e.dynamicChildren=Jn>0?nt||pn:null,Iu(),Jn>0&&nt&&nt.push(e),e}function w(e,t,n,s,o,l){return lr(u(e,t,n,s,o,l,!0))}function ir(e,t,n,s,o){return lr(Se(e,t,n,s,o,!0))}function ks(e){return e?e.__v_isVNode===!0:!1}function Pn(e,t){return e.type===t.type&&e.key===t.key}const rr=({key:e})=>e??null,hs=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Me(e)||re(e)?{i:tt,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,l=e===K?0:1,i=!1,r=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rr(t),ref:t&&hs(t),scopeId:Mi,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:tt};return r?(Fo(a,n),l&128&&e.normalize(a)):n&&(a.shapeFlag|=$e(n)?8:16),Jn>0&&!i&&nt&&(a.patchFlag>0||l&6)&&a.patchFlag!==32&&nt.push(a),a}const Se=Nu;function Nu(e,t=null,n=null,s=0,o=null,l=!1){if((!e||e===ou)&&(e=Jt),ks(e)){const r=yn(e,t,!0);return n&&Fo(r,n),Jn>0&&!l&&nt&&(r.shapeFlag&6?nt[nt.indexOf(e)]=r:nt.push(r)),r.patchFlag=-2,r}if(Ku(e)&&(e=e.__vccOpts),t){t=$u(t);let{class:r,style:a}=t;r&&!$e(r)&&(t.class=He(r)),xe(a)&&(Is(a)&&!ee(a)&&(a=Be({},a)),t.style=Ro(a))}const i=$e(e)?1:or(e)?128:Ga(e)?64:xe(e)?4:re(e)?2:0;return u(e,t,n,s,o,i,l,!0)}function $u(e){return e?Is(e)||zi(e)?Be({},e):e:null}function yn(e,t,n=!1,s=!1){const{props:o,ref:l,patchFlag:i,children:r,transition:a}=e,p=t?Mu(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&rr(p),ref:t&&t.ref?n&&l?ee(l)?l.concat(hs(t)):[l,hs(t)]:hs(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==K?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&yn(e.ssContent),ssFallback:e.ssFallback&&yn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Vo(d,a.clone(d)),d}function he(e=" ",t=0){return Se(Ls,null,e,t)}function me(e="",t=!1){return t?(k(),ir(Jt,null,e)):Se(Jt,null,e)}function kt(e){return e==null||typeof e=="boolean"?Se(Jt):ee(e)?Se(K,null,e.slice()):ks(e)?Rt(e):Se(Ls,null,String(e))}function Rt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:yn(e)}function Fo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ee(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Fo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!zi(t)?t._ctx=tt:o===3&&tt&&(tt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else re(t)?(t={default:t,_ctx:tt},n=32):(t=String(t),s&64?(n=16,t=[he(t)]):n=8);e.children=t,e.shapeFlag|=n}function Mu(...e){const t={};for(let n=0;nWe||tt;let ws,_o;{const e=Os(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),l=>{o.length>1?o.forEach(i=>i(l)):o[0](l)}};ws=t("__VUE_INSTANCE_SETTERS__",n=>We=n),_o=t("__VUE_SSR_SETTERS__",n=>zn=n)}const ts=e=>{const t=We;return ws(e),e.scope.on(),()=>{e.scope.off(),ws(t)}},yl=()=>{We&&We.scope.off(),ws(null)};function ur(e){return e.vnode.shapeFlag&4}let zn=!1;function Uu(e,t=!1,n=!1){t&&_o(t);const{props:s,children:o}=e.vnode,l=ur(e);ku(e,s,l,t),Eu(e,o,n||t);const i=l?ju(e,t):void 0;return t&&_o(!1),i}function ju(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,iu);const{setup:s}=n;if(s){$t();const o=e.setupContext=s.length>1?Hu(e):null,l=ts(e),i=Zn(s,e,0,[e.props,o]),r=oi(i);if(Mt(),l(),(r||e.sp)&&!jn(e)&&Ui(e),r){if(i.then(yl,yl),t)return i.then(a=>{bl(e,a)}).catch(a=>{Ns(a,e,0)});e.asyncDep=i}else bl(e,i)}else cr(e)}function bl(e,t,n){re(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=Oi(t)),cr(e)}function cr(e,t,n){const s=e.type;e.render||(e.render=s.render||xt);{const o=ts(e);$t();try{ru(e)}finally{Mt(),o()}}}const Fu={get(e,t){return Ge(e,"get",""),e[t]}};function Hu(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Fu),slots:e.slots,emit:e.emit,expose:t}}function Vs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Oi(Do(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Fn)return Fn[n](e)},has(t,n){return n in t||n in Fn}})):e.proxy}function Bu(e,t=!0){return re(e)?e.displayName||e.name:e.name||t&&e.__name}function Ku(e){return re(e)&&"__vccOpts"in e}const fe=(e,t)=>$a(e,t,zn);function fr(e,t,n){try{bs(-1);const s=arguments.length;return s===2?xe(t)&&!ee(t)?ks(t)?Se(e,null,[t]):Se(e,t):Se(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&ks(n)&&(n=[n]),Se(e,t,n))}finally{bs(1)}}const Gu="3.5.35";/**
-* @vue/runtime-dom v3.5.35
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/let yo;const kl=typeof window<"u"&&window.trustedTypes;if(kl)try{yo=kl.createPolicy("vue",{createHTML:e=>e})}catch{}const dr=yo?e=>yo.createHTML(e):e=>e,Wu="http://www.w3.org/2000/svg",qu="http://www.w3.org/1998/Math/MathML",At=typeof document<"u"?document:null,wl=At&&At.createElement("template"),Ju={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?At.createElementNS(Wu,e):t==="mathml"?At.createElementNS(qu,e):n?At.createElement(e,{is:n}):At.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>At.createTextNode(e),createComment:e=>At.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>At.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,l){const i=n?n.previousSibling:t.lastChild;if(o&&(o===l||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===l||!(o=o.nextSibling)););else{wl.innerHTML=dr(s==="svg"?``:s==="mathml"?``:e);const r=wl.content;if(s==="svg"||s==="mathml"){const a=r.firstChild;for(;a.firstChild;)r.appendChild(a.firstChild);r.removeChild(a)}t.insertBefore(r,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},zu=Symbol("_vtc");function Yu(e,t,n){const s=e[zu];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const xl=Symbol("_vod"),Qu=Symbol("_vsh"),Xu=Symbol(""),Zu=/(?:^|;)\s*display\s*:/;function ec(e,t,n){const s=e.style,o=$e(n);let l=!1;if(n&&!o){if(t)if($e(t))for(const i of t.split(";")){const r=i.slice(0,i.indexOf(":")).trim();n[r]==null&&$n(s,r,"")}else for(const i in t)n[i]==null&&$n(s,i,"");for(const i in n){i==="display"&&(l=!0);const r=n[i];r!=null?nc(e,i,!$e(t)&&t?t[i]:void 0,r)||$n(s,i,r):$n(s,i,"")}}else if(o){if(t!==n){const i=s[Xu];i&&(n+=";"+i),s.cssText=n,l=Zu.test(n)}}else t&&e.removeAttribute("style");xl in e&&(e[xl]=l?s.display:"",e[Qu]&&(s.display="none"))}const Cl=/\s*!important$/;function $n(e,t,n){if(ee(n))n.forEach(s=>$n(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=tc(e,t);Cl.test(n)?e.setProperty(Yt(s),n.replace(Cl,""),"important"):e[s]=n}}const El=["Webkit","Moz","ms"],no={};function tc(e,t){const n=no[t];if(n)return n;let s=Ye(t);if(s!=="filter"&&s in e)return no[t]=s;s=Rs(s);for(let o=0;oso||(ic.then(()=>so=0),so=Date.now());function ac(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(ee(o)){const l=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{l.call(s),s._stopped=!0};const i=o.slice(),r=[s];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,uc=(e,t,n,s,o,l)=>{const i=o==="svg";t==="class"?Yu(e,s,i):t==="style"?ec(e,n,s):Cs(t)?Es(t)||oc(e,t,n,s,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):cc(e,t,s,i))?(Rl(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Al(e,t,s,i,l,t!=="value")):e._isVueCE&&(fc(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(s)))?Rl(e,Ye(t),s,l,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Al(e,t,s,i))};function cc(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Pl(t)&&re(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Pl(t)&&$e(n)?!1:t in e}function fc(e,t){const n=e._def.props;if(!n)return!1;const s=Ye(t);return Array.isArray(n)?n.some(o=>Ye(o)===s):Object.keys(n).some(o=>Ye(o)===s)}const zt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ee(t)?n=>cs(t,n):t};function dc(e){e.target.composing=!0}function Il(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const at=Symbol("_assign");function Nl(e,t,n){return t&&(e=e.trim()),n&&(e=Ts(e)),e}const Te={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[at]=zt(o);const l=s||o.props&&o.props.type==="number";Pt(e,t?"change":"input",i=>{i.target.composing||e[at](Nl(e.value,n,l))}),(n||l)&&Pt(e,"change",()=>{e.value=Nl(e.value,n,l)}),t||(Pt(e,"compositionstart",dc),Pt(e,"compositionend",Il),Pt(e,"change",Il))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:l}},i){if(e[at]=zt(i),e.composing)return;const r=(l||e.type==="number")&&!/^0\d/.test(e.value)?Ts(e.value):e.value,a=t??"";if(r===a)return;const p=e.getRootNode();(p instanceof Document||p instanceof ShadowRoot)&&p.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},us={deep:!0,created(e,t,n){e[at]=zt(n),Pt(e,"change",()=>{const s=e._modelValue,o=bn(e),l=e.checked,i=e[at];if(ee(s)){const r=To(s,o),a=r!==-1;if(l&&!a)i(s.concat(o));else if(!l&&a){const p=[...s];p.splice(r,1),i(p)}}else if(xn(s)){const r=new Set(s);l?r.add(o):r.delete(o),i(r)}else i(hr(e,l))})},mounted:$l,beforeUpdate(e,t,n){e[at]=zt(n),$l(e,t,n)}};function $l(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(ee(t))o=To(t,s.props.value)>-1;else if(xn(t))o=t.has(s.props.value);else{if(t===n)return;o=qt(t,hr(e,!0))}e.checked!==o&&(e.checked=o)}const Ml={created(e,{value:t},n){e.checked=qt(t,n.props.value),e[at]=zt(n),Pt(e,"change",()=>{e[at](bn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[at]=zt(s),t!==n&&(e.checked=qt(t,s.props.value))}},Dl={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=xn(t);Pt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?Ts(bn(i)):bn(i));e[at](e.multiple?o?new Set(l):l:l[0]),e._assigning=!0,Nt(()=>{e._assigning=!1})}),e[at]=zt(s)},mounted(e,{value:t}){Ll(e,t)},beforeUpdate(e,t,n){e[at]=zt(n)},updated(e,{value:t}){e._assigning||Ll(e,t)}};function Ll(e,t){const n=e.multiple,s=ee(t);if(!(n&&!s&&!xn(t))){for(let o=0,l=e.options.length;oString(p)===String(r)):i.selected=To(t,r)>-1}else i.selected=t.has(r);else if(qt(bn(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function bn(e){return"_value"in e?e._value:e.value}function hr(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const hc=["ctrl","shift","alt","meta"],pc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>hc.some(n=>e[`${n}Key`]&&!t.includes(n))},nn=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...l)=>{for(let i=0;i{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const l=Yt(o.key);if(t.some(i=>i===l||mc[i]===l))return e(o)})},vc=Be({patchProp:uc},Ju);let Vl;function gc(){return Vl||(Vl=Au(vc))}const _c=(...e)=>{const t=gc().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=bc(s);if(!o)return;const l=t._component;!re(l)&&!l.render&&!l.template&&(l.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,yc(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function yc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function bc(e){return $e(e)?document.querySelector(e):e}/*!
- * pinia v2.3.1
- * (c) 2025 Eduardo San Martin Morote
- * @license MIT
- */let pr;const Us=e=>pr=e,mr=Symbol();function bo(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Bn;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Bn||(Bn={}));function kc(){const e=di(!0),t=e.run(()=>W({}));let n=[],s=[];const o=Do({install(l){Us(o),o._a=l,l.provide(mr,o),l.config.globalProperties.$pinia=o,s.forEach(i=>n.push(i)),s=[]},use(l){return this._a?n.push(l):s.push(l),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const vr=()=>{};function Ul(e,t,n,s=vr){e.push(t);const o=()=>{const l=e.indexOf(t);l>-1&&(e.splice(l,1),s())};return!n&&hi()&&aa(o),o}function fn(e,...t){e.slice().forEach(n=>{n(...t)})}const wc=e=>e(),jl=Symbol(),oo=Symbol();function ko(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],o=e[n];bo(o)&&bo(s)&&e.hasOwnProperty(n)&&!Me(s)&&!It(s)?e[n]=ko(o,s):e[n]=s}return e}const xc=Symbol();function Cc(e){return!bo(e)||!e.hasOwnProperty(xc)}const{assign:Bt}=Object;function Ec(e){return!!(Me(e)&&e.effect)}function Sc(e,t,n,s){const{state:o,actions:l,getters:i}=t,r=n.state.value[e];let a;function p(){r||(n.state.value[e]=o?o():{});const d=Oa(n.state.value[e]);return Bt(d,l,Object.keys(i||{}).reduce((f,_)=>(f[_]=Do(fe(()=>{Us(n);const b=n._s.get(e);return i[_].call(b,b)})),f),{}))}return a=gr(e,p,t,n,s,!0),a}function gr(e,t,n={},s,o,l){let i;const r=Bt({actions:{}},n),a={deep:!0};let p,d,f=[],_=[],b;const P=s.state.value[e];!l&&!P&&(s.state.value[e]={});let I;function B(oe){let le;p=d=!1,typeof oe=="function"?(oe(s.state.value[e]),le={type:Bn.patchFunction,storeId:e,events:b}):(ko(s.state.value[e],oe),le={type:Bn.patchObject,payload:oe,storeId:e,events:b});const J=I=Symbol();Nt().then(()=>{I===J&&(p=!0)}),d=!0,fn(f,le,s.state.value[e])}const Q=l?function(){const{state:le}=n,J=le?le():{};this.$patch(A=>{Bt(A,J)})}:vr;function M(){i.stop(),f=[],_=[],s._s.delete(e)}const z=(oe,le="")=>{if(jl in oe)return oe[oo]=le,oe;const J=function(){Us(s);const A=Array.from(arguments),j=[],O=[];function ve(te){j.push(te)}function Oe(te){O.push(te)}fn(_,{args:A,name:J[oo],store:se,after:ve,onError:Oe});let Ce;try{Ce=oe.apply(this&&this.$id===e?this:se,A)}catch(te){throw fn(O,te),te}return Ce instanceof Promise?Ce.then(te=>(fn(j,te),te)).catch(te=>(fn(O,te),Promise.reject(te))):(fn(j,Ce),Ce)};return J[jl]=!0,J[oo]=le,J},q={_p:s,$id:e,$onAction:Ul.bind(null,_),$patch:B,$reset:Q,$subscribe(oe,le={}){const J=Ul(f,oe,le.detached,()=>A()),A=i.run(()=>Vn(()=>s.state.value[e],j=>{(le.flush==="sync"?d:p)&&oe({storeId:e,type:Bn.direct,events:b},j)},Bt({},a,le)));return J},$dispose:M},se=Xn(q);s._s.set(e,se);const pe=(s._a&&s._a.runWithContext||wc)(()=>s._e.run(()=>(i=di()).run(()=>t({action:z}))));for(const oe in pe){const le=pe[oe];if(Me(le)&&!Ec(le)||It(le))l||(P&&Cc(le)&&(Me(le)?le.value=P[oe]:ko(le,P[oe])),s.state.value[e][oe]=le);else if(typeof le=="function"){const J=z(le,oe);pe[oe]=J,r.actions[oe]=le}}return Bt(se,pe),Bt(_e(se),pe),Object.defineProperty(se,"$state",{get:()=>s.state.value[e],set:oe=>{B(le=>{Bt(le,oe)})}}),s._p.forEach(oe=>{Bt(se,i.run(()=>oe({store:se,app:s._a,pinia:s,options:r})))}),P&&l&&n.hydrate&&n.hydrate(se.$state,P),p=!0,d=!0,se}/*! #__NO_SIDE_EFFECTS__ */function Ac(e,t,n){let s,o;const l=typeof t=="function";s=e,o=l?n:t;function i(r,a){const p=ja();return r=r||(p?rt(mr,null):null),r&&Us(r),r=pr,r._s.has(s)||(l?gr(s,t,o,r):Sc(s,o,r)),r._s.get(s)}return i.$id=s,i}/*!
- * vue-router v4.6.4
- * (c) 2025 Eduardo San Martin Morote
- * @license MIT
- */const hn=typeof document<"u";function _r(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Rc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&_r(e.default)}const ke=Object.assign;function lo(e,t){const n={};for(const s in t){const o=t[s];n[s]=gt(o)?o.map(e):e(o)}return n}const Kn=()=>{},gt=Array.isArray;function Fl(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const yr=/#/g,Tc=/&/g,Oc=/\//g,Pc=/=/g,Ic=/\?/g,br=/\+/g,Nc=/%5B/g,$c=/%5D/g,kr=/%5E/g,Mc=/%60/g,wr=/%7B/g,Dc=/%7C/g,xr=/%7D/g,Lc=/%20/g;function Ho(e){return e==null?"":encodeURI(""+e).replace(Dc,"|").replace(Nc,"[").replace($c,"]")}function Vc(e){return Ho(e).replace(wr,"{").replace(xr,"}").replace(kr,"^")}function wo(e){return Ho(e).replace(br,"%2B").replace(Lc,"+").replace(yr,"%23").replace(Tc,"%26").replace(Mc,"`").replace(wr,"{").replace(xr,"}").replace(kr,"^")}function Uc(e){return wo(e).replace(Pc,"%3D")}function jc(e){return Ho(e).replace(yr,"%23").replace(Ic,"%3F")}function Fc(e){return jc(e).replace(Oc,"%2F")}function Yn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Hc=/\/$/,Bc=e=>e.replace(Hc,"");function io(e,t,n="/"){let s,o={},l="",i="";const r=t.indexOf("#");let a=t.indexOf("?");return a=r>=0&&a>r?-1:a,a>=0&&(s=t.slice(0,a),l=t.slice(a,r>0?r:t.length),o=e(l.slice(1))),r>=0&&(s=s||t.slice(0,r),i=t.slice(r,t.length)),s=qc(s??t,n),{fullPath:s+l+i,path:s,query:o,hash:Yn(i)}}function Kc(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Hl(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Gc(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&kn(t.matched[s],n.matched[o])&&Cr(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function kn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Cr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Wc(e[n],t[n]))return!1;return!0}function Wc(e,t){return gt(e)?Bl(e,t):gt(t)?Bl(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Bl(e,t){return gt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function qc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),o=s[s.length-1];(o===".."||o===".")&&s.push("");let l=n.length-1,i,r;for(i=0;i1&&l--;else break;return n.slice(0,l).join("/")+"/"+s.slice(i).join("/")}const Ft={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let xo=function(e){return e.pop="pop",e.push="push",e}({}),ro=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function Jc(e){if(!e)if(hn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Bc(e)}const zc=/^[^#]+#/;function Yc(e,t){return e.replace(zc,"#")+t}function Qc(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const js=()=>({left:window.scrollX,top:window.scrollY});function Xc(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Qc(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Kl(e,t){return(history.state?history.state.position-t:-1)+e}const Co=new Map;function Zc(e,t){Co.set(e,t)}function ef(e){const t=Co.get(e);return Co.delete(e),t}function tf(e){return typeof e=="string"||e&&typeof e=="object"}function Er(e){return typeof e=="string"||typeof e=="symbol"}let Ne=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const Sr=Symbol("");Ne.MATCHER_NOT_FOUND+"",Ne.NAVIGATION_GUARD_REDIRECT+"",Ne.NAVIGATION_ABORTED+"",Ne.NAVIGATION_CANCELLED+"",Ne.NAVIGATION_DUPLICATED+"";function wn(e,t){return ke(new Error,{type:e,[Sr]:!0},t)}function St(e,t){return e instanceof Error&&Sr in e&&(t==null||!!(e.type&t))}const nf=["params","query","hash"];function sf(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of nf)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function of(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;so&&wo(o)):[s&&wo(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function lf(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=gt(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const rf=Symbol(""),Wl=Symbol(""),Fs=Symbol(""),Bo=Symbol(""),Eo=Symbol("");function In(){let e=[];function t(s){return e.push(s),()=>{const o=e.indexOf(s);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Gt(e,t,n,s,o,l=i=>i()){const i=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((r,a)=>{const p=_=>{_===!1?a(wn(Ne.NAVIGATION_ABORTED,{from:n,to:t})):_ instanceof Error?a(_):tf(_)?a(wn(Ne.NAVIGATION_GUARD_REDIRECT,{from:t,to:_})):(i&&s.enterCallbacks[o]===i&&typeof _=="function"&&i.push(_),r())},d=l(()=>e.call(s&&s.instances[o],t,n,p));let f=Promise.resolve(d);e.length<3&&(f=f.then(p)),f.catch(_=>a(_))})}function ao(e,t,n,s,o=l=>l()){const l=[];for(const i of e)for(const r in i.components){let a=i.components[r];if(!(t!=="beforeRouteEnter"&&!i.instances[r]))if(_r(a)){const p=(a.__vccOpts||a)[t];p&&l.push(Gt(p,n,s,i,r,o))}else{let p=a();l.push(()=>p.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${r}" at "${i.path}"`);const f=Rc(d)?d.default:d;i.mods[r]=d,i.components[r]=f;const _=(f.__vccOpts||f)[t];return _&&Gt(_,n,s,i,r,o)()}))}}return l}function af(e,t){const n=[],s=[],o=[],l=Math.max(t.matched.length,e.matched.length);for(let i=0;ikn(p,r))?s.push(r):n.push(r));const a=e.matched[i];a&&(t.matched.find(p=>kn(p,a))||o.push(a))}return[n,s,o]}/*!
- * vue-router v4.6.4
- * (c) 2025 Eduardo San Martin Morote
- * @license MIT
- */let uf=()=>location.protocol+"//"+location.host;function Ar(e,t){const{pathname:n,search:s,hash:o}=t,l=e.indexOf("#");if(l>-1){let i=o.includes(e.slice(l))?e.slice(l).length:1,r=o.slice(i);return r[0]!=="/"&&(r="/"+r),Hl(r,"")}return Hl(n,e)+s+o}function cf(e,t,n,s){let o=[],l=[],i=null;const r=({state:_})=>{const b=Ar(e,location),P=n.value,I=t.value;let B=0;if(_){if(n.value=b,t.value=_,i&&i===P){i=null;return}B=I?_.position-I.position:0}else s(b);o.forEach(Q=>{Q(n.value,P,{delta:B,type:xo.pop,direction:B?B>0?ro.forward:ro.back:ro.unknown})})};function a(){i=n.value}function p(_){o.push(_);const b=()=>{const P=o.indexOf(_);P>-1&&o.splice(P,1)};return l.push(b),b}function d(){if(document.visibilityState==="hidden"){const{history:_}=window;if(!_.state)return;_.replaceState(ke({},_.state,{scroll:js()}),"")}}function f(){for(const _ of l)_();l=[],window.removeEventListener("popstate",r),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",r),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:a,listen:p,destroy:f}}function ql(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?js():null}}function ff(e){const{history:t,location:n}=window,s={value:Ar(e,n)},o={value:t.state};o.value||l(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(a,p,d){const f=e.indexOf("#"),_=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+a:uf()+e+a;try{t[d?"replaceState":"pushState"](p,"",_),o.value=p}catch(b){console.error(b),n[d?"replace":"assign"](_)}}function i(a,p){l(a,ke({},t.state,ql(o.value.back,a,o.value.forward,!0),p,{position:o.value.position}),!0),s.value=a}function r(a,p){const d=ke({},o.value,t.state,{forward:a,scroll:js()});l(d.current,d,!0),l(a,ke({},ql(s.value,a,null),{position:d.position+1},p),!1),s.value=a}return{location:s,state:o,push:r,replace:i}}function df(e){e=Jc(e);const t=ff(e),n=cf(e,t.state,t.location,t.replace);function s(l,i=!0){i||n.pauseListeners(),history.go(l)}const o=ke({location:"",base:e,go:s,createHref:Yc.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function hf(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),df(e)}let sn=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Le=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Le||{});const pf={type:sn.Static,value:""},mf=/[a-zA-Z0-9_]/;function vf(e){if(!e)return[[]];if(e==="/")return[[pf]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${p}": ${b}`)}let n=Le.Static,s=n;const o=[];let l;function i(){l&&o.push(l),l=[]}let r=0,a,p="",d="";function f(){p&&(n===Le.Static?l.push({type:sn.Static,value:p}):n===Le.Param||n===Le.ParamRegExp||n===Le.ParamRegExpEnd?(l.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${p}) must be alone in its segment. eg: '/:ids+.`),l.push({type:sn.Param,value:p,regexp:d,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),p="")}function _(){p+=a}for(;rt.length?t.length===1&&t[0]===Je.Static+Je.Segment?1:-1:0}function Rr(e,t){let n=0;const s=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const kf={strict:!1,end:!0,sensitive:!1};function wf(e,t,n){const s=yf(vf(e.path),n),o=ke(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function xf(e,t){const n=[],s=new Map;t=Fl(kf,t);function o(f){return s.get(f)}function l(f,_,b){const P=!b,I=Ql(f);I.aliasOf=b&&b.record;const B=Fl(t,f),Q=[I];if("alias"in f){const q=typeof f.alias=="string"?[f.alias]:f.alias;for(const se of q)Q.push(Ql(ke({},I,{components:b?b.record.components:I.components,path:se,aliasOf:b?b.record:I})))}let M,z;for(const q of Q){const{path:se}=q;if(_&&se[0]!=="/"){const Re=_.record.path,pe=Re[Re.length-1]==="/"?"":"/";q.path=_.record.path+(se&&pe+se)}if(M=wf(q,_,B),b?b.alias.push(M):(z=z||M,z!==M&&z.alias.push(M),P&&f.name&&!Xl(M)&&i(f.name)),Tr(M)&&a(M),I.children){const Re=I.children;for(let pe=0;pe{i(z)}:Kn}function i(f){if(Er(f)){const _=s.get(f);_&&(s.delete(f),n.splice(n.indexOf(_),1),_.children.forEach(i),_.alias.forEach(i))}else{const _=n.indexOf(f);_>-1&&(n.splice(_,1),f.record.name&&s.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function r(){return n}function a(f){const _=Sf(f,n);n.splice(_,0,f),f.record.name&&!Xl(f)&&s.set(f.record.name,f)}function p(f,_){let b,P={},I,B;if("name"in f&&f.name){if(b=s.get(f.name),!b)throw wn(Ne.MATCHER_NOT_FOUND,{location:f});B=b.record.name,P=ke(Yl(_.params,b.keys.filter(z=>!z.optional).concat(b.parent?b.parent.keys.filter(z=>z.optional):[]).map(z=>z.name)),f.params&&Yl(f.params,b.keys.map(z=>z.name))),I=b.stringify(P)}else if(f.path!=null)I=f.path,b=n.find(z=>z.re.test(I)),b&&(P=b.parse(I),B=b.record.name);else{if(b=_.name?s.get(_.name):n.find(z=>z.re.test(_.path)),!b)throw wn(Ne.MATCHER_NOT_FOUND,{location:f,currentLocation:_});B=b.record.name,P=ke({},_.params,f.params),I=b.stringify(P)}const Q=[];let M=b;for(;M;)Q.unshift(M.record),M=M.parent;return{name:B,path:I,params:P,matched:Q,meta:Ef(Q)}}e.forEach(f=>l(f));function d(){n.length=0,s.clear()}return{addRoute:l,resolve:p,removeRoute:i,clearRoutes:d,getRoutes:r,getRecordMatcher:o}}function Yl(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Ql(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Cf(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Cf(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Xl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ef(e){return e.reduce((t,n)=>ke(t,n.meta),{})}function Sf(e,t){let n=0,s=t.length;for(;n!==s;){const l=n+s>>1;Rr(e,t[l])<0?s=l:n=l+1}const o=Af(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function Af(e){let t=e;for(;t=t.parent;)if(Tr(t)&&Rr(e,t)===0)return t}function Tr({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Zl(e){const t=rt(Fs),n=rt(Bo),s=fe(()=>{const a=pt(e.to);return t.resolve(a)}),o=fe(()=>{const{matched:a}=s.value,{length:p}=a,d=a[p-1],f=n.matched;if(!d||!f.length)return-1;const _=f.findIndex(kn.bind(null,d));if(_>-1)return _;const b=ei(a[p-2]);return p>1&&ei(d)===b&&f[f.length-1].path!==b?f.findIndex(kn.bind(null,a[p-2])):_}),l=fe(()=>o.value>-1&&If(n.params,s.value.params)),i=fe(()=>o.value>-1&&o.value===n.matched.length-1&&Cr(n.params,s.value.params));function r(a={}){if(Pf(a)){const p=t[pt(e.replace)?"replace":"push"](pt(e.to)).catch(Kn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>p),p}return Promise.resolve()}return{route:s,href:fe(()=>s.value.href),isActive:l,isExactActive:i,navigate:r}}function Rf(e){return e.length===1?e[0]:e}const Tf=Vi({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Zl,setup(e,{slots:t}){const n=Xn(Zl(e)),{options:s}=rt(Fs),o=fe(()=>({[ti(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[ti(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&Rf(t.default(n));return e.custom?l:fr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},l)}}}),Of=Tf;function Pf(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function If(e,t){for(const n in t){const s=t[n],o=e[n];if(typeof s=="string"){if(s!==o)return!1}else if(!gt(o)||o.length!==s.length||s.some((l,i)=>l.valueOf()!==o[i].valueOf()))return!1}return!0}function ei(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ti=(e,t,n)=>e??t??n,Nf=Vi({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=rt(Eo),o=fe(()=>e.route||s.value),l=rt(Wl,0),i=fe(()=>{let p=pt(l);const{matched:d}=o.value;let f;for(;(f=d[p])&&!f.components;)p++;return p}),r=fe(()=>o.value.matched[i.value]);ds(Wl,fe(()=>i.value+1)),ds(rf,r),ds(Eo,o);const a=W();return Vn(()=>[a.value,r.value,e.name],([p,d,f],[_,b,P])=>{d&&(d.instances[f]=p,b&&b!==d&&p&&p===_&&(d.leaveGuards.size||(d.leaveGuards=b.leaveGuards),d.updateGuards.size||(d.updateGuards=b.updateGuards))),p&&d&&(!b||!kn(d,b)||!_)&&(d.enterCallbacks[f]||[]).forEach(I=>I(p))},{flush:"post"}),()=>{const p=o.value,d=e.name,f=r.value,_=f&&f.components[d];if(!_)return ni(n.default,{Component:_,route:p});const b=f.props[d],P=b?b===!0?p.params:typeof b=="function"?b(p):b:null,B=fr(_,ke({},P,t,{onVnodeUnmounted:Q=>{Q.component.isUnmounted&&(f.instances[d]=null)},ref:a}));return ni(n.default,{Component:B,route:p})||B}}});function ni(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const $f=Nf;function Mf(e){const t=xf(e.routes,e),n=e.parseQuery||of,s=e.stringifyQuery||Gl,o=e.history,l=In(),i=In(),r=In(),a=Aa(Ft);let p=Ft;hn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=lo.bind(null,C=>""+C),f=lo.bind(null,Fc),_=lo.bind(null,Yn);function b(C,G){let F,V;return Er(C)?(F=t.getRecordMatcher(C),V=G):V=C,t.addRoute(V,F)}function P(C){const G=t.getRecordMatcher(C);G&&t.removeRoute(G)}function I(){return t.getRoutes().map(C=>C.record)}function B(C){return!!t.getRecordMatcher(C)}function Q(C,G){if(G=ke({},G||a.value),typeof C=="string"){const y=io(n,C,G.path),x=t.resolve({path:y.path},G),R=o.createHref(y.fullPath);return ke(y,x,{params:_(x.params),hash:Yn(y.hash),redirectedFrom:void 0,href:R})}let F;if(C.path!=null)F=ke({},C,{path:io(n,C.path,G.path).path});else{const y=ke({},C.params);for(const x in y)y[x]==null&&delete y[x];F=ke({},C,{params:f(y)}),G.params=f(G.params)}const V=t.resolve(F,G),ce=C.hash||"";V.params=d(_(V.params));const m=Kc(s,ke({},C,{hash:Vc(ce),path:V.path})),g=o.createHref(m);return ke({fullPath:m,hash:ce,query:s===Gl?lf(C.query):C.query||{}},V,{redirectedFrom:void 0,href:g})}function M(C){return typeof C=="string"?io(n,C,a.value.path):ke({},C)}function z(C,G){if(p!==C)return wn(Ne.NAVIGATION_CANCELLED,{from:G,to:C})}function q(C){return pe(C)}function se(C){return q(ke(M(C),{replace:!0}))}function Re(C,G){const F=C.matched[C.matched.length-1];if(F&&F.redirect){const{redirect:V}=F;let ce=typeof V=="function"?V(C,G):V;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=M(ce):{path:ce},ce.params={}),ke({query:C.query,hash:C.hash,params:ce.path!=null?{}:C.params},ce)}}function pe(C,G){const F=p=Q(C),V=a.value,ce=C.state,m=C.force,g=C.replace===!0,y=Re(F,V);if(y)return pe(ke(M(y),{state:typeof y=="object"?ke({},ce,y.state):ce,force:m,replace:g}),G||F);const x=F;x.redirectedFrom=G;let R;return!m&&Gc(s,V,F)&&(R=wn(Ne.NAVIGATION_DUPLICATED,{to:x,from:V}),Qe(V,V,!0,!1)),(R?Promise.resolve(R):J(x,V)).catch(E=>St(E)?St(E,Ne.NAVIGATION_GUARD_REDIRECT)?E:ot(E):de(E,x,V)).then(E=>{if(E){if(St(E,Ne.NAVIGATION_GUARD_REDIRECT))return pe(ke({replace:g},M(E.to),{state:typeof E.to=="object"?ke({},ce,E.to.state):ce,force:m}),G||x)}else E=j(x,V,!0,g,ce);return A(x,V,E),E})}function oe(C,G){const F=z(C,G);return F?Promise.reject(F):Promise.resolve()}function le(C){const G=ft.values().next().value;return G&&typeof G.runWithContext=="function"?G.runWithContext(C):C()}function J(C,G){let F;const[V,ce,m]=af(C,G);F=ao(V.reverse(),"beforeRouteLeave",C,G);for(const y of V)y.leaveGuards.forEach(x=>{F.push(Gt(x,C,G))});const g=oe.bind(null,C,G);return F.push(g),Ue(F).then(()=>{F=[];for(const y of l.list())F.push(Gt(y,C,G));return F.push(g),Ue(F)}).then(()=>{F=ao(ce,"beforeRouteUpdate",C,G);for(const y of ce)y.updateGuards.forEach(x=>{F.push(Gt(x,C,G))});return F.push(g),Ue(F)}).then(()=>{F=[];for(const y of m)if(y.beforeEnter)if(gt(y.beforeEnter))for(const x of y.beforeEnter)F.push(Gt(x,C,G));else F.push(Gt(y.beforeEnter,C,G));return F.push(g),Ue(F)}).then(()=>(C.matched.forEach(y=>y.enterCallbacks={}),F=ao(m,"beforeRouteEnter",C,G,le),F.push(g),Ue(F))).then(()=>{F=[];for(const y of i.list())F.push(Gt(y,C,G));return F.push(g),Ue(F)}).catch(y=>St(y,Ne.NAVIGATION_CANCELLED)?y:Promise.reject(y))}function A(C,G,F){r.list().forEach(V=>le(()=>V(C,G,F)))}function j(C,G,F,V,ce){const m=z(C,G);if(m)return m;const g=G===Ft,y=hn?history.state:{};F&&(V||g?o.replace(C.fullPath,ke({scroll:g&&y&&y.scroll},ce)):o.push(C.fullPath,ce)),a.value=C,Qe(C,G,F,g),ot()}let O;function ve(){O||(O=o.listen((C,G,F)=>{if(!dt.listening)return;const V=Q(C),ce=Re(V,dt.currentRoute.value);if(ce){pe(ke(ce,{replace:!0,force:!0}),V).catch(Kn);return}p=V;const m=a.value;hn&&Zc(Kl(m.fullPath,F.delta),js()),J(V,m).catch(g=>St(g,Ne.NAVIGATION_ABORTED|Ne.NAVIGATION_CANCELLED)?g:St(g,Ne.NAVIGATION_GUARD_REDIRECT)?(pe(ke(M(g.to),{force:!0}),V).then(y=>{St(y,Ne.NAVIGATION_ABORTED|Ne.NAVIGATION_DUPLICATED)&&!F.delta&&F.type===xo.pop&&o.go(-1,!1)}).catch(Kn),Promise.reject()):(F.delta&&o.go(-F.delta,!1),de(g,V,m))).then(g=>{g=g||j(V,m,!1),g&&(F.delta&&!St(g,Ne.NAVIGATION_CANCELLED)?o.go(-F.delta,!1):F.type===xo.pop&&St(g,Ne.NAVIGATION_ABORTED|Ne.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),A(V,m,g)}).catch(Kn)}))}let Oe=In(),Ce=In(),te;function de(C,G,F){ot(C);const V=Ce.list();return V.length?V.forEach(ce=>ce(C,G,F)):console.error(C),Promise.reject(C)}function ct(){return te&&a.value!==Ft?Promise.resolve():new Promise((C,G)=>{Oe.add([C,G])})}function ot(C){return te||(te=!C,ve(),Oe.list().forEach(([G,F])=>C?F(C):G()),Oe.reset()),C}function Qe(C,G,F,V){const{scrollBehavior:ce}=e;if(!hn||!ce)return Promise.resolve();const m=!F&&ef(Kl(C.fullPath,0))||(V||!F)&&history.state&&history.state.scroll||null;return Nt().then(()=>ce(C,G,m)).then(g=>g&&Xc(g)).catch(g=>de(g,C,G))}const je=C=>o.go(C);let Ct;const ft=new Set,dt={currentRoute:a,listening:!0,addRoute:b,removeRoute:P,clearRoutes:t.clearRoutes,hasRoute:B,getRoutes:I,resolve:Q,options:e,push:q,replace:se,go:je,back:()=>je(-1),forward:()=>je(1),beforeEach:l.add,beforeResolve:i.add,afterEach:r.add,onError:Ce.add,isReady:ct,install(C){C.component("RouterLink",Of),C.component("RouterView",$f),C.config.globalProperties.$router=dt,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>pt(a)}),hn&&!Ct&&a.value===Ft&&(Ct=!0,q(o.location).catch(V=>{}));const G={};for(const V in Ft)Object.defineProperty(G,V,{get:()=>a.value[V],enumerable:!0});C.provide(Fs,dt),C.provide(Bo,Ri(G)),C.provide(Eo,a);const F=C.unmount;ft.add(C),C.unmount=function(){ft.delete(C),ft.size<1&&(p=Ft,O&&O(),O=null,a.value=Ft,Ct=!1,te=!1),F()}}};function Ue(C){return C.reduce((G,F)=>G.then(()=>le(F)),Promise.resolve())}return dt}function Or(){return rt(Fs)}function Df(e){return rt(Bo)}const ns=Ac("auth",{state:()=>({token:localStorage.getItem("mcbot_token")||"",identity:localStorage.getItem("mcbot_identity")||""}),actions:{set(e,t){this.token=e,this.identity=t||"",localStorage.setItem("mcbot_token",e),localStorage.setItem("mcbot_identity",this.identity)},clear(){this.token="",this.identity="",localStorage.removeItem("mcbot_token"),localStorage.removeItem("mcbot_identity")}}}),Lf={key:0,class:"nav"},Vf={class:"who"},Uf={__name:"App",setup(e){const t=ns(),n=Df(),s=Or(),o=fe(()=>n.path!=="/login");function l(){t.clear(),s.push("/login")}return(i,r)=>{const a=ul("router-link"),p=ul("router-view");return k(),w(K,null,[o.value?(k(),w("nav",Lf,[r[3]||(r[3]=u("span",{class:"brand"},"mcbot",-1)),Se(a,{to:"/messages"},{default:fs(()=>[...r[0]||(r[0]=[he("Messages",-1)])]),_:1}),Se(a,{to:"/packets"},{default:fs(()=>[...r[1]||(r[1]=[he("Packets",-1)])]),_:1}),Se(a,{to:"/manage"},{default:fs(()=>[...r[2]||(r[2]=[he("Manage",-1)])]),_:1}),r[4]||(r[4]=u("span",{class:"spacer"},null,-1)),u("span",Vf,S(pt(t).identity||"authenticated"),1),u("button",{onClick:l},"Log out")])):me("",!0),Se(p)],64)}}};async function ne(e,t={}){const n=ns(),s={...t.headers||{}};n.token&&(s.Authorization=`Bearer ${n.token}`),t.json!==void 0&&(s["Content-Type"]="application/json",t={...t,body:JSON.stringify(t.json)},delete t.json);const o=await fetch(`/api${e}`,{...t,headers:s});if(o.status===401)throw n.clear(),location.hash.startsWith("#/login")||(location.hash="#/login"),new Error("unauthorized");if(!o.ok){let l=o.statusText;try{l=(await o.json()).detail||l}catch{}throw new Error(l)}return o.json()}function Pr(e){const t=ns();return`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api${e}?token=${encodeURIComponent(t.token)}`}const jf={class:"login-wrap"},Ff={class:"login-card"},Hf={key:0,class:"err"},Bf=["disabled"],Kf={__name:"Login",setup(e){const t=ns(),n=Or(),s=W(""),o=W(""),l=W(""),i=W(""),r=W(!1);async function a(){i.value="",r.value=!0;try{const d=await ne("/login",{method:"POST",json:{username:s.value,password:o.value}});t.set(d.token,d.user?`user:${d.user}`:""),n.push("/")}catch(d){i.value=d.message||"login failed"}finally{r.value=!1}}async function p(){if(i.value="",!!l.value.trim()){t.set(l.value.trim(),"");try{const d=await ne("/me");t.set(l.value.trim(),d.identity),n.push("/")}catch{t.clear(),i.value="invalid token"}}}return(d,f)=>(k(),w("div",jf,[u("div",Ff,[f[3]||(f[3]=u("h2",null,"mcbot admin",-1)),i.value?(k(),w("div",Hf,S(i.value),1)):me("",!0),f[4]||(f[4]=u("label",null,"Username",-1)),ge(u("input",{"onUpdate:modelValue":f[0]||(f[0]=_=>s.value=_),onKeyup:gn(a,["enter"]),autofocus:""},null,544),[[Te,s.value]]),f[5]||(f[5]=u("label",null,"Password",-1)),ge(u("input",{"onUpdate:modelValue":f[1]||(f[1]=_=>o.value=_),type:"password",onKeyup:gn(a,["enter"])},null,544),[[Te,o.value]]),u("button",{disabled:r.value,onClick:a},"Log in",8,Bf),f[6]||(f[6]=u("label",{style:{"margin-top":"10px"}},"…or paste an API token",-1)),ge(u("input",{"onUpdate:modelValue":f[2]||(f[2]=_=>l.value=_),placeholder:"bearer token",onKeyup:gn(p,["enter"])},null,544),[[Te,l.value]]),u("button",{onClick:p},"Use token")])]))}};function Wt(e){return String(e).padStart(2,"0")}function Ir(e){if(!e)return"";const t=new Date(e*1e3);return`${Wt(t.getHours())}:${Wt(t.getMinutes())}:${Wt(t.getSeconds())}`}function xs(e){if(!e)return"";const t=new Date(e*1e3);return`${t.getFullYear()}-${Wt(t.getMonth()+1)}-${Wt(t.getDate())} ${Wt(t.getHours())}:${Wt(t.getMinutes())}:${Wt(t.getSeconds())}`}const Ko=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Gf=["aria-label"],Wf={class:"bubble"},qf={__name:"InfoTip",props:{text:{type:String,default:""}},setup(e){const t=W(!1);return(n,s)=>(k(),w("span",{class:He(["infotip",{pinned:t.value}]),tabindex:"0",role:"button","aria-label":e.text,onClick:s[0]||(s[0]=o=>t.value=!t.value),onKeydown:[s[1]||(s[1]=gn(nn(o=>t.value=!t.value,["prevent"]),["enter"])),s[2]||(s[2]=gn(nn(o=>t.value=!t.value,["prevent"]),["space"]))],onBlur:s[3]||(s[3]=o=>t.value=!1)},[s[4]||(s[4]=u("span",{class:"dot","aria-hidden":"true"},"i",-1)),u("span",Wf,S(e.text),1)],42,Gf))}},Ht=Ko(qf,[["__scopeId","data-v-48ca1073"]]),Jf={class:"panes"},zf={class:"pane",style:{flex:"0 0 170px"}},Yf={class:"body"},Qf=["onClick"],Xf={class:"pane",style:{flex:"1"}},Zf={key:0,class:"toolbar"},ed={key:0,class:"err"},td={key:1,class:"muted"},nd={class:"body"},sd={key:0,class:"decoded"},od={class:"kv"},ld={class:"mono"},id={class:"kv"},rd={class:"k"},ad={key:1},ud={class:"kv"},cd={class:"mono muted"},fd={class:"toolbar"},dd=["disabled"],hd=["disabled"],pd={class:"chk"},md={class:"toolbar"},vd={class:"chk"},gd=["value"],_d={class:"kv"},yd={key:0,class:"muted"},bd={class:"toolbar"},kd=["disabled"],wd=["disabled"],xd={class:"chk"},Cd={class:"toolbar"},Ed={class:"chk"},Sd={class:"chk"},Ad=["disabled"],Rd={class:"chk"},Td=["min","max","step","onUpdate:modelValue"],Od=["onClick"],Pd={style:{"border-top":"1px solid var(--border, #333)"}},Id={class:"toolbar"},Nd=["disabled"],$d={key:0,class:"decoded"},Md={class:"kv"},Dd={class:"muted"},Ld={class:"mono"},Vd={class:"toolbar"},Ud={class:"chk"},jd={class:"chk"},Fd=["disabled"],Hd={class:"decoded"},Bd={style:{margin:"12px 0 4px"}},Kd={class:"kv"},Gd={class:"k"},Wd={class:"kv"},qd={class:"k mono"},Jd={key:2},zd={class:"toolbar"},Yd={class:"mono muted"},Qd=["onClick"],Xd={key:3},Zd={class:"toolbar"},eh={id:"newUserContacts"},th=["value"],nh=["value"],sh=["disabled"],oh={class:"mono muted"},lh=["onChange"],ih=["value"],rh={class:"chips"},ah=["onClick"],uh={style:{"white-space":"normal"}},ch=["onClick"],fh=["onClick"],dh=["onClick"],hh={key:4},ph={class:"toolbar"},mh={key:0,class:"muted"},vh={key:0,class:"muted"},gh=["checked","disabled","onChange"],_h=["onChange"],yh=["value"],bh={class:"chips"},kh=["onClick"],wh=["disabled","onClick"],xh={key:5},Ch={class:"chk"},Eh=["min","max","step","onUpdate:modelValue"],Sh=["onClick"],Ah=["checked","onChange"],Rh=["checked","onChange"],Th=["checked","onChange"],Oh=["value","onChange"],Ph=["onChange"],Ih=["value"],Nh={class:"chips"},$h={key:0,class:"muted"},Mh=["onClick"],Dh={key:6,class:"contacts-split"},Lh={class:"pane",style:{flex:"1.6","min-width":"0"}},Vh={class:"toolbar"},Uh={class:"chk"},jh=["checked"],Fh=["checked","onChange"],Hh=["disabled"],Bh={class:"muted"},Kh={key:0},Gh={key:0},Wh={key:0},qh={key:0},Jh={key:0},zh={key:0},Yh=["data-pk","onClick"],Qh=["checked","onChange"],Xh=["title"],Zh={class:"pane contact-detail"},ep={class:"body"},tp={key:0,class:"empty"},np={key:1,class:"decoded"},sp={class:"kv"},op={class:"k"},lp={key:7,class:"db-console"},ip={class:"db-editor"},rp={class:"toolbar"},ap=["disabled"],up=["disabled"],cp={class:"muted"},fp={key:0,class:"db-picker"},dp={class:"toolbar"},hp={class:"db-picker-list"},pp={key:0,class:"empty"},mp={key:1},vp=["onClick"],gp={style:{width:"20%"}},_p={class:"mono muted"},yp={key:0,style:{width:"1%"}},bp=["onClick"],kp={class:"db-results"},wp={key:0,class:"err",style:{padding:"8px 12px"}},xp={key:1},Cp=["title"],Ep={key:2,class:"empty"},Sp={key:3,class:"empty"},Ap={key:8},Rp=["title"],Tp={key:9,class:"empty"},Op={__name:"Manage",setup(e){const t=[{key:"stats",label:"Overview"},{key:"radio",label:"Radio"},{key:"contacts",label:"Contacts"},{key:"channels",label:"Channels"},{key:"users",label:"Users"},{key:"groups",label:"Groups"},{key:"command-config",label:"Commands"},{key:"audit",label:"Audit log"},{key:"database",label:"Database"}],n=W("stats"),s=W({}),o=W([]),l=W([]),i=W([]),r=W(""),a=W(""),p=W({name:"",key:""}),d=W({name:"",commands:""}),f=W({sel:"",group:""}),_={stats:"/stats",radio:"/device-info",contacts:"/contacts?limit=500",channels:"/channels",users:"/users",groups:"/groups","command-config":"/command-config",audit:"/audit?limit=200",database:"/db/saved-queries"};function b(h,c){const L=c.items||c;if(h==="command-config"&&Array.isArray(L))for(const ie of L){let v=[];try{v=ie.allowed_channels?JSON.parse(ie.allowed_channels):[]}catch{v=[]}ie._chans=v}return L}async function P(h,c=!1){if(n.value=h,r.value="",a.value="",!(s.value[h]&&!c))try{const L=await ne(_[h]);if(s.value[h]=b(h,L),h==="contacts"&&Hr(s.value[h]),h==="radio"&&(await Qe(),await E(),R()),h==="command-config"&&await Qe(),(h==="users"||h==="groups"||h==="contacts")&&!o.value.length){const ie=await ne("/groups");o.value=ie.items.map(v=>v.name)}if(h==="users"&&!s.value.contacts){const ie=await ne(_.contacts);s.value.contacts=b("contacts",ie)}if(h==="groups"&&!l.value.length){const ie=await ne("/command-config");l.value=ie.items.map(v=>v.command).sort()}if(h==="command-config"&&!i.value.length){const ie=await ne("/channels");i.value=ie.items.map(v=>v.name)}}catch(L){r.value=L.message}}const I=h=>P(h,!0);async function B(h,c,L=[]){r.value="",a.value="";try{await h,c&&(a.value=c)}catch(ie){r.value=ie.message}for(const ie of L)await I(ie)}function Q(h){const c=s.value["command-config"];if(!c)return;const L=c.findIndex(v=>v.command===h.command);if(L===-1)return;let ie=[];try{ie=h.allowed_channels?JSON.parse(h.allowed_channels):[]}catch{ie=[]}c[L]={...c[L],...h,_chans:ie}}async function M(h,c){r.value="",a.value="";try{const L=await ne(`/command-config/${encodeURIComponent(h)}`,{method:"PATCH",json:c});Q(L),a.value=`${h}: saved`}catch(L){r.value=L.message,await I("command-config")}}function z(h,c){!c||h._chans.includes(c)||M(h.command,{allowed_channels:[...h._chans,c]})}function q(h,c){M(h.command,{allowed_channels:h._chans.filter(L=>L!==c)})}async function se(){const h={name:p.value.name.trim()};p.value.key.trim()&&(h.key=p.value.key.trim()),h.name&&(await B(ne("/channels",{method:"POST",json:h}),`added ${h.name}`,["channels"]),r.value||(p.value={name:"",key:""}))}function Re(h){confirm(`Remove channel ${h}? This clears its radio slot.`)&&B(ne(`/channels/${encodeURIComponent(h)}`,{method:"DELETE"}),`removed ${h}`,["channels"])}function pe(h,c){c&&B(ne(`/users/${h}/groups`,{method:"POST",json:{group:c}}),"group added",["users"])}function oe(h,c){B(ne(`/users/${h}/groups/${encodeURIComponent(c)}`,{method:"DELETE"}),"group removed",["users"])}function le(h,c){const L=prompt("New alias:",c||"");L!==null&&B(ne(`/users/${h}`,{method:"PATCH",json:{name:L}}),"renamed",["users"])}function J(h,c){confirm(`Delete user ${c||h.slice(0,12)} from the bot?`)&&B(ne(`/users/${h}`,{method:"DELETE"}),"deleted",["users"])}function A(h){const c=(h.groups||[]).includes("blocked"),L=c?ne(`/users/${h.pubkey}/block`,{method:"DELETE"}):ne(`/users/${h.pubkey}/block`,{method:"POST"});B(L,c?"unblocked":"blocked",["users"])}async function j(){const h=d.value.name.trim();if(!h)return;const c=d.value.commands.split(",").map(L=>L.trim()).filter(Boolean);await B(ne("/groups",{method:"POST",json:{name:h,commands:c}}),`group ${h} created`,["groups"]),r.value||(d.value={name:"",commands:""})}function O(h){confirm(`Delete group ${h}?`)&&B(ne(`/groups/${encodeURIComponent(h)}`,{method:"DELETE"}),"deleted",["groups"])}function ve(h,c){c&&B(ne(`/groups/${encodeURIComponent(h)}/commands`,{method:"POST",json:{command:c}}),`granted ${c} to ${h}`,["groups"])}function Oe(h,c){c&&B(ne(`/groups/${encodeURIComponent(h)}/commands/${encodeURIComponent(c)}`,{method:"DELETE"}),`revoked ${c} from ${h}`,["groups"])}function Ce(h,c){B(ne(`/groups/${encodeURIComponent(h)}/all-users`,{method:c?"POST":"DELETE"}),c?`${h}: now includes all users`:`${h}: explicit members only`,["groups"])}const te=W("zero"),de=W(!1);async function ct(){de.value||(de.value=!0,await B(ne("/radio/advert",{method:"POST",json:{flood:te.value==="flood"}}),`${te.value==="flood"?"flood":"zero-hop"} advert sent`),de.value=!1)}const ot=W({});async function Qe(){try{const h={};for(const c of await ne("/settings"))h[c.key]=c;ot.value=h}catch(h){r.value=h.message}}function je(h){return Object.values(ot.value).filter(c=>c.group===h)}async function Ct(h){const c=ot.value[h],L=Number(c.value);await B(ne(`/settings/${h}`,{method:"PUT",json:{value:L}}),L>0?`${c.label}: ${L}${c.unit?" "+c.unit:""}`:`${c.label} disabled`),await Qe()}const ft=W([]),dt=W(null),Ue=W(""),C=W({name:"",private_key:""}),G=W({name:"",private_key:""}),F=W(!1),V=W({}),ce=W({}),m=W(!1),g=fe(()=>JSON.stringify(C.value)!==JSON.stringify(G.value)),y=fe(()=>JSON.stringify(V.value)!==JSON.stringify(ce.value));function x(h){const c=Cn.value.get(h);return c?et(c.value):null}function R(){C.value={name:x("self_info.name")??"",private_key:""},G.value={...C.value},V.value={freq:x("self_info.radio_freq"),bw:x("self_info.radio_bw"),sf:x("self_info.radio_sf"),cr:x("self_info.radio_cr"),tx_power:x("self_info.tx_power"),lat:x("self_info.adv_lat"),lon:x("self_info.adv_lon"),adv_loc_policy:!!x("self_info.adv_loc_policy")},ce.value={...V.value},dt.value=x("self_info.max_tx_power"),Ue.value="",F.value=!1,m.value=!1}async function E(){if(!ft.value.length)try{ft.value=(await ne("/radio/presets")).items}catch(h){r.value=h.message}}function H(){const h=ft.value.find(c=>c.name===Ue.value);h&&(V.value.freq=h.freq,V.value.bw=h.bw,V.value.sf=h.sf,V.value.cr=h.cr)}function D(){C.value={...G.value},F.value=!1}async function $(){const h=C.value,c={reboot:F.value};if(h.name!==G.value.name&&(c.name=h.name),(h.private_key||"").trim()){if(!confirm(`Import a new private key?
-
-This gives the node a NEW identity — existing contacts must re-add the bot and old DMs will no longer decrypt.`))return;c.private_key=h.private_key.trim()}await B(ne("/radio/identity",{method:"POST",json:c}),"identity updated",["radio"])}function T(){V.value={...ce.value},Ue.value="",m.value=!1}async function Z(){const h=V.value,c=ce.value,L={reboot:m.value};["freq","bw","sf","cr"].some(ie=>h[ie]!==c[ie])&&(L.freq=Number(h.freq),L.bw=Number(h.bw),L.sf=Number(h.sf),L.cr=Number(h.cr)),h.tx_power!==c.tx_power&&(L.tx_power=Number(h.tx_power)),(h.lat!==c.lat||h.lon!==c.lon)&&(L.lat=Number(h.lat),L.lon=Number(h.lon)),h.adv_loc_policy!==c.adv_loc_policy&&(L.adv_loc_policy=h.adv_loc_policy),await B(ne("/radio/settings",{method:"POST",json:L}),"radio settings updated",["radio"])}const U=W(null),Y=W(!1),X=W(!1),ue=W({enabled:!0,headroom:8});async function ye(){if(!Y.value){Y.value=!0,r.value="";try{const h=await ne("/radio/contacts-status");U.value=h,ue.value={enabled:h.policy.enabled,headroom:h.policy.headroom}}catch(h){r.value=h.message}Y.value=!1}}async function be(){await B(ne("/radio/contacts-policy",{method:"POST",json:{enabled:ue.value.enabled,headroom:Number(ue.value.headroom)}}),"Eviction policy updated (runtime only — set radio_evict_* in mcbot.conf to persist)"),await ye()}async function Pe(){if(!X.value){X.value=!0,r.value="",a.value="";try{const h=await ne("/radio/evict-contacts",{method:"POST",json:{dry_run:!0}}),c=h.evicted||[];if(!c.length){a.value=`Nothing to evict (used ${h.used}/${h.max??"?"}).`,X.value=!1;return}const L=c.map(Ie=>Ie.name||Ie.pubkey.slice(0,12)),ie=L.slice(0,20).join(`
-`),v=L.length>20?`
-…and ${L.length-20} more`:"";if(!confirm(`Evict ${c.length} stale contact(s) from the radio?
-
-${ie}${v}`)){X.value=!1;return}const N=await ne("/radio/evict-contacts",{method:"POST",json:{}});a.value=`Evicted ${N.evicted.length} contact(s)`+(N.failed?`, ${N.failed} failed`:"")+(N.shortfall?`, ${N.shortfall} short (protected)`:"")}catch(h){r.value=h.message}X.value=!1,await ye()}}const De=[{title:"Identity",keys:[["self_info.name","Name"],["self_info.public_key","Public key",{mono:!0}],["device_info.model","Model"],["device_info.ver","Firmware version"],["device_info.fw ver","Firmware code"],["device_info.fw_build","Firmware build"]]},{title:"Radio",keys:[["self_info.radio_freq","Frequency",{unit:"MHz"}],["self_info.radio_bw","Bandwidth",{unit:"kHz"}],["self_info.radio_sf","Spreading factor"],["self_info.radio_cr","Coding rate"],["self_info.tx_power","TX power",{unit:"dBm"}],["self_info.max_tx_power","Max TX power",{unit:"dBm"}],["device_info.path_hash_mode","Out path-hash mode",{fmt:h=>`${Number(h)+1} byte(s)/hop`}]]},{title:"Advertising",keys:[["self_info.adv_type","Advertised type"],["self_info.adv_lat","Latitude"],["self_info.adv_lon","Longitude"],["self_info.adv_loc_policy","Location-share policy"]]},{title:"Capacity",keys:[["device_info.max_channels","Max channels"],["device_info.max_contacts","Max contacts"]]},{title:"Battery / memory",keys:[["battery.level","Battery",{unit:"mV"}],["battery.total_kb","Total memory",{unit:"kB"}],["battery.used_kb","Used memory",{unit:"kB"}]]},{title:"Other",keys:[["device_info.ble_pin","BLE PIN"],["device_info.repeat","Repeater mode"],["self_info.manual_add_contacts","Manual contact add"],["self_info.multi_acks","Multi-acks"],["self_info.telemetry_mode_base","Telemetry: base"],["self_info.telemetry_mode_env","Telemetry: env"],["self_info.telemetry_mode_loc","Telemetry: location"]]}],lt=new Set(De.flatMap(h=>h.keys.map(c=>c[0])));function et(h){if(h==null)return null;try{return JSON.parse(h)}catch{return h}}function Vt(h,c){const L=et(h.value);if(L==null||L==="")return"";if(c!=null&&c.fmt)return c.fmt(L);let ie=typeof L=="object"?JSON.stringify(L):String(L);return c!=null&&c.unit&&(ie=`${ie} ${c.unit}`),ie}const Cn=fe(()=>{const h=new Map;for(const c of s.value.radio||[])h.set(c.key,c);return h}),Ke=fe(()=>[...s.value.radio||[]].filter(h=>!lt.has(h.key)).sort((h,c)=>h.key.localeCompare(c.key))),it={1:"Comp",2:"Rptr",3:"Room",4:"Sens"};function Qt(h){return h==null?"?":it[h]||String(h)}function ss(h){return h&&h.length>14?`${h.slice(0,6)}...${h.slice(-6)}`:h||""}function En(h){if(!h)return"";const c=new Date(h*1e3),L=ie=>String(ie).padStart(2,"0");return`${c.getFullYear()}-${L(c.getMonth()+1)}-${L(c.getDate())} ${L(c.getHours())}:${L(c.getMinutes())}`}const $r=fe(()=>o.value.filter(h=>h!=="public"&&h!=="blocked"));function Go(h){return`${h.adv_name||"(unnamed)"} — ${h.public_key}`}function Wo(){const h=f.value.sel.trim();if(!h)return"";const c=(s.value.contacts||[]).find(L=>Go(L)===h);return c?c.public_key:/^[0-9a-fA-F]{64}$/.test(h)?h.toLowerCase():""}async function Mr(){const h=Wo();if(!h){alert("Pick a contact from the list (or paste a 64-hex pubkey).");return}if(!f.value.group){alert("Choose an initial group.");return}r.value="",a.value="";try{await ne("/users",{method:"POST",json:{pubkey:h,group:f.value.group}}),a.value=`bot user created and added to ${f.value.group}`,f.value={sel:"",group:""},await I("users")}catch(c){alert(c.message)}}const Hs=W(""),rn=W(new Set),Sn=W(new Set),Fe=W({col:"adv_name",dir:"asc"}),An=W(new Set),qo=W(null),an=fe(()=>(s.value.contacts||[]).find(h=>h.public_key===qo.value)||null);function Jo(h){qo.value=h.public_key}const Dr=fe(()=>{const h=an.value;if(!h)return[];let c;h.out_path_len===-1?c="flood (no path)":h.out_path_len===0?c="direct (0 hops)":h.out_path?c=`${h.out_path} (${h.out_path_len} hop${h.out_path_len===1?"":"s"})`:c=`${h.out_path_len??"?"} hop(s)`;const L=h.adv_lat!=null&&h.adv_lon!=null?`${h.adv_lat}, ${h.adv_lon}`:"—";return[["name",h.adv_name||"—",!1],["type",Qt(h.type),!1],["public key",h.public_key,!0],["flags",h.flags??"—",!1],["out path",c,!0],["path hash mode",h.out_path_hash_mode??"—",!1],["location (lat, lon)",L,!1],["last advert",En(h.last_advert)||"—",!1],["last modified",En(h.lastmod)||"—",!1],["first seen",En(h.first_seen_at)||"—",!1],["last synced",En(h.last_synced_at)||"—",!1]]}),Lr=fe(()=>[...Sn.value].sort()),Vr=fe(()=>rn.value.size===0),Ur=h=>!rn.value.has(h);function jr(h){rn.value=h?new Set:new Set(Sn.value)}function Fr(h,c){const L=new Set(rn.value);c?L.delete(h):L.add(h),rn.value=L}function Hr(h){let c=null;for(const L of h){const ie=Qt(L.type);Sn.value.has(ie)||(c=c||new Set(Sn.value),c.add(ie))}c&&(Sn.value=c)}function un(h){Fe.value.col===h?Fe.value={col:h,dir:Fe.value.dir==="asc"?"desc":"asc"}:Fe.value={col:h,dir:"asc"}}function Br(h){const c=new Set(An.value);c.has(h)?c.delete(h):c.add(h),An.value=c}const Bs=fe(()=>(s.value.contacts||[]).filter(h=>An.value.has(h.public_key))),zo=fe(()=>Bs.value.length>0);async function Kr(){const h=Bs.value;if(!h.length)return;const c=h.map(Xe=>Xe.adv_name||Xe.public_key.slice(0,12)),L=c.slice(0,20).join(`
-`),ie=c.length>20?`
-…and ${c.length-20} more`:"";if(!confirm(`Delete ${h.length} contact(s)?
-
-${L}${ie}`))return;r.value="",a.value="";let v=0,N=0,Ie="";for(const Xe of h)try{await ne(`/contacts/${encodeURIComponent(Xe.public_key)}`,{method:"DELETE"}),v++}catch(Ws){N++,Ie=`${Ws.message} (${Xe.adv_name||Xe.public_key.slice(0,12)})`}An.value=new Set,await I("contacts"),a.value=N?`Deleted ${v}, ${N} failed`:`Deleted ${v} contact(s)`,Ie&&(r.value=Ie)}const Ks=fe(()=>{const h=s.value.contacts||[],c=Hs.value.toLowerCase().trim(),L=rn.value,ie=h.filter(Xe=>L.size&&L.has(Qt(Xe.type))?!1:c?(Xe.public_key||"").toLowerCase().includes(c)||(Xe.adv_name||"").toLowerCase().includes(c):!0),{col:v,dir:N}=Fe.value,Ie=N==="asc"?1:-1;return ie.sort((Xe,Ws)=>{const Rn=Xe[v],Tn=Ws[v];return Rn==null&&Tn==null?0:Rn==null?1:Tn==null?-1:typeof Rn=="number"&&typeof Tn=="number"?(Rn-Tn)*Ie:String(Rn).localeCompare(String(Tn))*Ie}),ie}),Yo=W(null);function Gr(h){var c,L;(L=(c=Yo.value)==null?void 0:c.querySelector(`[data-pk="${h}"]`))==null||L.scrollIntoView({block:"nearest"})}function Wr(h){const c=Ks.value;if(!c.length)return;const L=an.value?c.findIndex(N=>N.public_key===an.value.public_key):-1,ie=L===-1?h>0?0:c.length-1:Math.max(0,Math.min(c.length-1,L+h)),v=c[ie];Jo(v),Nt(()=>Gr(v.public_key))}function Qo(h){if(n.value!=="contacts"||h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;const c=h.target;c&&(c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.tagName==="SELECT"||c.isContentEditable)||h.metaKey||h.ctrlKey||h.altKey||(h.preventDefault(),Wr(h.key==="ArrowUp"?-1:1))}function Xo(h){return h&&h.length?Object.keys(h[0]).filter(c=>!c.startsWith("_")):[]}function Gs(h){return h==null?"":Array.isArray(h)?h.join(", "):typeof h=="object"?JSON.stringify(h):String(h)}function Zo(h,c){return c==="ts"&&h[c]?xs(h[c]):Gs(h[c])}const Xt=W(""),Ut=W(null),os=W(""),ls=W(!1),jt=W(null),el=fe(()=>{const h=Ut.value;return h?h.columns.length?`${h.rows.length} row(s)`:h.rowcount>=0?`${h.rowcount} row(s) affected`:"OK":""});async function qr(){const h=Xt.value.trim();if(h){ls.value=!0,os.value="",Ut.value=null;try{Ut.value=await ne("/db/query",{method:"POST",json:{sql:h}})}catch(c){os.value=c.message}finally{ls.value=!1}}}async function Jr(){const h=Xt.value.trim();if(!h)return;const c=(window.prompt("Save query as:")||"").trim();c&&await B(ne("/db/saved-queries",{method:"POST",json:{name:c,query:h}}),`saved "${c}"`,["database"])}function tl(h){jt.value=h,I("database")}function zr(h){jt.value==="load"&&(Xt.value=h.query,jt.value=null)}async function Yr(h){confirm(`Delete saved query "${h.name}"?`)&&await B(ne(`/db/saved-queries/${h.id}`,{method:"DELETE"}),`deleted "${h.name}"`,["database"])}return Ms(()=>{P("stats"),window.addEventListener("keydown",Qo)}),es(()=>window.removeEventListener("keydown",Qo)),(h,c)=>{var L,ie;return k(),w("div",Jf,[u("div",zf,[c[36]||(c[36]=u("h3",null,"Manage",-1)),u("div",Yf,[u("table",null,[u("tbody",null,[(k(),w(K,null,ae(t,v=>u("tr",{key:v.key,class:He(["clickable",{selected:n.value===v.key}]),onClick:N=>P(v.key)},[u("td",null,S(v.label),1)],10,Qf)),64))])])])]),u("div",Xf,[u("h3",null,S((L=t.find(v=>v.key===n.value))==null?void 0:L.label),1),r.value||a.value?(k(),w("div",Zf,[r.value?(k(),w("span",ed,S(r.value),1)):me("",!0),a.value?(k(),w("span",td,S(a.value),1)):me("",!0)])):me("",!0),u("div",nd,[n.value==="stats"&&s.value.stats?(k(),w("div",sd,[u("div",od,[c[37]||(c[37]=u("div",{class:"k"},"identity",-1)),u("div",ld,S(((ie=s.value.stats.identity)==null?void 0:ie.pubkey)||"—"),1),c[38]||(c[38]=u("div",{class:"k"},"events seen",-1)),u("div",null,S(s.value.stats.event_count),1),c[39]||(c[39]=u("div",{class:"k"},"commands loaded",-1)),u("div",null,S(s.value.stats.commands_loaded),1)]),c[40]||(c[40]=u("h4",null,"Counts",-1)),u("div",id,[(k(!0),w(K,null,ae(s.value.stats.counts,(v,N)=>(k(),w(K,{key:N},[u("div",rd,S(N),1),u("div",null,S(v),1)],64))),128))])])):n.value==="radio"?(k(),w("div",ad,[c[65]||(c[65]=u("h4",{class:"sec"},"Identity",-1)),u("div",ud,[c[41]||(c[41]=u("div",{class:"k"},"Name",-1)),u("div",null,[ge(u("input",{"onUpdate:modelValue":c[0]||(c[0]=v=>C.value.name=v),maxlength:"32",style:{width:"16em"}},null,512),[[Te,C.value.name]])]),c[42]||(c[42]=u("div",{class:"k"},"Public key",-1)),u("div",cd,S(x("self_info.public_key")||"—"),1),c[43]||(c[43]=u("div",{class:"k"},"New private key",-1)),u("div",null,[ge(u("input",{"onUpdate:modelValue":c[1]||(c[1]=v=>C.value.private_key=v),placeholder:"128-hex to rotate identity (optional)",style:{width:"24em"}},null,512),[[Te,C.value.private_key]]),Se(Ht,{text:"Paste a 64-byte (128 hex) private key to give the node a NEW identity. Existing contacts must re-add the bot and old DMs stop decrypting. Leave blank to keep the current key."})])]),u("div",fd,[u("button",{disabled:!g.value,onClick:$},"Save",8,dd),u("button",{disabled:!g.value,onClick:D},"Cancel",8,hd),u("label",pd,[ge(u("input",{type:"checkbox","onUpdate:modelValue":c[2]||(c[2]=v=>F.value=v)},null,512),[[us,F.value]]),c[44]||(c[44]=he(" Reboot after",-1))])]),c[66]||(c[66]=u("h4",{class:"sec"},"Radio settings",-1)),u("div",md,[u("label",vd,[c[46]||(c[46]=he(" Preset ",-1)),ge(u("select",{"onUpdate:modelValue":c[3]||(c[3]=v=>Ue.value=v),onChange:H},[c[45]||(c[45]=u("option",{value:""},"Custom…",-1)),(k(!0),w(K,null,ae(ft.value,v=>(k(),w("option",{key:v.name,value:v.name},S(v.name),9,gd))),128))],544),[[Dl,Ue.value]])]),Se(Ht,{text:"Fills the fields below with a region's recommended values — review before saving. Presets are starting points; verify for your area."})]),u("div",_d,[c[47]||(c[47]=u("div",{class:"k"},"Frequency (MHz)",-1)),u("div",null,[ge(u("input",{type:"number",step:"0.001","onUpdate:modelValue":c[4]||(c[4]=v=>V.value.freq=v),style:{width:"9em"}},null,512),[[Te,V.value.freq,void 0,{number:!0}]])]),c[48]||(c[48]=u("div",{class:"k"},"Bandwidth (kHz)",-1)),u("div",null,[ge(u("input",{type:"number",step:"0.1","onUpdate:modelValue":c[5]||(c[5]=v=>V.value.bw=v),style:{width:"9em"}},null,512),[[Te,V.value.bw,void 0,{number:!0}]])]),c[49]||(c[49]=u("div",{class:"k"},"Spreading factor",-1)),u("div",null,[ge(u("input",{type:"number",min:"5",max:"12","onUpdate:modelValue":c[6]||(c[6]=v=>V.value.sf=v),style:{width:"6em"}},null,512),[[Te,V.value.sf,void 0,{number:!0}]])]),c[50]||(c[50]=u("div",{class:"k"},"Coding rate",-1)),u("div",null,[ge(u("input",{type:"number",min:"5",max:"8","onUpdate:modelValue":c[7]||(c[7]=v=>V.value.cr=v),style:{width:"6em"}},null,512),[[Te,V.value.cr,void 0,{number:!0}]])]),c[51]||(c[51]=u("div",{class:"k"},"TX power (dBm)",-1)),u("div",null,[ge(u("input",{type:"number",min:"0","onUpdate:modelValue":c[8]||(c[8]=v=>V.value.tx_power=v),style:{width:"6em"}},null,512),[[Te,V.value.tx_power,void 0,{number:!0}]]),dt.value!=null?(k(),w("span",yd," max "+S(dt.value),1)):me("",!0)]),c[52]||(c[52]=u("div",{class:"k"},"Latitude",-1)),u("div",null,[ge(u("input",{type:"number",step:"0.00001","onUpdate:modelValue":c[9]||(c[9]=v=>V.value.lat=v),style:{width:"11em"}},null,512),[[Te,V.value.lat,void 0,{number:!0}]])]),c[53]||(c[53]=u("div",{class:"k"},"Longitude",-1)),u("div",null,[ge(u("input",{type:"number",step:"0.00001","onUpdate:modelValue":c[10]||(c[10]=v=>V.value.lon=v),style:{width:"11em"}},null,512),[[Te,V.value.lon,void 0,{number:!0}]])]),c[54]||(c[54]=u("div",{class:"k"},"Include location in adverts",-1)),u("div",null,[ge(u("input",{type:"checkbox","onUpdate:modelValue":c[11]||(c[11]=v=>V.value.adv_loc_policy=v)},null,512),[[us,V.value.adv_loc_policy]])])]),u("div",bd,[u("button",{disabled:!y.value,onClick:Z},"Save",8,kd),u("button",{disabled:!y.value,onClick:T},"Cancel",8,wd),u("label",xd,[ge(u("input",{type:"checkbox","onUpdate:modelValue":c[12]||(c[12]=v=>m.value=v)},null,512),[[us,m.value]]),c[55]||(c[55]=he(" Reboot after",-1))]),Se(Ht,{text:"Radio-parameter changes usually require a reboot to take effect."})]),c[67]||(c[67]=u("h4",{class:"sec"},"Advert",-1)),u("div",Cd,[u("label",Ed,[ge(u("input",{type:"radio",value:"zero","onUpdate:modelValue":c[13]||(c[13]=v=>te.value=v)},null,512),[[Ml,te.value]]),c[56]||(c[56]=he(" Zero hop ",-1))]),u("label",Sd,[ge(u("input",{type:"radio",value:"flood","onUpdate:modelValue":c[14]||(c[14]=v=>te.value=v)},null,512),[[Ml,te.value]]),c[57]||(c[57]=he(" Flood ",-1))]),u("button",{disabled:de.value,onClick:ct},S(de.value?"Sending…":"Advert"),9,Ad),Se(Ht,{text:"Zero-hop reaches direct neighbors only; flood propagates through the mesh."})]),(k(!0),w(K,null,ae(je("radio"),v=>(k(),w("div",{key:v.key,class:"toolbar"},[u("label",Rd,[he(S(v.label),1),v.unit?(k(),w(K,{key:0},[he(" ("+S(v.unit)+")",1)],64)):me("",!0),ge(u("input",{type:"number",min:v.min,max:v.max,step:v.step,"onUpdate:modelValue":N=>v.value=N,style:{width:"5em"}},null,8,Td),[[Te,v.value,void 0,{number:!0}]])]),u("button",{onClick:N=>Ct(v.key)},"Apply",8,Od),Se(Ht,{text:v.description},null,8,["text"])]))),128)),u("div",Pd,[u("div",Id,[c[58]||(c[58]=u("strong",null,"Contact table",-1)),u("button",{disabled:Y.value,onClick:ye},S(Y.value?"Checking…":"Check contact table"),9,Nd),Se(Ht,{text:"Reads the radio's contact list (takes a few seconds)."})]),U.value?(k(),w("div",$d,[u("div",Md,[c[59]||(c[59]=u("div",{class:"k"},"Used / max",-1)),u("div",null,[he(S(U.value.used)+" / "+S(U.value.max??"?")+" ",1),u("span",Dd,"("+S(U.value.free??"?")+" free)",1)]),c[60]||(c[60]=u("div",{class:"k"},"Protected / evictable",-1)),u("div",null,S(U.value.protected)+" protected, "+S(U.value.eligible)+" evictable",1),c[61]||(c[61]=u("div",{class:"k"},"Firmware autoadd byte",-1)),u("div",Ld,S(U.value.autoadd_raw??"n/a"),1)]),u("div",Vd,[u("label",Ud,[ge(u("input",{type:"checkbox","onUpdate:modelValue":c[15]||(c[15]=v=>ue.value.enabled=v)},null,512),[[us,ue.value.enabled]]),c[62]||(c[62]=he(" Auto-evict (startup + when full) ",-1))]),u("label",jd,[c[63]||(c[63]=he(" Headroom ",-1)),ge(u("input",{type:"number",min:"1",max:"100","onUpdate:modelValue":c[16]||(c[16]=v=>ue.value.headroom=v),style:{width:"4em"}},null,512),[[Te,ue.value.headroom,void 0,{number:!0}]])]),u("button",{onClick:be},"Apply"),u("button",{disabled:X.value,onClick:Pe},S(X.value?"Evicting…":"Evict to headroom now"),9,Fd),Se(Ht,{text:"Evicts the stalest contacts from the radio (bot users, owners, and recent DM peers are protected; the bot's database keeps the full archive). Policy changes here are runtime only — set radio_evict_* in mcbot.conf to persist across restarts."})])])):me("",!0)]),c[68]||(c[68]=u("h4",{class:"sec"},"Device info",-1)),c[69]||(c[69]=u("div",{class:"muted",style:{padding:"0 12px 6px"}},"what the radio currently reports (read-only)",-1)),u("div",Hd,[(k(),w(K,null,ae(De,v=>(k(),w(K,{key:v.title},[u("h4",Bd,S(v.title),1),u("div",Kd,[(k(!0),w(K,null,ae(v.keys,N=>{var Ie;return k(),w(K,{key:N[0]},[u("div",Gd,S(N[1]),1),u("div",{class:He({mono:(Ie=N[2])==null?void 0:Ie.mono})},S(Vt(Cn.value.get(N[0])||{},N[2])||"—"),3)],64)}),128))])],64))),64)),Ke.value.length?(k(),w(K,{key:0},[c[64]||(c[64]=u("h4",{style:{margin:"12px 0 4px"}},"Unrecognized",-1)),u("div",Wd,[(k(!0),w(K,null,ae(Ke.value,v=>(k(),w(K,{key:v.key},[u("div",qd,S(v.key),1),u("div",null,S(Vt(v)||"—"),1)],64))),128))])],64)):me("",!0)])])):n.value==="channels"?(k(),w("div",Jd,[u("div",zd,[ge(u("input",{"onUpdate:modelValue":c[17]||(c[17]=v=>p.value.name=v),placeholder:"name (e.g. #bot or MyChan)",style:{flex:"1"}},null,512),[[Te,p.value.name]]),ge(u("input",{"onUpdate:modelValue":c[18]||(c[18]=v=>p.value.key=v),placeholder:"hex key (non-# only)",style:{flex:"1"}},null,512),[[Te,p.value.key]]),u("button",{onClick:se},"Add channel")]),u("table",null,[c[70]||(c[70]=u("thead",null,[u("tr",null,[u("th",null,"idx"),u("th",null,"name"),u("th",null,"secret"),u("th")])],-1)),u("tbody",null,[(k(!0),w(K,null,ae(s.value.channels,v=>(k(),w("tr",{key:v.channel_idx},[u("td",null,S(v.channel_idx),1),u("td",null,S(v.name),1),u("td",Yd,S((v.secret_hex||"").slice(0,12))+"…",1),u("td",null,[u("button",{onClick:N=>Re(v.name)},"remove",8,Qd)])]))),128))])])])):n.value==="users"?(k(),w("div",Xd,[u("div",Zd,[ge(u("input",{"onUpdate:modelValue":c[19]||(c[19]=v=>f.value.sel=v),list:"newUserContacts",placeholder:"add bot user: search a contact…",style:{flex:"0 0 320px"}},null,512),[[Te,f.value.sel]]),u("datalist",eh,[(k(!0),w(K,null,ae(s.value.contacts||[],v=>(k(),w("option",{key:v.public_key,value:Go(v)},null,8,th))),128))]),ge(u("select",{"onUpdate:modelValue":c[20]||(c[20]=v=>f.value.group=v)},[c[71]||(c[71]=u("option",{value:""},"initial group…",-1)),(k(!0),w(K,null,ae($r.value,v=>(k(),w("option",{key:v,value:v},S(v),9,nh))),128))],512),[[Dl,f.value.group]]),u("button",{disabled:!Wo()||!f.value.group,onClick:Mr}," Add bot user ",8,sh)]),u("table",null,[c[73]||(c[73]=u("thead",null,[u("tr",null,[u("th",null,"name"),u("th",null,"pubkey"),u("th",{style:{width:"130px"}},"add group"),u("th",null,"groups"),u("th",null,"actions")])],-1)),u("tbody",null,[(k(!0),w(K,null,ae(s.value.users,v=>(k(),w("tr",{key:v.pubkey},[u("td",null,S(v.name||"?"),1),u("td",oh,S(v.pubkey.slice(0,12)),1),u("td",null,[u("select",{onChange:N=>{pe(v.pubkey,N.target.value),N.target.value=""}},[c[72]||(c[72]=u("option",{value:""},"+ group…",-1)),(k(!0),w(K,null,ae(o.value,N=>(k(),w("option",{key:N,value:N},S(N),9,ih))),128))],40,lh)]),u("td",rh,[(k(!0),w(K,null,ae(v.groups,N=>(k(),w("span",{key:N,class:"tag"},[he(S(N)+" ",1),u("a",{href:"#",onClick:nn(Ie=>oe(v.pubkey,N),["prevent"]),title:"remove"},"×",8,ah)]))),128))]),u("td",uh,[u("button",{onClick:N=>le(v.pubkey,v.name)},"rename",8,ch),u("button",{onClick:N=>A(v)},S((v.groups||[]).includes("blocked")?"unblock":"block"),9,fh),u("button",{onClick:N=>J(v.pubkey,v.name)},"delete",8,dh)])]))),128))])])])):n.value==="groups"?(k(),w("div",hh,[u("div",ph,[ge(u("input",{"onUpdate:modelValue":c[21]||(c[21]=v=>d.value.name=v),placeholder:"new group name"},null,512),[[Te,d.value.name]]),ge(u("input",{"onUpdate:modelValue":c[22]||(c[22]=v=>d.value.commands=v),placeholder:"commands (comma list, optional)",style:{flex:"1"}},null,512),[[Te,d.value.commands]]),u("button",{onClick:j},"Create group")]),u("table",null,[c[76]||(c[76]=u("thead",null,[u("tr",null,[u("th",null,"name"),u("th",null,"users"),u("th",{title:"Every user is a member (the * membership)"},"all users"),u("th",{style:{width:"150px"}},"grant command"),u("th",null,"commands"),u("th")])],-1)),u("tbody",null,[(k(!0),w(K,null,ae(s.value.groups,v=>(k(),w("tr",{key:v.name},[u("td",null,[he(S(v.name),1),v.is_system?(k(),w("span",mh," [sys]")):me("",!0)]),u("td",null,[he(S(v.nusers),1),v.all_users?(k(),w("span",vh," +*")):me("",!0)]),u("td",null,[u("input",{type:"checkbox",checked:v.all_users,disabled:v.name==="blocked",title:"Include all users (*) in this group",onChange:N=>Ce(v.name,N.target.checked)},null,40,gh)]),u("td",null,[u("select",{onChange:N=>{ve(v.name,N.target.value),N.target.value=""}},[c[74]||(c[74]=u("option",{value:""},"+ command…",-1)),c[75]||(c[75]=u("option",{value:"*"},"* (all commands)",-1)),(k(!0),w(K,null,ae(l.value,N=>(k(),w("option",{key:N,value:N},S(N),9,yh))),128))],40,_h)]),u("td",bh,[(k(!0),w(K,null,ae(v.commands,N=>(k(),w("span",{key:N,class:"tag"},[he(S(N)+" ",1),u("a",{href:"#",onClick:nn(Ie=>Oe(v.name,N),["prevent"]),title:"revoke"},"×",8,kh)]))),128))]),u("td",null,[u("button",{disabled:v.is_system,onClick:N=>O(v.name)},"delete",8,wh)])]))),128))])])])):n.value==="command-config"?(k(),w("div",xh,[(k(!0),w(K,null,ae(je("commands"),v=>(k(),w("div",{key:v.key,class:"toolbar"},[u("label",Ch,[he(S(v.label),1),v.unit?(k(),w(K,{key:0},[he(" ("+S(v.unit)+")",1)],64)):me("",!0),ge(u("input",{type:"number",min:v.min,max:v.max,step:v.step,"onUpdate:modelValue":N=>v.value=N,style:{width:"5em"}},null,8,Eh),[[Te,v.value,void 0,{number:!0}]])]),u("button",{onClick:N=>Ct(v.key)},"Apply",8,Sh),Se(Ht,{text:v.description},null,8,["text"])]))),128)),u("table",null,[c[78]||(c[78]=u("thead",null,[u("tr",null,[u("th",null,"command"),u("th",null,"enabled"),u("th",null,"allow_dm"),u("th",null,"dm_only"),u("th",null,"cooldown"),u("th",{style:{width:"140px"}},"allow channel"),u("th",null,"allowed channels")])],-1)),u("tbody",null,[(k(!0),w(K,null,ae(s.value["command-config"],v=>(k(),w("tr",{key:v.command},[u("td",null,S(v.command),1),u("td",null,[u("input",{type:"checkbox",checked:!!v.enabled,onChange:N=>M(v.command,{enabled:N.target.checked})},null,40,Ah)]),u("td",null,[u("input",{type:"checkbox",checked:!!v.allow_dm,onChange:N=>M(v.command,{allow_dm:N.target.checked})},null,40,Rh)]),u("td",null,[u("input",{type:"checkbox",checked:!!v.dm_only,onChange:N=>M(v.command,{dm_only:N.target.checked})},null,40,Th)]),u("td",null,[u("input",{type:"number",value:v.cooldown_seconds,style:{width:"64px"},onChange:N=>M(v.command,{cooldown_seconds:Number(N.target.value)})},null,40,Oh)]),u("td",null,[u("select",{onChange:N=>{z(v,N.target.value),N.target.value=""}},[c[77]||(c[77]=u("option",{value:""},"+ channel…",-1)),(k(!0),w(K,null,ae(i.value,N=>(k(),w("option",{key:N,value:N},S(N),9,Ih))),128))],40,Ph)]),u("td",Nh,[v._chans.length?me("",!0):(k(),w("span",$h,"(any)")),(k(!0),w(K,null,ae(v._chans,N=>(k(),w("span",{key:N,class:"tag"},[he(S(N)+" ",1),u("a",{href:"#",onClick:nn(Ie=>q(v,N),["prevent"]),title:"remove"},"×",8,Mh)]))),128))])]))),128))])])])):n.value==="contacts"?(k(),w("div",Dh,[u("div",Lh,[u("div",Vh,[ge(u("input",{"onUpdate:modelValue":c[23]||(c[23]=v=>Hs.value=v),placeholder:"search name or pubkey…",style:{flex:"0 0 260px"}},null,512),[[Te,Hs.value]]),u("label",Uh,[u("input",{type:"checkbox",checked:Vr.value,onChange:c[24]||(c[24]=v=>jr(v.target.checked))},null,40,jh),c[79]||(c[79]=he(" All ",-1))]),(k(!0),w(K,null,ae(Lr.value,v=>(k(),w("label",{key:v,class:"chk"},[u("input",{type:"checkbox",checked:Ur(v),onChange:N=>Fr(v,N.target.checked)},null,40,Fh),he(" "+S(v),1)]))),128)),u("button",{disabled:!zo.value,onClick:Kr}," Delete"+S(zo.value?` (${Bs.value.length})`:""),9,Hh),u("span",Bh,S(Ks.value.length)+" shown",1)]),u("div",{class:"body",ref_key:"contactListEl",ref:Yo},[u("table",null,[u("thead",null,[u("tr",null,[c[86]||(c[86]=u("th",{style:{width:"24px"}},null,-1)),u("th",{class:"sortable",onClick:c[25]||(c[25]=v=>un("public_key"))},[c[80]||(c[80]=he(" pubkey",-1)),Fe.value.col==="public_key"?(k(),w("span",Kh,S(Fe.value.dir==="asc"?"▲":"▼"),1)):me("",!0)]),u("th",{class:"sortable",onClick:c[26]||(c[26]=v=>un("adv_name"))},[c[81]||(c[81]=he(" name",-1)),Fe.value.col==="adv_name"?(k(),w("span",Gh,S(Fe.value.dir==="asc"?"▲":"▼"),1)):me("",!0)]),u("th",{class:"sortable",onClick:c[27]||(c[27]=v=>un("type"))},[c[82]||(c[82]=he(" type",-1)),Fe.value.col==="type"?(k(),w("span",Wh,S(Fe.value.dir==="asc"?"▲":"▼"),1)):me("",!0)]),u("th",{class:"sortable",onClick:c[28]||(c[28]=v=>un("adv_lat"))},[c[83]||(c[83]=he(" lat",-1)),Fe.value.col==="adv_lat"?(k(),w("span",qh,S(Fe.value.dir==="asc"?"▲":"▼"),1)):me("",!0)]),u("th",{class:"sortable",onClick:c[29]||(c[29]=v=>un("adv_lon"))},[c[84]||(c[84]=he(" lon",-1)),Fe.value.col==="adv_lon"?(k(),w("span",Jh,S(Fe.value.dir==="asc"?"▲":"▼"),1)):me("",!0)]),u("th",{class:"sortable",onClick:c[30]||(c[30]=v=>un("last_synced_at"))},[c[85]||(c[85]=he(" last synced",-1)),Fe.value.col==="last_synced_at"?(k(),w("span",zh,S(Fe.value.dir==="asc"?"▲":"▼"),1)):me("",!0)])])]),u("tbody",null,[(k(!0),w(K,null,ae(Ks.value,v=>(k(),w("tr",{key:v.public_key,"data-pk":v.public_key,class:He(["clickable",{selected:an.value&&an.value.public_key===v.public_key}]),onClick:N=>Jo(v)},[u("td",null,[u("input",{type:"checkbox",checked:An.value.has(v.public_key),onChange:N=>Br(v.public_key),onClick:c[31]||(c[31]=nn(()=>{},["stop"]))},null,40,Qh)]),u("td",{class:"mono",title:v.public_key},S(ss(v.public_key)),9,Xh),u("td",null,S(v.adv_name||""),1),u("td",null,S(Qt(v.type)),1),u("td",null,S(v.adv_lat??""),1),u("td",null,S(v.adv_lon??""),1),u("td",null,S(En(v.last_synced_at)),1)],10,Yh))),128))])])],512)]),u("div",Zh,[c[87]||(c[87]=u("h3",null,"Contact",-1)),u("div",ep,[an.value?(k(),w("div",np,[u("div",sp,[(k(!0),w(K,null,ae(Dr.value,v=>(k(),w(K,{key:v[0]},[u("div",op,S(v[0]),1),u("div",{class:He({mono:v[2]}),style:{"word-break":"break-all"}},S(v[1]),3)],64))),128))])])):(k(),w("div",tp,"select a contact"))])])])):n.value==="database"?(k(),w("div",lp,[u("div",ip,[ge(u("textarea",{"onUpdate:modelValue":c[32]||(c[32]=v=>Xt.value=v),class:"db-query mono",spellcheck:"false",placeholder:"SQL — one statement, e.g. SELECT * FROM contacts LIMIT 20"},null,512),[[Te,Xt.value]]),u("div",rp,[u("button",{disabled:!Xt.value.trim()||ls.value,onClick:qr},S(ls.value?"Running…":"Submit"),9,ap),u("button",{disabled:!Xt.value.trim(),onClick:Jr},"Save",8,up),u("button",{onClick:c[33]||(c[33]=v=>tl("load"))},"Load"),u("button",{onClick:c[34]||(c[34]=v=>tl("delete"))},"Delete"),u("span",cp,S(el.value),1),c[88]||(c[88]=u("span",{class:"muted db-warn"},"runs against the live database",-1))])]),jt.value?(k(),w("div",fp,[u("div",dp,[u("strong",null,S(jt.value==="load"?"Load a saved query":"Delete a saved query"),1),u("button",{onClick:c[35]||(c[35]=v=>jt.value=null)},"Cancel")]),u("div",hp,[s.value.database&&s.value.database.length?(k(),w("table",mp,[u("tbody",null,[(k(!0),w(K,null,ae(s.value.database,v=>(k(),w("tr",{key:v.id,class:He({clickable:jt.value==="load"}),onClick:N=>zr(v)},[u("td",gp,S(v.name),1),u("td",_p,S((v.query||"").slice(0,80)),1),jt.value==="delete"?(k(),w("td",yp,[u("a",{href:"#",title:"delete",onClick:nn(N=>Yr(v),["prevent","stop"])},"✕",8,bp)])):me("",!0)],10,vp))),128))])])):(k(),w("div",pp," no saved queries "))])])):me("",!0),u("div",kp,[os.value?(k(),w("div",wp,S(os.value),1)):Ut.value&&Ut.value.columns.length?(k(),w("table",xp,[u("thead",null,[u("tr",null,[(k(!0),w(K,null,ae(Ut.value.columns,v=>(k(),w("th",{key:v},S(v),1))),128))])]),u("tbody",null,[(k(!0),w(K,null,ae(Ut.value.rows,(v,N)=>(k(),w("tr",{key:N},[(k(!0),w(K,null,ae(v,(Ie,Xe)=>(k(),w("td",{key:Xe,title:Gs(Ie)},S(Gs(Ie)),9,Cp))),128))]))),128))])])):Ut.value?(k(),w("div",Ep,S(el.value),1)):(k(),w("div",Sp,"no results yet"))])])):Array.isArray(s.value[n.value])?(k(),w("table",Ap,[u("thead",null,[u("tr",null,[(k(!0),w(K,null,ae(Xo(s.value[n.value]),v=>(k(),w("th",{key:v},S(v),1))),128))])]),u("tbody",null,[(k(!0),w(K,null,ae(s.value[n.value],(v,N)=>(k(),w("tr",{key:N},[(k(!0),w(K,null,ae(Xo(s.value[n.value]),Ie=>(k(),w("td",{key:Ie,title:Zo(v,Ie)},S(Zo(v,Ie)),9,Rp))),128))]))),128))])])):(k(),w("div",Tp,"loading…"))])])])}}},Pp=Ko(Op,[["__scopeId","data-v-a817f27c"]]),Ip={class:"panes"},Np={class:"side-col"},$p={class:"pane",style:{flex:"1 1 0","min-height":"160px"}},Mp={class:"body"},Dp=["onClick"],Lp={class:"muted"},Vp={class:"pane",style:{flex:"1 1 0","min-height":"200px"}},Up={class:"toolbar"},jp={class:"body"},Fp=["onClick"],Hp={class:"muted mono"},Bp={class:"pane",style:{flex:"1"}},Kp={key:0,class:"err",style:{padding:"10px"}},Gp={key:1,class:"empty"},Wp={class:"meta"},qp={class:"who"},Jp={key:0},zp=["href"],Yp={key:1,class:"mention"},Qp={class:"toolbar"},Xp=["placeholder","disabled"],Zp=["disabled"],em={key:0,class:"err",style:{padding:"0 12px 8px"}},tm={__name:"Messages",setup(e){const t=W([]),n=W(null),s=W(null),o=W([]),l=W(null),i=W([]),r=W(""),a=W(""),p=W(""),d=W(!1),f=W("");let _=null;const b=fe(()=>{const J=r.value.toLowerCase();return J?i.value.filter(A=>(A.adv_name||"").toLowerCase().includes(J)||(A.public_key||"").toLowerCase().includes(J)):i.value}),P=fe(()=>{if(typeof n.value=="number"){const J=t.value.find(A=>A.channel_idx===n.value);return{kind:"channel",idx:n.value,label:(J==null?void 0:J.name)||`#${n.value}`}}return n.value==="dm"&&s.value?{kind:"dm",pubkey:s.value.public_key,label:s.value.adv_name||s.value.public_key.slice(0,12)}:null}),I=fe(()=>P.value?`Message ${P.value.label}…`:"Pick a channel or a contact to send to…");async function B(){t.value=(await ne("/channels")).items,n.value===null&&t.value.length&&z(t.value[0].channel_idx)}async function Q(){i.value=(await ne("/contacts?limit=500")).items}async function M(){await Nt();const J=l.value;J&&(J.scrollTop=J.scrollHeight)}async function z(J){n.value=J,s.value=null;const A=await ne(`/channel-messages?channel_idx=${J}&limit=100`);o.value=A.items.slice().reverse(),await M()}async function q(){n.value="dm",s.value=null;const J=await ne("/direct-messages?limit=100");o.value=J.items.slice().reverse(),await M()}async function se(J){n.value="dm",s.value=J;const A=await ne(`/direct-messages?pubkey=${encodeURIComponent(J.public_key)}&limit=100`);o.value=A.items.slice().reverse(),await M()}async function Re(){const J=p.value.trim();if(!(!J||!P.value||d.value)){d.value=!0,f.value="";try{P.value.kind==="channel"?await ne("/send/channel",{method:"POST",json:{channel_idx:P.value.idx,text:J}}):await ne("/send/dm",{method:"POST",json:{pubkey:P.value.pubkey,text:J}}),p.value=""}catch(A){f.value=A.message}finally{d.value=!1}}}function pe(J,A){if(!J||!A)return J||"";const j=`${A}: `;return J.startsWith(j)?J.slice(j.length):J}const oe=/(https?:\/\/[^\s<>]+)|@\[([^\]]+)\]/g;function le(J){const A=pe(J.text,J.sender_name),j=[];let O=0,ve;for(oe.lastIndex=0;(ve=oe.exec(A))!==null;){if(ve.index>O&&j.push({type:"text",value:A.slice(O,ve.index)}),ve[1]){const Oe=ve[1].match(/^(.*?)([.,;:!?)]+)$/);Oe?(j.push({type:"link",value:Oe[1]}),j.push({type:"text",value:Oe[2]})):j.push({type:"link",value:ve[1]})}else j.push({type:"mention",value:ve[2]});O=oe.lastIndex}return O{try{await B(),await Q()}catch(J){a.value=J.message}_=new WebSocket(Pr("/ws/messages")),_.onmessage=J=>{const A=JSON.parse(J.data),j=l.value,O=j?j.scrollHeight-j.scrollTop-j.clientHeight<60:!0;let ve=!1;n.value==="dm"&&A.kind==="dm"?(!s.value||A.sender_pubkey===s.value.public_key)&&(o.value.push(A),ve=!0):A.kind==="channel"&&A.channel_idx===n.value&&(o.value.push(A),ve=!0),o.value.length>300&&o.value.shift(),ve&&O&&M()}}),es(()=>_&&_.close()),(J,A)=>{var j;return k(),w("div",Ip,[u("div",Np,[u("div",$p,[A[3]||(A[3]=u("h3",null,"Channels",-1)),u("div",Mp,[u("table",null,[u("tbody",null,[(k(!0),w(K,null,ae(t.value,O=>(k(),w("tr",{key:O.channel_idx,class:He(["clickable",{selected:n.value===O.channel_idx}]),onClick:ve=>z(O.channel_idx)},[u("td",null,[he(S(O.name)+" ",1),u("span",Lp,"#"+S(O.channel_idx),1)])],10,Dp))),128)),u("tr",{class:He(["clickable",{selected:n.value==="dm"&&!s.value}]),onClick:q},[...A[2]||(A[2]=[u("td",null,"✉ Direct messages",-1)])],2)])])])]),u("div",Vp,[u("h3",null,"Contacts ("+S(i.value.length)+")",1),u("div",Up,[ge(u("input",{"onUpdate:modelValue":A[0]||(A[0]=O=>r.value=O),placeholder:"search",style:{flex:"1"}},null,512),[[Te,r.value]])]),u("div",jp,[u("table",null,[u("tbody",null,[(k(!0),w(K,null,ae(b.value,O=>(k(),w("tr",{key:O.public_key,class:He(["clickable",{selected:s.value&&s.value.public_key===O.public_key}]),onClick:ve=>se(O),title:"Open a DM conversation with this contact"},[u("td",null,[he(S(O.adv_name||"(unnamed)"),1),A[4]||(A[4]=u("br",null,null,-1)),u("span",Hp,S(O.public_key.slice(0,12)),1)])],10,Fp))),128))])])])])]),u("div",Bp,[u("h3",null,S(n.value==="dm"?s.value?`DM · ${s.value.adv_name||s.value.public_key.slice(0,12)}`:"Direct messages":((j=t.value.find(O=>O.channel_idx===n.value))==null?void 0:j.name)||"Messages"),1),u("div",{class:"body",ref_key:"msgBody",ref:l},[a.value?(k(),w("div",Kp,S(a.value),1)):me("",!0),o.value.length?me("",!0):(k(),w("div",Gp,"no messages")),(k(!0),w(K,null,ae(o.value,O=>{var ve;return k(),w("div",{key:O.id,class:He(["msg",{out:O.is_outgoing}])},[u("div",Wp,[u("span",qp,S(O.is_outgoing?"→ me":O.sender_name||((ve=O.sender_pubkey)==null?void 0:ve.slice(0,12))||"?"),1),he(" · "+S(pt(Ir)(O.received_at))+" ",1),O.snr!=null?(k(),w("span",Jp,"· snr "+S(O.snr),1)):me("",!0)]),u("div",null,[(k(!0),w(K,null,ae(le(O),(Oe,Ce)=>(k(),w(K,{key:Ce},[Oe.type==="link"?(k(),w("a",{key:0,href:Oe.value,target:"_blank",rel:"noopener noreferrer"},S(Oe.value),9,zp)):Oe.type==="mention"?(k(),w("span",Yp,"@["+S(Oe.value)+"]",1)):(k(),w(K,{key:2},[he(S(Oe.value),1)],64))],64))),128))])],2)}),128))],512),u("div",Qp,[ge(u("input",{style:{flex:"1"},placeholder:I.value,"onUpdate:modelValue":A[1]||(A[1]=O=>p.value=O),disabled:!P.value||d.value,onKeyup:gn(Re,["enter"])},null,40,Xp),[[Te,p.value]]),u("button",{disabled:!P.value||d.value||!p.value.trim(),onClick:Re},S(d.value?"Sending…":"Send"),9,Zp)]),f.value?(k(),w("div",em,S(f.value),1)):me("",!0)])])}}},nm={class:"hexdump"},sm=["onMouseenter"],om={key:0},lm={key:1},im={key:0,class:"empty"},rm={__name:"HexDump",props:{hex:{type:String,default:""},activeRange:{type:Object,default:null}},emits:["hover-offset"],setup(e,{emit:t}){const n=e,s=t,o=fe(()=>{const i=(n.hex||"").replace(/\s+/g,""),r=[];for(let a=0;a+2<=i.length;a+=2)r.push(i.slice(a,a+2));return r});function l(i){const r=n.activeRange;return r&&i>=r.offset&&i(k(),w("div",nm,[(k(!0),w(K,null,ae(o.value,(a,p)=>(k(),w("span",{key:p,class:He(["hexbyte",{active:l(p)}]),onMouseenter:d=>s("hover-offset",p),onMouseleave:r[0]||(r[0]=d=>s("hover-offset",null))},[he(S(a),1),(p+1)%16===0?(k(),w("span",om,[...r[1]||(r[1]=[u("br",null,null,-1)])])):(k(),w("span",lm))],42,sm))),128)),o.value.length?me("",!0):(k(),w("div",im,"no raw bytes"))]))}},am=["onMouseenter"],um={class:"fname"},cm={class:"fmeta"},fm={class:"fval"},dm={key:0,class:"fval muted"},hm={key:1,class:"fmeta"},pm={key:0,class:"decoded"},mm={class:"kv"},vm={class:"k"},gm={class:"mono"},_m={__name:"FieldBreakout",props:{fields:{type:Array,default:()=>[]},decoded:{type:Object,default:null},activeIndex:{type:Number,default:-1}},emits:["hover-field"],setup(e,{emit:t}){const n=t;function s(i){return i==="timestamp"||i.endsWith("_timestamp")||i.endsWith("_at")}function o(i,r){return s(i)?xs(r):l(r)}function l(i){return i==null?"":typeof i=="object"?JSON.stringify(i):String(i)}return(i,r)=>(k(),w("div",null,[(k(!0),w(K,null,ae(e.fields,(a,p)=>(k(),w("div",{key:p,class:He(["field-row",{active:p===e.activeIndex}]),onMouseenter:d=>n("hover-field",p),onMouseleave:r[0]||(r[0]=d=>n("hover-field",-1))},[u("div",um,S(a.name),1),u("div",cm,"offset "+S(a.offset)+" · "+S(a.length)+" byte(s)",1),u("div",fm,S(a.hex),1),a.value!==null&&a.value!==void 0?(k(),w("div",dm,S(l(a.value)),1)):me("",!0),a.description?(k(),w("div",hm,S(a.description),1)):me("",!0)],42,am))),128)),e.decoded?(k(),w("div",pm,[r[1]||(r[1]=u("h4",{style:{margin:"6px 0"}},"Decoded payload",-1)),u("div",mm,[(k(!0),w(K,null,ae(e.decoded,(a,p)=>(k(),w(K,{key:p},[u("div",vm,S(p),1),u("div",gm,S(o(p,a)),1)],64))),128))])])):me("",!0)]))}},ym={class:"pdetail"},bm={key:0,class:"pdesc"},km={class:"kv"},wm={class:"k"},xm={class:"kv"},Cm={class:"k"},Em={class:"mono"},Sm={class:"kv"},Am={class:"k"},Rm={class:"mono"},Tm={__name:"PacketDetail",props:{packet:{type:Object,required:!0}},setup(e){const t=e,n={ADVERT:"A node broadcast an advertisement (presence beacon). The bot learns its public key, name, and route and tracks it as a contact.",DM:"A direct message addressed to the bot, decrypted from RF. Dispatched to a command handler if it is a command, else logged.",GRPCHAT:"A channel (group) message the bot holds the key for. Logged, and dispatched if it is a command.",DM_SENT:"The radio accepted an outbound DM from the bot for transmission.",ACK:"Acknowledgement that a message the bot sent reached its destination.",CMD_ACK:"The radio firmware accepted a command the bot issued (OK frame).",CMD_ERR:"The radio firmware rejected a command the bot issued (ERROR frame).",CONTACT:"One contact entry streamed from the radio during a contact-table sync.",NEW_CONTACT:"The radio added a new contact after hearing a previously-unknown node.",CONTACTS_SYNC:"A contact-table sync from the radio completed.",CONTACT_DEL:"A contact was removed from the radio's contact table.",CONTACTS_FULL:"The radio's contact table is full and is dropping new nodes. Triggers automatic eviction when enabled.",REPEAT:"A repeater was heard rebroadcasting a message the bot sent (delivery is propagating).",NO_REPEAT:"No repeater was heard rebroadcasting the bot's message within the timeout window.",RETRY:"No repeater was heard, so the bot resent the channel message — an identical retransmit (same timestamp) that only repeaters which missed it pick up.",DIRECT_0HOP:"The bot's DM went straight to a 0-hop neighbor, so no repeater is involved — nothing to rebroadcast.",PATH_UPDATE:"Routing-path information for a contact was updated.",PATH_RESPONSE:"A response carrying the route to a contact.",TRACE:"A path-trace (traceroute) response.",TELEMETRY:"A telemetry response from a node.",BATTERY:"The radio reported its battery status.",STATUS:"A status response from the radio.",DEVICE_INFO:"The radio reported its device information.",SELF_INFO:"The radio reported its own identity/configuration.",CHANNEL_INFO:"The radio reported channel configuration.",TIME:"The radio reported its current clock time.",MSG_WAIT:"The radio signaled that messages are queued; the bot will fetch them.",NO_MORE_MSGS:"The radio's queued-message fetch is drained — nothing more waiting.",LOGIN_OK:"A login to a repeater/room server succeeded.",LOGIN_FAIL:"A login to a repeater/room server failed.",CONNECTION:"The bot's link to the radio changed state (connected/disconnected).",RX_LOG:"A raw RF frame captured from the radio's receive log.",LOG:"A log line emitted by the radio."},s=fe(()=>n[t.packet.packet_type]||"");function o(f){return f!=null&&f!==""}const l=fe(()=>{const f=t.packet,_=[],b=(P,I,B={})=>{o(I)&&_.push({k:P,v:I,...B})};return b("received",f.received_at,{time:!0}),b("event_type",f.event_type),b("packet_type",f.packet_type),b("channel",f.channel_idx),b("from",f.sender_name),b("pubkey",f.sender_pubkey||f.sender_pubkey_prefix,{mono:!0}),b("path",o(f.path_len)?`${f.path} (${f.path_len} hops)`:f.path,{mono:!0}),b("SNR",f.snr),b("RSSI",f.rssi),b("text",f.text),_});function i(f){if(!f)return null;if(typeof f=="object")return f;try{return JSON.parse(f)}catch{return null}}const r=fe(()=>{const f=i(t.packet.payload_json);return!f||typeof f!="object"||Object.keys(f).length===0?null:f}),a=fe(()=>{const f=i(t.packet.attributes_json);return!f||typeof f!="object"||Object.keys(f).length===0?null:f});function p(f){return f==="timestamp"||f.endsWith("_timestamp")||f.endsWith("_at")||f==="last_advert"}function d(f,_){return _==null?"":p(f)&&typeof _=="number"&&_>0?xs(_):typeof _=="object"?JSON.stringify(_):String(_)}return(f,_)=>(k(),w("div",ym,[s.value?(k(),w("p",bm,S(s.value),1)):me("",!0),_[2]||(_[2]=u("h4",null,"Packet",-1)),u("div",km,[(k(!0),w(K,null,ae(l.value,b=>(k(),w(K,{key:b.k},[u("div",wm,S(b.k),1),u("div",{class:He({mono:b.mono})},S(b.time?pt(xs)(b.v):b.v),3)],64))),128))]),r.value?(k(),w(K,{key:1},[_[0]||(_[0]=u("h4",null,"Payload",-1)),u("div",xm,[(k(!0),w(K,null,ae(r.value,(b,P)=>(k(),w(K,{key:P},[u("div",Cm,S(P),1),u("div",Em,S(d(P,b)),1)],64))),128))])],64)):me("",!0),a.value?(k(),w(K,{key:2},[_[1]||(_[1]=u("h4",null,"Attributes",-1)),u("div",Sm,[(k(!0),w(K,null,ae(a.value,(b,P)=>(k(),w(K,{key:P},[u("div",Am,S(P),1),u("div",Rm,S(d(P,b)),1)],64))),128))])],64)):me("",!0)]))}},Om=Ko(Tm,[["__scopeId","data-v-d89941d4"]]),Pm={class:"panes"},Im={class:"pane",style:{flex:"1.3"}},Nm={class:"toolbar"},$m={class:"chk"},Mm=["checked"],Dm=["checked","onChange"],Lm={class:"muted"},Vm={key:0,class:"err"},Um=["data-pid","onClick"],jm={class:"pane",style:{flex:"1"}},Fm={class:"body"},Hm={key:0,class:"empty"},Bm={key:1,class:"empty"},Km={key:0,class:"err",style:{padding:"0 12px"}},Gm={key:3,class:"empty"},Wm={__name:"Packets",setup(e){const t=W([]),n=W(null),s=W(new Set),o=W(new Set),l=W(null),i=W(null),r=W(null),a=W(-1),p=W("");let d=null;const f=fe(()=>[...o.value].sort()),_=fe(()=>s.value.size===0),b=A=>!s.value.has(A),P=fe(()=>s.value.size===0?t.value:t.value.filter(A=>!s.value.has(A.packet_type)));function I(A){let j=null;for(const O of A)O.packet_type&&!o.value.has(O.packet_type)&&(j=j||new Set(o.value),j.add(O.packet_type));j&&(o.value=j)}function B(A){s.value=A?new Set:new Set(o.value)}function Q(A,j){const O=new Set(s.value);j?O.delete(A):O.add(A),s.value=O}const M=fe(()=>{if(!i.value||a.value<0)return null;const A=i.value.fields[a.value];return A?{offset:A.offset,length:A.length}:null});async function z(){try{const A=await ne("/packets?limit=200");t.value=A.items.slice().reverse(),I(A.items),await Nt(),se()}catch(A){p.value=A.message}}function q(){const A=n.value;return A?A.scrollHeight-A.scrollTop-A.clientHeight<40:!0}function se(){const A=n.value;A&&(A.scrollTop=A.scrollHeight)}function Re(A){var j,O;(O=(j=n.value)==null?void 0:j.querySelector(`[data-pid="${A}"]`))==null||O.scrollIntoView({block:"nearest"})}function pe(A){const j=P.value;if(!j.length)return;let O=l.value?j.findIndex(Oe=>Oe.id===l.value.id):-1;O===-1?O=j.length-1:O=Math.max(0,Math.min(j.length-1,O+A));const ve=j[O];le(ve),Nt(()=>Re(ve.id))}function oe(A){if(A.key!=="ArrowUp"&&A.key!=="ArrowDown")return;const j=A.target;j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT"||j.isContentEditable)||A.metaKey||A.ctrlKey||A.altKey||(A.preventDefault(),pe(A.key==="ArrowUp"?-1:1))}async function le(A){l.value=A,i.value=null,r.value=null,a.value=-1;try{A.has_raw?i.value=await ne("/packets/decode",{method:"POST",json:{packet_id:A.id}}):r.value=await ne(`/packets/${A.id}`)}catch(j){p.value=j.message}}function J(A){if(A===null||!i.value){a.value=-1;return}const j=i.value.fields.findIndex(O=>A>=O.offset&&A{z(),d=new WebSocket(Pr("/ws/packets")),d.onmessage=A=>{const j=JSON.parse(A.data),O=q();t.value.push(j),t.value.length>500&&t.value.shift(),I([j]),O&&Nt(se)},window.addEventListener("keydown",oe)}),es(()=>{d&&d.close(),window.removeEventListener("keydown",oe)}),(A,j)=>(k(),w("div",Pm,[u("div",Im,[j[4]||(j[4]=u("h3",null,"Packets (live)",-1)),u("div",Nm,[u("label",$m,[u("input",{type:"checkbox",checked:_.value,onChange:j[0]||(j[0]=O=>B(O.target.checked))},null,40,Mm),j[2]||(j[2]=he(" All ",-1))]),(k(!0),w(K,null,ae(f.value,O=>(k(),w("label",{key:O,class:"chk"},[u("input",{type:"checkbox",checked:b(O),onChange:ve=>Q(O,ve.target.checked)},null,40,Dm),he(" "+S(O),1)]))),128)),u("span",Lm,S(P.value.length)+" shown",1),p.value?(k(),w("span",Vm,S(p.value),1)):me("",!0)]),u("div",{class:"body",ref_key:"listEl",ref:n},[u("table",null,[j[3]||(j[3]=u("thead",null,[u("tr",null,[u("th",null,"time"),u("th",null,"type"),u("th",null,"from"),u("th",null,"ch"),u("th",null,"text"),u("th",null,"raw")])],-1)),u("tbody",null,[(k(!0),w(K,null,ae(P.value,O=>(k(),w("tr",{key:O.id,"data-pid":O.id,class:He(["clickable",{selected:l.value&&l.value.id===O.id}]),onClick:ve=>le(O)},[u("td",null,S(pt(Ir)(O.received_at)),1),u("td",null,S(O.packet_type),1),u("td",null,S(O.sender_name||O.sender_pubkey_prefix||""),1),u("td",null,S(O.channel_idx??""),1),u("td",null,S(O.text||""),1),u("td",null,S(O.has_raw?"●":""),1)],10,Um))),128))])])],512)]),u("div",jm,[j[5]||(j[5]=u("h3",null,"Inspector",-1)),u("div",Fm,[l.value?l.value.has_raw?i.value?(k(),w(K,{key:2},[Se(rm,{hex:i.value.raw_hex,"active-range":M.value,onHoverOffset:J},null,8,["hex","active-range"]),i.value.error?(k(),w("div",Km,S(i.value.error),1)):me("",!0),Se(_m,{fields:i.value.fields,decoded:i.value.decoded,"active-index":a.value,onHoverField:j[1]||(j[1]=O=>a.value=O)},null,8,["fields","decoded","active-index"])],64)):(k(),w("div",Gm,"decoding…")):(k(),w(K,{key:1},[r.value?(k(),ir(Om,{key:0,packet:r.value},null,8,["packet"])):(k(),w("div",Bm,"loading…"))],64)):(k(),w("div",Hm,"select a packet"))])])]))}},qm=[{path:"/login",component:Kf,meta:{public:!0}},{path:"/",redirect:"/messages"},{path:"/manage",component:Pp},{path:"/messages",component:tm},{path:"/packets",component:Wm}],Nr=Mf({history:hf(),routes:qm});Nr.beforeEach(e=>{const t=ns();if(!e.meta.public&&!t.token)return"/login";if(e.path==="/login"&&t.token)return"/"});_c(Uf).use(kc()).use(Nr).mount("#app");
diff --git a/webapi/static/assets/index-pCYi_UMw.js b/webapi/static/assets/index-pCYi_UMw.js
new file mode 100644
index 0000000..14bf42c
--- /dev/null
+++ b/webapi/static/assets/index-pCYi_UMw.js
@@ -0,0 +1,39 @@
+(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();/**
+* @vue/shared v3.5.35
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/function ro(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Te={},nn=[],vt=()=>{},Rl=()=>!1,is=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),as=e=>e.startsWith("onUpdate:"),Be=Object.assign,io=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},hi=Object.prototype.hasOwnProperty,xe=(e,t)=>hi.call(e,t),ne=Array.isArray,sn=e=>hn(e)==="[object Map]",dn=e=>hn(e)==="[object Set]",To=e=>hn(e)==="[object Date]",pi=e=>hn(e)==="[object RegExp]",ie=e=>typeof e=="function",$e=e=>typeof e=="string",ot=e=>typeof e=="symbol",Ce=e=>e!==null&&typeof e=="object",$l=e=>(Ce(e)||ie(e))&&ie(e.then)&&ie(e.catch),Ol=Object.prototype.toString,hn=e=>Ol.call(e),mi=e=>hn(e).slice(8,-1),Pl=e=>hn(e)==="[object Object]",us=e=>$e(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bn=ro(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cs=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},vi=/-\w/g,ze=cs(e=>e.replace(vi,t=>t.slice(1).toUpperCase())),gi=/\B([A-Z])/g,Ft=cs(e=>e.replace(gi,"-$1").toLowerCase()),fs=cs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ss=cs(e=>e?`on${fs(e)}`:""),mt=(e,t)=>!Object.is(e,t),on=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},ds=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ro;const hs=()=>Ro||(Ro=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ao(e){if(ne(e)){const t={};for(let n=0;n{if(n){const s=n.split(yi);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function He(e){let t="";if($e(e))t=e;else if(ne(e))for(let n=0;nVt(n,t))}const Ml=e=>!!(e&&e.__v_isRef===!0),$=e=>$e(e)?e:e==null?"":ne(e)||Ce(e)&&(e.toString===Ol||!ie(e.toString))?Ml(e)?$(e.value):JSON.stringify(e,Dl,2):String(e),Dl=(e,t)=>Ml(t)?Dl(e,t.value):sn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],l)=>(n[Es(s,l)+" =>"]=o,n),{})}:dn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Es(n))}:ot(t)?Es(t):Ce(t)&&!ne(t)&&!Pl(t)?String(t):t,Es=(e,t="")=>{var n;return ot(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
+* @vue/reactivity v3.5.35
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/let Le;class Ll{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Le&&(Le.active?(this.parent=Le,this.index=(Le.scopes||(Le.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(Le===this)Le=this.prevScope;else{let t=Le;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(wn){let t=wn;for(wn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;kn;){let t=kn;for(kn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Bl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Kl(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),ho(s),Ei(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Hs(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Gl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Gl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Rn)||(e.globalVersion=Rn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Hs(e))))return;e.flags|=2;const t=e.dep,n=Re,s=lt;Re=e,lt=!0;try{Bl(e);const o=e.fn(e._value);(t.version===0||mt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Re=n,lt=s,Kl(e),e.flags&=-3}}function ho(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)ho(l,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ei(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let lt=!0;const Wl=[];function At(){Wl.push(lt),lt=!1}function Tt(){const e=Wl.pop();lt=e===void 0?!0:e}function $o(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Re;Re=void 0;try{t()}finally{Re=n}}}let Rn=0;class Ai{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class po{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Re||!lt||Re===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Re)n=this.activeLink=new Ai(Re,this),Re.deps?(n.prevDep=Re.depsTail,Re.depsTail.nextDep=n,Re.depsTail=n):Re.deps=Re.depsTail=n,ql(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Re.depsTail,n.nextDep=void 0,Re.depsTail.nextDep=n,Re.depsTail=n,Re.deps===n&&(Re.deps=s)}return n}trigger(t){this.version++,Rn++,this.notify(t)}notify(t){co();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{fo()}}}function ql(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)ql(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const zn=new WeakMap,Wt=Symbol(""),Bs=Symbol(""),$n=Symbol("");function Ke(e,t,n){if(lt&&Re){let s=zn.get(e);s||zn.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new po),o.map=s,o.key=n),o.track()}}function wt(e,t,n,s,o,l){const r=zn.get(e);if(!r){Rn++;return}const i=a=>{a&&a.trigger()};if(co(),t==="clear")r.forEach(i);else{const a=ne(e),f=a&&us(n);if(a&&n==="length"){const c=Number(s);r.forEach((d,g)=>{(g==="length"||g===$n||!ot(g)&&g>=c)&&i(d)})}else switch((n!==void 0||r.has(void 0))&&i(r.get(n)),f&&i(r.get($n)),t){case"add":a?f&&i(r.get("length")):(i(r.get(Wt)),sn(e)&&i(r.get(Bs)));break;case"delete":a||(i(r.get(Wt)),sn(e)&&i(r.get(Bs)));break;case"set":sn(e)&&i(r.get(Wt));break}}fo()}function Ti(e,t){const n=zn.get(e);return n&&n.get(t)}function Qt(e){const t=be(e);return t===e?t:(Ke(t,"iterate",$n),Ze(e)?t:t.map(rt))}function ps(e){return Ke(e=be(e),"iterate",$n),e}function ht(e,t){return Rt(e)?an(St(e)?rt(t):t):rt(t)}const Ri={__proto__:null,[Symbol.iterator](){return Ts(this,Symbol.iterator,e=>ht(this,e))},concat(...e){return Qt(this).concat(...e.map(t=>ne(t)?Qt(t):t))},entries(){return Ts(this,"entries",e=>(e[1]=ht(this,e[1]),e))},every(e,t){return _t(this,"every",e,t,void 0,arguments)},filter(e,t){return _t(this,"filter",e,t,n=>n.map(s=>ht(this,s)),arguments)},find(e,t){return _t(this,"find",e,t,n=>ht(this,n),arguments)},findIndex(e,t){return _t(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return _t(this,"findLast",e,t,n=>ht(this,n),arguments)},findLastIndex(e,t){return _t(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return _t(this,"forEach",e,t,void 0,arguments)},includes(...e){return Rs(this,"includes",e)},indexOf(...e){return Rs(this,"indexOf",e)},join(e){return Qt(this).join(e)},lastIndexOf(...e){return Rs(this,"lastIndexOf",e)},map(e,t){return _t(this,"map",e,t,void 0,arguments)},pop(){return mn(this,"pop")},push(...e){return mn(this,"push",e)},reduce(e,...t){return Oo(this,"reduce",e,t)},reduceRight(e,...t){return Oo(this,"reduceRight",e,t)},shift(){return mn(this,"shift")},some(e,t){return _t(this,"some",e,t,void 0,arguments)},splice(...e){return mn(this,"splice",e)},toReversed(){return Qt(this).toReversed()},toSorted(e){return Qt(this).toSorted(e)},toSpliced(...e){return Qt(this).toSpliced(...e)},unshift(...e){return mn(this,"unshift",e)},values(){return Ts(this,"values",e=>ht(this,e))}};function Ts(e,t,n){const s=ps(e),o=s[t]();return s!==e&&!Ze(e)&&(o._next=o.next,o.next=()=>{const l=o._next();return l.done||(l.value=n(l.value)),l}),o}const $i=Array.prototype;function _t(e,t,n,s,o,l){const r=ps(e),i=r!==e&&!Ze(e),a=r[t];if(a!==$i[t]){const d=a.apply(e,l);return i?rt(d):d}let f=n;r!==e&&(i?f=function(d,g){return n.call(this,ht(e,d),g,e)}:n.length>2&&(f=function(d,g){return n.call(this,d,g,e)}));const c=a.call(r,f,s);return i&&o?o(c):c}function Oo(e,t,n,s){const o=ps(e),l=o!==e&&!Ze(e);let r=n,i=!1;o!==e&&(l?(i=s.length===0,r=function(f,c,d){return i&&(i=!1,f=ht(e,f)),n.call(this,f,ht(e,c),d,e)}):n.length>3&&(r=function(f,c,d){return n.call(this,f,c,d,e)}));const a=o[t](r,...s);return i?ht(e,a):a}function Rs(e,t,n){const s=be(e);Ke(s,"iterate",$n);const o=s[t](...n);return(o===-1||o===!1)&&ms(n[0])?(n[0]=be(n[0]),s[t](...n)):o}function mn(e,t,n=[]){At(),co();const s=be(e)[t].apply(e,n);return fo(),Tt(),s}const Oi=ro("__proto__,__v_isRef,__isVue"),Jl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ot));function Pi(e){ot(e)||(e=String(e));const t=be(this);return Ke(t,"has",e),t.hasOwnProperty(e)}class zl{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,l=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return l;if(n==="__v_raw")return s===(o?l?Hi:Zl:l?Xl:Ql).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=ne(t);if(!o){let a;if(r&&(a=Ri[n]))return a;if(n==="hasOwnProperty")return Pi}const i=Reflect.get(t,n,Ie(t)?t:s);if((ot(n)?Jl.has(n):Oi(n))||(o||Ke(t,"get",n),l))return i;if(Ie(i)){const a=r&&us(n)?i:i.value;return o&&Ce(a)?Gs(a):a}return Ce(i)?o?Gs(i):Dn(i):i}}class Yl extends zl{constructor(t=!1){super(!1,t)}set(t,n,s,o){let l=t[n];const r=ne(t)&&us(n);if(!this._isShallow){const f=Rt(l);if(!Ze(s)&&!Rt(s)&&(l=be(l),s=be(s)),!r&&Ie(l)&&!Ie(s))return f||(l.value=s),!0}const i=r?Number(n)e,Hn=e=>Reflect.getPrototypeOf(e);function Li(e,t,n){return function(...s){const o=this.__v_raw,l=be(o),r=sn(l),i=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,f=o[e](...s),c=n?Ks:t?an:rt;return!t&&Ke(l,"iterate",a?Bs:Wt),Be(Object.create(f),{next(){const{value:d,done:g}=f.next();return g?{value:d,done:g}:{value:i?[c(d[0]),c(d[1])]:c(d),done:g}}})}}function Bn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Vi(e,t){const n={get(o){const l=this.__v_raw,r=be(l),i=be(o);e||(mt(o,i)&&Ke(r,"get",o),Ke(r,"get",i));const{has:a}=Hn(r),f=t?Ks:e?an:rt;if(a.call(r,o))return f(l.get(o));if(a.call(r,i))return f(l.get(i));l!==r&&l.get(o)},get size(){const o=this.__v_raw;return!e&&Ke(be(o),"iterate",Wt),o.size},has(o){const l=this.__v_raw,r=be(l),i=be(o);return e||(mt(o,i)&&Ke(r,"has",o),Ke(r,"has",i)),o===i?l.has(o):l.has(o)||l.has(i)},forEach(o,l){const r=this,i=r.__v_raw,a=be(i),f=t?Ks:e?an:rt;return!e&&Ke(a,"iterate",Wt),i.forEach((c,d)=>o.call(l,f(c),f(d),r))}};return Be(n,e?{add:Bn("add"),set:Bn("set"),delete:Bn("delete"),clear:Bn("clear")}:{add(o){const l=be(this),r=Hn(l),i=be(o),a=!t&&!Ze(o)&&!Rt(o)?i:o;return r.has.call(l,a)||mt(o,a)&&r.has.call(l,o)||mt(i,a)&&r.has.call(l,i)||(l.add(a),wt(l,"add",a,a)),this},set(o,l){!t&&!Ze(l)&&!Rt(l)&&(l=be(l));const r=be(this),{has:i,get:a}=Hn(r);let f=i.call(r,o);f||(o=be(o),f=i.call(r,o));const c=a.call(r,o);return r.set(o,l),f?mt(l,c)&&wt(r,"set",o,l):wt(r,"add",o,l),this},delete(o){const l=be(this),{has:r,get:i}=Hn(l);let a=r.call(l,o);a||(o=be(o),a=r.call(l,o)),i&&i.call(l,o);const f=l.delete(o);return a&&wt(l,"delete",o,void 0),f},clear(){const o=be(this),l=o.size!==0,r=o.clear();return l&&wt(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Li(o,e,t)}),n}function mo(e,t){const n=Vi(e,t);return(s,o,l)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(xe(n,o)&&o in s?n:s,o,l)}const Ui={get:mo(!1,!1)},Fi={get:mo(!1,!0)},ji={get:mo(!0,!1)};const Ql=new WeakMap,Xl=new WeakMap,Zl=new WeakMap,Hi=new WeakMap;function Bi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dn(e){return Rt(e)?e:vo(e,!1,Ni,Ui,Ql)}function er(e){return vo(e,!1,Di,Fi,Xl)}function Gs(e){return vo(e,!0,Mi,ji,Zl)}function vo(e,t,n,s,o){if(!Ce(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const l=o.get(e);if(l)return l;const r=Bi(mi(e));if(r===0)return e;const i=new Proxy(e,r===2?s:n);return o.set(e,i),i}function St(e){return Rt(e)?St(e.__v_raw):!!(e&&e.__v_isReactive)}function Rt(e){return!!(e&&e.__v_isReadonly)}function Ze(e){return!!(e&&e.__v_isShallow)}function ms(e){return e?!!e.__v_raw:!1}function be(e){const t=e&&e.__v_raw;return t?be(t):e}function go(e){return!xe(e,"__v_skip")&&Object.isExtensible(e)&&Il(e,"__v_skip",!0),e}const rt=e=>Ce(e)?Dn(e):e,an=e=>Ce(e)?Gs(e):e;function Ie(e){return e?e.__v_isRef===!0:!1}function X(e){return tr(e,!1)}function Ki(e){return tr(e,!0)}function tr(e,t){return Ie(e)?e:new Gi(e,t)}class Gi{constructor(t,n){this.dep=new po,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:be(t),this._value=n?t:rt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Ze(t)||Rt(t);t=s?t:be(t),mt(t,n)&&(this._rawValue=t,this._value=s?t:rt(t),this.dep.trigger())}}function fe(e){return Ie(e)?e.value:e}const Wi={get:(e,t,n)=>t==="__v_raw"?e:fe(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Ie(o)&&!Ie(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function nr(e){return St(e)?e:new Proxy(e,Wi)}function qi(e){const t=ne(e)?new Array(e.length):{};for(const n in e)t[n]=zi(e,n);return t}class Ji{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=ot(n)?n:String(n),this._raw=be(t);let o=!0,l=t;if(!ne(t)||ot(this._key)||!us(this._key))do o=!ms(l)||Ze(l);while(o&&(l=l.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=fe(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ie(this._raw[this._key])){const n=this._object[this._key];if(Ie(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Ti(this._raw,this._key)}}function zi(e,t,n){return new Ji(e,t,n)}class Yi{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new po(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Rn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Re!==this)return Hl(this,!0),!0}get value(){const t=this.dep.track();return Gl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Qi(e,t,n=!1){let s,o;return ie(e)?s=e:(s=e.get,o=e.set),new Yi(s,o,n)}const Kn={},Yn=new WeakMap;let Bt;function Xi(e,t=!1,n=Bt){if(n){let s=Yn.get(n);s||Yn.set(n,s=[]),s.push(e)}}function Zi(e,t,n=Te){const{immediate:s,deep:o,once:l,scheduler:r,augmentJob:i,call:a}=n,f=S=>o?S:Ze(S)||o===!1||o===0?xt(S,1):xt(S);let c,d,g,m,w=!1,x=!1;if(Ie(e)?(d=()=>e.value,w=Ze(e)):St(e)?(d=()=>f(e),w=!0):ne(e)?(x=!0,w=e.some(S=>St(S)||Ze(S)),d=()=>e.map(S=>{if(Ie(S))return S.value;if(St(S))return f(S);if(ie(S))return a?a(S,2):S()})):ie(e)?t?d=a?()=>a(e,2):e:d=()=>{if(g){At();try{g()}finally{Tt()}}const S=Bt;Bt=c;try{return a?a(e,3,[m]):e(m)}finally{Bt=S}}:d=vt,t&&o){const S=d,I=o===!0?1/0:o;d=()=>xt(S(),I)}const b=Ul(),U=()=>{c.stop(),b&&b.active&&io(b.effects,c)};if(l&&t){const S=t;t=(...I)=>{S(...I),U()}}let C=x?new Array(e.length).fill(Kn):Kn;const E=S=>{if(!(!(c.flags&1)||!c.dirty&&!S))if(t){const I=c.run();if(o||w||(x?I.some((ee,j)=>mt(ee,C[j])):mt(I,C))){g&&g();const ee=Bt;Bt=c;try{const j=[I,C===Kn?void 0:x&&C[0]===Kn?[]:C,m];C=I,a?a(t,3,j):t(...j)}finally{Bt=ee}}}else c.run()};return i&&i(E),c=new Fl(d),c.scheduler=r?()=>r(E,!1):E,m=S=>Xi(S,!1,c),g=c.onStop=()=>{const S=Yn.get(c);if(S){if(a)a(S,4);else for(const I of S)I();Yn.delete(c)}},t?s?E(!0):C=c.run():r?r(E.bind(null,!0),!0):c.run(),U.pause=c.pause.bind(c),U.resume=c.resume.bind(c),U.stop=U,U}function xt(e,t=1/0,n){if(t<=0||!Ce(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ie(e))xt(e.value,t,n);else if(ne(e))for(let s=0;s{xt(s,t,n)});else if(Pl(e)){for(const s in e)xt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&xt(e[s],t,n)}return e}/**
+* @vue/runtime-core v3.5.35
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/function Ln(e,t,n,s){try{return s?e(...s):e()}catch(o){vs(o,t,n)}}function it(e,t,n,s){if(ie(e)){const o=Ln(e,t,n,s);return o&&$l(o)&&o.catch(l=>{vs(l,t,n)}),o}if(ne(e)){const o=[];for(let l=0;l>>1,o=Je[s],l=On(o);l=On(n)?Je.push(e):Je.splice(ta(t),0,e),e.flags|=1,or()}}function or(){Qn||(Qn=sr.then(rr))}function na(e){ne(e)?ln.push(...e):Nt&&e.id===-1?Nt.splice(Zt+1,0,e):e.flags&1||(ln.push(e),e.flags|=1),or()}function Po(e,t,n=dt+1){for(;nOn(n)-On(s));if(ln.length=0,Nt){Nt.push(...t);return}for(Nt=t,Zt=0;Zte.id==null?e.flags&2?-1:1/0:e.id;function rr(e){try{for(dt=0;dt{s._d&&ss(-1);const l=Xn(t);let r;try{r=e(...o)}finally{Xn(l),s._d&&ss(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function ke(e,t){if(Qe===null)return e;const n=ks(Qe),s=e.dirs||(e.dirs=[]);for(let o=0;o1)return n&&ie(t)?t.call(s&&s.proxy):t}}function sa(){return!!(wo()||Jt)}const oa=Symbol.for("v-scx"),la=()=>et(oa);function Lt(e,t,n){return ar(e,t,n)}function ar(e,t,n=Te){const{immediate:s,deep:o,flush:l,once:r}=n,i=Be({},n),a=t&&s||!t&&l!=="post";let f;if(Nn){if(l==="sync"){const m=la();f=m.__watcherHandles||(m.__watcherHandles=[])}else if(!a){const m=()=>{};return m.stop=vt,m.resume=vt,m.pause=vt,m}}const c=Ge;i.call=(m,w,x)=>it(m,c,w,x);let d=!1;l==="post"?i.scheduler=m=>{Ve(m,c&&c.suspense)}:l!=="sync"&&(d=!0,i.scheduler=(m,w)=>{w?m():_o(m)}),i.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,c&&(m.id=c.uid,m.i=c))};const g=Zi(e,t,i);return Nn&&(f?f.push(g):a&&g()),g}function ra(e,t,n){const s=this.proxy,o=$e(e)?e.includes(".")?ur(s,e):()=>s[e]:e.bind(s,s);let l;ie(t)?l=t:(l=t.handler,n=t);const r=Un(this),i=ar(o,l.bind(s),n);return r(),i}function ur(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;oe.__isTeleport,$s=Symbol("_leaveCb");function gs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,gs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function cr(e,t){return ie(e)?Be({name:e.name},t,{setup:e}):e}function fr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Io(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Zn=new WeakMap;function Cn(e,t,n,s,o=!1){if(ne(e)){e.forEach((x,b)=>Cn(x,t&&(ne(t)?t[b]:t),n,s,o));return}if(qt(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Cn(e,t,n,s.component.subTree);return}const l=s.shapeFlag&4?ks(s.component):s.el,r=o?null:l,{i,r:a}=e,f=t&&t.r,c=i.refs===Te?i.refs={}:i.refs,d=i.setupState,g=be(d),m=d===Te?Rl:x=>Io(c,x)?!1:xe(g,x),w=(x,b)=>!(b&&Io(c,b));if(f!=null&&f!==a){if(No(t),$e(f))c[f]=null,m(f)&&(d[f]=null);else if(Ie(f)){const x=t;w(f,x.k)&&(f.value=null),x.k&&(c[x.k]=null)}}if(ie(a))Ln(a,i,12,[r,c]);else{const x=$e(a),b=Ie(a);if(x||b){const U=()=>{if(e.f){const C=x?m(a)?d[a]:c[a]:w()||!e.k?a.value:c[e.k];if(o)ne(C)&&io(C,l);else if(ne(C))C.includes(l)||C.push(l);else if(x)c[a]=[l],m(a)&&(d[a]=c[a]);else{const E=[l];w(a,e.k)&&(a.value=E),e.k&&(c[e.k]=E)}}else x?(c[a]=r,m(a)&&(d[a]=r)):b&&(w(a,e.k)&&(a.value=r),e.k&&(c[e.k]=r))};if(r){const C=()=>{U(),Zn.delete(e)};C.id=-1,Zn.set(e,C),Ve(C,n)}else No(e),U()}}}function No(e){const t=Zn.get(e);t&&(t.flags|=8,Zn.delete(e))}hs().requestIdleCallback;hs().cancelIdleCallback;const qt=e=>!!e.type.__asyncLoader,dr=e=>e.type.__isKeepAlive,ua={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=wo(),s=n.ctx;if(!s.renderer)return()=>{const C=t.default&&t.default();return C&&C.length===1?C[0]:C};const o=new Map,l=new Set;let r=null;const i=n.suspense,{renderer:{p:a,m:f,um:c,o:{createElement:d}}}=s,g=d("div");s.activate=(C,E,S,I,ee)=>{const j=C.component;f(C,E,S,0,i),a(j.vnode,C,E,S,j,i,I,C.slotScopeIds,ee),Ve(()=>{j.isDeactivated=!1,j.a&&on(j.a);const W=C.props&&C.props.onVnodeMounted;W&&nt(W,j.parent,C)},i)},s.deactivate=C=>{const E=C.component;ts(E.m),ts(E.a),f(C,g,null,1,i),Ve(()=>{E.da&&on(E.da);const S=C.props&&C.props.onVnodeUnmounted;S&&nt(S,E.parent,C),E.isDeactivated=!0},i)};function m(C){Os(C),c(C,n,i,!0)}function w(C){o.forEach((E,S)=>{const I=Qs(qt(E)?E.type.__asyncResolved||{}:E.type);I&&!C(I)&&x(S)})}function x(C){const E=o.get(C);E&&(!r||!en(E,r))?m(E):r&&Os(r),o.delete(C),l.delete(C)}Lt(()=>[e.include,e.exclude],([C,E])=>{C&&w(S=>gn(C,S)),E&&w(S=>!gn(E,S))},{flush:"post",deep:!0});let b=null;const U=()=>{b!=null&&(ns(n.subTree.type)?Ve(()=>{o.set(b,Gn(n.subTree))},n.subTree.suspense):o.set(b,Gn(n.subTree)))};return tt(U),vr(U),gr(()=>{o.forEach(C=>{const{subTree:E,suspense:S}=n,I=Gn(E);if(C.type===I.type&&C.key===I.key){Os(I);const ee=I.component.da;ee&&Ve(ee,S);return}m(C)})}),()=>{if(b=null,!t.default)return r=null;const C=t.default(),E=C[0];if(C.length>1)return r=null,C;if(!In(E)||!(E.shapeFlag&4)&&!(E.shapeFlag&128))return r=null,E;let S=Gn(E);if(S.type===$t)return r=null,S;const I=S.type,ee=Qs(qt(S)?S.type.__asyncResolved||{}:I),{include:j,exclude:W,max:J}=e;if(j&&(!ee||!gn(j,ee))||W&&ee&&gn(W,ee))return S.shapeFlag&=-257,r=S,E;const F=S.key==null?I:S.key,T=o.get(F);return S.el&&(S=zt(S),E.shapeFlag&128&&(E.ssContent=S)),b=F,T?(S.el=T.el,S.component=T.component,S.transition&&gs(S,S.transition),S.shapeFlag|=512,l.delete(F),l.add(F)):(l.add(F),J&&l.size>parseInt(J,10)&&x(l.values().next().value)),S.shapeFlag|=256,r=S,ns(E.type)?E:S}}},ca=ua;function gn(e,t){return ne(e)?e.some(n=>gn(n,t)):$e(e)?e.split(",").includes(t):pi(e)?(e.lastIndex=0,e.test(t)):!1}function hr(e,t){mr(e,"a",t)}function pr(e,t){mr(e,"da",t)}function mr(e,t,n=Ge){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(_s(t,s,n),n){let o=n.parent;for(;o&&o.parent;)dr(o.parent.vnode)&&fa(s,t,n,o),o=o.parent}}function fa(e,t,n,s){const o=_s(t,e,s,!0);Vn(()=>{io(s[t],o)},n)}function Os(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Gn(e){return e.shapeFlag&128?e.ssContent:e}function _s(e,t,n=Ge,s=!1){if(n){const o=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...r)=>{At();const i=Un(n),a=it(t,n,e,r);return i(),Tt(),a});return s?o.unshift(l):o.push(l),l}}const Ot=e=>(t,n=Ge)=>{(!Nn||e==="sp")&&_s(e,(...s)=>t(...s),n)},da=Ot("bm"),tt=Ot("m"),ha=Ot("bu"),vr=Ot("u"),gr=Ot("bum"),Vn=Ot("um"),pa=Ot("sp"),ma=Ot("rtg"),va=Ot("rtc");function ga(e,t=Ge){_s("ec",e,t)}const _r="components";function Mo(e,t){return br(_r,e,!0,t)||e}const yr=Symbol.for("v-ndc");function _a(e){return $e(e)?br(_r,e,!1)||e:e||yr}function br(e,t,n=!0,s=!1){const o=Qe||Ge;if(o){const l=o.type;{const i=Qs(l,!1);if(i&&(i===t||i===ze(t)||i===fs(ze(t))))return l}const r=Do(o[e]||l[e],t)||Do(o.appContext[e],t);return!r&&s?l:r}}function Do(e,t){return e&&(e[t]||e[ze(t)]||e[fs(ze(t))])}function ae(e,t,n,s){let o;const l=n,r=ne(e);if(r||$e(e)){const i=r&&St(e);let a=!1,f=!1;i&&(a=!Ze(e),f=Rt(e),e=ps(e)),o=new Array(e.length);for(let c=0,d=e.length;ct(i,a,void 0,l));else{const i=Object.keys(e);o=new Array(i.length);for(let a=0,f=i.length;ae?Ur(e)?ks(e):Ws(e.parent):null,Sn=Be(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ws(e.parent),$root:e=>Ws(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>wr(e),$forceUpdate:e=>e.f||(e.f=()=>{_o(e.update)}),$nextTick:e=>e.n||(e.n=Et.bind(e.proxy)),$watch:e=>ra.bind(e)}),Ps=(e,t)=>e!==Te&&!e.__isScriptSetup&&xe(e,t),ya={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:l,accessCache:r,type:i,appContext:a}=e;if(t[0]!=="$"){const g=r[t];if(g!==void 0)switch(g){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return l[t]}else{if(Ps(s,t))return r[t]=1,s[t];if(o!==Te&&xe(o,t))return r[t]=2,o[t];if(xe(l,t))return r[t]=3,l[t];if(n!==Te&&xe(n,t))return r[t]=4,n[t];qs&&(r[t]=0)}}const f=Sn[t];let c,d;if(f)return t==="$attrs"&&Ke(e.attrs,"get",""),f(e);if((c=i.__cssModules)&&(c=c[t]))return c;if(n!==Te&&xe(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,xe(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:l}=e;return Ps(o,t)?(o[t]=n,!0):s!==Te&&xe(s,t)?(s[t]=n,!0):xe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:l,type:r}},i){let a;return!!(n[i]||e!==Te&&i[0]!=="$"&&xe(e,i)||Ps(t,i)||xe(l,i)||xe(s,i)||xe(Sn,i)||xe(o.config.globalProperties,i)||(a=r.__cssModules)&&a[i])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:xe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Lo(e){return ne(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let qs=!0;function ba(e){const t=wr(e),n=e.proxy,s=e.ctx;qs=!1,t.beforeCreate&&Vo(t.beforeCreate,e,"bc");const{data:o,computed:l,methods:r,watch:i,provide:a,inject:f,created:c,beforeMount:d,mounted:g,beforeUpdate:m,updated:w,activated:x,deactivated:b,beforeDestroy:U,beforeUnmount:C,destroyed:E,unmounted:S,render:I,renderTracked:ee,renderTriggered:j,errorCaptured:W,serverPrefetch:J,expose:F,inheritAttrs:T,components:K,directives:N,filters:ue}=t;if(f&&ka(f,s,null),r)for(const oe in r){const pe=r[oe];ie(pe)&&(s[oe]=pe.bind(n))}if(o){const oe=o.call(n,n);Ce(oe)&&(e.data=Dn(oe))}if(qs=!0,l)for(const oe in l){const pe=l[oe],L=ie(pe)?pe.bind(n,n):ie(pe.get)?pe.get.bind(n,n):vt,D=!ie(pe)&&ie(pe.set)?pe.set.bind(n):vt,z=de({get:L,set:D});Object.defineProperty(s,oe,{enumerable:!0,configurable:!0,get:()=>z.value,set:ve=>z.value=ve})}if(i)for(const oe in i)kr(i[oe],s,n,oe);if(a){const oe=ie(a)?a.call(n):a;Reflect.ownKeys(oe).forEach(pe=>{xn(pe,oe[pe])})}c&&Vo(c,e,"c");function he(oe,pe){ne(pe)?pe.forEach(L=>oe(L.bind(n))):pe&&oe(pe.bind(n))}if(he(da,d),he(tt,g),he(ha,m),he(vr,w),he(hr,x),he(pr,b),he(ga,W),he(va,ee),he(ma,j),he(gr,C),he(Vn,S),he(pa,J),ne(F))if(F.length){const oe=e.exposed||(e.exposed={});F.forEach(pe=>{Object.defineProperty(oe,pe,{get:()=>n[pe],set:L=>n[pe]=L,enumerable:!0})})}else e.exposed||(e.exposed={});I&&e.render===vt&&(e.render=I),T!=null&&(e.inheritAttrs=T),K&&(e.components=K),N&&(e.directives=N),J&&fr(e)}function ka(e,t,n=vt){ne(e)&&(e=Js(e));for(const s in e){const o=e[s];let l;Ce(o)?"default"in o?l=et(o.from||s,o.default,!0):l=et(o.from||s):l=et(o),Ie(l)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>l.value,set:r=>l.value=r}):t[s]=l}}function Vo(e,t,n){it(ne(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function kr(e,t,n,s){let o=s.includes(".")?ur(n,s):()=>n[s];if($e(e)){const l=t[e];ie(l)&&Lt(o,l)}else if(ie(e))Lt(o,e.bind(n));else if(Ce(e))if(ne(e))e.forEach(l=>kr(l,t,n,s));else{const l=ie(e.handler)?e.handler.bind(n):t[e.handler];ie(l)&&Lt(o,l,e)}}function wr(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:l,config:{optionMergeStrategies:r}}=e.appContext,i=l.get(t);let a;return i?a=i:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(f=>es(a,f,r,!0)),es(a,t,r)),Ce(t)&&l.set(t,a),a}function es(e,t,n,s=!1){const{mixins:o,extends:l}=t;l&&es(e,l,n,!0),o&&o.forEach(r=>es(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const i=wa[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const wa={data:Uo,props:Fo,emits:Fo,methods:_n,computed:_n,beforeCreate:We,created:We,beforeMount:We,mounted:We,beforeUpdate:We,updated:We,beforeDestroy:We,beforeUnmount:We,destroyed:We,unmounted:We,activated:We,deactivated:We,errorCaptured:We,serverPrefetch:We,components:_n,directives:_n,watch:Ca,provide:Uo,inject:xa};function Uo(e,t){return t?e?function(){return Be(ie(e)?e.call(this,this):e,ie(t)?t.call(this,this):t)}:t:e}function xa(e,t){return _n(Js(e),Js(t))}function Js(e){if(ne(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ze(t)}Modifiers`]||e[`${Ft(t)}Modifiers`];function Ta(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Te;let o=n;const l=t.startsWith("update:"),r=l&&Aa(s,t.slice(7));r&&(r.trim&&(o=n.map(c=>$e(c)?c.trim():c)),r.number&&(o=n.map(ds)));let i,a=s[i=Ss(t)]||s[i=Ss(ze(t))];!a&&l&&(a=s[i=Ss(Ft(t))]),a&&it(a,e,6,o);const f=s[i+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,it(f,e,6,o)}}const Ra=new WeakMap;function Cr(e,t,n=!1){const s=n?Ra:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const l=e.emits;let r={},i=!1;if(!ie(e)){const a=f=>{const c=Cr(f,t,!0);c&&(i=!0,Be(r,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!l&&!i?(Ce(e)&&s.set(e,null),null):(ne(l)?l.forEach(a=>r[a]=null):Be(r,l),Ce(e)&&s.set(e,r),r)}function ys(e,t){return!e||!is(t)?!1:(t=t.slice(2).replace(/Once$/,""),xe(e,t[0].toLowerCase()+t.slice(1))||xe(e,Ft(t))||xe(e,t))}function jo(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[l],slots:r,attrs:i,emit:a,render:f,renderCache:c,props:d,data:g,setupState:m,ctx:w,inheritAttrs:x}=e,b=Xn(e);let U,C;try{if(n.shapeFlag&4){const S=o||s,I=S;U=pt(f.call(I,S,c,d,m,g,w)),C=i}else{const S=t;U=pt(S.length>1?S(d,{attrs:i,slots:r,emit:a}):S(d,null)),C=t.props?i:$a(i)}}catch(S){En.length=0,vs(S,e,1),U=Ee($t)}let E=U;if(C&&x!==!1){const S=Object.keys(C),{shapeFlag:I}=E;S.length&&I&7&&(l&&S.some(as)&&(C=Oa(C,l)),E=zt(E,C,!1,!0))}return n.dirs&&(E=zt(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(n.dirs):n.dirs),n.transition&&gs(E,n.transition),U=E,Xn(b),U}const $a=e=>{let t;for(const n in e)(n==="class"||n==="style"||is(n))&&((t||(t={}))[n]=e[n]);return t},Oa=(e,t)=>{const n={};for(const s in e)(!as(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Pa(e,t,n){const{props:s,children:o,component:l}=e,{props:r,children:i,patchFlag:a}=t,f=l.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Ho(s,r,f):!!r;if(a&8){const c=t.dynamicProps;for(let d=0;dObject.create(Er),Tr=e=>Object.getPrototypeOf(e)===Er;function Na(e,t,n,s=!1){const o={},l=Ar();e.propsDefaults=Object.create(null),Rr(e,t,o,l);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:er(o):e.type.props?e.props=o:e.props=l,e.attrs=l}function Ma(e,t,n,s){const{props:o,attrs:l,vnode:{patchFlag:r}}=e,i=be(o),[a]=e.propsOptions;let f=!1;if((s||r>0)&&!(r&16)){if(r&8){const c=e.vnode.dynamicProps;for(let d=0;d{a=!0;const[g,m]=$r(d,t,!0);Be(r,g),m&&i.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!l&&!a)return Ce(e)&&s.set(e,nn),nn;if(ne(l))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",bo=e=>ne(e)?e.map(pt):[pt(e)],La=(e,t,n)=>{if(t._n)return t;const s=qn((...o)=>bo(t(...o)),n);return s._c=!1,s},Or=(e,t,n)=>{const s=e._ctx;for(const o in e){if(yo(o))continue;const l=e[o];if(ie(l))t[o]=La(o,l,s);else if(l!=null){const r=bo(l);t[o]=()=>r}}},Pr=(e,t)=>{const n=bo(t);e.slots.default=()=>n},Ir=(e,t,n)=>{for(const s in t)(n||!yo(s))&&(e[s]=t[s])},Va=(e,t,n)=>{const s=e.slots=Ar();if(e.vnode.shapeFlag&32){const o=t._;o?(Ir(s,t,n),n&&Il(s,"_",o,!0)):Or(t,s)}else t&&Pr(e,t)},Ua=(e,t,n)=>{const{vnode:s,slots:o}=e;let l=!0,r=Te;if(s.shapeFlag&32){const i=t._;i?n&&i===1?l=!1:Ir(o,t,n):(l=!t.$stable,Or(t,o)),r=t}else t&&(Pr(e,t),r={default:1});if(l)for(const i in o)!yo(i)&&r[i]==null&&delete o[i]},Ve=Ka;function Fa(e){return ja(e)}function ja(e,t){const n=hs();n.__VUE__=!0;const{insert:s,remove:o,patchProp:l,createElement:r,createText:i,createComment:a,setText:f,setElementText:c,parentNode:d,nextSibling:g,setScopeId:m=vt,insertStaticContent:w}=e,x=(h,v,_,O=null,P=null,R=null,q=void 0,G=null,B=!!v.dynamicChildren)=>{if(h===v)return;h&&!en(h,v)&&(O=p(h),ve(h,P,R,!0),h=null),v.patchFlag===-2&&(B=!1,v.dynamicChildren=null);const{type:M,ref:se,shapeFlag:Y}=v;switch(M){case bs:b(h,v,_,O);break;case $t:U(h,v,_,O);break;case Ns:h==null&&C(v,_,O,q);break;case Q:K(h,v,_,O,P,R,q,G,B);break;default:Y&1?I(h,v,_,O,P,R,q,G,B):Y&6?N(h,v,_,O,P,R,q,G,B):(Y&64||Y&128)&&M.process(h,v,_,O,P,R,q,G,B,Z)}se!=null&&P?Cn(se,h&&h.ref,R,v||h,!v):se==null&&h&&h.ref!=null&&Cn(h.ref,null,R,h,!0)},b=(h,v,_,O)=>{if(h==null)s(v.el=i(v.children),_,O);else{const P=v.el=h.el;v.children!==h.children&&f(P,v.children)}},U=(h,v,_,O)=>{h==null?s(v.el=a(v.children||""),_,O):v.el=h.el},C=(h,v,_,O)=>{[h.el,h.anchor]=w(h.children,v,_,O,h.el,h.anchor)},E=({el:h,anchor:v},_,O)=>{let P;for(;h&&h!==v;)P=g(h),s(h,_,O),h=P;s(v,_,O)},S=({el:h,anchor:v})=>{let _;for(;h&&h!==v;)_=g(h),o(h),h=_;o(v)},I=(h,v,_,O,P,R,q,G,B)=>{if(v.type==="svg"?q="svg":v.type==="math"&&(q="mathml"),h==null)ee(v,_,O,P,R,q,G,B);else{const M=h.el&&h.el._isVueCE?h.el:null;try{M&&M._beginPatch(),J(h,v,P,R,q,G,B)}finally{M&&M._endPatch()}}},ee=(h,v,_,O,P,R,q,G)=>{let B,M;const{props:se,shapeFlag:Y,transition:te,dirs:le}=h;if(B=h.el=r(h.type,R,se&&se.is,se),Y&8?c(B,h.children):Y&16&&W(h.children,B,null,O,P,Is(h,R),q,G),le&&jt(h,null,O,"created"),j(B,h,h.scopeId,q,O),se){for(const Ae in se)Ae!=="value"&&!bn(Ae)&&l(B,Ae,null,se[Ae],R,O);"value"in se&&l(B,"value",null,se.value,R),(M=se.onVnodeBeforeMount)&&nt(M,O,h)}le&&jt(h,null,O,"beforeMount");const ge=Ha(P,te);ge&&te.beforeEnter(B),s(B,v,_),((M=se&&se.onVnodeMounted)||ge||le)&&Ve(()=>{try{M&&nt(M,O,h),ge&&te.enter(B),le&&jt(h,null,O,"mounted")}finally{}},P)},j=(h,v,_,O,P)=>{if(_&&m(h,_),O)for(let R=0;R{for(let M=B;M{const G=v.el=h.el;let{patchFlag:B,dynamicChildren:M,dirs:se}=v;B|=h.patchFlag&16;const Y=h.props||Te,te=v.props||Te;let le;if(_&&Ht(_,!1),(le=te.onVnodeBeforeUpdate)&&nt(le,_,v,h),se&&jt(v,h,_,"beforeUpdate"),_&&Ht(_,!0),(Y.innerHTML&&te.innerHTML==null||Y.textContent&&te.textContent==null)&&c(G,""),M?F(h.dynamicChildren,M,G,_,O,Is(v,P),R):q||pe(h,v,G,null,_,O,Is(v,P),R,!1),B>0){if(B&16)T(G,Y,te,_,P);else if(B&2&&Y.class!==te.class&&l(G,"class",null,te.class,P),B&4&&l(G,"style",Y.style,te.style,P),B&8){const ge=v.dynamicProps;for(let Ae=0;Ae{le&&nt(le,_,v,h),se&&jt(v,h,_,"updated")},O)},F=(h,v,_,O,P,R,q)=>{for(let G=0;G{if(v!==_){if(v!==Te)for(const R in v)!bn(R)&&!(R in _)&&l(h,R,v[R],null,P,O);for(const R in _){if(bn(R))continue;const q=_[R],G=v[R];q!==G&&R!=="value"&&l(h,R,G,q,P,O)}"value"in _&&l(h,"value",v.value,_.value,P)}},K=(h,v,_,O,P,R,q,G,B)=>{const M=v.el=h?h.el:i(""),se=v.anchor=h?h.anchor:i("");let{patchFlag:Y,dynamicChildren:te,slotScopeIds:le}=v;le&&(G=G?G.concat(le):le),h==null?(s(M,_,O),s(se,_,O),W(v.children||[],_,se,P,R,q,G,B)):Y>0&&Y&64&&te&&h.dynamicChildren&&h.dynamicChildren.length===te.length?(F(h.dynamicChildren,te,_,P,R,q,G),(v.key!=null||P&&v===P.subTree)&&Nr(h,v,!0)):pe(h,v,_,se,P,R,q,G,B)},N=(h,v,_,O,P,R,q,G,B)=>{v.slotScopeIds=G,h==null?v.shapeFlag&512?P.ctx.activate(v,_,O,q,B):ue(v,_,O,P,R,q,B):ye(h,v,B)},ue=(h,v,_,O,P,R,q)=>{const G=h.component=Qa(h,O,P);if(dr(h)&&(G.ctx.renderer=Z),Xa(G,!1,q),G.asyncDep){if(P&&P.registerDep(G,he,q),!h.el){const B=G.subTree=Ee($t);U(null,B,v,_),h.placeholder=B.el}}else he(G,h,v,_,P,R,q)},ye=(h,v,_)=>{const O=v.component=h.component;if(Pa(h,v,_))if(O.asyncDep&&!O.asyncResolved){oe(O,v,_);return}else O.next=v,O.update();else v.el=h.el,O.vnode=v},he=(h,v,_,O,P,R,q)=>{const G=()=>{if(h.isMounted){let{next:Y,bu:te,u:le,parent:ge,vnode:Ae}=h;{const ct=Mr(h);if(ct){Y&&(Y.el=Ae.el,oe(h,Y,q)),ct.asyncDep.then(()=>{Ve(()=>{h.isUnmounted||M()},P)});return}}let Se=Y,Ne;Ht(h,!1),Y?(Y.el=Ae.el,oe(h,Y,q)):Y=Ae,te&&on(te),(Ne=Y.props&&Y.props.onVnodeBeforeUpdate)&&nt(Ne,ge,Y,Ae),Ht(h,!0);const je=jo(h),ut=h.subTree;h.subTree=je,x(ut,je,d(ut.el),p(ut),h,P,R),Y.el=je.el,Se===null&&Ia(h,je.el),le&&Ve(le,P),(Ne=Y.props&&Y.props.onVnodeUpdated)&&Ve(()=>nt(Ne,ge,Y,Ae),P)}else{let Y;const{el:te,props:le}=v,{bm:ge,m:Ae,parent:Se,root:Ne,type:je}=h,ut=qt(v);Ht(h,!1),ge&&on(ge),!ut&&(Y=le&&le.onVnodeBeforeMount)&&nt(Y,Se,v),Ht(h,!0);{Ne.ce&&Ne.ce._hasShadowRoot()&&Ne.ce._injectChildStyle(je,h.parent?h.parent.type:void 0);const ct=h.subTree=jo(h);x(null,ct,_,O,h,P,R),v.el=ct.el}if(Ae&&Ve(Ae,P),!ut&&(Y=le&&le.onVnodeMounted)){const ct=v;Ve(()=>nt(Y,Se,ct),P)}(v.shapeFlag&256||Se&&qt(Se.vnode)&&Se.vnode.shapeFlag&256)&&h.a&&Ve(h.a,P),h.isMounted=!0,v=_=O=null}};h.scope.on();const B=h.effect=new Fl(G);h.scope.off();const M=h.update=B.run.bind(B),se=h.job=B.runIfDirty.bind(B);se.i=h,se.id=h.uid,B.scheduler=()=>_o(se),Ht(h,!0),M()},oe=(h,v,_)=>{v.component=h;const O=h.vnode.props;h.vnode=v,h.next=null,Ma(h,v.props,O,_),Ua(h,v.children,_),At(),Po(h),Tt()},pe=(h,v,_,O,P,R,q,G,B=!1)=>{const M=h&&h.children,se=h?h.shapeFlag:0,Y=v.children,{patchFlag:te,shapeFlag:le}=v;if(te>0){if(te&128){D(M,Y,_,O,P,R,q,G,B);return}else if(te&256){L(M,Y,_,O,P,R,q,G,B);return}}le&8?(se&16&&H(M,P,R),Y!==M&&c(_,Y)):se&16?le&16?D(M,Y,_,O,P,R,q,G,B):H(M,P,R,!0):(se&8&&c(_,""),le&16&&W(Y,_,O,P,R,q,G,B))},L=(h,v,_,O,P,R,q,G,B)=>{h=h||nn,v=v||nn;const M=h.length,se=v.length,Y=Math.min(M,se);let te;for(te=0;tese?H(h,P,R,!0,!1,Y):W(v,_,O,P,R,q,G,B,Y)},D=(h,v,_,O,P,R,q,G,B)=>{let M=0;const se=v.length;let Y=h.length-1,te=se-1;for(;M<=Y&&M<=te;){const le=h[M],ge=v[M]=B?kt(v[M]):pt(v[M]);if(en(le,ge))x(le,ge,_,null,P,R,q,G,B);else break;M++}for(;M<=Y&&M<=te;){const le=h[Y],ge=v[te]=B?kt(v[te]):pt(v[te]);if(en(le,ge))x(le,ge,_,null,P,R,q,G,B);else break;Y--,te--}if(M>Y){if(M<=te){const le=te+1,ge=lete)for(;M<=Y;)ve(h[M],P,R,!0),M++;else{const le=M,ge=M,Ae=new Map;for(M=ge;M<=te;M++){const Ye=v[M]=B?kt(v[M]):pt(v[M]);Ye.key!=null&&Ae.set(Ye.key,M)}let Se,Ne=0;const je=te-ge+1;let ut=!1,ct=0;const pn=new Array(je);for(M=0;M=je){ve(Ye,P,R,!0);continue}let ft;if(Ye.key!=null)ft=Ae.get(Ye.key);else for(Se=ge;Se<=te;Se++)if(pn[Se-ge]===0&&en(Ye,v[Se])){ft=Se;break}ft===void 0?ve(Ye,P,R,!0):(pn[ft-ge]=M+1,ft>=ct?ct=ft:ut=!0,x(Ye,v[ft],_,null,P,R,q,G,B),Ne++)}const So=ut?Ba(pn):nn;for(Se=So.length-1,M=je-1;M>=0;M--){const Ye=ge+M,ft=v[Ye],Eo=v[Ye+1],Ao=Ye+1{const{el:R,type:q,transition:G,children:B,shapeFlag:M}=h;if(M&6){z(h.component.subTree,v,_,O);return}if(M&128){h.suspense.move(v,_,O);return}if(M&64){q.move(h,v,_,Z);return}if(q===Q){s(R,v,_);for(let Y=0;YG.enter(R),P));else{const{leave:Y,delayLeave:te,afterLeave:le}=G,ge=()=>{h.ctx.isUnmounted?o(R):s(R,v,_)},Ae=()=>{const Se=R._isLeaving||!!R[$s];R._isLeaving&&R[$s](!0),G.persisted&&!Se?ge():Y(R,()=>{ge(),le&&le()})};te?te(R,ge,Ae):Ae()}else s(R,v,_)},ve=(h,v,_,O=!1,P=!1)=>{const{type:R,props:q,ref:G,children:B,dynamicChildren:M,shapeFlag:se,patchFlag:Y,dirs:te,cacheIndex:le,memo:ge}=h;if(Y===-2&&(P=!1),G!=null&&(At(),Cn(G,null,_,h,!0),Tt()),le!=null&&(v.renderCache[le]=void 0),se&256){v.ctx.deactivate(h);return}const Ae=se&1&&te,Se=!qt(h);let Ne;if(Se&&(Ne=q&&q.onVnodeBeforeUnmount)&&nt(Ne,v,h),se&6)Fe(h.component,_,O);else{if(se&128){h.suspense.unmount(_,O);return}Ae&&jt(h,null,v,"beforeUnmount"),se&64?h.type.remove(h,v,_,Z,O):M&&!M.hasOnce&&(R!==Q||Y>0&&Y&64)?H(M,v,_,!1,!0):(R===Q&&Y&384||!P&&se&16)&&H(B,v,_),O&&Me(h)}const je=ge!=null&&le==null;(Se&&(Ne=q&&q.onVnodeUnmounted)||Ae||je)&&Ve(()=>{Ne&&nt(Ne,v,h),Ae&&jt(h,null,v,"unmounted"),je&&(h.el=null)},_)},Me=h=>{const{type:v,el:_,anchor:O,transition:P}=h;if(v===Q){Ue(_,O);return}if(v===Ns){S(h);return}const R=()=>{o(_),P&&!P.persisted&&P.afterLeave&&P.afterLeave()};if(h.shapeFlag&1&&P&&!P.persisted){const{leave:q,delayLeave:G}=P,B=()=>q(_,R);G?G(h.el,R,B):B()}else R()},Ue=(h,v)=>{let _;for(;h!==v;)_=g(h),o(h),h=_;o(v)},Fe=(h,v,_)=>{const{bum:O,scope:P,job:R,subTree:q,um:G,m:B,a:M}=h;ts(B),ts(M),O&&on(O),P.stop(),R&&(R.flags|=8,ve(q,h,v,_)),G&&Ve(G,v),Ve(()=>{h.isUnmounted=!0},v)},H=(h,v,_,O=!1,P=!1,R=0)=>{for(let q=R;q{if(h.shapeFlag&6)return p(h.component.subTree);if(h.shapeFlag&128)return h.suspense.next();const v=g(h.anchor||h.el),_=v&&v[ia];return _?g(_):v};let A=!1;const V=(h,v,_)=>{let O;h==null?v._vnode&&(ve(v._vnode,null,null,!0),O=v._vnode.component):x(v._vnode||null,h,v,null,null,null,_),v._vnode=h,A||(A=!0,Po(O),lr(),A=!1)},Z={p:x,um:ve,m:z,r:Me,mt:ue,mc:W,pc:pe,pbc:F,n:p,o:e};return{render:V,hydrate:void 0,createApp:Ea(V)}}function Is({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ht({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ha(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Nr(e,t,n=!1){const s=e.children,o=t.children;if(ne(s)&&ne(o))for(let l=0;l>1,e[n[i]]0&&(t[s]=n[l-1]),n[l]=s)}}for(l=n.length,r=n[l-1];l-- >0;)n[l]=r,r=t[r];return n}function Mr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Mr(t)}function ts(e){if(e)for(let t=0;te.__isSuspense;function Ka(e,t){t&&t.pendingBranch?ne(e)?t.effects.push(...e):t.effects.push(e):na(e)}const Q=Symbol.for("v-fgt"),bs=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),Ns=Symbol.for("v-stc"),En=[];let Xe=null;function y(e=!1){En.push(Xe=e?null:[])}function Ga(){En.pop(),Xe=En[En.length-1]||null}let Pn=1;function ss(e,t=!1){Pn+=e,e<0&&Xe&&t&&(Xe.hasOnce=!0)}function Lr(e){return e.dynamicChildren=Pn>0?Xe||nn:null,Ga(),Pn>0&&Xe&&Xe.push(e),e}function k(e,t,n,s,o,l){return Lr(u(e,t,n,s,o,l,!0))}function os(e,t,n,s,o){return Lr(Ee(e,t,n,s,o,!0))}function In(e){return e?e.__v_isVNode===!0:!1}function en(e,t){return e.type===t.type&&e.key===t.key}const Vr=({key:e})=>e??null,Jn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Ie(e)||ie(e)?{i:Qe,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,l=e===Q?0:1,r=!1,i=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Vr(t),ref:t&&Jn(t),scopeId:ir,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Qe};return i?(ko(a,n),l&128&&e.normalize(a)):n&&(a.shapeFlag|=$e(n)?8:16),Pn>0&&!r&&Xe&&(a.patchFlag>0||l&6)&&a.patchFlag!==32&&Xe.push(a),a}const Ee=Wa;function Wa(e,t=null,n=null,s=0,o=null,l=!1){if((!e||e===yr)&&(e=$t),In(e)){const i=zt(e,t,!0);return n&&ko(i,n),Pn>0&&!l&&Xe&&(i.shapeFlag&6?Xe[Xe.indexOf(e)]=i:Xe.push(i)),i.patchFlag=-2,i}if(nu(e)&&(e=e.__vccOpts),t){t=qa(t);let{class:i,style:a}=t;i&&!$e(i)&&(t.class=He(i)),Ce(a)&&(ms(a)&&!ne(a)&&(a=Be({},a)),t.style=ao(a))}const r=$e(e)?1:ns(e)?128:aa(e)?64:Ce(e)?4:ie(e)?2:0;return u(e,t,n,s,o,r,l,!0)}function qa(e){return e?ms(e)||Tr(e)?Be({},e):e:null}function zt(e,t,n=!1,s=!1){const{props:o,ref:l,patchFlag:r,children:i,transition:a}=e,f=t?Ja(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Vr(f),ref:t&&t.ref?n&&l?ne(l)?l.concat(Jn(t)):[l,Jn(t)]:Jn(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Q?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zt(e.ssContent),ssFallback:e.ssFallback&&zt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&gs(c,a.clone(c)),c}function me(e=" ",t=0){return Ee(bs,null,e,t)}function _e(e="",t=!1){return t?(y(),os($t,null,e)):Ee($t,null,e)}function pt(e){return e==null||typeof e=="boolean"?Ee($t):ne(e)?Ee(Q,null,e.slice()):In(e)?kt(e):Ee(bs,null,String(e))}function kt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:zt(e)}function ko(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ne(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),ko(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Tr(t)?t._ctx=Qe:o===3&&Qe&&(Qe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ie(t)?(t={default:t,_ctx:Qe},n=32):(t=String(t),s&64?(n=16,t=[me(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ja(...e){const t={};for(let n=0;nGe||Qe;let ls,Ys;{const e=hs(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),l=>{o.length>1?o.forEach(r=>r(l)):o[0](l)}};ls=t("__VUE_INSTANCE_SETTERS__",n=>Ge=n),Ys=t("__VUE_SSR_SETTERS__",n=>Nn=n)}const Un=e=>{const t=Ge;return ls(e),e.scope.on(),()=>{e.scope.off(),ls(t)}},Ko=()=>{Ge&&Ge.scope.off(),ls(null)};function Ur(e){return e.vnode.shapeFlag&4}let Nn=!1;function Xa(e,t=!1,n=!1){t&&Ys(t);const{props:s,children:o}=e.vnode,l=Ur(e);Na(e,s,l,t),Va(e,o,n||t);const r=l?Za(e,t):void 0;return t&&Ys(!1),r}function Za(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ya);const{setup:s}=n;if(s){At();const o=e.setupContext=s.length>1?tu(e):null,l=Un(e),r=Ln(s,e,0,[e.props,o]),i=$l(r);if(Tt(),l(),(i||e.sp)&&!qt(e)&&fr(e),i){if(r.then(Ko,Ko),t)return r.then(a=>{Go(e,a)}).catch(a=>{vs(a,e,0)});e.asyncDep=r}else Go(e,r)}else Fr(e)}function Go(e,t,n){ie(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ce(t)&&(e.setupState=nr(t)),Fr(e)}function Fr(e,t,n){const s=e.type;e.render||(e.render=s.render||vt);{const o=Un(e);At();try{ba(e)}finally{Tt(),o()}}}const eu={get(e,t){return Ke(e,"get",""),e[t]}};function tu(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,eu),slots:e.slots,emit:e.emit,expose:t}}function ks(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(nr(go(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Sn)return Sn[n](e)},has(t,n){return n in t||n in Sn}})):e.proxy}function Qs(e,t=!0){return ie(e)?e.displayName||e.name:e.name||t&&e.__name}function nu(e){return ie(e)&&"__vccOpts"in e}const de=(e,t)=>Qi(e,t,Nn);function jr(e,t,n){try{ss(-1);const s=arguments.length;return s===2?Ce(t)&&!ne(t)?In(t)?Ee(e,null,[t]):Ee(e,t):Ee(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&In(n)&&(n=[n]),Ee(e,t,n))}finally{ss(1)}}const su="3.5.35";/**
+* @vue/runtime-dom v3.5.35
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/let Xs;const Wo=typeof window<"u"&&window.trustedTypes;if(Wo)try{Xs=Wo.createPolicy("vue",{createHTML:e=>e})}catch{}const Hr=Xs?e=>Xs.createHTML(e):e=>e,ou="http://www.w3.org/2000/svg",lu="http://www.w3.org/1998/Math/MathML",bt=typeof document<"u"?document:null,qo=bt&&bt.createElement("template"),ru={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?bt.createElementNS(ou,e):t==="mathml"?bt.createElementNS(lu,e):n?bt.createElement(e,{is:n}):bt.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>bt.createTextNode(e),createComment:e=>bt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,l){const r=n?n.previousSibling:t.lastChild;if(o&&(o===l||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===l||!(o=o.nextSibling)););else{qo.innerHTML=Hr(s==="svg"?``:s==="mathml"?``:e);const i=qo.content;if(s==="svg"||s==="mathml"){const a=i.firstChild;for(;a.firstChild;)i.appendChild(a.firstChild);i.removeChild(a)}t.insertBefore(i,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},iu=Symbol("_vtc");function au(e,t,n){const s=e[iu];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jo=Symbol("_vod"),uu=Symbol("_vsh"),cu=Symbol(""),fu=/(?:^|;)\s*display\s*:/;function du(e,t,n){const s=e.style,o=$e(n);let l=!1;if(n&&!o){if(t)if($e(t))for(const r of t.split(";")){const i=r.slice(0,r.indexOf(":")).trim();n[i]==null&&yn(s,i,"")}else for(const r in t)n[r]==null&&yn(s,r,"");for(const r in n){r==="display"&&(l=!0);const i=n[r];i!=null?pu(e,r,!$e(t)&&t?t[r]:void 0,i)||yn(s,r,i):yn(s,r,"")}}else if(o){if(t!==n){const r=s[cu];r&&(n+=";"+r),s.cssText=n,l=fu.test(n)}}else t&&e.removeAttribute("style");Jo in e&&(e[Jo]=l?s.display:"",e[uu]&&(s.display="none"))}const zo=/\s*!important$/;function yn(e,t,n){if(ne(n))n.forEach(s=>yn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=hu(e,t);zo.test(n)?e.setProperty(Ft(s),n.replace(zo,""),"important"):e[s]=n}}const Yo=["Webkit","Moz","ms"],Ms={};function hu(e,t){const n=Ms[t];if(n)return n;let s=ze(t);if(s!=="filter"&&s in e)return Ms[t]=s;s=fs(s);for(let o=0;oDs||(_u.then(()=>Ds=0),Ds=Date.now());function bu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(ne(o)){const l=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{l.call(s),s._stopped=!0};const r=o.slice(),i=[s];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ku=(e,t,n,s,o,l)=>{const r=o==="svg";t==="class"?au(e,s,r):t==="style"?du(e,n,s):is(t)?as(t)||vu(e,t,n,s,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):wu(e,t,s,r))?(Zo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Xo(e,t,s,r,l,t!=="value")):e._isVueCE&&(xu(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(s)))?Zo(e,ze(t),s,l,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Xo(e,t,s,r))};function wu(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&nl(t)&&ie(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return nl(t)&&$e(n)?!1:t in e}function xu(e,t){const n=e._def.props;if(!n)return!1;const s=ze(t);return Array.isArray(n)?n.some(o=>ze(o)===s):Object.keys(n).some(o=>ze(o)===s)}const Ut=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ne(t)?n=>on(t,n):t};function Cu(e){e.target.composing=!0}function sl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const st=Symbol("_assign");function ol(e,t,n){return t&&(e=e.trim()),n&&(e=ds(e)),e}const Oe={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[st]=Ut(o);const l=s||o.props&&o.props.type==="number";Ct(e,t?"change":"input",r=>{r.target.composing||e[st](ol(e.value,n,l))}),(n||l)&&Ct(e,"change",()=>{e.value=ol(e.value,n,l)}),t||(Ct(e,"compositionstart",Cu),Ct(e,"compositionend",sl),Ct(e,"change",sl))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:l}},r){if(e[st]=Ut(r),e.composing)return;const i=(l||e.type==="number")&&!/^0\d/.test(e.value)?ds(e.value):e.value,a=t??"";if(i===a)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},Wn={deep:!0,created(e,t,n){e[st]=Ut(n),Ct(e,"change",()=>{const s=e._modelValue,o=un(e),l=e.checked,r=e[st];if(ne(s)){const i=uo(s,o),a=i!==-1;if(l&&!a)r(s.concat(o));else if(!l&&a){const f=[...s];f.splice(i,1),r(f)}}else if(dn(s)){const i=new Set(s);l?i.add(o):i.delete(o),r(i)}else r(Kr(e,l))})},mounted:ll,beforeUpdate(e,t,n){e[st]=Ut(n),ll(e,t,n)}};function ll(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(ne(t))o=uo(t,s.props.value)>-1;else if(dn(t))o=t.has(s.props.value);else{if(t===n)return;o=Vt(t,Kr(e,!0))}e.checked!==o&&(e.checked=o)}const rl={created(e,{value:t},n){e.checked=Vt(t,n.props.value),e[st]=Ut(n),Ct(e,"change",()=>{e[st](un(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[st]=Ut(s),t!==n&&(e.checked=Vt(t,s.props.value))}},Br={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=dn(t);Ct(e,"change",()=>{const l=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?ds(un(r)):un(r));e[st](e.multiple?o?new Set(l):l:l[0]),e._assigning=!0,Et(()=>{e._assigning=!1})}),e[st]=Ut(s)},mounted(e,{value:t}){il(e,t)},beforeUpdate(e,t,n){e[st]=Ut(n)},updated(e,{value:t}){e._assigning||il(e,t)}};function il(e,t){const n=e.multiple,s=ne(t);if(!(n&&!s&&!dn(t))){for(let o=0,l=e.options.length;oString(f)===String(i)):r.selected=uo(t,i)>-1}else r.selected=t.has(i);else if(Vt(un(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function un(e){return"_value"in e?e._value:e.value}function Kr(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Su=["ctrl","shift","alt","meta"],Eu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Su.some(n=>e[`${n}Key`]&&!t.includes(n))},Yt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...l)=>{for(let r=0;r{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const l=Ft(o.key);if(t.some(r=>r===l||Au[r]===l))return e(o)})},Tu=Be({patchProp:ku},ru);let al;function Ru(){return al||(al=Fa(Tu))}const $u=(...e)=>{const t=Ru().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Pu(s);if(!o)return;const l=t._component;!ie(l)&&!l.render&&!l.template&&(l.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,Ou(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t};function Ou(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Pu(e){return $e(e)?document.querySelector(e):e}/*!
+ * pinia v2.3.1
+ * (c) 2025 Eduardo San Martin Morote
+ * @license MIT
+ */let Gr;const ws=e=>Gr=e,Wr=Symbol();function Zs(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var An;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(An||(An={}));function Iu(){const e=Vl(!0),t=e.run(()=>X({}));let n=[],s=[];const o=go({install(l){ws(o),o._a=l,l.provide(Wr,o),l.config.globalProperties.$pinia=o,s.forEach(r=>n.push(r)),s=[]},use(l){return this._a?n.push(l):s.push(l),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const qr=()=>{};function ul(e,t,n,s=qr){e.push(t);const o=()=>{const l=e.indexOf(t);l>-1&&(e.splice(l,1),s())};return!n&&Ul()&&Si(o),o}function Xt(e,...t){e.slice().forEach(n=>{n(...t)})}const Nu=e=>e(),cl=Symbol(),Ls=Symbol();function eo(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],o=e[n];Zs(o)&&Zs(s)&&e.hasOwnProperty(n)&&!Ie(s)&&!St(s)?e[n]=eo(o,s):e[n]=s}return e}const Mu=Symbol();function Du(e){return!Zs(e)||!e.hasOwnProperty(Mu)}const{assign:It}=Object;function Lu(e){return!!(Ie(e)&&e.effect)}function Vu(e,t,n,s){const{state:o,actions:l,getters:r}=t,i=n.state.value[e];let a;function f(){i||(n.state.value[e]=o?o():{});const c=qi(n.state.value[e]);return It(c,l,Object.keys(r||{}).reduce((d,g)=>(d[g]=go(de(()=>{ws(n);const m=n._s.get(e);return r[g].call(m,m)})),d),{}))}return a=Jr(e,f,t,n,s,!0),a}function Jr(e,t,n={},s,o,l){let r;const i=It({actions:{}},n),a={deep:!0};let f,c,d=[],g=[],m;const w=s.state.value[e];!l&&!w&&(s.state.value[e]={});let x;function b(W){let J;f=c=!1,typeof W=="function"?(W(s.state.value[e]),J={type:An.patchFunction,storeId:e,events:m}):(eo(s.state.value[e],W),J={type:An.patchObject,payload:W,storeId:e,events:m});const F=x=Symbol();Et().then(()=>{x===F&&(f=!0)}),c=!0,Xt(d,J,s.state.value[e])}const U=l?function(){const{state:J}=n,F=J?J():{};this.$patch(T=>{It(T,F)})}:qr;function C(){r.stop(),d=[],g=[],s._s.delete(e)}const E=(W,J="")=>{if(cl in W)return W[Ls]=J,W;const F=function(){ws(s);const T=Array.from(arguments),K=[],N=[];function ue(oe){K.push(oe)}function ye(oe){N.push(oe)}Xt(g,{args:T,name:F[Ls],store:I,after:ue,onError:ye});let he;try{he=W.apply(this&&this.$id===e?this:I,T)}catch(oe){throw Xt(N,oe),oe}return he instanceof Promise?he.then(oe=>(Xt(K,oe),oe)).catch(oe=>(Xt(N,oe),Promise.reject(oe))):(Xt(K,he),he)};return F[cl]=!0,F[Ls]=J,F},S={_p:s,$id:e,$onAction:ul.bind(null,g),$patch:b,$reset:U,$subscribe(W,J={}){const F=ul(d,W,J.detached,()=>T()),T=r.run(()=>Lt(()=>s.state.value[e],K=>{(J.flush==="sync"?c:f)&&W({storeId:e,type:An.direct,events:m},K)},It({},a,J)));return F},$dispose:C},I=Dn(S);s._s.set(e,I);const j=(s._a&&s._a.runWithContext||Nu)(()=>s._e.run(()=>(r=Vl()).run(()=>t({action:E}))));for(const W in j){const J=j[W];if(Ie(J)&&!Lu(J)||St(J))l||(w&&Du(J)&&(Ie(J)?J.value=w[W]:eo(J,w[W])),s.state.value[e][W]=J);else if(typeof J=="function"){const F=E(J,W);j[W]=F,i.actions[W]=J}}return It(I,j),It(be(I),j),Object.defineProperty(I,"$state",{get:()=>s.state.value[e],set:W=>{b(J=>{It(J,W)})}}),s._p.forEach(W=>{It(I,r.run(()=>W({store:I,app:s._a,pinia:s,options:i})))}),w&&l&&n.hydrate&&n.hydrate(I.$state,w),f=!0,c=!0,I}/*! #__NO_SIDE_EFFECTS__ */function Uu(e,t,n){let s,o;const l=typeof t=="function";s=e,o=l?n:t;function r(i,a){const f=sa();return i=i||(f?et(Wr,null):null),i&&ws(i),i=Gr,i._s.has(s)||(l?Jr(s,t,o,i):Vu(s,o,i)),i._s.get(s)}return r.$id=s,r}/*!
+ * vue-router v4.6.4
+ * (c) 2025 Eduardo San Martin Morote
+ * @license MIT
+ */const tn=typeof document<"u";function zr(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Fu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&zr(e.default)}const we=Object.assign;function Vs(e,t){const n={};for(const s in t){const o=t[s];n[s]=at(o)?o.map(e):e(o)}return n}const Tn=()=>{},at=Array.isArray;function fl(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Yr=/#/g,ju=/&/g,Hu=/\//g,Bu=/=/g,Ku=/\?/g,Qr=/\+/g,Gu=/%5B/g,Wu=/%5D/g,Xr=/%5E/g,qu=/%60/g,Zr=/%7B/g,Ju=/%7C/g,ei=/%7D/g,zu=/%20/g;function xo(e){return e==null?"":encodeURI(""+e).replace(Ju,"|").replace(Gu,"[").replace(Wu,"]")}function Yu(e){return xo(e).replace(Zr,"{").replace(ei,"}").replace(Xr,"^")}function to(e){return xo(e).replace(Qr,"%2B").replace(zu,"+").replace(Yr,"%23").replace(ju,"%26").replace(qu,"`").replace(Zr,"{").replace(ei,"}").replace(Xr,"^")}function Qu(e){return to(e).replace(Bu,"%3D")}function Xu(e){return xo(e).replace(Yr,"%23").replace(Ku,"%3F")}function Zu(e){return Xu(e).replace(Hu,"%2F")}function Mn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const ec=/\/$/,tc=e=>e.replace(ec,"");function Us(e,t,n="/"){let s,o={},l="",r="";const i=t.indexOf("#");let a=t.indexOf("?");return a=i>=0&&a>i?-1:a,a>=0&&(s=t.slice(0,a),l=t.slice(a,i>0?i:t.length),o=e(l.slice(1))),i>=0&&(s=s||t.slice(0,i),r=t.slice(i,t.length)),s=lc(s??t,n),{fullPath:s+l+r,path:s,query:o,hash:Mn(r)}}function nc(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function dl(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function sc(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&cn(t.matched[s],n.matched[o])&&ti(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function cn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ti(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!oc(e[n],t[n]))return!1;return!0}function oc(e,t){return at(e)?hl(e,t):at(t)?hl(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function hl(e,t){return at(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function lc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),o=s[s.length-1];(o===".."||o===".")&&s.push("");let l=n.length-1,r,i;for(r=0;r1&&l--;else break;return n.slice(0,l).join("/")+"/"+s.slice(r).join("/")}const Pt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let no=function(e){return e.pop="pop",e.push="push",e}({}),Fs=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function rc(e){if(!e)if(tn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),tc(e)}const ic=/^[^#]+#/;function ac(e,t){return e.replace(ic,"#")+t}function uc(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const xs=()=>({left:window.scrollX,top:window.scrollY});function cc(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=uc(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function pl(e,t){return(history.state?history.state.position-t:-1)+e}const so=new Map;function fc(e,t){so.set(e,t)}function dc(e){const t=so.get(e);return so.delete(e),t}function hc(e){return typeof e=="string"||e&&typeof e=="object"}function ni(e){return typeof e=="string"||typeof e=="symbol"}let Pe=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const si=Symbol("");Pe.MATCHER_NOT_FOUND+"",Pe.NAVIGATION_GUARD_REDIRECT+"",Pe.NAVIGATION_ABORTED+"",Pe.NAVIGATION_CANCELLED+"",Pe.NAVIGATION_DUPLICATED+"";function fn(e,t){return we(new Error,{type:e,[si]:!0},t)}function yt(e,t){return e instanceof Error&&si in e&&(t==null||!!(e.type&t))}const pc=["params","query","hash"];function mc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of pc)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function vc(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;so&&to(o)):[s&&to(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function gc(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=at(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const _c=Symbol(""),vl=Symbol(""),Cs=Symbol(""),Co=Symbol(""),oo=Symbol("");function vn(){let e=[];function t(s){return e.push(s),()=>{const o=e.indexOf(s);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Mt(e,t,n,s,o,l=r=>r()){const r=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((i,a)=>{const f=g=>{g===!1?a(fn(Pe.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?a(g):hc(g)?a(fn(Pe.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(r&&s.enterCallbacks[o]===r&&typeof g=="function"&&r.push(g),i())},c=l(()=>e.call(s&&s.instances[o],t,n,f));let d=Promise.resolve(c);e.length<3&&(d=d.then(f)),d.catch(g=>a(g))})}function js(e,t,n,s,o=l=>l()){const l=[];for(const r of e)for(const i in r.components){let a=r.components[i];if(!(t!=="beforeRouteEnter"&&!r.instances[i]))if(zr(a)){const f=(a.__vccOpts||a)[t];f&&l.push(Mt(f,n,s,r,i,o))}else{let f=a();l.push(()=>f.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${i}" at "${r.path}"`);const d=Fu(c)?c.default:c;r.mods[i]=c,r.components[i]=d;const g=(d.__vccOpts||d)[t];return g&&Mt(g,n,s,r,i,o)()}))}}return l}function yc(e,t){const n=[],s=[],o=[],l=Math.max(t.matched.length,e.matched.length);for(let r=0;rcn(f,i))?s.push(i):n.push(i));const a=e.matched[r];a&&(t.matched.find(f=>cn(f,a))||o.push(a))}return[n,s,o]}/*!
+ * vue-router v4.6.4
+ * (c) 2025 Eduardo San Martin Morote
+ * @license MIT
+ */let bc=()=>location.protocol+"//"+location.host;function oi(e,t){const{pathname:n,search:s,hash:o}=t,l=e.indexOf("#");if(l>-1){let r=o.includes(e.slice(l))?e.slice(l).length:1,i=o.slice(r);return i[0]!=="/"&&(i="/"+i),dl(i,"")}return dl(n,e)+s+o}function kc(e,t,n,s){let o=[],l=[],r=null;const i=({state:g})=>{const m=oi(e,location),w=n.value,x=t.value;let b=0;if(g){if(n.value=m,t.value=g,r&&r===w){r=null;return}b=x?g.position-x.position:0}else s(m);o.forEach(U=>{U(n.value,w,{delta:b,type:no.pop,direction:b?b>0?Fs.forward:Fs.back:Fs.unknown})})};function a(){r=n.value}function f(g){o.push(g);const m=()=>{const w=o.indexOf(g);w>-1&&o.splice(w,1)};return l.push(m),m}function c(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(we({},g.state,{scroll:xs()}),"")}}function d(){for(const g of l)g();l=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:a,listen:f,destroy:d}}function gl(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?xs():null}}function wc(e){const{history:t,location:n}=window,s={value:oi(e,n)},o={value:t.state};o.value||l(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(a,f,c){const d=e.indexOf("#"),g=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+a:bc()+e+a;try{t[c?"replaceState":"pushState"](f,"",g),o.value=f}catch(m){console.error(m),n[c?"replace":"assign"](g)}}function r(a,f){l(a,we({},t.state,gl(o.value.back,a,o.value.forward,!0),f,{position:o.value.position}),!0),s.value=a}function i(a,f){const c=we({},o.value,t.state,{forward:a,scroll:xs()});l(c.current,c,!0),l(a,we({},gl(s.value,a,null),{position:c.position+1},f),!1),s.value=a}return{location:s,state:o,push:i,replace:r}}function xc(e){e=rc(e);const t=wc(e),n=kc(e,t.state,t.location,t.replace);function s(l,r=!0){r||n.pauseListeners(),history.go(l)}const o=we({location:"",base:e,go:s,createHref:ac.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function Cc(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),xc(e)}let Gt=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var De=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(De||{});const Sc={type:Gt.Static,value:""},Ec=/[a-zA-Z0-9_]/;function Ac(e){if(!e)return[[]];if(e==="/")return[[Sc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=De.Static,s=n;const o=[];let l;function r(){l&&o.push(l),l=[]}let i=0,a,f="",c="";function d(){f&&(n===De.Static?l.push({type:Gt.Static,value:f}):n===De.Param||n===De.ParamRegExp||n===De.ParamRegExpEnd?(l.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),l.push({type:Gt.Param,value:f,regexp:c,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),f="")}function g(){f+=a}for(;it.length?t.length===1&&t[0]===qe.Static+qe.Segment?1:-1:0}function li(e,t){let n=0;const s=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const Pc={strict:!1,end:!0,sensitive:!1};function Ic(e,t,n){const s=$c(Ac(e.path),n),o=we(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function Nc(e,t){const n=[],s=new Map;t=fl(Pc,t);function o(d){return s.get(d)}function l(d,g,m){const w=!m,x=kl(d);x.aliasOf=m&&m.record;const b=fl(t,d),U=[x];if("alias"in d){const S=typeof d.alias=="string"?[d.alias]:d.alias;for(const I of S)U.push(kl(we({},x,{components:m?m.record.components:x.components,path:I,aliasOf:m?m.record:x})))}let C,E;for(const S of U){const{path:I}=S;if(g&&I[0]!=="/"){const ee=g.record.path,j=ee[ee.length-1]==="/"?"":"/";S.path=g.record.path+(I&&j+I)}if(C=Ic(S,g,b),m?m.alias.push(C):(E=E||C,E!==C&&E.alias.push(C),w&&d.name&&!wl(C)&&r(d.name)),ri(C)&&a(C),x.children){const ee=x.children;for(let j=0;j{r(E)}:Tn}function r(d){if(ni(d)){const g=s.get(d);g&&(s.delete(d),n.splice(n.indexOf(g),1),g.children.forEach(r),g.alias.forEach(r))}else{const g=n.indexOf(d);g>-1&&(n.splice(g,1),d.record.name&&s.delete(d.record.name),d.children.forEach(r),d.alias.forEach(r))}}function i(){return n}function a(d){const g=Lc(d,n);n.splice(g,0,d),d.record.name&&!wl(d)&&s.set(d.record.name,d)}function f(d,g){let m,w={},x,b;if("name"in d&&d.name){if(m=s.get(d.name),!m)throw fn(Pe.MATCHER_NOT_FOUND,{location:d});b=m.record.name,w=we(bl(g.params,m.keys.filter(E=>!E.optional).concat(m.parent?m.parent.keys.filter(E=>E.optional):[]).map(E=>E.name)),d.params&&bl(d.params,m.keys.map(E=>E.name))),x=m.stringify(w)}else if(d.path!=null)x=d.path,m=n.find(E=>E.re.test(x)),m&&(w=m.parse(x),b=m.record.name);else{if(m=g.name?s.get(g.name):n.find(E=>E.re.test(g.path)),!m)throw fn(Pe.MATCHER_NOT_FOUND,{location:d,currentLocation:g});b=m.record.name,w=we({},g.params,d.params),x=m.stringify(w)}const U=[];let C=m;for(;C;)U.unshift(C.record),C=C.parent;return{name:b,path:x,params:w,matched:U,meta:Dc(U)}}e.forEach(d=>l(d));function c(){n.length=0,s.clear()}return{addRoute:l,resolve:f,removeRoute:r,clearRoutes:c,getRoutes:i,getRecordMatcher:o}}function bl(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function kl(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Mc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Mc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function wl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Dc(e){return e.reduce((t,n)=>we(t,n.meta),{})}function Lc(e,t){let n=0,s=t.length;for(;n!==s;){const l=n+s>>1;li(e,t[l])<0?s=l:n=l+1}const o=Vc(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function Vc(e){let t=e;for(;t=t.parent;)if(ri(t)&&li(e,t)===0)return t}function ri({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function xl(e){const t=et(Cs),n=et(Co),s=de(()=>{const a=fe(e.to);return t.resolve(a)}),o=de(()=>{const{matched:a}=s.value,{length:f}=a,c=a[f-1],d=n.matched;if(!c||!d.length)return-1;const g=d.findIndex(cn.bind(null,c));if(g>-1)return g;const m=Cl(a[f-2]);return f>1&&Cl(c)===m&&d[d.length-1].path!==m?d.findIndex(cn.bind(null,a[f-2])):g}),l=de(()=>o.value>-1&&Bc(n.params,s.value.params)),r=de(()=>o.value>-1&&o.value===n.matched.length-1&&ti(n.params,s.value.params));function i(a={}){if(Hc(a)){const f=t[fe(e.replace)?"replace":"push"](fe(e.to)).catch(Tn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:s,href:de(()=>s.value.href),isActive:l,isExactActive:r,navigate:i}}function Uc(e){return e.length===1?e[0]:e}const Fc=cr({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:xl,setup(e,{slots:t}){const n=Dn(xl(e)),{options:s}=et(Cs),o=de(()=>({[Sl(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Sl(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&Uc(t.default(n));return e.custom?l:jr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},l)}}}),jc=Fc;function Hc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Bc(e,t){for(const n in t){const s=t[n],o=e[n];if(typeof s=="string"){if(s!==o)return!1}else if(!at(o)||o.length!==s.length||s.some((l,r)=>l.valueOf()!==o[r].valueOf()))return!1}return!0}function Cl(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Sl=(e,t,n)=>e??t??n,Kc=cr({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=et(oo),o=de(()=>e.route||s.value),l=et(vl,0),r=de(()=>{let f=fe(l);const{matched:c}=o.value;let d;for(;(d=c[f])&&!d.components;)f++;return f}),i=de(()=>o.value.matched[r.value]);xn(vl,de(()=>r.value+1)),xn(_c,i),xn(oo,o);const a=X();return Lt(()=>[a.value,i.value,e.name],([f,c,d],[g,m,w])=>{c&&(c.instances[d]=f,m&&m!==c&&f&&f===g&&(c.leaveGuards.size||(c.leaveGuards=m.leaveGuards),c.updateGuards.size||(c.updateGuards=m.updateGuards))),f&&c&&(!m||!cn(c,m)||!g)&&(c.enterCallbacks[d]||[]).forEach(x=>x(f))},{flush:"post"}),()=>{const f=o.value,c=e.name,d=i.value,g=d&&d.components[c];if(!g)return El(n.default,{Component:g,route:f});const m=d.props[c],w=m?m===!0?f.params:typeof m=="function"?m(f):m:null,b=jr(g,we({},w,t,{onVnodeUnmounted:U=>{U.component.isUnmounted&&(d.instances[c]=null)},ref:a}));return El(n.default,{Component:b,route:f})||b}}});function El(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Gc=Kc;function Wc(e){const t=Nc(e.routes,e),n=e.parseQuery||vc,s=e.stringifyQuery||ml,o=e.history,l=vn(),r=vn(),i=vn(),a=Ki(Pt);let f=Pt;tn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Vs.bind(null,p=>""+p),d=Vs.bind(null,Zu),g=Vs.bind(null,Mn);function m(p,A){let V,Z;return ni(p)?(V=t.getRecordMatcher(p),Z=A):Z=p,t.addRoute(Z,V)}function w(p){const A=t.getRecordMatcher(p);A&&t.removeRoute(A)}function x(){return t.getRoutes().map(p=>p.record)}function b(p){return!!t.getRecordMatcher(p)}function U(p,A){if(A=we({},A||a.value),typeof p=="string"){const _=Us(n,p,A.path),O=t.resolve({path:_.path},A),P=o.createHref(_.fullPath);return we(_,O,{params:g(O.params),hash:Mn(_.hash),redirectedFrom:void 0,href:P})}let V;if(p.path!=null)V=we({},p,{path:Us(n,p.path,A.path).path});else{const _=we({},p.params);for(const O in _)_[O]==null&&delete _[O];V=we({},p,{params:d(_)}),A.params=d(A.params)}const Z=t.resolve(V,A),ce=p.hash||"";Z.params=c(g(Z.params));const h=nc(s,we({},p,{hash:Yu(ce),path:Z.path})),v=o.createHref(h);return we({fullPath:h,hash:ce,query:s===ml?gc(p.query):p.query||{}},Z,{redirectedFrom:void 0,href:v})}function C(p){return typeof p=="string"?Us(n,p,a.value.path):we({},p)}function E(p,A){if(f!==p)return fn(Pe.NAVIGATION_CANCELLED,{from:A,to:p})}function S(p){return j(p)}function I(p){return S(we(C(p),{replace:!0}))}function ee(p,A){const V=p.matched[p.matched.length-1];if(V&&V.redirect){const{redirect:Z}=V;let ce=typeof Z=="function"?Z(p,A):Z;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=C(ce):{path:ce},ce.params={}),we({query:p.query,hash:p.hash,params:ce.path!=null?{}:p.params},ce)}}function j(p,A){const V=f=U(p),Z=a.value,ce=p.state,h=p.force,v=p.replace===!0,_=ee(V,Z);if(_)return j(we(C(_),{state:typeof _=="object"?we({},ce,_.state):ce,force:h,replace:v}),A||V);const O=V;O.redirectedFrom=A;let P;return!h&&sc(s,Z,V)&&(P=fn(Pe.NAVIGATION_DUPLICATED,{to:O,from:Z}),z(Z,Z,!0,!1)),(P?Promise.resolve(P):F(O,Z)).catch(R=>yt(R)?yt(R,Pe.NAVIGATION_GUARD_REDIRECT)?R:D(R):pe(R,O,Z)).then(R=>{if(R){if(yt(R,Pe.NAVIGATION_GUARD_REDIRECT))return j(we({replace:v},C(R.to),{state:typeof R.to=="object"?we({},ce,R.to.state):ce,force:h}),A||O)}else R=K(O,Z,!0,v,ce);return T(O,Z,R),R})}function W(p,A){const V=E(p,A);return V?Promise.reject(V):Promise.resolve()}function J(p){const A=Ue.values().next().value;return A&&typeof A.runWithContext=="function"?A.runWithContext(p):p()}function F(p,A){let V;const[Z,ce,h]=yc(p,A);V=js(Z.reverse(),"beforeRouteLeave",p,A);for(const _ of Z)_.leaveGuards.forEach(O=>{V.push(Mt(O,p,A))});const v=W.bind(null,p,A);return V.push(v),H(V).then(()=>{V=[];for(const _ of l.list())V.push(Mt(_,p,A));return V.push(v),H(V)}).then(()=>{V=js(ce,"beforeRouteUpdate",p,A);for(const _ of ce)_.updateGuards.forEach(O=>{V.push(Mt(O,p,A))});return V.push(v),H(V)}).then(()=>{V=[];for(const _ of h)if(_.beforeEnter)if(at(_.beforeEnter))for(const O of _.beforeEnter)V.push(Mt(O,p,A));else V.push(Mt(_.beforeEnter,p,A));return V.push(v),H(V)}).then(()=>(p.matched.forEach(_=>_.enterCallbacks={}),V=js(h,"beforeRouteEnter",p,A,J),V.push(v),H(V))).then(()=>{V=[];for(const _ of r.list())V.push(Mt(_,p,A));return V.push(v),H(V)}).catch(_=>yt(_,Pe.NAVIGATION_CANCELLED)?_:Promise.reject(_))}function T(p,A,V){i.list().forEach(Z=>J(()=>Z(p,A,V)))}function K(p,A,V,Z,ce){const h=E(p,A);if(h)return h;const v=A===Pt,_=tn?history.state:{};V&&(Z||v?o.replace(p.fullPath,we({scroll:v&&_&&_.scroll},ce)):o.push(p.fullPath,ce)),a.value=p,z(p,A,V,v),D()}let N;function ue(){N||(N=o.listen((p,A,V)=>{if(!Fe.listening)return;const Z=U(p),ce=ee(Z,Fe.currentRoute.value);if(ce){j(we(ce,{replace:!0,force:!0}),Z).catch(Tn);return}f=Z;const h=a.value;tn&&fc(pl(h.fullPath,V.delta),xs()),F(Z,h).catch(v=>yt(v,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_CANCELLED)?v:yt(v,Pe.NAVIGATION_GUARD_REDIRECT)?(j(we(C(v.to),{force:!0}),Z).then(_=>{yt(_,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_DUPLICATED)&&!V.delta&&V.type===no.pop&&o.go(-1,!1)}).catch(Tn),Promise.reject()):(V.delta&&o.go(-V.delta,!1),pe(v,Z,h))).then(v=>{v=v||K(Z,h,!1),v&&(V.delta&&!yt(v,Pe.NAVIGATION_CANCELLED)?o.go(-V.delta,!1):V.type===no.pop&&yt(v,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),T(Z,h,v)}).catch(Tn)}))}let ye=vn(),he=vn(),oe;function pe(p,A,V){D(p);const Z=he.list();return Z.length?Z.forEach(ce=>ce(p,A,V)):console.error(p),Promise.reject(p)}function L(){return oe&&a.value!==Pt?Promise.resolve():new Promise((p,A)=>{ye.add([p,A])})}function D(p){return oe||(oe=!p,ue(),ye.list().forEach(([A,V])=>p?V(p):A()),ye.reset()),p}function z(p,A,V,Z){const{scrollBehavior:ce}=e;if(!tn||!ce)return Promise.resolve();const h=!V&&dc(pl(p.fullPath,0))||(Z||!V)&&history.state&&history.state.scroll||null;return Et().then(()=>ce(p,A,h)).then(v=>v&&cc(v)).catch(v=>pe(v,p,A))}const ve=p=>o.go(p);let Me;const Ue=new Set,Fe={currentRoute:a,listening:!0,addRoute:m,removeRoute:w,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:x,resolve:U,options:e,push:S,replace:I,go:ve,back:()=>ve(-1),forward:()=>ve(1),beforeEach:l.add,beforeResolve:r.add,afterEach:i.add,onError:he.add,isReady:L,install(p){p.component("RouterLink",jc),p.component("RouterView",Gc),p.config.globalProperties.$router=Fe,Object.defineProperty(p.config.globalProperties,"$route",{enumerable:!0,get:()=>fe(a)}),tn&&!Me&&a.value===Pt&&(Me=!0,S(o.location).catch(Z=>{}));const A={};for(const Z in Pt)Object.defineProperty(A,Z,{get:()=>a.value[Z],enumerable:!0});p.provide(Cs,Fe),p.provide(Co,er(A)),p.provide(oo,a);const V=p.unmount;Ue.add(p),p.unmount=function(){Ue.delete(p),Ue.size<1&&(f=Pt,N&&N(),N=null,a.value=Pt,Me=!1,oe=!1),V()}}};function H(p){return p.reduce((A,V)=>A.then(()=>J(V)),Promise.resolve())}return Fe}function ii(){return et(Cs)}function qc(e){return et(Co)}const Fn=Uu("auth",{state:()=>({token:localStorage.getItem("mcbot_token")||"",identity:localStorage.getItem("mcbot_identity")||""}),actions:{set(e,t){this.token=e,this.identity=t||"",localStorage.setItem("mcbot_token",e),localStorage.setItem("mcbot_identity",this.identity)},clear(){this.token="",this.identity="",localStorage.removeItem("mcbot_token"),localStorage.removeItem("mcbot_identity")}}}),Jc={key:0,class:"nav"},zc={class:"who"},Yc={__name:"App",setup(e){const t=Fn(),n=qc(),s=ii(),o=de(()=>n.path!=="/login");function l(){t.clear(),s.push("/login")}return(r,i)=>{const a=Mo("router-link"),f=Mo("router-view");return y(),k(Q,null,[o.value?(y(),k("nav",Jc,[i[3]||(i[3]=u("span",{class:"brand"},"mcbot",-1)),Ee(a,{to:"/messages"},{default:qn(()=>[...i[0]||(i[0]=[me("Messages",-1)])]),_:1}),Ee(a,{to:"/packets"},{default:qn(()=>[...i[1]||(i[1]=[me("Packets",-1)])]),_:1}),Ee(a,{to:"/manage"},{default:qn(()=>[...i[2]||(i[2]=[me("Manage",-1)])]),_:1}),i[4]||(i[4]=u("span",{class:"spacer"},null,-1)),u("span",zc,$(fe(t).identity||"authenticated"),1),u("button",{onClick:l},"Log out")])):_e("",!0),Ee(f)],64)}}};async function re(e,t={}){const n=Fn(),s={...t.headers||{}};n.token&&(s.Authorization=`Bearer ${n.token}`),t.json!==void 0&&(s["Content-Type"]="application/json",t={...t,body:JSON.stringify(t.json)},delete t.json);const o=await fetch(`/api${e}`,{...t,headers:s});if(o.status===401)throw n.clear(),location.hash.startsWith("#/login")||(location.hash="#/login"),new Error("unauthorized");if(!o.ok){let l=o.statusText;try{l=(await o.json()).detail||l}catch{}throw new Error(l)}return o.json()}function ai(e){const t=Fn();return`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api${e}?token=${encodeURIComponent(t.token)}`}const Qc={class:"login-wrap"},Xc={class:"login-card"},Zc={key:0,class:"err"},ef=["disabled"],tf={__name:"Login",setup(e){const t=Fn(),n=ii(),s=X(""),o=X(""),l=X(""),r=X(""),i=X(!1);async function a(){r.value="",i.value=!0;try{const c=await re("/login",{method:"POST",json:{username:s.value,password:o.value}});t.set(c.token,c.user?`user:${c.user}`:""),n.push("/")}catch(c){r.value=c.message||"login failed"}finally{i.value=!1}}async function f(){if(r.value="",!!l.value.trim()){t.set(l.value.trim(),"");try{const c=await re("/me");t.set(l.value.trim(),c.identity),n.push("/")}catch{t.clear(),r.value="invalid token"}}}return(c,d)=>(y(),k("div",Qc,[u("div",Xc,[d[3]||(d[3]=u("h2",null,"mcbot admin",-1)),r.value?(y(),k("div",Zc,$(r.value),1)):_e("",!0),d[4]||(d[4]=u("label",null,"Username",-1)),ke(u("input",{"onUpdate:modelValue":d[0]||(d[0]=g=>s.value=g),onKeyup:rn(a,["enter"]),autofocus:""},null,544),[[Oe,s.value]]),d[5]||(d[5]=u("label",null,"Password",-1)),ke(u("input",{"onUpdate:modelValue":d[1]||(d[1]=g=>o.value=g),type:"password",onKeyup:rn(a,["enter"])},null,544),[[Oe,o.value]]),u("button",{disabled:i.value,onClick:a},"Log in",8,ef),d[6]||(d[6]=u("label",{style:{"margin-top":"10px"}},"…or paste an API token",-1)),ke(u("input",{"onUpdate:modelValue":d[2]||(d[2]=g=>l.value=g),placeholder:"bearer token",onKeyup:rn(f,["enter"])},null,544),[[Oe,l.value]]),u("button",{onClick:f},"Use token")])]))}},ui=Symbol("manage-context");function gt(){return et(ui)}const nf={key:0,class:"decoded"},sf={class:"kv"},of={class:"mono"},lf={class:"kv"},rf={class:"k"},af={key:1,class:"empty"},uf={__name:"StatsTab",setup(e){const{data:t,fetchTab:n}=gt();return tt(()=>n("stats")),(s,o)=>{var l;return fe(t).stats?(y(),k("div",nf,[u("div",sf,[o[0]||(o[0]=u("div",{class:"k"},"identity",-1)),u("div",of,$(((l=fe(t).stats.identity)==null?void 0:l.pubkey)||"—"),1),o[1]||(o[1]=u("div",{class:"k"},"events seen",-1)),u("div",null,$(fe(t).stats.event_count),1),o[2]||(o[2]=u("div",{class:"k"},"commands loaded",-1)),u("div",null,$(fe(t).stats.commands_loaded),1)]),o[3]||(o[3]=u("h4",null,"Counts",-1)),u("div",lf,[(y(!0),k(Q,null,ae(fe(t).stats.counts,(r,i)=>(y(),k(Q,{key:i},[u("div",rf,$(i),1),u("div",null,$(r),1)],64))),128))])])):(y(),k("div",af,"loading…"))}}},jn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},cf=["aria-label"],ff={class:"bubble"},df={__name:"InfoTip",props:{text:{type:String,default:""}},setup(e){const t=X(!1);return(n,s)=>(y(),k("span",{class:He(["infotip",{pinned:t.value}]),tabindex:"0",role:"button","aria-label":e.text,onClick:s[0]||(s[0]=o=>t.value=!t.value),onKeydown:[s[1]||(s[1]=rn(Yt(o=>t.value=!t.value,["prevent"]),["enter"])),s[2]||(s[2]=rn(Yt(o=>t.value=!t.value,["prevent"]),["space"]))],onBlur:s[3]||(s[3]=o=>t.value=!1)},[s[4]||(s[4]=u("span",{class:"dot","aria-hidden":"true"},"i",-1)),u("span",ff,$(e.text),1)],42,cf))}},Kt=jn(df,[["__scopeId","data-v-48ca1073"]]),hf={class:"chk"},pf=["min","max","step","onUpdate:modelValue"],mf=["onClick"],ci={__name:"SettingRows",props:{group:{type:String,required:!0}},setup(e){const{settingsFor:t,applySetting:n}=gt();return(s,o)=>(y(!0),k(Q,null,ae(fe(t)(e.group),l=>(y(),k("div",{key:l.key,class:"toolbar"},[u("label",hf,[me($(l.label),1),l.unit?(y(),k(Q,{key:0},[me(" ("+$(l.unit)+")",1)],64)):_e("",!0),ke(u("input",{type:"number",min:l.min,max:l.max,step:l.step,"onUpdate:modelValue":r=>l.value=r,style:{width:"5em"}},null,8,pf),[[Oe,l.value,void 0,{number:!0}]])]),u("button",{onClick:r=>fe(n)(l.key)},"Apply",8,mf),Ee(Kt,{text:l.description},null,8,["text"])]))),128))}},vf={class:"kv"},gf={class:"mono muted"},_f={class:"toolbar"},yf=["disabled"],bf=["disabled"],kf={class:"chk"},wf={class:"toolbar"},xf={class:"chk"},Cf=["value"],Sf={class:"kv"},Ef={key:0,class:"muted"},Af={class:"toolbar"},Tf=["disabled"],Rf=["disabled"],$f={class:"chk"},Of={class:"toolbar"},Pf={class:"chk"},If={class:"chk"},Nf=["disabled"],Mf={style:{"border-top":"1px solid var(--border, #333)"}},Df={class:"toolbar"},Lf=["disabled"],Vf={key:0,class:"decoded"},Uf={class:"kv"},Ff={class:"muted"},jf={class:"mono"},Hf={class:"toolbar"},Bf={class:"chk"},Kf={class:"chk"},Gf=["disabled"],Wf={class:"decoded"},qf={style:{margin:"12px 0 4px"}},Jf={class:"kv"},zf={class:"k"},Yf={class:"kv"},Qf={class:"k mono"},Xf={__name:"RadioTab",setup(e){const{data:t,error:n,notice:s,fetchTab:o,run:l,loadSettings:r}=gt();tt(async()=>{await o("radio"),await r(),await j()});const i=X("zero"),a=X(!1);async function f(){a.value||(a.value=!0,await l(re("/radio/advert",{method:"POST",json:{flood:i.value==="flood"}}),`${i.value==="flood"?"flood":"zero-hop"} advert sent`),a.value=!1)}const c=X([]),d=X(null),g=X(""),m=X({name:"",private_key:""}),w=X({name:"",private_key:""}),x=X(!1),b=X({}),U=X({}),C=X(!1),E=de(()=>JSON.stringify(m.value)!==JSON.stringify(w.value)),S=de(()=>JSON.stringify(b.value)!==JSON.stringify(U.value));function I(H){const p=Ue.value.get(H);return p?ve(p.value):null}function ee(){m.value={name:I("self_info.name")??"",private_key:""},w.value={...m.value},b.value={freq:I("self_info.radio_freq"),bw:I("self_info.radio_bw"),sf:I("self_info.radio_sf"),cr:I("self_info.radio_cr"),tx_power:I("self_info.tx_power"),lat:I("self_info.adv_lat"),lon:I("self_info.adv_lon"),adv_loc_policy:!!I("self_info.adv_loc_policy")},U.value={...b.value},d.value=I("self_info.max_tx_power"),g.value="",x.value=!1,C.value=!1}async function j(){if(!c.value.length)try{c.value=(await re("/radio/presets")).items}catch(H){n.value=H.message}}function W(){const H=c.value.find(p=>p.name===g.value);H&&(b.value.freq=H.freq,b.value.bw=H.bw,b.value.sf=H.sf,b.value.cr=H.cr)}function J(){m.value={...w.value},x.value=!1}async function F(){const H=m.value,p={reboot:x.value};if(H.name!==w.value.name&&(p.name=H.name),(H.private_key||"").trim()){if(!confirm(`Import a new private key?
+
+This gives the node a NEW identity — existing contacts must re-add the bot and old DMs will no longer decrypt.`))return;p.private_key=H.private_key.trim()}await l(re("/radio/identity",{method:"POST",json:p}),"identity updated",["radio"])}function T(){b.value={...U.value},g.value="",C.value=!1}async function K(){const H=b.value,p=U.value,A={reboot:C.value};["freq","bw","sf","cr"].some(V=>H[V]!==p[V])&&(A.freq=Number(H.freq),A.bw=Number(H.bw),A.sf=Number(H.sf),A.cr=Number(H.cr)),H.tx_power!==p.tx_power&&(A.tx_power=Number(H.tx_power)),(H.lat!==p.lat||H.lon!==p.lon)&&(A.lat=Number(H.lat),A.lon=Number(H.lon)),H.adv_loc_policy!==p.adv_loc_policy&&(A.adv_loc_policy=H.adv_loc_policy),await l(re("/radio/settings",{method:"POST",json:A}),"radio settings updated",["radio"])}const N=X(null),ue=X(!1),ye=X(!1),he=X({enabled:!0,headroom:8});async function oe(){if(!ue.value){ue.value=!0,n.value="";try{const H=await re("/radio/contacts-status");N.value=H,he.value={enabled:H.policy.enabled,headroom:H.policy.headroom}}catch(H){n.value=H.message}ue.value=!1}}async function pe(){await l(re("/radio/contacts-policy",{method:"POST",json:{enabled:he.value.enabled,headroom:Number(he.value.headroom)}}),"Eviction policy updated (runtime only — set radio_evict_* in mcbot.conf to persist)"),await oe()}async function L(){if(!ye.value){ye.value=!0,n.value="",s.value="";try{const H=await re("/radio/evict-contacts",{method:"POST",json:{dry_run:!0}}),p=H.evicted||[];if(!p.length){s.value=`Nothing to evict (used ${H.used}/${H.max??"?"}).`,ye.value=!1;return}const A=p.map(h=>h.name||h.pubkey.slice(0,12)),V=A.slice(0,20).join(`
+`),Z=A.length>20?`
+…and ${A.length-20} more`:"";if(!confirm(`Evict ${p.length} stale contact(s) from the radio?
+
+${V}${Z}`)){ye.value=!1;return}const ce=await re("/radio/evict-contacts",{method:"POST",json:{}});s.value=`Evicted ${ce.evicted.length} contact(s)`+(ce.failed?`, ${ce.failed} failed`:"")+(ce.shortfall?`, ${ce.shortfall} short (protected)`:"")}catch(H){n.value=H.message}ye.value=!1,await oe()}}const D=[{title:"Identity",keys:[["self_info.name","Name"],["self_info.public_key","Public key",{mono:!0}],["device_info.model","Model"],["device_info.ver","Firmware version"],["device_info.fw ver","Firmware code"],["device_info.fw_build","Firmware build"]]},{title:"Radio",keys:[["self_info.radio_freq","Frequency",{unit:"MHz"}],["self_info.radio_bw","Bandwidth",{unit:"kHz"}],["self_info.radio_sf","Spreading factor"],["self_info.radio_cr","Coding rate"],["self_info.tx_power","TX power",{unit:"dBm"}],["self_info.max_tx_power","Max TX power",{unit:"dBm"}],["device_info.path_hash_mode","Out path-hash mode",{fmt:H=>`${Number(H)+1} byte(s)/hop`}]]},{title:"Advertising",keys:[["self_info.adv_type","Advertised type"],["self_info.adv_lat","Latitude"],["self_info.adv_lon","Longitude"],["self_info.adv_loc_policy","Location-share policy"]]},{title:"Capacity",keys:[["device_info.max_channels","Max channels"],["device_info.max_contacts","Max contacts"]]},{title:"Battery / memory",keys:[["battery.level","Battery",{unit:"mV"}],["battery.total_kb","Total memory",{unit:"kB"}],["battery.used_kb","Used memory",{unit:"kB"}]]},{title:"Other",keys:[["device_info.ble_pin","BLE PIN"],["device_info.repeat","Repeater mode"],["self_info.manual_add_contacts","Manual contact add"],["self_info.multi_acks","Multi-acks"],["self_info.telemetry_mode_base","Telemetry: base"],["self_info.telemetry_mode_env","Telemetry: env"],["self_info.telemetry_mode_loc","Telemetry: location"]]}],z=new Set(D.flatMap(H=>H.keys.map(p=>p[0])));function ve(H){if(H==null)return null;try{return JSON.parse(H)}catch{return H}}function Me(H,p){const A=ve(H.value);if(A==null||A==="")return"";if(p!=null&&p.fmt)return p.fmt(A);let V=typeof A=="object"?JSON.stringify(A):String(A);return p!=null&&p.unit&&(V=`${V} ${p.unit}`),V}const Ue=de(()=>{const H=new Map;for(const p of t.value.radio||[])H.set(p.key,p);return H}),Fe=de(()=>[...t.value.radio||[]].filter(H=>!z.has(H.key)).sort((H,p)=>H.key.localeCompare(p.key)));return Lt(()=>t.value.radio,ee,{immediate:!0}),(H,p)=>(y(),k("div",null,[p[41]||(p[41]=u("h4",{class:"sec"},"Identity",-1)),u("div",vf,[p[17]||(p[17]=u("div",{class:"k"},"Name",-1)),u("div",null,[ke(u("input",{"onUpdate:modelValue":p[0]||(p[0]=A=>m.value.name=A),maxlength:"32",style:{width:"16em"}},null,512),[[Oe,m.value.name]])]),p[18]||(p[18]=u("div",{class:"k"},"Public key",-1)),u("div",gf,$(I("self_info.public_key")||"—"),1),p[19]||(p[19]=u("div",{class:"k"},"New private key",-1)),u("div",null,[ke(u("input",{"onUpdate:modelValue":p[1]||(p[1]=A=>m.value.private_key=A),placeholder:"128-hex to rotate identity (optional)",style:{width:"24em"}},null,512),[[Oe,m.value.private_key]]),Ee(Kt,{text:"Paste a 64-byte (128 hex) private key to give the node a NEW identity. Existing contacts must re-add the bot and old DMs stop decrypting. Leave blank to keep the current key."})])]),u("div",_f,[u("button",{disabled:!E.value,onClick:F},"Save",8,yf),u("button",{disabled:!E.value,onClick:J},"Cancel",8,bf),u("label",kf,[ke(u("input",{type:"checkbox","onUpdate:modelValue":p[2]||(p[2]=A=>x.value=A)},null,512),[[Wn,x.value]]),p[20]||(p[20]=me(" Reboot after",-1))])]),p[42]||(p[42]=u("h4",{class:"sec"},"Radio settings",-1)),u("div",wf,[u("label",xf,[p[22]||(p[22]=me(" Preset ",-1)),ke(u("select",{"onUpdate:modelValue":p[3]||(p[3]=A=>g.value=A),onChange:W},[p[21]||(p[21]=u("option",{value:""},"Custom…",-1)),(y(!0),k(Q,null,ae(c.value,A=>(y(),k("option",{key:A.name,value:A.name},$(A.name),9,Cf))),128))],544),[[Br,g.value]])]),Ee(Kt,{text:"Fills the fields below with a region's recommended values — review before saving. Presets are starting points; verify for your area."})]),u("div",Sf,[p[23]||(p[23]=u("div",{class:"k"},"Frequency (MHz)",-1)),u("div",null,[ke(u("input",{type:"number",step:"0.001","onUpdate:modelValue":p[4]||(p[4]=A=>b.value.freq=A),style:{width:"9em"}},null,512),[[Oe,b.value.freq,void 0,{number:!0}]])]),p[24]||(p[24]=u("div",{class:"k"},"Bandwidth (kHz)",-1)),u("div",null,[ke(u("input",{type:"number",step:"0.1","onUpdate:modelValue":p[5]||(p[5]=A=>b.value.bw=A),style:{width:"9em"}},null,512),[[Oe,b.value.bw,void 0,{number:!0}]])]),p[25]||(p[25]=u("div",{class:"k"},"Spreading factor",-1)),u("div",null,[ke(u("input",{type:"number",min:"5",max:"12","onUpdate:modelValue":p[6]||(p[6]=A=>b.value.sf=A),style:{width:"6em"}},null,512),[[Oe,b.value.sf,void 0,{number:!0}]])]),p[26]||(p[26]=u("div",{class:"k"},"Coding rate",-1)),u("div",null,[ke(u("input",{type:"number",min:"5",max:"8","onUpdate:modelValue":p[7]||(p[7]=A=>b.value.cr=A),style:{width:"6em"}},null,512),[[Oe,b.value.cr,void 0,{number:!0}]])]),p[27]||(p[27]=u("div",{class:"k"},"TX power (dBm)",-1)),u("div",null,[ke(u("input",{type:"number",min:"0","onUpdate:modelValue":p[8]||(p[8]=A=>b.value.tx_power=A),style:{width:"6em"}},null,512),[[Oe,b.value.tx_power,void 0,{number:!0}]]),d.value!=null?(y(),k("span",Ef," max "+$(d.value),1)):_e("",!0)]),p[28]||(p[28]=u("div",{class:"k"},"Latitude",-1)),u("div",null,[ke(u("input",{type:"number",step:"0.00001","onUpdate:modelValue":p[9]||(p[9]=A=>b.value.lat=A),style:{width:"11em"}},null,512),[[Oe,b.value.lat,void 0,{number:!0}]])]),p[29]||(p[29]=u("div",{class:"k"},"Longitude",-1)),u("div",null,[ke(u("input",{type:"number",step:"0.00001","onUpdate:modelValue":p[10]||(p[10]=A=>b.value.lon=A),style:{width:"11em"}},null,512),[[Oe,b.value.lon,void 0,{number:!0}]])]),p[30]||(p[30]=u("div",{class:"k"},"Include location in adverts",-1)),u("div",null,[ke(u("input",{type:"checkbox","onUpdate:modelValue":p[11]||(p[11]=A=>b.value.adv_loc_policy=A)},null,512),[[Wn,b.value.adv_loc_policy]])])]),u("div",Af,[u("button",{disabled:!S.value,onClick:K},"Save",8,Tf),u("button",{disabled:!S.value,onClick:T},"Cancel",8,Rf),u("label",$f,[ke(u("input",{type:"checkbox","onUpdate:modelValue":p[12]||(p[12]=A=>C.value=A)},null,512),[[Wn,C.value]]),p[31]||(p[31]=me(" Reboot after",-1))]),Ee(Kt,{text:"Radio-parameter changes usually require a reboot to take effect."})]),p[43]||(p[43]=u("h4",{class:"sec"},"Advert",-1)),u("div",Of,[u("label",Pf,[ke(u("input",{type:"radio",value:"zero","onUpdate:modelValue":p[13]||(p[13]=A=>i.value=A)},null,512),[[rl,i.value]]),p[32]||(p[32]=me(" Zero hop ",-1))]),u("label",If,[ke(u("input",{type:"radio",value:"flood","onUpdate:modelValue":p[14]||(p[14]=A=>i.value=A)},null,512),[[rl,i.value]]),p[33]||(p[33]=me(" Flood ",-1))]),u("button",{disabled:a.value,onClick:f},$(a.value?"Sending…":"Advert"),9,Nf),Ee(Kt,{text:"Zero-hop reaches direct neighbors only; flood propagates through the mesh."})]),Ee(ci,{group:"radio"}),u("div",Mf,[u("div",Df,[p[34]||(p[34]=u("strong",null,"Contact table",-1)),u("button",{disabled:ue.value,onClick:oe},$(ue.value?"Checking…":"Check contact table"),9,Lf),Ee(Kt,{text:"Reads the radio's contact list (takes a few seconds)."})]),N.value?(y(),k("div",Vf,[u("div",Uf,[p[35]||(p[35]=u("div",{class:"k"},"Used / max",-1)),u("div",null,[me($(N.value.used)+" / "+$(N.value.max??"?")+" ",1),u("span",Ff,"("+$(N.value.free??"?")+" free)",1)]),p[36]||(p[36]=u("div",{class:"k"},"Protected / evictable",-1)),u("div",null,$(N.value.protected)+" protected, "+$(N.value.eligible)+" evictable",1),p[37]||(p[37]=u("div",{class:"k"},"Firmware autoadd byte",-1)),u("div",jf,$(N.value.autoadd_raw??"n/a"),1)]),u("div",Hf,[u("label",Bf,[ke(u("input",{type:"checkbox","onUpdate:modelValue":p[15]||(p[15]=A=>he.value.enabled=A)},null,512),[[Wn,he.value.enabled]]),p[38]||(p[38]=me(" Auto-evict (startup + when full) ",-1))]),u("label",Kf,[p[39]||(p[39]=me(" Headroom ",-1)),ke(u("input",{type:"number",min:"1",max:"100","onUpdate:modelValue":p[16]||(p[16]=A=>he.value.headroom=A),style:{width:"4em"}},null,512),[[Oe,he.value.headroom,void 0,{number:!0}]])]),u("button",{onClick:pe},"Apply"),u("button",{disabled:ye.value,onClick:L},$(ye.value?"Evicting…":"Evict to headroom now"),9,Gf),Ee(Kt,{text:"Evicts the stalest contacts from the radio (bot users, owners, and recent DM peers are protected; the bot's database keeps the full archive). Policy changes here are runtime only — set radio_evict_* in mcbot.conf to persist across restarts."})])])):_e("",!0)]),p[44]||(p[44]=u("h4",{class:"sec"},"Device info",-1)),p[45]||(p[45]=u("div",{class:"muted",style:{padding:"0 12px 6px"}},"what the radio currently reports (read-only)",-1)),u("div",Wf,[(y(),k(Q,null,ae(D,A=>(y(),k(Q,{key:A.title},[u("h4",qf,$(A.title),1),u("div",Jf,[(y(!0),k(Q,null,ae(A.keys,V=>{var Z;return y(),k(Q,{key:V[0]},[u("div",zf,$(V[1]),1),u("div",{class:He({mono:(Z=V[2])==null?void 0:Z.mono})},$(Me(Ue.value.get(V[0])||{},V[2])||"—"),3)],64)}),128))])],64))),64)),Fe.value.length?(y(),k(Q,{key:0},[p[40]||(p[40]=u("h4",{style:{margin:"12px 0 4px"}},"Unrecognized",-1)),u("div",Yf,[(y(!0),k(Q,null,ae(Fe.value,A=>(y(),k(Q,{key:A.key},[u("div",Qf,$(A.key),1),u("div",null,$(Me(A)||"—"),1)],64))),128))])],64)):_e("",!0)])]))}},Zf=jn(Xf,[["__scopeId","data-v-989996ca"]]),ed={class:"contacts-split"},td={class:"pane",style:{flex:"1.6","min-width":"0"}},nd={class:"toolbar"},sd={class:"chk"},od=["checked"],ld=["checked","onChange"],rd=["disabled"],id={class:"muted"},ad={key:0},ud={key:0},cd={key:0},fd={key:0},dd={key:0},hd={key:0},pd=["data-pk","onClick"],md=["checked","onChange"],vd=["title"],gd={class:"pane contact-detail"},_d={class:"body"},yd={key:0,class:"empty"},bd={key:1,class:"decoded"},kd={class:"kv"},wd={class:"k"},xd={__name:"ContactsTab",setup(e){const{data:t,error:n,notice:s,fetchTab:o,reload:l}=gt();tt(()=>o("contacts")),hr(()=>window.addEventListener("keydown",pe)),pr(()=>window.removeEventListener("keydown",pe)),Vn(()=>window.removeEventListener("keydown",pe));const r={1:"Comp",2:"Rptr",3:"Room",4:"Sens"};function i(L){return L==null?"?":r[L]||String(L)}function a(L){return L&&L.length>14?`${L.slice(0,6)}...${L.slice(-6)}`:L||""}function f(L){if(!L)return"";const D=new Date(L*1e3),z=ve=>String(ve).padStart(2,"0");return`${D.getFullYear()}-${z(D.getMonth()+1)}-${z(D.getDate())} ${z(D.getHours())}:${z(D.getMinutes())}`}const c=X(""),d=X(new Set),g=X(new Set),m=X({col:"adv_name",dir:"asc"}),w=X(new Set),x=X(null),b=de(()=>(t.value.contacts||[]).find(L=>L.public_key===x.value)||null);function U(L){x.value=L.public_key}const C=de(()=>{const L=b.value;if(!L)return[];let D;L.out_path_len===-1?D="flood (no path)":L.out_path_len===0?D="direct (0 hops)":L.out_path?D=`${L.out_path} (${L.out_path_len} hop${L.out_path_len===1?"":"s"})`:D=`${L.out_path_len??"?"} hop(s)`;const z=L.adv_lat!=null&&L.adv_lon!=null?`${L.adv_lat}, ${L.adv_lon}`:"—";return[["name",L.adv_name||"—",!1],["type",i(L.type),!1],["public key",L.public_key,!0],["flags",L.flags??"—",!1],["out path",D,!0],["path hash mode",L.out_path_hash_mode??"—",!1],["location (lat, lon)",z,!1],["last advert",f(L.last_advert)||"—",!1],["last modified",f(L.lastmod)||"—",!1],["first seen",f(L.first_seen_at)||"—",!1],["last synced",f(L.last_synced_at)||"—",!1]]}),E=de(()=>[...g.value].sort()),S=de(()=>d.value.size===0),I=L=>!d.value.has(L);function ee(L){d.value=L?new Set:new Set(g.value)}function j(L,D){const z=new Set(d.value);D?z.delete(L):z.add(L),d.value=z}function W(L){let D=null;for(const z of L){const ve=i(z.type);g.value.has(ve)||(D=D||new Set(g.value),D.add(ve))}D&&(g.value=D)}Lt(()=>t.value.contacts,L=>L&&W(L),{immediate:!0});function J(L){m.value.col===L?m.value={col:L,dir:m.value.dir==="asc"?"desc":"asc"}:m.value={col:L,dir:"asc"}}function F(L){const D=new Set(w.value);D.has(L)?D.delete(L):D.add(L),w.value=D}const T=de(()=>(t.value.contacts||[]).filter(L=>w.value.has(L.public_key))),K=de(()=>T.value.length>0);async function N(){const L=T.value;if(!L.length)return;const D=L.map(H=>H.adv_name||H.public_key.slice(0,12)),z=D.slice(0,20).join(`
+`),ve=D.length>20?`
+…and ${D.length-20} more`:"";if(!confirm(`Delete ${L.length} contact(s)?
+
+${z}${ve}`))return;n.value="",s.value="";let Me=0,Ue=0,Fe="";for(const H of L)try{await re(`/contacts/${encodeURIComponent(H.public_key)}`,{method:"DELETE"}),Me++}catch(p){Ue++,Fe=`${p.message} (${H.adv_name||H.public_key.slice(0,12)})`}w.value=new Set,await l("contacts"),s.value=Ue?`Deleted ${Me}, ${Ue} failed`:`Deleted ${Me} contact(s)`,Fe&&(n.value=Fe)}const ue=de(()=>{const L=t.value.contacts||[],D=c.value.toLowerCase().trim(),z=d.value,ve=L.filter(H=>z.size&&z.has(i(H.type))?!1:D?(H.public_key||"").toLowerCase().includes(D)||(H.adv_name||"").toLowerCase().includes(D):!0),{col:Me,dir:Ue}=m.value,Fe=Ue==="asc"?1:-1;return ve.sort((H,p)=>{const A=H[Me],V=p[Me];return A==null&&V==null?0:A==null?1:V==null?-1:typeof A=="number"&&typeof V=="number"?(A-V)*Fe:String(A).localeCompare(String(V))*Fe}),ve}),ye=X(null);function he(L){var D,z;(z=(D=ye.value)==null?void 0:D.querySelector(`[data-pk="${L}"]`))==null||z.scrollIntoView({block:"nearest"})}function oe(L){const D=ue.value;if(!D.length)return;const z=b.value?D.findIndex(Ue=>Ue.public_key===b.value.public_key):-1,ve=z===-1?L>0?0:D.length-1:Math.max(0,Math.min(D.length-1,z+L)),Me=D[ve];U(Me),Et(()=>he(Me.public_key))}function pe(L){if(L.key!=="ArrowUp"&&L.key!=="ArrowDown")return;const D=L.target;D&&(D.tagName==="INPUT"||D.tagName==="TEXTAREA"||D.tagName==="SELECT"||D.isContentEditable)||L.metaKey||L.ctrlKey||L.altKey||(L.preventDefault(),oe(L.key==="ArrowUp"?-1:1))}return(L,D)=>(y(),k("div",ed,[u("div",td,[u("div",nd,[ke(u("input",{"onUpdate:modelValue":D[0]||(D[0]=z=>c.value=z),placeholder:"search name or pubkey…",style:{flex:"0 0 260px"}},null,512),[[Oe,c.value]]),u("label",sd,[u("input",{type:"checkbox",checked:S.value,onChange:D[1]||(D[1]=z=>ee(z.target.checked))},null,40,od),D[9]||(D[9]=me(" All ",-1))]),(y(!0),k(Q,null,ae(E.value,z=>(y(),k("label",{key:z,class:"chk"},[u("input",{type:"checkbox",checked:I(z),onChange:ve=>j(z,ve.target.checked)},null,40,ld),me(" "+$(z),1)]))),128)),u("button",{disabled:!K.value,onClick:N}," Delete"+$(K.value?` (${T.value.length})`:""),9,rd),u("span",id,$(ue.value.length)+" shown",1)]),u("div",{class:"body",ref_key:"contactListEl",ref:ye},[u("table",null,[u("thead",null,[u("tr",null,[D[16]||(D[16]=u("th",{style:{width:"24px"}},null,-1)),u("th",{class:"sortable",onClick:D[2]||(D[2]=z=>J("public_key"))},[D[10]||(D[10]=me(" pubkey",-1)),m.value.col==="public_key"?(y(),k("span",ad,$(m.value.dir==="asc"?"▲":"▼"),1)):_e("",!0)]),u("th",{class:"sortable",onClick:D[3]||(D[3]=z=>J("adv_name"))},[D[11]||(D[11]=me(" name",-1)),m.value.col==="adv_name"?(y(),k("span",ud,$(m.value.dir==="asc"?"▲":"▼"),1)):_e("",!0)]),u("th",{class:"sortable",onClick:D[4]||(D[4]=z=>J("type"))},[D[12]||(D[12]=me(" type",-1)),m.value.col==="type"?(y(),k("span",cd,$(m.value.dir==="asc"?"▲":"▼"),1)):_e("",!0)]),u("th",{class:"sortable",onClick:D[5]||(D[5]=z=>J("adv_lat"))},[D[13]||(D[13]=me(" lat",-1)),m.value.col==="adv_lat"?(y(),k("span",fd,$(m.value.dir==="asc"?"▲":"▼"),1)):_e("",!0)]),u("th",{class:"sortable",onClick:D[6]||(D[6]=z=>J("adv_lon"))},[D[14]||(D[14]=me(" lon",-1)),m.value.col==="adv_lon"?(y(),k("span",dd,$(m.value.dir==="asc"?"▲":"▼"),1)):_e("",!0)]),u("th",{class:"sortable",onClick:D[7]||(D[7]=z=>J("last_synced_at"))},[D[15]||(D[15]=me(" last synced",-1)),m.value.col==="last_synced_at"?(y(),k("span",hd,$(m.value.dir==="asc"?"▲":"▼"),1)):_e("",!0)])])]),u("tbody",null,[(y(!0),k(Q,null,ae(ue.value,z=>(y(),k("tr",{key:z.public_key,"data-pk":z.public_key,class:He(["clickable",{selected:b.value&&b.value.public_key===z.public_key}]),onClick:ve=>U(z)},[u("td",null,[u("input",{type:"checkbox",checked:w.value.has(z.public_key),onChange:ve=>F(z.public_key),onClick:D[8]||(D[8]=Yt(()=>{},["stop"]))},null,40,md)]),u("td",{class:"mono",title:z.public_key},$(a(z.public_key)),9,vd),u("td",null,$(z.adv_name||""),1),u("td",null,$(i(z.type)),1),u("td",null,$(z.adv_lat??""),1),u("td",null,$(z.adv_lon??""),1),u("td",null,$(f(z.last_synced_at)),1)],10,pd))),128))])])],512)]),u("div",gd,[D[17]||(D[17]=u("h3",null,"Contact",-1)),u("div",_d,[b.value?(y(),k("div",bd,[u("div",kd,[(y(!0),k(Q,null,ae(C.value,z=>(y(),k(Q,{key:z[0]},[u("div",wd,$(z[0]),1),u("div",{class:He({mono:z[2]}),style:{"word-break":"break-all"}},$(z[1]),3)],64))),128))])])):(y(),k("div",yd,"select a contact"))])])]))}},Cd=jn(xd,[["__scopeId","data-v-72e63925"]]),Sd={class:"toolbar"},Ed={class:"mono muted"},Ad=["onClick"],Td={__name:"ChannelsTab",setup(e){const{data:t,error:n,fetchTab:s,run:o}=gt(),l=X({name:"",key:""});tt(()=>s("channels"));async function r(){const a={name:l.value.name.trim()};l.value.key.trim()&&(a.key=l.value.key.trim()),a.name&&(await o(re("/channels",{method:"POST",json:a}),`added ${a.name}`,["channels"]),n.value||(l.value={name:"",key:""}))}function i(a){confirm(`Remove channel ${a}? This clears its radio slot.`)&&o(re(`/channels/${encodeURIComponent(a)}`,{method:"DELETE"}),`removed ${a}`,["channels"])}return(a,f)=>(y(),k("div",null,[u("div",Sd,[ke(u("input",{"onUpdate:modelValue":f[0]||(f[0]=c=>l.value.name=c),placeholder:"name (e.g. #bot or MyChan)",style:{flex:"1"}},null,512),[[Oe,l.value.name]]),ke(u("input",{"onUpdate:modelValue":f[1]||(f[1]=c=>l.value.key=c),placeholder:"hex key (non-# only)",style:{flex:"1"}},null,512),[[Oe,l.value.key]]),u("button",{onClick:r},"Add channel")]),u("table",null,[f[2]||(f[2]=u("thead",null,[u("tr",null,[u("th",null,"idx"),u("th",null,"name"),u("th",null,"secret"),u("th")])],-1)),u("tbody",null,[(y(!0),k(Q,null,ae(fe(t).channels,c=>(y(),k("tr",{key:c.channel_idx},[u("td",null,$(c.channel_idx),1),u("td",null,$(c.name),1),u("td",Ed,$((c.secret_hex||"").slice(0,12))+"…",1),u("td",null,[u("button",{onClick:d=>i(c.name)},"remove",8,Ad)])]))),128))])])]))}},Rd={class:"toolbar"},$d={id:"newUserContacts"},Od=["value"],Pd=["value"],Id=["disabled"],Nd={class:"mono muted"},Md=["onChange"],Dd=["value"],Ld={class:"chips"},Vd=["onClick"],Ud={style:{"white-space":"normal"}},Fd=["onClick"],jd=["onClick"],Hd=["onClick"],Bd={__name:"UsersTab",setup(e){const{data:t,error:n,notice:s,fetchTab:o,reload:l,run:r,groupNames:i,ensureGroupNames:a}=gt(),f=X({sel:"",group:""});tt(async()=>{await o("users"),await a(),await o("contacts")});function c(E,S){S&&r(re(`/users/${E}/groups`,{method:"POST",json:{group:S}}),"group added",["users"])}function d(E,S){r(re(`/users/${E}/groups/${encodeURIComponent(S)}`,{method:"DELETE"}),"group removed",["users"])}function g(E,S){const I=prompt("New alias:",S||"");I!==null&&r(re(`/users/${E}`,{method:"PATCH",json:{name:I}}),"renamed",["users"])}function m(E,S){confirm(`Delete user ${S||E.slice(0,12)} from the bot?`)&&r(re(`/users/${E}`,{method:"DELETE"}),"deleted",["users"])}function w(E){const S=(E.groups||[]).includes("blocked"),I=S?re(`/users/${E.pubkey}/block`,{method:"DELETE"}):re(`/users/${E.pubkey}/block`,{method:"POST"});r(I,S?"unblocked":"blocked",["users"])}const x=de(()=>i.value.filter(E=>E!=="public"&&E!=="blocked"));function b(E){return`${E.adv_name||"(unnamed)"} — ${E.public_key}`}function U(){const E=f.value.sel.trim();if(!E)return"";const S=(t.value.contacts||[]).find(I=>b(I)===E);return S?S.public_key:/^[0-9a-fA-F]{64}$/.test(E)?E.toLowerCase():""}async function C(){const E=U();if(!E){alert("Pick a contact from the list (or paste a 64-hex pubkey).");return}if(!f.value.group){alert("Choose an initial group.");return}n.value="",s.value="";try{await re("/users",{method:"POST",json:{pubkey:E,group:f.value.group}}),s.value=`bot user created and added to ${f.value.group}`,f.value={sel:"",group:""},await l("users")}catch(S){alert(S.message)}}return(E,S)=>(y(),k("div",null,[u("div",Rd,[ke(u("input",{"onUpdate:modelValue":S[0]||(S[0]=I=>f.value.sel=I),list:"newUserContacts",placeholder:"add bot user: search a contact…",style:{flex:"0 0 320px"}},null,512),[[Oe,f.value.sel]]),u("datalist",$d,[(y(!0),k(Q,null,ae(fe(t).contacts||[],I=>(y(),k("option",{key:I.public_key,value:b(I)},null,8,Od))),128))]),ke(u("select",{"onUpdate:modelValue":S[1]||(S[1]=I=>f.value.group=I)},[S[2]||(S[2]=u("option",{value:""},"initial group…",-1)),(y(!0),k(Q,null,ae(x.value,I=>(y(),k("option",{key:I,value:I},$(I),9,Pd))),128))],512),[[Br,f.value.group]]),u("button",{disabled:!U()||!f.value.group,onClick:C}," Add bot user ",8,Id)]),u("table",null,[S[4]||(S[4]=u("thead",null,[u("tr",null,[u("th",null,"name"),u("th",null,"pubkey"),u("th",{style:{width:"130px"}},"add group"),u("th",null,"groups"),u("th",null,"actions")])],-1)),u("tbody",null,[(y(!0),k(Q,null,ae(fe(t).users,I=>(y(),k("tr",{key:I.pubkey},[u("td",null,$(I.name||"?"),1),u("td",Nd,$(I.pubkey.slice(0,12)),1),u("td",null,[u("select",{onChange:ee=>{c(I.pubkey,ee.target.value),ee.target.value=""}},[S[3]||(S[3]=u("option",{value:""},"+ group…",-1)),(y(!0),k(Q,null,ae(fe(i),ee=>(y(),k("option",{key:ee,value:ee},$(ee),9,Dd))),128))],40,Md)]),u("td",Ld,[(y(!0),k(Q,null,ae(I.groups,ee=>(y(),k("span",{key:ee,class:"tag"},[me($(ee)+" ",1),u("a",{href:"#",onClick:Yt(j=>d(I.pubkey,ee),["prevent"]),title:"remove"},"×",8,Vd)]))),128))]),u("td",Ud,[u("button",{onClick:ee=>g(I.pubkey,I.name)},"rename",8,Fd),u("button",{onClick:ee=>w(I)},$((I.groups||[]).includes("blocked")?"unblock":"block"),9,jd),u("button",{onClick:ee=>m(I.pubkey,I.name)},"delete",8,Hd)])]))),128))])])]))}},Kd={class:"toolbar"},Gd={key:0,class:"muted"},Wd={key:0,class:"muted"},qd=["checked","disabled","onChange"],Jd=["onChange"],zd=["value"],Yd={class:"chips"},Qd=["onClick"],Xd=["disabled","onClick"],Zd={__name:"GroupsTab",setup(e){const{data:t,error:n,fetchTab:s,run:o,commandNames:l,ensureCommandNames:r}=gt(),i=X({name:"",commands:""});tt(async()=>{await s("groups"),await r()});async function a(){const m=i.value.name.trim();if(!m)return;const w=i.value.commands.split(",").map(x=>x.trim()).filter(Boolean);await o(re("/groups",{method:"POST",json:{name:m,commands:w}}),`group ${m} created`,["groups"]),n.value||(i.value={name:"",commands:""})}function f(m){confirm(`Delete group ${m}?`)&&o(re(`/groups/${encodeURIComponent(m)}`,{method:"DELETE"}),"deleted",["groups"])}function c(m,w){w&&o(re(`/groups/${encodeURIComponent(m)}/commands`,{method:"POST",json:{command:w}}),`granted ${w} to ${m}`,["groups"])}function d(m,w){w&&o(re(`/groups/${encodeURIComponent(m)}/commands/${encodeURIComponent(w)}`,{method:"DELETE"}),`revoked ${w} from ${m}`,["groups"])}function g(m,w){o(re(`/groups/${encodeURIComponent(m)}/all-users`,{method:w?"POST":"DELETE"}),w?`${m}: now includes all users`:`${m}: explicit members only`,["groups"])}return(m,w)=>(y(),k("div",null,[u("div",Kd,[ke(u("input",{"onUpdate:modelValue":w[0]||(w[0]=x=>i.value.name=x),placeholder:"new group name"},null,512),[[Oe,i.value.name]]),ke(u("input",{"onUpdate:modelValue":w[1]||(w[1]=x=>i.value.commands=x),placeholder:"commands (comma list, optional)",style:{flex:"1"}},null,512),[[Oe,i.value.commands]]),u("button",{onClick:a},"Create group")]),u("table",null,[w[4]||(w[4]=u("thead",null,[u("tr",null,[u("th",null,"name"),u("th",null,"users"),u("th",{title:"Every user is a member (the * membership)"},"all users"),u("th",{style:{width:"150px"}},"grant command"),u("th",null,"commands"),u("th")])],-1)),u("tbody",null,[(y(!0),k(Q,null,ae(fe(t).groups,x=>(y(),k("tr",{key:x.name},[u("td",null,[me($(x.name),1),x.is_system?(y(),k("span",Gd," [sys]")):_e("",!0)]),u("td",null,[me($(x.nusers),1),x.all_users?(y(),k("span",Wd," +*")):_e("",!0)]),u("td",null,[u("input",{type:"checkbox",checked:x.all_users,disabled:x.name==="blocked",title:"Include all users (*) in this group",onChange:b=>g(x.name,b.target.checked)},null,40,qd)]),u("td",null,[u("select",{onChange:b=>{c(x.name,b.target.value),b.target.value=""}},[w[2]||(w[2]=u("option",{value:""},"+ command…",-1)),w[3]||(w[3]=u("option",{value:"*"},"* (all commands)",-1)),(y(!0),k(Q,null,ae(fe(l),b=>(y(),k("option",{key:b,value:b},$(b),9,zd))),128))],40,Jd)]),u("td",Yd,[(y(!0),k(Q,null,ae(x.commands,b=>(y(),k("span",{key:b,class:"tag"},[me($(b)+" ",1),u("a",{href:"#",onClick:Yt(U=>d(x.name,b),["prevent"]),title:"revoke"},"×",8,Qd)]))),128))]),u("td",null,[u("button",{disabled:x.is_system,onClick:b=>f(x.name)},"delete",8,Xd)])]))),128))])])]))}},eh=["checked","onChange"],th=["checked","onChange"],nh=["checked","onChange"],sh=["value","onChange"],oh=["onChange"],lh=["value"],rh={class:"chips"},ih={key:0,class:"muted"},ah=["onClick"],uh={__name:"CommandsTab",setup(e){const{data:t,error:n,notice:s,fetchTab:o,reload:l,channelNames:r,ensureChannelNames:i,loadSettings:a}=gt();tt(async()=>{await o("command-config"),await a(),await i()});function f(m){const w=t.value["command-config"];if(!w)return;const x=w.findIndex(U=>U.command===m.command);if(x===-1)return;let b=[];try{b=m.allowed_channels?JSON.parse(m.allowed_channels):[]}catch{b=[]}w[x]={...w[x],...m,_chans:b}}async function c(m,w){n.value="",s.value="";try{const x=await re(`/command-config/${encodeURIComponent(m)}`,{method:"PATCH",json:w});f(x),s.value=`${m}: saved`}catch(x){n.value=x.message,await l("command-config")}}function d(m,w){!w||m._chans.includes(w)||c(m.command,{allowed_channels:[...m._chans,w]})}function g(m,w){c(m.command,{allowed_channels:m._chans.filter(x=>x!==w)})}return(m,w)=>(y(),k("div",null,[Ee(ci,{group:"commands"}),u("table",null,[w[1]||(w[1]=u("thead",null,[u("tr",null,[u("th",null,"command"),u("th",null,"enabled"),u("th",null,"allow_dm"),u("th",null,"dm_only"),u("th",null,"cooldown"),u("th",{style:{width:"140px"}},"allow channel"),u("th",null,"allowed channels")])],-1)),u("tbody",null,[(y(!0),k(Q,null,ae(fe(t)["command-config"],x=>(y(),k("tr",{key:x.command},[u("td",null,$(x.command),1),u("td",null,[u("input",{type:"checkbox",checked:!!x.enabled,onChange:b=>c(x.command,{enabled:b.target.checked})},null,40,eh)]),u("td",null,[u("input",{type:"checkbox",checked:!!x.allow_dm,onChange:b=>c(x.command,{allow_dm:b.target.checked})},null,40,th)]),u("td",null,[u("input",{type:"checkbox",checked:!!x.dm_only,onChange:b=>c(x.command,{dm_only:b.target.checked})},null,40,nh)]),u("td",null,[u("input",{type:"number",value:x.cooldown_seconds,style:{width:"64px"},onChange:b=>c(x.command,{cooldown_seconds:Number(b.target.value)})},null,40,sh)]),u("td",null,[u("select",{onChange:b=>{d(x,b.target.value),b.target.value=""}},[w[0]||(w[0]=u("option",{value:""},"+ channel…",-1)),(y(!0),k(Q,null,ae(fe(r),b=>(y(),k("option",{key:b,value:b},$(b),9,lh))),128))],40,oh)]),u("td",rh,[x._chans.length?_e("",!0):(y(),k("span",ih,"(any)")),(y(!0),k(Q,null,ae(x._chans,b=>(y(),k("span",{key:b,class:"tag"},[me($(b)+" ",1),u("a",{href:"#",onClick:Yt(U=>g(x,b),["prevent"]),title:"remove"},"×",8,ah)]))),128))])]))),128))])])]))}};function Dt(e){return String(e).padStart(2,"0")}function fi(e){if(!e)return"";const t=new Date(e*1e3);return`${Dt(t.getHours())}:${Dt(t.getMinutes())}:${Dt(t.getSeconds())}`}function rs(e){if(!e)return"";const t=new Date(e*1e3);return`${t.getFullYear()}-${Dt(t.getMonth()+1)}-${Dt(t.getDate())} ${Dt(t.getHours())}:${Dt(t.getMinutes())}:${Dt(t.getSeconds())}`}function Al(e){return e&&e.length?Object.keys(e[0]).filter(t=>!t.startsWith("_")):[]}function lo(e){return e==null?"":Array.isArray(e)?e.join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function Tl(e,t){return t==="ts"&&e[t]?rs(e[t]):lo(e[t])}const ch={key:0},fh=["title"],dh={key:1,class:"empty"},hh={__name:"AuditTab",setup(e){const{data:t,fetchTab:n}=gt();return tt(()=>n("audit")),(s,o)=>Array.isArray(fe(t).audit)?(y(),k("table",ch,[u("thead",null,[u("tr",null,[(y(!0),k(Q,null,ae(fe(Al)(fe(t).audit),l=>(y(),k("th",{key:l},$(l),1))),128))])]),u("tbody",null,[(y(!0),k(Q,null,ae(fe(t).audit,(l,r)=>(y(),k("tr",{key:r},[(y(!0),k(Q,null,ae(fe(Al)(fe(t).audit),i=>(y(),k("td",{key:i,title:fe(Tl)(l,i)},$(fe(Tl)(l,i)),9,fh))),128))]))),128))])])):(y(),k("div",dh,"loading…"))}},ph={class:"db-console"},mh={class:"db-editor"},vh={class:"toolbar"},gh=["disabled"],_h=["disabled"],yh={class:"muted"},bh={key:0,class:"db-picker"},kh={class:"toolbar"},wh={class:"db-picker-list"},xh={key:0,class:"empty"},Ch={key:1},Sh=["onClick"],Eh={style:{width:"20%"}},Ah={class:"mono muted"},Th={key:0,style:{width:"1%"}},Rh=["onClick"],$h={class:"db-results"},Oh={key:0,class:"err",style:{padding:"8px 12px"}},Ph={key:1},Ih=["title"],Nh={key:2,class:"empty"},Mh={key:3,class:"empty"},Dh={__name:"DatabaseTab",setup(e){const{data:t,fetchTab:n,reload:s,run:o}=gt(),l=X(""),r=X(null),i=X(""),a=X(!1),f=X(null);tt(()=>n("database"));const c=de(()=>{const b=r.value;return b?b.columns.length?`${b.rows.length} row(s)`:b.rowcount>=0?`${b.rowcount} row(s) affected`:"OK":""});async function d(){const b=l.value.trim();if(b){a.value=!0,i.value="",r.value=null;try{r.value=await re("/db/query",{method:"POST",json:{sql:b}})}catch(U){i.value=U.message}finally{a.value=!1}}}async function g(){const b=l.value.trim();if(!b)return;const U=(window.prompt("Save query as:")||"").trim();U&&await o(re("/db/saved-queries",{method:"POST",json:{name:U,query:b}}),`saved "${U}"`,["database"])}function m(b){f.value=b,s("database")}function w(b){f.value==="load"&&(l.value=b.query,f.value=null)}async function x(b){confirm(`Delete saved query "${b.name}"?`)&&await o(re(`/db/saved-queries/${b.id}`,{method:"DELETE"}),`deleted "${b.name}"`,["database"])}return(b,U)=>(y(),k("div",ph,[u("div",mh,[ke(u("textarea",{"onUpdate:modelValue":U[0]||(U[0]=C=>l.value=C),class:"db-query mono",spellcheck:"false",placeholder:"SQL — one statement, e.g. SELECT * FROM contacts LIMIT 20"},null,512),[[Oe,l.value]]),u("div",vh,[u("button",{disabled:!l.value.trim()||a.value,onClick:d},$(a.value?"Running…":"Submit"),9,gh),u("button",{disabled:!l.value.trim(),onClick:g},"Save",8,_h),u("button",{onClick:U[1]||(U[1]=C=>m("load"))},"Load"),u("button",{onClick:U[2]||(U[2]=C=>m("delete"))},"Delete"),u("span",yh,$(c.value),1),U[4]||(U[4]=u("span",{class:"muted db-warn"},"runs against the live database",-1))])]),f.value?(y(),k("div",bh,[u("div",kh,[u("strong",null,$(f.value==="load"?"Load a saved query":"Delete a saved query"),1),u("button",{onClick:U[3]||(U[3]=C=>f.value=null)},"Cancel")]),u("div",wh,[fe(t).database&&fe(t).database.length?(y(),k("table",Ch,[u("tbody",null,[(y(!0),k(Q,null,ae(fe(t).database,C=>(y(),k("tr",{key:C.id,class:He({clickable:f.value==="load"}),onClick:E=>w(C)},[u("td",Eh,$(C.name),1),u("td",Ah,$((C.query||"").slice(0,80)),1),f.value==="delete"?(y(),k("td",Th,[u("a",{href:"#",title:"delete",onClick:Yt(E=>x(C),["prevent","stop"])},"✕",8,Rh)])):_e("",!0)],10,Sh))),128))])])):(y(),k("div",xh," no saved queries "))])])):_e("",!0),u("div",$h,[i.value?(y(),k("div",Oh,$(i.value),1)):r.value&&r.value.columns.length?(y(),k("table",Ph,[u("thead",null,[u("tr",null,[(y(!0),k(Q,null,ae(r.value.columns,C=>(y(),k("th",{key:C},$(C),1))),128))])]),u("tbody",null,[(y(!0),k(Q,null,ae(r.value.rows,(C,E)=>(y(),k("tr",{key:E},[(y(!0),k(Q,null,ae(C,(S,I)=>(y(),k("td",{key:I,title:fe(lo)(S)},$(fe(lo)(S)),9,Ih))),128))]))),128))])])):r.value?(y(),k("div",Nh,$(c.value),1)):(y(),k("div",Mh,"no results yet"))])]))}},Lh=jn(Dh,[["__scopeId","data-v-f896d1a7"]]),Vh={class:"panes"},Uh={class:"pane",style:{flex:"0 0 170px"}},Fh={class:"body"},jh=["onClick"],Hh={class:"pane",style:{flex:"1"}},Bh={key:0,class:"toolbar"},Kh={key:0,class:"err"},Gh={key:1,class:"muted"},Wh={class:"body"},qh={__name:"Manage",setup(e){const t=[{key:"stats",label:"Overview"},{key:"radio",label:"Radio"},{key:"contacts",label:"Contacts"},{key:"channels",label:"Channels"},{key:"users",label:"Users"},{key:"groups",label:"Groups"},{key:"command-config",label:"Commands"},{key:"audit",label:"Audit log"},{key:"database",label:"Database"}],n={stats:uf,radio:Zf,contacts:Cd,channels:Td,users:Bd,groups:Zd,"command-config":uh,audit:hh,database:Lh},s=X("stats"),o=X({}),l=X([]),r=X([]),i=X([]),a=X(""),f=X(""),c={stats:"/stats",radio:"/device-info",contacts:"/contacts?limit=500",channels:"/channels",users:"/users",groups:"/groups","command-config":"/command-config",audit:"/audit?limit=200",database:"/db/saved-queries"};function d(j,W){const J=W.items||W;if(j==="command-config"&&Array.isArray(J))for(const F of J){let T=[];try{T=F.allowed_channels?JSON.parse(F.allowed_channels):[]}catch{T=[]}F._chans=T}return J}async function g(j,W=!1){if(!(o.value[j]&&!W))try{const J=await re(c[j]);o.value[j]=d(j,J)}catch(J){a.value=J.message}}const m=j=>g(j,!0);function w(j){s.value=j,a.value="",f.value=""}async function x(j,W,J=[]){a.value="",f.value="";try{await j,W&&(f.value=W)}catch(F){a.value=F.message}for(const F of J)await m(F)}async function b(){if(!l.value.length)try{l.value=(await re("/groups")).items.map(j=>j.name)}catch(j){a.value=j.message}}async function U(){if(!r.value.length)try{r.value=(await re("/command-config")).items.map(j=>j.command).sort()}catch(j){a.value=j.message}}async function C(){if(!i.value.length)try{i.value=(await re("/channels")).items.map(j=>j.name)}catch(j){a.value=j.message}}const E=X({});async function S(){try{const j={};for(const W of await re("/settings"))j[W.key]=W;E.value=j}catch(j){a.value=j.message}}function I(j){return Object.values(E.value).filter(W=>W.group===j)}async function ee(j){const W=E.value[j],J=Number(W.value);await x(re(`/settings/${j}`,{method:"PUT",json:{value:J}}),J>0?`${W.label}: ${J}${W.unit?" "+W.unit:""}`:`${W.label} disabled`),await S()}return xn(ui,{data:o,error:a,notice:f,fetchTab:g,reload:m,run:x,groupNames:l,commandNames:r,channelNames:i,ensureGroupNames:b,ensureCommandNames:U,ensureChannelNames:C,settings:E,settingsFor:I,applySetting:ee,loadSettings:S}),(j,W)=>{var J;return y(),k("div",Vh,[u("div",Uh,[W[0]||(W[0]=u("h3",null,"Manage",-1)),u("div",Fh,[u("table",null,[u("tbody",null,[(y(),k(Q,null,ae(t,F=>u("tr",{key:F.key,class:He(["clickable",{selected:s.value===F.key}]),onClick:T=>w(F.key)},[u("td",null,$(F.label),1)],10,jh)),64))])])])]),u("div",Hh,[u("h3",null,$((J=t.find(F=>F.key===s.value))==null?void 0:J.label),1),a.value||f.value?(y(),k("div",Bh,[a.value?(y(),k("span",Kh,$(a.value),1)):_e("",!0),f.value?(y(),k("span",Gh,$(f.value),1)):_e("",!0)])):_e("",!0),u("div",Wh,[(y(),os(ca,null,[(y(),os(_a(n[s.value])))],1024))])])])}}},Jh={class:"panes"},zh={class:"side-col"},Yh={class:"pane",style:{flex:"1 1 0","min-height":"160px"}},Qh={class:"body"},Xh=["onClick"],Zh={class:"muted"},ep={class:"pane",style:{flex:"1 1 0","min-height":"200px"}},tp={class:"toolbar"},np={class:"body"},sp=["onClick"],op={class:"muted mono"},lp={class:"pane",style:{flex:"1"}},rp={key:0,class:"err",style:{padding:"10px"}},ip={key:1,class:"empty"},ap={class:"meta"},up={class:"who"},cp={key:0},fp=["href"],dp={key:1,class:"mention"},hp={class:"toolbar"},pp=["placeholder","disabled"],mp=["disabled"],vp={key:0,class:"err",style:{padding:"0 12px 8px"}},gp={__name:"Messages",setup(e){const t=X([]),n=X(null),s=X(null),o=X([]),l=X(null),r=X([]),i=X(""),a=X(""),f=X(""),c=X(!1),d=X("");let g=null;const m=de(()=>{const F=i.value.toLowerCase();return F?r.value.filter(T=>(T.adv_name||"").toLowerCase().includes(F)||(T.public_key||"").toLowerCase().includes(F)):r.value}),w=de(()=>{if(typeof n.value=="number"){const F=t.value.find(T=>T.channel_idx===n.value);return{kind:"channel",idx:n.value,label:(F==null?void 0:F.name)||`#${n.value}`}}return n.value==="dm"&&s.value?{kind:"dm",pubkey:s.value.public_key,label:s.value.adv_name||s.value.public_key.slice(0,12)}:null}),x=de(()=>w.value?`Message ${w.value.label}…`:"Pick a channel or a contact to send to…");async function b(){t.value=(await re("/channels")).items,n.value===null&&t.value.length&&E(t.value[0].channel_idx)}async function U(){r.value=(await re("/contacts?limit=500")).items}async function C(){await Et();const F=l.value;F&&(F.scrollTop=F.scrollHeight)}async function E(F){n.value=F,s.value=null;const T=await re(`/channel-messages?channel_idx=${F}&limit=100`);o.value=T.items.slice().reverse(),await C()}async function S(){n.value="dm",s.value=null;const F=await re("/direct-messages?limit=100");o.value=F.items.slice().reverse(),await C()}async function I(F){n.value="dm",s.value=F;const T=await re(`/direct-messages?pubkey=${encodeURIComponent(F.public_key)}&limit=100`);o.value=T.items.slice().reverse(),await C()}async function ee(){const F=f.value.trim();if(!(!F||!w.value||c.value)){c.value=!0,d.value="";try{w.value.kind==="channel"?await re("/send/channel",{method:"POST",json:{channel_idx:w.value.idx,text:F}}):await re("/send/dm",{method:"POST",json:{pubkey:w.value.pubkey,text:F}}),f.value=""}catch(T){d.value=T.message}finally{c.value=!1}}}function j(F,T){if(!F||!T)return F||"";const K=`${T}: `;return F.startsWith(K)?F.slice(K.length):F}const W=/(https?:\/\/[^\s<>]+)|@\[([^\]]+)\]/g;function J(F){const T=j(F.text,F.sender_name),K=[];let N=0,ue;for(W.lastIndex=0;(ue=W.exec(T))!==null;){if(ue.index>N&&K.push({type:"text",value:T.slice(N,ue.index)}),ue[1]){const ye=ue[1].match(/^(.*?)([.,;:!?)]+)$/);ye?(K.push({type:"link",value:ye[1]}),K.push({type:"text",value:ye[2]})):K.push({type:"link",value:ue[1]})}else K.push({type:"mention",value:ue[2]});N=W.lastIndex}return N{try{await b(),await U()}catch(F){a.value=F.message}g=new WebSocket(ai("/ws/messages")),g.onmessage=F=>{const T=JSON.parse(F.data),K=l.value,N=K?K.scrollHeight-K.scrollTop-K.clientHeight<60:!0;let ue=!1;n.value==="dm"&&T.kind==="dm"?(!s.value||T.sender_pubkey===s.value.public_key)&&(o.value.push(T),ue=!0):T.kind==="channel"&&T.channel_idx===n.value&&(o.value.push(T),ue=!0),o.value.length>300&&o.value.shift(),ue&&N&&C()}}),Vn(()=>g&&g.close()),(F,T)=>{var K;return y(),k("div",Jh,[u("div",zh,[u("div",Yh,[T[3]||(T[3]=u("h3",null,"Channels",-1)),u("div",Qh,[u("table",null,[u("tbody",null,[(y(!0),k(Q,null,ae(t.value,N=>(y(),k("tr",{key:N.channel_idx,class:He(["clickable",{selected:n.value===N.channel_idx}]),onClick:ue=>E(N.channel_idx)},[u("td",null,[me($(N.name)+" ",1),u("span",Zh,"#"+$(N.channel_idx),1)])],10,Xh))),128)),u("tr",{class:He(["clickable",{selected:n.value==="dm"&&!s.value}]),onClick:S},[...T[2]||(T[2]=[u("td",null,"✉ Direct messages",-1)])],2)])])])]),u("div",ep,[u("h3",null,"Contacts ("+$(r.value.length)+")",1),u("div",tp,[ke(u("input",{"onUpdate:modelValue":T[0]||(T[0]=N=>i.value=N),placeholder:"search",style:{flex:"1"}},null,512),[[Oe,i.value]])]),u("div",np,[u("table",null,[u("tbody",null,[(y(!0),k(Q,null,ae(m.value,N=>(y(),k("tr",{key:N.public_key,class:He(["clickable",{selected:s.value&&s.value.public_key===N.public_key}]),onClick:ue=>I(N),title:"Open a DM conversation with this contact"},[u("td",null,[me($(N.adv_name||"(unnamed)"),1),T[4]||(T[4]=u("br",null,null,-1)),u("span",op,$(N.public_key.slice(0,12)),1)])],10,sp))),128))])])])])]),u("div",lp,[u("h3",null,$(n.value==="dm"?s.value?`DM · ${s.value.adv_name||s.value.public_key.slice(0,12)}`:"Direct messages":((K=t.value.find(N=>N.channel_idx===n.value))==null?void 0:K.name)||"Messages"),1),u("div",{class:"body",ref_key:"msgBody",ref:l},[a.value?(y(),k("div",rp,$(a.value),1)):_e("",!0),o.value.length?_e("",!0):(y(),k("div",ip,"no messages")),(y(!0),k(Q,null,ae(o.value,N=>{var ue;return y(),k("div",{key:N.id,class:He(["msg",{out:N.is_outgoing}])},[u("div",ap,[u("span",up,$(N.is_outgoing?"→ me":N.sender_name||((ue=N.sender_pubkey)==null?void 0:ue.slice(0,12))||"?"),1),me(" · "+$(fe(fi)(N.received_at))+" ",1),N.snr!=null?(y(),k("span",cp,"· snr "+$(N.snr),1)):_e("",!0)]),u("div",null,[(y(!0),k(Q,null,ae(J(N),(ye,he)=>(y(),k(Q,{key:he},[ye.type==="link"?(y(),k("a",{key:0,href:ye.value,target:"_blank",rel:"noopener noreferrer"},$(ye.value),9,fp)):ye.type==="mention"?(y(),k("span",dp,"@["+$(ye.value)+"]",1)):(y(),k(Q,{key:2},[me($(ye.value),1)],64))],64))),128))])],2)}),128))],512),u("div",hp,[ke(u("input",{style:{flex:"1"},placeholder:x.value,"onUpdate:modelValue":T[1]||(T[1]=N=>f.value=N),disabled:!w.value||c.value,onKeyup:rn(ee,["enter"])},null,40,pp),[[Oe,f.value]]),u("button",{disabled:!w.value||c.value||!f.value.trim(),onClick:ee},$(c.value?"Sending…":"Send"),9,mp)]),d.value?(y(),k("div",vp,$(d.value),1)):_e("",!0)])])}}},_p={class:"hexdump"},yp=["onMouseenter"],bp={key:0},kp={key:1},wp={key:0,class:"empty"},xp={__name:"HexDump",props:{hex:{type:String,default:""},activeRange:{type:Object,default:null}},emits:["hover-offset"],setup(e,{emit:t}){const n=e,s=t,o=de(()=>{const r=(n.hex||"").replace(/\s+/g,""),i=[];for(let a=0;a+2<=r.length;a+=2)i.push(r.slice(a,a+2));return i});function l(r){const i=n.activeRange;return i&&r>=i.offset&&r(y(),k("div",_p,[(y(!0),k(Q,null,ae(o.value,(a,f)=>(y(),k("span",{key:f,class:He(["hexbyte",{active:l(f)}]),onMouseenter:c=>s("hover-offset",f),onMouseleave:i[0]||(i[0]=c=>s("hover-offset",null))},[me($(a),1),(f+1)%16===0?(y(),k("span",bp,[...i[1]||(i[1]=[u("br",null,null,-1)])])):(y(),k("span",kp))],42,yp))),128)),o.value.length?_e("",!0):(y(),k("div",wp,"no raw bytes"))]))}},Cp=["onMouseenter"],Sp={class:"fname"},Ep={class:"fmeta"},Ap={class:"fval"},Tp={key:0,class:"fval muted"},Rp={key:1,class:"fmeta"},$p={key:0,class:"decoded"},Op={class:"kv"},Pp={class:"k"},Ip={class:"mono"},Np={__name:"FieldBreakout",props:{fields:{type:Array,default:()=>[]},decoded:{type:Object,default:null},activeIndex:{type:Number,default:-1}},emits:["hover-field"],setup(e,{emit:t}){const n=t;function s(r){return r==="timestamp"||r.endsWith("_timestamp")||r.endsWith("_at")}function o(r,i){return s(r)?rs(i):l(i)}function l(r){return r==null?"":typeof r=="object"?JSON.stringify(r):String(r)}return(r,i)=>(y(),k("div",null,[(y(!0),k(Q,null,ae(e.fields,(a,f)=>(y(),k("div",{key:f,class:He(["field-row",{active:f===e.activeIndex}]),onMouseenter:c=>n("hover-field",f),onMouseleave:i[0]||(i[0]=c=>n("hover-field",-1))},[u("div",Sp,$(a.name),1),u("div",Ep,"offset "+$(a.offset)+" · "+$(a.length)+" byte(s)",1),u("div",Ap,$(a.hex),1),a.value!==null&&a.value!==void 0?(y(),k("div",Tp,$(l(a.value)),1)):_e("",!0),a.description?(y(),k("div",Rp,$(a.description),1)):_e("",!0)],42,Cp))),128)),e.decoded?(y(),k("div",$p,[i[1]||(i[1]=u("h4",{style:{margin:"6px 0"}},"Decoded payload",-1)),u("div",Op,[(y(!0),k(Q,null,ae(e.decoded,(a,f)=>(y(),k(Q,{key:f},[u("div",Pp,$(f),1),u("div",Ip,$(o(f,a)),1)],64))),128))])])):_e("",!0)]))}},Mp={class:"pdetail"},Dp={key:0,class:"pdesc"},Lp={class:"kv"},Vp={class:"k"},Up={class:"kv"},Fp={class:"k"},jp={class:"mono"},Hp={class:"kv"},Bp={class:"k"},Kp={class:"mono"},Gp={__name:"PacketDetail",props:{packet:{type:Object,required:!0}},setup(e){const t=e,n={ADVERT:"A node broadcast an advertisement (presence beacon). The bot learns its public key, name, and route and tracks it as a contact.",DM:"A direct message addressed to the bot, decrypted from RF. Dispatched to a command handler if it is a command, else logged.",GRPCHAT:"A channel (group) message the bot holds the key for. Logged, and dispatched if it is a command.",DM_SENT:"The radio accepted an outbound DM from the bot for transmission.",ACK:"Acknowledgement that a message the bot sent reached its destination.",CMD_ACK:"The radio firmware accepted a command the bot issued (OK frame).",CMD_ERR:"The radio firmware rejected a command the bot issued (ERROR frame).",CONTACT:"One contact entry streamed from the radio during a contact-table sync.",NEW_CONTACT:"The radio added a new contact after hearing a previously-unknown node.",CONTACTS_SYNC:"A contact-table sync from the radio completed.",CONTACT_DEL:"A contact was removed from the radio's contact table.",CONTACTS_FULL:"The radio's contact table is full and is dropping new nodes. Triggers automatic eviction when enabled.",REPEAT:"A repeater was heard rebroadcasting a message the bot sent (delivery is propagating).",NO_REPEAT:"No repeater was heard rebroadcasting the bot's message within the timeout window.",RETRY:"No repeater was heard, so the bot resent the channel message — an identical retransmit (same timestamp) that only repeaters which missed it pick up.",DIRECT_0HOP:"The bot's DM went straight to a 0-hop neighbor, so no repeater is involved — nothing to rebroadcast.",PATH_UPDATE:"Routing-path information for a contact was updated.",PATH_RESPONSE:"A response carrying the route to a contact.",TRACE:"A path-trace (traceroute) response.",TELEMETRY:"A telemetry response from a node.",BATTERY:"The radio reported its battery status.",STATUS:"A status response from the radio.",DEVICE_INFO:"The radio reported its device information.",SELF_INFO:"The radio reported its own identity/configuration.",CHANNEL_INFO:"The radio reported channel configuration.",TIME:"The radio reported its current clock time.",MSG_WAIT:"The radio signaled that messages are queued; the bot will fetch them.",NO_MORE_MSGS:"The radio's queued-message fetch is drained — nothing more waiting.",LOGIN_OK:"A login to a repeater/room server succeeded.",LOGIN_FAIL:"A login to a repeater/room server failed.",CONNECTION:"The bot's link to the radio changed state (connected/disconnected).",RX_LOG:"A raw RF frame captured from the radio's receive log.",LOG:"A log line emitted by the radio."},s=de(()=>n[t.packet.packet_type]||"");function o(d){return d!=null&&d!==""}const l=de(()=>{const d=t.packet,g=[],m=(w,x,b={})=>{o(x)&&g.push({k:w,v:x,...b})};return m("received",d.received_at,{time:!0}),m("event_type",d.event_type),m("packet_type",d.packet_type),m("channel",d.channel_idx),m("from",d.sender_name),m("pubkey",d.sender_pubkey||d.sender_pubkey_prefix,{mono:!0}),m("path",o(d.path_len)?`${d.path} (${d.path_len} hops)`:d.path,{mono:!0}),m("SNR",d.snr),m("RSSI",d.rssi),m("text",d.text),g});function r(d){if(!d)return null;if(typeof d=="object")return d;try{return JSON.parse(d)}catch{return null}}const i=de(()=>{const d=r(t.packet.payload_json);return!d||typeof d!="object"||Object.keys(d).length===0?null:d}),a=de(()=>{const d=r(t.packet.attributes_json);return!d||typeof d!="object"||Object.keys(d).length===0?null:d});function f(d){return d==="timestamp"||d.endsWith("_timestamp")||d.endsWith("_at")||d==="last_advert"}function c(d,g){return g==null?"":f(d)&&typeof g=="number"&&g>0?rs(g):typeof g=="object"?JSON.stringify(g):String(g)}return(d,g)=>(y(),k("div",Mp,[s.value?(y(),k("p",Dp,$(s.value),1)):_e("",!0),g[2]||(g[2]=u("h4",null,"Packet",-1)),u("div",Lp,[(y(!0),k(Q,null,ae(l.value,m=>(y(),k(Q,{key:m.k},[u("div",Vp,$(m.k),1),u("div",{class:He({mono:m.mono})},$(m.time?fe(rs)(m.v):m.v),3)],64))),128))]),i.value?(y(),k(Q,{key:1},[g[0]||(g[0]=u("h4",null,"Payload",-1)),u("div",Up,[(y(!0),k(Q,null,ae(i.value,(m,w)=>(y(),k(Q,{key:w},[u("div",Fp,$(w),1),u("div",jp,$(c(w,m)),1)],64))),128))])],64)):_e("",!0),a.value?(y(),k(Q,{key:2},[g[1]||(g[1]=u("h4",null,"Attributes",-1)),u("div",Hp,[(y(!0),k(Q,null,ae(a.value,(m,w)=>(y(),k(Q,{key:w},[u("div",Bp,$(w),1),u("div",Kp,$(c(w,m)),1)],64))),128))])],64)):_e("",!0)]))}},Wp=jn(Gp,[["__scopeId","data-v-d89941d4"]]),qp={class:"panes"},Jp={class:"pane",style:{flex:"1.3"}},zp={class:"toolbar"},Yp={class:"chk"},Qp=["checked"],Xp=["checked","onChange"],Zp={class:"muted"},em={key:0,class:"err"},tm=["data-pid","onClick"],nm={class:"pane",style:{flex:"1"}},sm={class:"body"},om={key:0,class:"empty"},lm={key:1,class:"empty"},rm={key:0,class:"err",style:{padding:"0 12px"}},im={key:3,class:"empty"},am={__name:"Packets",setup(e){const t=X([]),n=X(null),s=X(new Set),o=X(new Set),l=X(null),r=X(null),i=X(null),a=X(-1),f=X("");let c=null;const d=de(()=>[...o.value].sort()),g=de(()=>s.value.size===0),m=T=>!s.value.has(T),w=de(()=>s.value.size===0?t.value:t.value.filter(T=>!s.value.has(T.packet_type)));function x(T){let K=null;for(const N of T)N.packet_type&&!o.value.has(N.packet_type)&&(K=K||new Set(o.value),K.add(N.packet_type));K&&(o.value=K)}function b(T){s.value=T?new Set:new Set(o.value)}function U(T,K){const N=new Set(s.value);K?N.delete(T):N.add(T),s.value=N}const C=de(()=>{if(!r.value||a.value<0)return null;const T=r.value.fields[a.value];return T?{offset:T.offset,length:T.length}:null});async function E(){try{const T=await re("/packets?limit=200");t.value=T.items.slice().reverse(),x(T.items),await Et(),I()}catch(T){f.value=T.message}}function S(){const T=n.value;return T?T.scrollHeight-T.scrollTop-T.clientHeight<40:!0}function I(){const T=n.value;T&&(T.scrollTop=T.scrollHeight)}function ee(T){var K,N;(N=(K=n.value)==null?void 0:K.querySelector(`[data-pid="${T}"]`))==null||N.scrollIntoView({block:"nearest"})}function j(T){const K=w.value;if(!K.length)return;let N=l.value?K.findIndex(ye=>ye.id===l.value.id):-1;N===-1?N=K.length-1:N=Math.max(0,Math.min(K.length-1,N+T));const ue=K[N];J(ue),Et(()=>ee(ue.id))}function W(T){if(T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const K=T.target;K&&(K.tagName==="INPUT"||K.tagName==="TEXTAREA"||K.tagName==="SELECT"||K.isContentEditable)||T.metaKey||T.ctrlKey||T.altKey||(T.preventDefault(),j(T.key==="ArrowUp"?-1:1))}async function J(T){l.value=T,r.value=null,i.value=null,a.value=-1;try{T.has_raw?r.value=await re("/packets/decode",{method:"POST",json:{packet_id:T.id}}):i.value=await re(`/packets/${T.id}`)}catch(K){f.value=K.message}}function F(T){if(T===null||!r.value){a.value=-1;return}const K=r.value.fields.findIndex(N=>T>=N.offset&&T{E(),c=new WebSocket(ai("/ws/packets")),c.onmessage=T=>{const K=JSON.parse(T.data),N=S();t.value.push(K),t.value.length>500&&t.value.shift(),x([K]),N&&Et(I)},window.addEventListener("keydown",W)}),Vn(()=>{c&&c.close(),window.removeEventListener("keydown",W)}),(T,K)=>(y(),k("div",qp,[u("div",Jp,[K[4]||(K[4]=u("h3",null,"Packets (live)",-1)),u("div",zp,[u("label",Yp,[u("input",{type:"checkbox",checked:g.value,onChange:K[0]||(K[0]=N=>b(N.target.checked))},null,40,Qp),K[2]||(K[2]=me(" All ",-1))]),(y(!0),k(Q,null,ae(d.value,N=>(y(),k("label",{key:N,class:"chk"},[u("input",{type:"checkbox",checked:m(N),onChange:ue=>U(N,ue.target.checked)},null,40,Xp),me(" "+$(N),1)]))),128)),u("span",Zp,$(w.value.length)+" shown",1),f.value?(y(),k("span",em,$(f.value),1)):_e("",!0)]),u("div",{class:"body",ref_key:"listEl",ref:n},[u("table",null,[K[3]||(K[3]=u("thead",null,[u("tr",null,[u("th",null,"time"),u("th",null,"type"),u("th",null,"from"),u("th",null,"ch"),u("th",null,"text"),u("th",null,"raw")])],-1)),u("tbody",null,[(y(!0),k(Q,null,ae(w.value,N=>(y(),k("tr",{key:N.id,"data-pid":N.id,class:He(["clickable",{selected:l.value&&l.value.id===N.id}]),onClick:ue=>J(N)},[u("td",null,$(fe(fi)(N.received_at)),1),u("td",null,$(N.packet_type),1),u("td",null,$(N.sender_name||N.sender_pubkey_prefix||""),1),u("td",null,$(N.channel_idx??""),1),u("td",null,$(N.text||""),1),u("td",null,$(N.has_raw?"●":""),1)],10,tm))),128))])])],512)]),u("div",nm,[K[5]||(K[5]=u("h3",null,"Inspector",-1)),u("div",sm,[l.value?l.value.has_raw?r.value?(y(),k(Q,{key:2},[Ee(xp,{hex:r.value.raw_hex,"active-range":C.value,onHoverOffset:F},null,8,["hex","active-range"]),r.value.error?(y(),k("div",rm,$(r.value.error),1)):_e("",!0),Ee(Np,{fields:r.value.fields,decoded:r.value.decoded,"active-index":a.value,onHoverField:K[1]||(K[1]=N=>a.value=N)},null,8,["fields","decoded","active-index"])],64)):(y(),k("div",im,"decoding…")):(y(),k(Q,{key:1},[i.value?(y(),os(Wp,{key:0,packet:i.value},null,8,["packet"])):(y(),k("div",lm,"loading…"))],64)):(y(),k("div",om,"select a packet"))])])]))}},um=[{path:"/login",component:tf,meta:{public:!0}},{path:"/",redirect:"/messages"},{path:"/manage",component:qh},{path:"/messages",component:gp},{path:"/packets",component:am}],di=Wc({history:Cc(),routes:um});di.beforeEach(e=>{const t=Fn();if(!e.meta.public&&!t.token)return"/login";if(e.path==="/login"&&t.token)return"/"});$u(Yc).use(Iu()).use(di).mount("#app");
diff --git a/webapi/static/index.html b/webapi/static/index.html
index cd7688d..0df35da 100644
--- a/webapi/static/index.html
+++ b/webapi/static/index.html
@@ -4,8 +4,8 @@
mcbot admin
-
-
+
+