smart-home-engine 1.20.5 → 1.20.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-tUihOf0o.js","assets/monaco-langs-Dt8a9eeo.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-xpfUxGc8.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-tUihOf0o.js","assets/monaco-langs-Dt8a9eeo.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-w-m3uHER.js"])))=>i.map(i=>d[i]);
2
2
  var s3=Object.defineProperty;var kS=o=>{throw TypeError(o)};var o3=(o,e,t)=>e in o?s3(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Gn=(o,e,t)=>o3(o,typeof e!="symbol"?e+"":e,t),Gb=(o,e,t)=>e.has(o)||kS("Cannot "+t);var ke=(o,e,t)=>(Gb(o,e,"read from private field"),t?t.call(o):e.get(o)),Rn=(o,e,t)=>e.has(o)?kS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Nn=(o,e,t,i)=>(Gb(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),bs=(o,e,t)=>(Gb(o,e,"access private method"),t);import{_ as lA,m as cA,l as bi,A as Ko,C as Ue,I as ys,D as Tp,a as zs,g as dA,M as ri,b as nn,E as Sa,c as K,r as ls,d as ia,e as S,f as r3,h as _s,R as On,S as Xi,i as Fo,j as na,k as Zn,n as Dn,o as Me,p as _t,K as qs,q as gi,s as Wt,t as eo,u as te,v as Pn,O as nl,w as Xs,P as wi,x as Kb,y as Mp,z as uA,B as Pl,F as Da,G as ZC,H as po,U as ds,J as qf,L as Si,N as Hl,Q as a3,T as jo,V as XC,W as l3,X as hA,$ as fi,Y as Jn,Z as Kn,a0 as ks,a1 as fn,a2 as Er,a3 as Hg,a4 as Nt,a5 as tv,a6 as c3,a7 as d3,a8 as Js,a9 as u3,aa as Aa,ab as Zo,ac as Fi,ad as fA,ae as Cs,af as h3,ag as f3,ah as Uo,ai as E0,aj as Gs,ak as q_,al as Ho,am as dd,an as ww,ao as G_,ap as co,aq as Gf,ar as uo,as as K_,at as Z_,au as g3,av as Rp,aw as y0,ax as Xl,ay as p3,az as w0,aA as x3,aB as Sw,aC as v3,aD as m3,aE as BS,aF as Ws,aG as Tl,aH as Wo,aI as bn,aJ as Bl,aK as _3,aL as al,aM as _r,aN as ro,aO as ka,aP as Dw,aQ as to,aR as Ns,aS as Fv,aT as _n,aU as gA,aV as b3,aW as Aw,aX as X_,aY as kw,aZ as Bw,a_ as Ud,a$ as C3,b0 as Fw,b1 as E3,b2 as Lw,b3 as Yl,b4 as Ql,b5 as Kf,b6 as Wg,b7 as or,b8 as Np,b9 as Lv,ba as Zb,bb as fs,bc as Iw,bd as Op,be as Y_,bf as y3,bg as pA,bh as zg,bi as Zf,bj as Vg,bk as Hp,bl as Q_,bm as Xn,bn as ud,bo as Wp,bp as w3,bq as S3,br as Pw,bs as D3,bt as Iv,bu as Tr,bv as Tw,bw as Xf,bx as Jl,by as S0,bz as Ln,bA as Yf,bB as xA,bC as zp,bD as A3,bE as qd,bF as ci,bG as FS,bH as iv,bI as vA,bJ as ra,bK as Ca,bL as xs,bM as Qf,bN as Xr,bO as Jf,bP as As,bQ as jg,bR as ch,bS as YC,bT as mA,bU as _A,bV as bA,bW as Mw,bX as Jo,bY as rs,bZ as Vp,b_ as CA,b$ as Ml,c0 as J_,c1 as k3,c2 as nf,c3 as LS,c4 as jp,c5 as EA,c6 as sf,c7 as B3,c8 as jr,c9 as eb,ca as F3,cb as Xo,cc as Ba,cd as $p,ce as $g,cf as yA,cg as Lr,ch as Up,ci as tb,cj as L3,ck as I3,cl as P3,cm as D0,cn as ll,co as ao,cp as T3,cq as Rw,cr as M3,cs as R3,ct as IS,cu as N3,cv as qp,cw as Wl,cx as QC,cy as ju,cz as zl,cA as O3,cB as sl,cC as Yr,cD as gr,cE as PS,cF as Po,cG as Gp,cH as td,cI as cl,cJ as H3,cK as Fa,cL as Ug,cM as ib,cN as wA,cO as W3,cP as z3,cQ as Nw,cR as V3,cS as qg,cT as j3,cU as kc,cV as Gg,cW as TS,cX as $3,cY as U3,cZ as hl,c_ as q3,c$ as Ow,d0 as SA,d1 as DA,d2 as AA,d3 as kA,d4 as G3,d5 as K3,d6 as BA,d7 as FA,d8 as Z3,d9 as Hw,da as X3,db as Y3,dc as Ls,dd as Q3,de as Ww,df as J3,dg as of,dh as MS,di as e4,dj as t4,dk as i4,dl as n4,dm as s4,dn as o4,dp as e0,dq as nb,dr as JC,ds as r4,dt as a4,du as RS,dv as e1,dw as l4,dx as NS,dy as Xb,dz as c4,dA as LA,dB as d4,dC as IA,dD as t1,dE as u4,dF as h4,dG as f4,dH as PA,dI as TA,dJ as g4,dK as Pv,dL as MA,dM as sb,dN as p4,dO as x4,dP as id,dQ as zw,dR as v4,dS as OS,dT as HS,dU as m4,dV as rf,dW as RA,dX as _4,dY as b4,dZ as C4,d_ as E4,d$ as NA,e0 as OA,e1 as HA,e2 as WA,e3 as y4,e4 as ol,e5 as WS,e6 as w4,e7 as Kp,e8 as S4,e9 as eg,ea as zA,eb as zS,ec as Kg,ed as VA,ee as Tv,ef as D4,eg as jA,eh as A4,ei as $A,ej as k4,ek as B4,el as UA,em as qA,en as Vl,eo as ob,ep as F4,eq as GA,er as br,es as Gd,et as KA,eu as L4,ev as I4,ew as ZA,ex as XA,ey as P4,ez as YA,eA as QA,eB as Zg,eC as T4,eD as M4,eE as R4,eF as N4,eG as j0,eH as VS,eI as O4,eJ as H4,eK as W4,eL as Mv,eM as _o,eN as z4,eO as i1,eP as dh,eQ as V4,eR as Al,eS as j4,eT as $4,eU as JA,eV as U4,eW as vg,eX as q4,eY as G4,eZ as K4,e_ as Z4,e$ as jS,f0 as $S,f1 as US,f2 as uh,f3 as Vw,f4 as ek,f5 as n1,f6 as nv,f7 as tk,f8 as Rv,f9 as X4,fa as Y4,fb as Q4,fc as J4,fd as jw,fe as ik,ff as e7,fg as Nv,fh as nk,fi as sk,fj as t7,fk as i7,fl as n7,fm as s7,fn as o7,fo as r7,fp as a7,fq as l7,fr as ok,fs as c7,ft as Ov,fu as rk,fv as d7,fw as ak,fx as u7,fy as lk,fz as ck,fA as h7,fB as qS,fC as dk,fD as GS,fE as f7,fF as Yb,fG as KS,fH as g7,fI as p7,fJ as x7,fK as Xa,fL as nd,fM as v7,fN as ZS,fO as sv,fP as m7,fQ as Fl,fR as rb,fS as s1,fT as _7,fU as uk,fV as hk,fW as To,fX as XS,fY as Cx,fZ as $w,f_ as b7,f$ as C7,g0 as E7,g1 as y7,g2 as w7,g3 as S7,g4 as D7,g5 as A7,g6 as YS,g7 as k7,g8 as B7,g9 as F7,ga as t0,gb as mg,gc as fk,gd as L7,ge as Uw,gf as ov,gg as Ex,gh as Qb,gi as I7,gj as P7,gk,gl as T7,gm as qw,gn as M7,go as R7,gp as pk,gq as ab,gr as N7,gs as Hv,gt as Gw,gu as Kw,gv as Zw,gw as xk,gx as vk,gy as mk,gz as _k,gA as bk,gB as Ck,gC as Ek,gD as QS,gE as yk,gF as Ph,gG as O7,gH as H7,gI as W7,gJ as z7,gK as wk,gL as V7,gM as j7,gN as JS,gO as o1,gP as Mc,gQ as $7,gR as U7,gS as q7,gT as G7,gU as K7,gV as Z7,gW as e8,gX as Xw,gY as r1,gZ as X7,g_ as a1,g$ as Y7,h0 as Q7,h1 as J7,h2 as eL,h3 as Yw,h4 as Sk,h5 as t8,h6 as i8,h7 as tL,h8 as iL,h9 as nL,ha as n8,hb as Jb,hc as sL,hd as oL,he as rL,hf as eC,hg as Dk,hh as Ak,hi as kk,hj as Bk,hk as jl,hl as Fk,hm as Qw,hn as s8,ho as aL,hp as Lk,hq as lL,hr as cL,hs as lb,ht as cb,hu as hh,hv as db,hw as Zp,hx as dL,hy as ub,hz as uL,hA as hL,hB as fL,hC as Ik,hD as $0,hE as gL,hF as pL,hG as xL,hH as vL,hI as Xp,hJ as mL,hK as Pk,hL as Tk,hM as Mk,hN as l1,hO as _L,hP as bL,hQ as CL,hR as EL,hS as yL,hT as c1,hU as wL,hV as SL,hW as DL,hX as AL,hY as kL,hZ as BL,h_ as FL,h$ as LL,i0 as Rk,i1 as IL,i2 as PL,i3 as TL,i4 as o8,i5 as ML,i6 as RL,i7 as Ld,i8 as dr,i9 as d1,ia as Nk,ib as NL,ic as OL}from"./monaco-langs-Dt8a9eeo.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=t(n);fetch(n.href,s)}})();const Ok=!1;var Jw=Array.isArray,HL=Array.prototype.indexOf,Wv=Array.prototype.includes,hb=Array.from,WL=Object.defineProperty,yf=Object.getOwnPropertyDescriptor,zL=Object.getOwnPropertyDescriptors,VL=Object.prototype,jL=Array.prototype,Hk=Object.getPrototypeOf,r8=Object.isExtensible;const fb=()=>{};function $L(o){for(var e=0;e<o.length;e++)o[e]()}function Wk(){var o,e,t=new Promise((i,n)=>{o=i,e=n});return{promise:t,resolve:o,reject:e}}function UL(o,e,t=!1){return o===void 0?t?e():e:o}function a8(o,e){if(Array.isArray(o))return o;if(!(Symbol.iterator in o))return Array.from(o);const t=[];for(const i of o)if(t.push(i),t.length===e)break;return t}const No=2,i0=4,gb=8,zk=1<<24,Ea=16,wa=32,sd=64,u1=128,ea=512,bo=1024,Ao=2048,dl=4096,tr=8192,ta=16384,A0=32768,h1=1<<25,n0=65536,zv=1<<17,qL=1<<18,k0=1<<19,GL=1<<20,el=1<<25,$u=65536,Vv=1<<21,wf=1<<22,Rc=1<<23,Kd=Symbol("$state"),KL=Symbol("legacy props"),ZL=Symbol(""),rv=Symbol("attributes"),f1=Symbol("class"),g1=Symbol("style"),tg=Symbol("text"),av=Symbol("form reset"),pb=new class extends Error{constructor(){super(...arguments);Gn(this,"name","StaleReactionError");Gn(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var oA;const XL=!!((oA=globalThis.document)!=null&&oA.contentType)&&globalThis.document.contentType.includes("xml");function Vk(o){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function YL(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function QL(o,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function JL(o){throw new Error("https://svelte.dev/e/effect_in_teardown")}function eI(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function tI(o){throw new Error("https://svelte.dev/e/effect_orphan")}function iI(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function nI(o){throw new Error("https://svelte.dev/e/props_invalid_value")}function sI(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function oI(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function rI(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function aI(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const lI=1,cI=2,jk=4,dI=8,uI=16,hI=1,fI=4,gI=8,pI=16,xI=1,vI=2,mo=Symbol("uninitialized"),$k="http://www.w3.org/1999/xhtml",mI="http://www.w3.org/2000/svg",_I="http://www.w3.org/1998/Math/MathML";function bI(){console.warn("https://svelte.dev/e/derived_inert")}function CI(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function EI(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Uk(o){return o===this.v}function yI(o,e){return o!=o?e==e:o!==e||o!==null&&typeof o=="object"||typeof o=="function"}function qk(o){return!yI(o,this.v)}let wI=!1,Ro=null;function s0(o){Ro=o}function Ys(o,e=!1,t){Ro={p:Ro,i:!1,c:null,e:null,s:o,x:null,r:as,l:null}}function Qs(o){var e=Ro,t=e.e;if(t!==null){e.e=null;for(var i of t)g6(i)}return o!==void 0&&(e.x=o),e.i=!0,Ro=e.p,o??{}}function Gk(){return!0}let Rd=[];function Kk(){var o=Rd;Rd=[],$L(o)}function Nc(o){if(Rd.length===0&&!bg){var e=Rd;queueMicrotask(()=>{e===Rd&&Kk()})}Rd.push(o)}function SI(){for(;Rd.length>0;)Kk()}function Zk(o){var e=as;if(e===null)return os.f|=Rc,o;if((e.f&A0)===0&&(e.f&i0)===0)throw o;Bc(o,e)}function Bc(o,e){for(;e!==null;){if((e.f&u1)!==0){if((e.f&A0)===0)throw o;try{e.b.error(o);return}catch(t){o=t}}e=e.parent}throw o}const DI=-7169;function no(o,e){o.f=o.f&DI|e}function e9(o){(o.f&ea)!==0||o.deps===null?no(o,bo):no(o,dl)}function Xk(o){if(o!==null)for(const e of o)(e.f&No)===0||(e.f&$u)===0||(e.f^=$u,Xk(e.deps))}function Yk(o,e,t){(o.f&Ao)!==0?e.add(o):(o.f&dl)!==0&&t.add(o),Xk(o.deps),no(o,bo)}let yx=!1;function AI(o){var e=yx;try{return yx=!1,[o(),yx]}finally{yx=e}}let tC=null,Th=null,vn=null,_g=null,Lo=null,p1=null,bg=!1,iC=!1,af=null,lv=null;var l8=0;let kI=1;var kf,Sc,Wd,Bf,Ff,Lf,yl,If,ur,kp,wl,ha,qa,Pf,zd,Is,x1,ig,v1,Qk,Jk,Xh,BI,ng;const Jm=class Jm{constructor(){Rn(this,Is);Gn(this,"id",kI++);Rn(this,kf,!1);Gn(this,"linked",!0);Rn(this,Sc,null);Rn(this,Wd,null);Gn(this,"async_deriveds",new Map);Gn(this,"current",new Map);Gn(this,"previous",new Map);Rn(this,Bf,new Set);Rn(this,Ff,new Set);Rn(this,Lf,0);Rn(this,yl,new Map);Rn(this,If,null);Rn(this,ur,[]);Rn(this,kp,[]);Rn(this,wl,new Set);Rn(this,ha,new Set);Rn(this,qa,new Map);Rn(this,Pf,new Set);Gn(this,"is_fork",!1);Rn(this,zd,!1);Th===null?tC=Th=this:(Nn(Th,Wd,this),Nn(this,Sc,Th)),Th=this}skip_effect(e){ke(this,qa).has(e)||ke(this,qa).set(e,{d:[],m:[]}),ke(this,Pf).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=ke(this,qa).get(e);if(i){ke(this,qa).delete(e);for(var n of i.d)no(n,Ao),t(n);for(n of i.m)no(n,dl),t(n)}ke(this,Pf).add(e)}capture(e,t,i=!1){e.v!==mo&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Rc)===0&&(this.current.set(e,[t,i]),Lo==null||Lo.set(e,t)),this.is_fork||(e.v=t)}activate(){vn=this}deactivate(){vn=null,Lo=null}flush(){try{iC=!0,vn=this,bs(this,Is,ig).call(this)}finally{l8=0,p1=null,af=null,lv=null,iC=!1,vn=null,Lo=null,Zd.clear()}}discard(){var e;for(const t of ke(this,Ff))t(this);ke(this,Ff).clear(),bs(this,Is,ng).call(this),(e=ke(this,If))==null||e.resolve()}register_created_effect(e){ke(this,kp).push(e)}increment(e,t){if(Nn(this,Lf,ke(this,Lf)+1),e){let i=ke(this,yl).get(t)??0;ke(this,yl).set(t,i+1)}}decrement(e,t){if(Nn(this,Lf,ke(this,Lf)-1),e){let i=ke(this,yl).get(t)??0;i===1?ke(this,yl).delete(t):ke(this,yl).set(t,i-1)}ke(this,zd)||(Nn(this,zd,!0),Nc(()=>{Nn(this,zd,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)ke(this,wl).add(i);for(const i of t)ke(this,ha).add(i);e.clear(),t.clear()}oncommit(e){ke(this,Bf).add(e)}ondiscard(e){ke(this,Ff).add(e)}settled(){return(ke(this,If)??Nn(this,If,Wk())).promise}static ensure(){if(vn===null){const e=vn=new Jm;!iC&&!bg&&Nc(()=>{ke(e,kf)||e.flush()})}return vn}apply(){{Lo=null;return}}schedule(e){var n;if(p1=e,(n=e.b)!=null&&n.is_pending&&(e.f&(i0|gb|zk))!==0&&(e.f&A0)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(af!==null&&t===as&&(os===null||(os.f&No)===0))return;if((i&(sd|wa))!==0){if((i&bo)===0)return;t.f^=bo}}ke(this,ur).push(t)}};kf=new WeakMap,Sc=new WeakMap,Wd=new WeakMap,Bf=new WeakMap,Ff=new WeakMap,Lf=new WeakMap,yl=new WeakMap,If=new WeakMap,ur=new WeakMap,kp=new WeakMap,wl=new WeakMap,ha=new WeakMap,qa=new WeakMap,Pf=new WeakMap,zd=new WeakMap,Is=new WeakSet,x1=function(){if(this.is_fork)return!0;for(const i of ke(this,yl).keys()){for(var e=i,t=!1;e.parent!==null;){if(ke(this,qa).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},ig=function(){var d,u,f,g;Nn(this,kf,!0),l8++>1e3&&(bs(this,Is,ng).call(this),LI());for(const p of ke(this,wl))ke(this,ha).delete(p),no(p,Ao),this.schedule(p);for(const p of ke(this,ha))no(p,dl),this.schedule(p);const e=ke(this,ur);Nn(this,ur,[]),this.apply();var t=af=[],i=[],n=lv=[];for(const p of e)try{bs(this,Is,v1).call(this,p,t,i)}catch(C){throw i6(p),bs(this,Is,x1).call(this)||this.discard(),C}if(vn=null,n.length>0){var s=Jm.ensure();for(const p of n)s.schedule(p)}if(af=null,lv=null,bs(this,Is,x1).call(this)){bs(this,Is,Xh).call(this,i),bs(this,Is,Xh).call(this,t);for(const[p,C]of ke(this,qa))t6(p,C);n.length>0&&bs(d=vn,Is,ig).call(d);return}const r=bs(this,Is,Qk).call(this);if(r){bs(this,Is,Xh).call(this,i),bs(this,Is,Xh).call(this,t),bs(u=r,Is,Jk).call(u,this);return}ke(this,wl).clear(),ke(this,ha).clear();for(const p of ke(this,Bf))p(this);ke(this,Bf).clear(),_g=this,c8(i),c8(t),_g=null,(f=ke(this,If))==null||f.resolve();var a=vn;if(ke(this,Lf)===0&&(ke(this,ur).length===0||a!==null)&&bs(this,Is,ng).call(this),ke(this,ur).length>0)if(a!==null){const p=a;ke(p,ur).push(...ke(this,ur).filter(C=>!ke(p,ur).includes(C)))}else a=this;a!==null&&bs(g=a,Is,ig).call(g)},v1=function(e,t,i){e.f^=bo;for(var n=e.first;n!==null;){var s=n.f,r=(s&(wa|sd))!==0,a=r&&(s&bo)!==0,d=a||(s&tr)!==0||ke(this,qa).has(n);if(!d&&n.fn!==null){r?n.f^=bo:(s&i0)!==0?t.push(n):Qp(n)&&((s&Ea)!==0&&ke(this,ha).add(n),r0(n));var u=n.first;if(u!==null){n=u;continue}}for(;n!==null;){var f=n.next;if(f!==null){n=f;break}n=n.parent}}},Qk=function(){for(var e=ke(this,Sc);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=ke(e,Sc)}return null},Jk=function(e){var i;for(const[n,s]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,s);for(const[n,s]of e.async_deriveds){const r=this.async_deriveds.get(n);r&&s.promise.then(r.resolve).catch(r.reject)}this.transfer_effects(ke(e,wl),ke(e,ha));const t=n=>{var s=n.reactions;if(s!==null)for(const d of s){var r=d.f;if((r&No)!==0)t(d);else{var a=d;r&(wf|Ea)&&!this.async_deriveds.has(a)&&(ke(this,ha).delete(a),no(a,Ao),this.schedule(a))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),bs(i=e,Is,ng).call(i),vn=this,bs(this,Is,ig).call(this)},Xh=function(e){for(var t=0;t<e.length;t+=1)Yk(e[t],ke(this,wl),ke(this,ha))},BI=function(){var f;for(let g=tC;g!==null;g=ke(g,Wd)){var e=g.id<this.id,t=[];for(const[p,[C,b]]of this.current){if(g.current.has(p)){var i=g.current.get(p)[0];if(e&&C!==i)g.current.set(p,[C,b]);else continue}t.push(p)}if(e)for(const[p,C]of this.async_deriveds){const b=g.async_deriveds.get(p);b&&C.promise.then(b.resolve).catch(b.reject)}if(ke(g,kf)){var n=[...g.current.keys()].filter(p=>!g.current.get(p)[1]&&!this.current.has(p));if(n.length===0)e&&g.discard();else if(t.length>0){if(e)for(const p of ke(this,Pf))g.unskip_effect(p,C=>{var b;(C.f&(Ea|wf))!==0?g.schedule(C):bs(b=g,Is,Xh).call(b,[C])});g.activate();var s=new Set,r=new Map;for(var a of t)e6(a,n,s,r);r=new Map;var d=[...g.current].filter(([p,C])=>{const b=this.current.get(p);return b?b[0]!==C[0]||b[1]!==C[1]:!0}).map(([p])=>p);if(d.length>0)for(const p of ke(this,kp))(p.f&(ta|tr|zv))===0&&t9(p,d,r)&&((p.f&(wf|Ea))!==0?(no(p,Ao),g.schedule(p)):ke(g,wl).add(p));if(ke(g,ur).length>0&&!ke(g,zd)){g.apply();for(var u of ke(g,ur))bs(f=g,Is,v1).call(f,u,[],[]);Nn(g,ur,[])}g.deactivate()}}}},ng=function(){if(this.linked){var e=ke(this,Sc),t=ke(this,Wd);e===null?tC=t:Nn(e,Wd,t),t===null?Th=e:Nn(t,Sc,e),this.linked=!1}};let Uu=Jm;function FI(o){var e=bg;bg=!0;try{for(var t;;){if(SI(),vn===null)return t;vn.flush()}}finally{bg=e}}function LI(){try{iI()}catch(o){Bc(o,p1)}}let ca=null;function c8(o){var e=o.length;if(e!==0){for(var t=0;t<e;){var i=o[t++];if((i.f&(ta|tr))===0&&Qp(i)&&(ca=new Set,r0(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&v6(i),(ca==null?void 0:ca.size)>0)){Zd.clear();for(const n of ca){if((n.f&(ta|tr))!==0)continue;const s=[n];let r=n.parent;for(;r!==null;)ca.has(r)&&(ca.delete(r),s.push(r)),r=r.parent;for(let a=s.length-1;a>=0;a--){const d=s[a];(d.f&(ta|tr))===0&&r0(d)}}ca.clear()}}ca=null}}function e6(o,e,t,i){if(!t.has(o)&&(t.add(o),o.reactions!==null))for(const n of o.reactions){const s=n.f;(s&No)!==0?e6(n,e,t,i):(s&(wf|Ea))!==0&&(s&Ao)===0&&t9(n,e,i)&&(no(n,Ao),i9(n))}}function t9(o,e,t){const i=t.get(o);if(i!==void 0)return i;if(o.deps!==null)for(const n of o.deps){if(Wv.call(e,n))return!0;if((n.f&No)!==0&&t9(n,e,t))return t.set(n,!0),!0}return t.set(o,!1),!1}function i9(o){vn.schedule(o)}function t6(o,e){if(!((o.f&wa)!==0&&(o.f&bo)!==0)){(o.f&Ao)!==0?e.d.push(o):(o.f&dl)!==0&&e.m.push(o),no(o,bo);for(var t=o.first;t!==null;)t6(t,e),t=t.next}}function i6(o){no(o,bo);for(var e=o.first;e!==null;)i6(e),e=e.next}function II(o){let e=0,t=qu(0),i;return()=>{r9()&&(l(t),vb(()=>(e===0&&(i=tc(()=>o(()=>Cg(t)))),e+=1,()=>{Nc(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Cg(t))})})))}}var PI=n0|k0;function TI(o,e,t,i){new MI(o,e,t,i)}var Ur,yw,qr,Vd,hr,Gr,Yo,Ar,Sl,jd,Dc,Tf,Bp,Fp,Dl,e_,so,RI,NI,OI,m1,cv,dv,_1,b1;class MI{constructor(e,t,i,n){Rn(this,so);Gn(this,"parent");Gn(this,"is_pending",!1);Gn(this,"transform_error");Rn(this,Ur);Rn(this,yw,null);Rn(this,qr);Rn(this,Vd);Rn(this,hr);Rn(this,Gr,null);Rn(this,Yo,null);Rn(this,Ar,null);Rn(this,Sl,null);Rn(this,jd,0);Rn(this,Dc,0);Rn(this,Tf,!1);Rn(this,Bp,new Set);Rn(this,Fp,new Set);Rn(this,Dl,null);Rn(this,e_,II(()=>(Nn(this,Dl,qu(ke(this,jd))),()=>{Nn(this,Dl,null)})));var s;Nn(this,Ur,e),Nn(this,qr,t),Nn(this,Vd,r=>{var a=as;a.b=this,a.f|=u1,i(r)}),this.parent=as.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(r=>r),Nn(this,hr,c9(()=>{bs(this,so,m1).call(this)},PI))}defer_effect(e){Yk(e,ke(this,Bp),ke(this,Fp))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!ke(this,qr).pending}update_pending_count(e,t){bs(this,so,_1).call(this,e,t),Nn(this,jd,ke(this,jd)+e),!(!ke(this,Dl)||ke(this,Tf))&&(Nn(this,Tf,!0),Nc(()=>{Nn(this,Tf,!1),ke(this,Dl)&&o0(ke(this,Dl),ke(this,jd))}))}get_effect_pending(){return ke(this,e_).call(this),l(ke(this,Dl))}error(e){if(!ke(this,qr).onerror&&!ke(this,qr).failed)throw e;vn!=null&&vn.is_fork?(ke(this,Gr)&&vn.skip_effect(ke(this,Gr)),ke(this,Yo)&&vn.skip_effect(ke(this,Yo)),ke(this,Ar)&&vn.skip_effect(ke(this,Ar)),vn.oncommit(()=>{bs(this,so,b1).call(this,e)})):bs(this,so,b1).call(this,e)}}Ur=new WeakMap,yw=new WeakMap,qr=new WeakMap,Vd=new WeakMap,hr=new WeakMap,Gr=new WeakMap,Yo=new WeakMap,Ar=new WeakMap,Sl=new WeakMap,jd=new WeakMap,Dc=new WeakMap,Tf=new WeakMap,Bp=new WeakMap,Fp=new WeakMap,Dl=new WeakMap,e_=new WeakMap,so=new WeakSet,RI=function(){try{Nn(this,Gr,Kr(()=>ke(this,Vd).call(this,ke(this,Ur))))}catch(e){this.error(e)}},NI=function(e){const t=ke(this,qr).failed;t&&Nn(this,Ar,Kr(()=>{t(ke(this,Ur),()=>e,()=>()=>{})}))},OI=function(){const e=ke(this,qr).pending;e&&(this.is_pending=!0,Nn(this,Yo,Kr(()=>e(ke(this,Ur)))),Nc(()=>{var t=Nn(this,Sl,document.createDocumentFragment()),i=Rl();t.append(i),Nn(this,Gr,bs(this,so,dv).call(this,()=>Kr(()=>ke(this,Vd).call(this,i)))),ke(this,Dc)===0&&(ke(this,Ur).before(t),Nn(this,Sl,null),Yd(ke(this,Yo),()=>{Nn(this,Yo,null)}),bs(this,so,cv).call(this,vn))}))},m1=function(){try{if(this.is_pending=this.has_pending_snippet(),Nn(this,Dc,0),Nn(this,jd,0),Nn(this,Gr,Kr(()=>{ke(this,Vd).call(this,ke(this,Ur))})),ke(this,Dc)>0){var e=Nn(this,Sl,document.createDocumentFragment());u9(ke(this,Gr),e);const t=ke(this,qr).pending;Nn(this,Yo,Kr(()=>t(ke(this,Ur))))}else bs(this,so,cv).call(this,vn)}catch(t){this.error(t)}},cv=function(e){this.is_pending=!1,e.transfer_effects(ke(this,Bp),ke(this,Fp))},dv=function(e){var t=as,i=os,n=Ro;ul(ke(this,hr)),sa(ke(this,hr)),s0(ke(this,hr).ctx);try{return Uu.ensure(),e()}catch(s){return Zk(s),null}finally{ul(t),sa(i),s0(n)}},_1=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&bs(i=this.parent,so,_1).call(i,e,t);return}Nn(this,Dc,ke(this,Dc)+e),ke(this,Dc)===0&&(bs(this,so,cv).call(this,t),ke(this,Yo)&&Yd(ke(this,Yo),()=>{Nn(this,Yo,null)}),ke(this,Sl)&&(ke(this,Ur).before(ke(this,Sl)),Nn(this,Sl,null)))},b1=function(e){ke(this,Gr)&&(Cr(ke(this,Gr)),Nn(this,Gr,null)),ke(this,Yo)&&(Cr(ke(this,Yo)),Nn(this,Yo,null)),ke(this,Ar)&&(Cr(ke(this,Ar)),Nn(this,Ar,null));var t=ke(this,qr).onerror;let i=ke(this,qr).failed;var n=!1,s=!1;const r=()=>{if(n){EI();return}n=!0,s&&aI(),ke(this,Ar)!==null&&Yd(ke(this,Ar),()=>{Nn(this,Ar,null)}),bs(this,so,dv).call(this,()=>{bs(this,so,m1).call(this)})},a=d=>{try{s=!0,t==null||t(d,r),s=!1}catch(u){Bc(u,ke(this,hr)&&ke(this,hr).parent)}i&&Nn(this,Ar,bs(this,so,dv).call(this,()=>{try{return Kr(()=>{var u=as;u.b=this,u.f|=u1,i(ke(this,Ur),()=>d,()=>r)})}catch(u){return Bc(u,ke(this,hr).parent),null}}))};Nc(()=>{var d;try{d=this.transform_error(e)}catch(u){Bc(u,ke(this,hr)&&ke(this,hr).parent);return}d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(a,u=>Bc(u,ke(this,hr)&&ke(this,hr).parent)):a(d)})};function HI(o,e,t,i){const n=Xg;var s=o.filter(p=>!p.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var r=as,a=WI(),d=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(p=>p.promise)):null;function u(p){if((r.f&ta)===0){a();try{i(p)}catch(C){Bc(C,r)}jv()}}var f=n6();if(t.length===0){d.then(()=>u(e.map(n))).finally(f);return}function g(){Promise.all(t.map(p=>zI(p))).then(p=>u([...e.map(n),...p])).catch(p=>Bc(p,r)).finally(f)}d?d.then(()=>{a(),g(),jv()}):g()}function WI(){var o=as,e=os,t=Ro,i=vn;return function(s=!0){ul(o),sa(e),s0(t),s&&(o.f&ta)===0&&(i==null||i.activate(),i==null||i.apply())}}function jv(o=!0){ul(null),sa(null),s0(null),o&&(vn==null||vn.deactivate())}function n6(){var o=as,e=o.b,t=vn,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(i,o),()=>{e==null||e.update_pending_count(-1,t),t.decrement(i,o)}}function Xg(o){var e=No|Ao;return as!==null&&(as.f|=k0),{ctx:Ro,deps:null,effects:null,equals:Uk,f:e,fn:o,reactions:null,rv:0,v:mo,wv:0,parent:as,ac:null}}const wx=Symbol("obsolete");function zI(o,e,t){let i=as;i===null&&YL();var n=void 0,s=qu(mo),r=!os,a=new Set;return JI(()=>{var C,b;var d=as,u=Wk();n=u.promise;try{Promise.resolve(o()).then(u.resolve,E=>{E!==pb&&u.reject(E)}).finally(jv)}catch(E){u.reject(E),jv()}var f=vn;if(r){if((d.f&A0)!==0)var g=n6();if((C=i.b)!=null&&C.is_rendered())(b=f.async_deriveds.get(d))==null||b.reject(wx);else for(const E of a.values())E.reject(wx);a.add(u),f.async_deriveds.set(d,u)}const p=(E,y=void 0)=>{g==null||g(),a.delete(u),y!==wx&&(f.activate(),y?(s.f|=Rc,o0(s,y)):((s.f&Rc)!==0&&(s.f^=Rc),o0(s,E)),f.deactivate())};u.promise.then(p,E=>p(null,E||"unknown"))}),a9(()=>{for(const d of a)d.reject(wx)}),new Promise(d=>{function u(f){function g(){f===n?d(s):u(n)}f.then(g,g)}u(n)})}function Ft(o){const e=Xg(o);return b6(e),e}function n9(o){const e=Xg(o);return e.equals=qk,e}function VI(o){var e=o.effects;if(e!==null){o.effects=null;for(var t=0;t<e.length;t+=1)Cr(e[t])}}function s9(o){var e,t=as,i=o.parent;if(!$l&&i!==null&&o.v!==mo&&(i.f&(ta|tr))!==0)return bI(),o.v;ul(i);try{o.f&=~$u,VI(o),e=w6(o)}finally{ul(t)}return e}function s6(o){var e=s9(o);if(!o.equals(e)&&(o.wv=E6(),(!(vn!=null&&vn.is_fork)||o.deps===null)&&(vn!==null?(vn.capture(o,e,!0),_g==null||_g.capture(o,e,!0)):o.v=e,o.deps===null))){no(o,bo);return}$l||(Lo!==null?(r9()||vn!=null&&vn.is_fork)&&Lo.set(o,e):e9(o))}function jI(o){var e,t;if(o.effects!==null)for(const i of o.effects)(i.teardown||i.ac)&&((e=i.teardown)==null||e.call(i),(t=i.ac)==null||t.abort(pb),i.fn!==null&&(i.teardown=fb),i.ac=null,Yg(i,0),d9(i))}function o6(o){if(o.effects!==null)for(const e of o.effects)e.teardown&&e.fn!==null&&r0(e)}let $v=new Set;const Zd=new Map;let r6=!1;function qu(o,e){var t={f:0,v:o,reactions:null,equals:Uk,rv:0,wv:0};return t}function B(o,e){const t=qu(o);return b6(t),t}function $I(o,e=!1,t=!0){const i=qu(o);return e||(i.equals=qk),i}function x(o,e,t=!1){os!==null&&(!ya||(os.f&zv)!==0)&&Gk()&&(os.f&(No|Ea|wf|zv))!==0&&(rl===null||!rl.has(o))&&rI();let i=t?xi(e):e;return o0(o,i,lv)}function o0(o,e,t=null){if(!o.equals(e)){Zd.set(o,$l?e:o.v);var i=Uu.ensure();if(i.capture(o,e),(o.f&No)!==0){const n=o;(o.f&Ao)!==0&&s9(n),Lo===null&&e9(n)}o.wv=E6(),a6(o,Ao,t),as!==null&&(as.f&bo)!==0&&(as.f&(wa|sd))===0&&($r===null?tP([o]):$r.push(o)),!i.is_fork&&$v.size>0&&!r6&&UI()}return e}function UI(){r6=!1;for(const o of $v){(o.f&bo)!==0&&no(o,dl);let e;try{e=Qp(o)}catch{e=!0}e&&r0(o)}$v.clear()}function d8(o,e=1){var t=l(o),i=e===1?t++:t--;return x(o,t),i}function Cg(o){x(o,o.v+1)}function a6(o,e,t){var i=o.reactions;if(i!==null)for(var n=i.length,s=0;s<n;s++){var r=i[s],a=r.f,d=(a&Ao)===0;if(d&&no(r,e),(a&zv)!==0)$v.add(r);else if((a&No)!==0){var u=r;Lo==null||Lo.delete(u),(a&$u)===0&&(a&ea&&(as===null||(as.f&Vv)===0)&&(r.f|=$u),a6(u,dl,t))}else if(d){var f=r;(a&Ea)!==0&&ca!==null&&ca.add(f),t!==null?t.push(f):i9(f)}}}function xi(o){if(typeof o!="object"||o===null||Kd in o)return o;const e=Hk(o);if(e!==VL&&e!==jL)return o;var t=new Map,i=Jw(o),n=B(0),s=Qd,r=a=>{if(Qd===s)return a();var d=os,u=Qd;sa(null),g8(s);var f=a();return sa(d),g8(u),f};return i&&t.set("length",B(o.length)),new Proxy(o,{defineProperty(a,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&sI();var f=t.get(d);return f===void 0?r(()=>{var g=B(u.value);return t.set(d,g),g}):x(f,u.value,!0),!0},deleteProperty(a,d){var u=t.get(d);if(u===void 0){if(d in a){const f=r(()=>B(mo));t.set(d,f),Cg(n)}}else x(u,mo),Cg(n);return!0},get(a,d,u){var C;if(d===Kd)return o;var f=t.get(d),g=d in a;if(f===void 0&&(!g||(C=yf(a,d))!=null&&C.writable)&&(f=r(()=>{var b=xi(g?a[d]:mo),E=B(b);return E}),t.set(d,f)),f!==void 0){var p=l(f);return p===mo?void 0:p}return Reflect.get(a,d,u)},getOwnPropertyDescriptor(a,d){var u=Reflect.getOwnPropertyDescriptor(a,d);if(u&&"value"in u){var f=t.get(d);f&&(u.value=l(f))}else if(u===void 0){var g=t.get(d),p=g==null?void 0:g.v;if(g!==void 0&&p!==mo)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(a,d){var p;if(d===Kd)return!0;var u=t.get(d),f=u!==void 0&&u.v!==mo||Reflect.has(a,d);if(u!==void 0||as!==null&&(!f||(p=yf(a,d))!=null&&p.writable)){u===void 0&&(u=r(()=>{var C=f?xi(a[d]):mo,b=B(C);return b}),t.set(d,u));var g=l(u);if(g===mo)return!1}return f},set(a,d,u,f){var T;var g=t.get(d),p=d in a;if(i&&d==="length")for(var C=u;C<g.v;C+=1){var b=t.get(C+"");b!==void 0?x(b,mo):C in a&&(b=r(()=>B(mo)),t.set(C+"",b))}if(g===void 0)(!p||(T=yf(a,d))!=null&&T.writable)&&(g=r(()=>B(void 0)),x(g,xi(u)),t.set(d,g));else{p=g.v!==mo;var E=r(()=>xi(u));x(g,E)}var y=Reflect.getOwnPropertyDescriptor(a,d);if(y!=null&&y.set&&y.set.call(f,u),!p){if(i&&typeof d=="string"){var A=t.get("length"),I=Number(d);Number.isInteger(I)&&I>=A.v&&x(A,I+1)}Cg(n)}return!0},ownKeys(a){l(n);var d=Reflect.ownKeys(a).filter(g=>{var p=t.get(g);return p===void 0||p.v!==mo});for(var[u,f]of t)f.v!==mo&&!(u in a)&&d.push(u);return d},setPrototypeOf(){oI()}})}function u8(o){try{if(o!==null&&typeof o=="object"&&Kd in o)return o[Kd]}catch{}return o}function qI(o,e){return Object.is(u8(o),u8(e))}var Xd,l6,c6,d6,u6;function GI(){if(Xd===void 0){Xd=window,l6=document,c6=/Firefox/.test(navigator.userAgent);var o=Element.prototype,e=Node.prototype,t=Text.prototype;d6=yf(e,"firstChild").get,u6=yf(e,"nextSibling").get,r8(o)&&(o[f1]=void 0,o[rv]=null,o[g1]=void 0,o.__e=void 0),r8(t)&&(t[tg]=void 0)}}function Rl(o=""){return document.createTextNode(o)}function tl(o){return d6.call(o)}function Yp(o){return u6.call(o)}function m(o,e){return tl(o)}function dt(o,e=!1){{var t=tl(o);return t instanceof Comment&&t.data===""?Yp(t):t}}function v(o,e=1,t=!1){let i=o;for(;e--;)i=Yp(i);return i}function KI(o){o.textContent=""}function h6(){return!1}function f6(o,e,t){return e==null||e===$k?t?document.createElement(o,{is:t}):document.createElement(o):t?document.createElementNS(e,o,{is:t}):document.createElementNS(e,o)}let h8=!1;function ZI(){h8||(h8=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{var e;if(!o.defaultPrevented)for(const t of o.target.elements)(e=t[av])==null||e.call(t)})},{capture:!0}))}function xb(o){var e=os,t=as;sa(null),ul(null);try{return o()}finally{sa(e),ul(t)}}function o9(o,e,t,i=t){o.addEventListener(e,()=>xb(t));const n=o[av];n?o[av]=()=>{n(),i(!0)}:o[av]=()=>i(!0),ZI()}function XI(o){as===null&&(os===null&&tI(),eI()),$l&&JL()}function YI(o,e){var t=e.last;t===null?e.last=e.first=o:(t.next=o,o.prev=t,e.last=o)}function ec(o,e){var t=as;t!==null&&(t.f&tr)!==0&&(o|=tr);var i={ctx:Ro,deps:null,nodes:null,f:o|Ao|ea,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};vn==null||vn.register_created_effect(i);var n=i;if((o&i0)!==0)af!==null?af.push(i):Uu.ensure().schedule(i);else if(e!==null){try{r0(i)}catch(r){throw Cr(i),r}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&k0)===0&&(n=n.first,(o&Ea)!==0&&(o&n0)!==0&&n!==null&&(n.f|=n0))}if(n!==null&&(n.parent=t,t!==null&&YI(n,t),os!==null&&(os.f&No)!==0&&(o&sd)===0)){var s=os;(s.effects??(s.effects=[])).push(n)}return i}function r9(){return os!==null&&!ya}function a9(o){const e=ec(gb,null);return no(e,bo),e.teardown=o,e}function ps(o){XI();var e=as.f,t=!os&&(e&wa)!==0&&Ro!==null&&!Ro.i;if(t){var i=Ro;(i.e??(i.e=[])).push(o)}else return g6(o)}function g6(o){return ec(i0|GL,o)}function QI(o){Uu.ensure();const e=ec(sd|k0,o);return(t={})=>new Promise(i=>{t.outro?Yd(e,()=>{Cr(e),i(void 0)}):(Cr(e),i(void 0))})}function l9(o){return ec(i0,o)}function JI(o){return ec(wf|k0,o)}function vb(o,e=0){return ec(gb|e,o)}function W(o,e=[],t=[],i=[]){HI(i,e,t,n=>{ec(gb,()=>o(...n.map(l)))})}function c9(o,e=0){var t=ec(Ea|e,o);return t}function Kr(o){return ec(wa|k0,o)}function p6(o){var e=o.teardown;if(e!==null){const t=$l,i=os;f8(!0),sa(null);try{e.call(null)}finally{f8(t),sa(i)}}}function d9(o,e=!1){var t=o.first;for(o.first=o.last=null;t!==null;){const n=t.ac;n!==null&&xb(()=>{n.abort(pb)});var i=t.next;(t.f&sd)!==0?t.parent=null:Cr(t,e),t=i}}function eP(o){for(var e=o.first;e!==null;){var t=e.next;(e.f&wa)===0&&Cr(e),e=t}}function Cr(o,e=!0){var t=!1;(e||(o.f&qL)!==0)&&o.nodes!==null&&o.nodes.end!==null&&(x6(o.nodes.start,o.nodes.end),t=!0),no(o,h1),d9(o,e&&!t),Yg(o,0);var i=o.nodes&&o.nodes.t;if(i!==null)for(const s of i)s.stop();p6(o),o.f^=h1,o.f|=ta;var n=o.parent;n!==null&&n.first!==null&&v6(o),o.next=o.prev=o.teardown=o.ctx=o.deps=o.fn=o.nodes=o.ac=o.b=null}function x6(o,e){for(;o!==null;){var t=o===e?null:Yp(o);o.remove(),o=t}}function v6(o){var e=o.parent,t=o.prev,i=o.next;t!==null&&(t.next=i),i!==null&&(i.prev=t),e!==null&&(e.first===o&&(e.first=i),e.last===o&&(e.last=t))}function Yd(o,e,t=!0){var i=[];m6(o,i,!0);var n=()=>{t&&Cr(o),e&&e()},s=i.length;if(s>0){var r=()=>--s||n();for(var a of i)a.out(r)}else n()}function m6(o,e,t){if((o.f&tr)===0){o.f^=tr;var i=o.nodes&&o.nodes.t;if(i!==null)for(const a of i)(a.is_global||t)&&e.push(a);for(var n=o.first;n!==null;){var s=n.next;if((n.f&sd)===0){var r=(n.f&n0)!==0||(n.f&wa)!==0&&(o.f&Ea)!==0;m6(n,e,r?t:!1)}n=s}}}function Uv(o){_6(o,!0)}function _6(o,e){if((o.f&tr)!==0){o.f^=tr,(o.f&bo)===0&&(no(o,Ao),Uu.ensure().schedule(o));for(var t=o.first;t!==null;){var i=t.next,n=(t.f&n0)!==0||(t.f&wa)!==0;_6(t,n?e:!1),t=i}var s=o.nodes&&o.nodes.t;if(s!==null)for(const r of s)(r.is_global||e)&&r.in()}}function u9(o,e){if(o.nodes)for(var t=o.nodes.start,i=o.nodes.end;t!==null;){var n=t===i?null:Yp(t);e.append(t),t=n}}let uv=!1,$l=!1;function f8(o){$l=o}let os=null,ya=!1;function sa(o){os=o}let as=null;function ul(o){as=o}let rl=null;function b6(o){os!==null&&(rl??(rl=new Set)).add(o)}let fr=null,Sr=0,$r=null;function tP(o){$r=o}let C6=1,Nd=0,Qd=Nd;function g8(o){Qd=o}function E6(){return++C6}function Qp(o){var e=o.f;if((e&Ao)!==0)return!0;if(e&No&&(o.f&=~$u),(e&dl)!==0){for(var t=o.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(Qp(s)&&s6(s),s.wv>o.wv)return!0}(e&ea)!==0&&Lo===null&&no(o,bo)}return!1}function y6(o,e,t=!0){var i=o.reactions;if(i!==null&&!(rl!==null&&rl.has(o)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&No)!==0?y6(s,e,!1):e===s&&(t?no(s,Ao):(s.f&bo)!==0&&no(s,dl),i9(s))}}function w6(o){var E;var e=fr,t=Sr,i=$r,n=os,s=rl,r=Ro,a=ya,d=Qd,u=o.f;fr=null,Sr=0,$r=null,os=(u&(wa|sd))===0?o:null,rl=null,s0(o.ctx),ya=!1,Qd=++Nd,o.ac!==null&&(xb(()=>{o.ac.abort(pb)}),o.ac=null);try{o.f|=Vv;var f=o.fn,g=f();o.f|=A0;var p=o.deps,C=vn==null?void 0:vn.is_fork;if(fr!==null){var b;if(C||Yg(o,Sr),p!==null&&Sr>0)for(p.length=Sr+fr.length,b=0;b<fr.length;b++)p[Sr+b]=fr[b];else o.deps=p=fr;if(r9()&&(o.f&ea)!==0)for(b=Sr;b<p.length;b++)((E=p[b]).reactions??(E.reactions=[])).push(o)}else!C&&p!==null&&Sr<p.length&&(Yg(o,Sr),p.length=Sr);if(Gk()&&$r!==null&&!ya&&p!==null&&(o.f&(No|dl|Ao))===0)for(b=0;b<$r.length;b++)y6($r[b],o);if(n!==null&&n!==o){if(Nd++,n.deps!==null)for(let y=0;y<t;y+=1)n.deps[y].rv=Nd;if(e!==null)for(const y of e)y.rv=Nd;$r!==null&&(i===null?i=$r:i.push(...$r))}return(o.f&Rc)!==0&&(o.f^=Rc),g}catch(y){return Zk(y)}finally{o.f^=Vv,fr=e,Sr=t,$r=i,os=n,rl=s,s0(r),ya=a,Qd=d}}function iP(o,e){let t=e.reactions;if(t!==null){var i=HL.call(t,o);if(i!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[i]=t[n],t.pop())}}if(t===null&&(e.f&No)!==0&&(fr===null||!Wv.call(fr,e))){var s=e;(s.f&ea)!==0&&(s.f^=ea,s.f&=~$u),s.v!==mo&&e9(s),jI(s),Yg(s,0)}}function Yg(o,e){var t=o.deps;if(t!==null)for(var i=e;i<t.length;i++)iP(o,t[i])}function r0(o){var e=o.f;if((e&ta)===0){no(o,bo);var t=as,i=uv;as=o,uv=!0;try{(e&(Ea|zk))!==0?eP(o):d9(o),p6(o);var n=w6(o);o.teardown=typeof n=="function"?n:null,o.wv=C6;var s;Ok&&wI&&(o.f&Ao)!==0&&o.deps}finally{uv=i,as=t}}}async function kl(){await Promise.resolve(),FI()}function l(o){var e=o.f,t=(e&No)!==0;if(os!==null&&!ya){var i=as!==null&&(as.f&ta)!==0;if(!i&&(rl===null||!rl.has(o))){var n=os.deps;if((os.f&Vv)!==0)o.rv<Nd&&(o.rv=Nd,fr===null&&n!==null&&n[Sr]===o?Sr++:fr===null?fr=[o]:fr.push(o));else{os.deps??(os.deps=[]),Wv.call(os.deps,o)||os.deps.push(o);var s=o.reactions;s===null?o.reactions=[os]:Wv.call(s,os)||s.push(os)}}}if($l&&Zd.has(o))return Zd.get(o);if(t){var r=o;if($l){var a=r.v;return((r.f&bo)===0&&r.reactions!==null||D6(r))&&(a=s9(r)),Zd.set(r,a),a}var d=(r.f&ea)===0&&!ya&&os!==null&&(uv||(os.f&ea)!==0),u=(r.f&A0)===0;Qp(r)&&(d&&(r.f|=ea),s6(r)),d&&!u&&(o6(r),S6(r))}if(Lo!=null&&Lo.has(o))return Lo.get(o);if((o.f&Rc)!==0)throw o.v;return o.v}function S6(o){if(o.f|=ea,o.deps!==null)for(const e of o.deps)(e.reactions??(e.reactions=[])).push(o),(e.f&No)!==0&&(e.f&ea)===0&&(o6(e),S6(e))}function D6(o){if(o.v===mo)return!0;if(o.deps===null)return!1;for(const e of o.deps)if(Zd.has(e)||(e.f&No)!==0&&D6(e))return!0;return!1}function tc(o){var e=ya;try{return ya=!0,o()}finally{ya=e}}const nP=["touchstart","touchmove"];function sP(o){return nP.includes(o)}const Od=Symbol("events"),A6=new Set,C1=new Set;function oP(o,e,t,i={}){function n(s){if(i.capture||E1.call(e,s),!s.cancelBubble)return xb(()=>t==null?void 0:t.call(this,s))}return o.startsWith("pointer")||o.startsWith("touch")||o==="wheel"?Nc(()=>{e.addEventListener(o,n,i)}):e.addEventListener(o,n,i),n}function Ms(o,e,t,i,n){var s={capture:i,passive:n},r=oP(o,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&a9(()=>{e.removeEventListener(o,r,s)})}function z(o,e,t){(e[Od]??(e[Od]={}))[o]=t}function lo(o){for(var e=0;e<o.length;e++)A6.add(o[e]);for(var t of C1)t(o)}let p8=null;function E1(o){var E,y;var e=this,t=e.ownerDocument,i=o.type,n=((E=o.composedPath)==null?void 0:E.call(o))||[],s=n[0]||o.target;p8=o;var r=0,a=p8===o&&o[Od];if(a){var d=n.indexOf(a);if(d!==-1&&(e===document||e===window)){o[Od]=e;return}var u=n.indexOf(e);if(u===-1)return;d<=u&&(r=d)}if(s=n[r]||o.target,s!==e){WL(o,"currentTarget",{configurable:!0,get(){return s||t}});var f=os,g=as;sa(null),ul(null);try{for(var p,C=[];s!==null&&s!==e;){try{var b=(y=s[Od])==null?void 0:y[i];b!=null&&(!s.disabled||o.target===s)&&b.call(s,o)}catch(A){p?C.push(A):p=A}if(o.cancelBubble)break;r++,s=r<n.length?n[r]:null}if(p){for(let A of C)queueMicrotask(()=>{throw A});throw p}}finally{o[Od]=e,delete o.currentTarget,sa(f),ul(g)}}}var rA;const nC=((rA=globalThis==null?void 0:globalThis.window)==null?void 0:rA.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:o=>o});function rP(o){return(nC==null?void 0:nC.createHTML(o))??o}function k6(o){var e=f6("template");return e.innerHTML=rP(o.replaceAll("<!>","<!---->")),e.content}function Gu(o,e){var t=as;t.nodes===null&&(t.nodes={start:o,end:e,a:null,t:null})}function F(o,e){var t=(e&xI)!==0,i=(e&vI)!==0,n,s=!o.startsWith("<!>");return()=>{n===void 0&&(n=k6(s?o:"<!>"+o),t||(n=tl(n)));var r=i||c6?document.importNode(n,!0):n.cloneNode(!0);if(t){var a=tl(r),d=r.lastChild;Gu(a,d)}else Gu(r,r);return r}}function aP(o,e,t="svg"){var i=!o.startsWith("<!>"),n=`<${t}>${i?o:"<!>"+o}</${t}>`,s;return()=>{if(!s){var r=k6(n),a=tl(r);s=tl(a)}var d=s.cloneNode(!0);return Gu(d,d),d}}function mb(o,e){return aP(o,e,"svg")}function Co(o=""){{var e=Rl(o+"");return Gu(e,e),e}}function Us(){var o=document.createDocumentFragment(),e=document.createComment(""),t=Rl();return o.append(e,t),Gu(e,t),o}function D(o,e){o!==null&&o.before(e)}function N(o,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(o[tg]??(o[tg]=o.nodeValue))&&(o[tg]=t,o.nodeValue=`${t}`)}function lP(o,e){return cP(o,e)}const Sx=new Map;function cP(o,{target:e,anchor:t,props:i={},events:n,context:s,intro:r=!0,transformError:a}){GI();var d=void 0,u=QI(()=>{var f=t??e.appendChild(Rl());TI(f,{pending:()=>{}},C=>{Ys({});var b=Ro;s&&(b.c=s),n&&(i.$$events=n),d=o(C,i)||{},Qs()},a);var g=new Set,p=C=>{for(var b=0;b<C.length;b++){var E=C[b];if(!g.has(E)){g.add(E);var y=sP(E);for(const T of[e,document]){var A=Sx.get(T);A===void 0&&(A=new Map,Sx.set(T,A));var I=A.get(E);I===void 0?(T.addEventListener(E,E1,{passive:y}),A.set(E,1)):A.set(E,I+1)}}}};return p(hb(A6)),C1.add(p),()=>{var y;for(var C of g)for(const A of[e,document]){var b=Sx.get(A),E=b.get(C);--E==0?(A.removeEventListener(C,E1),b.delete(C),b.size===0&&Sx.delete(A)):b.set(C,E)}C1.delete(p),f!==t&&((y=f.parentNode)==null||y.removeChild(f))}});return dP.set(d,u),d}let dP=new WeakMap;var fa,Ga,kr,$d,Lp,Ip,t_;class uP{constructor(e,t=!0){Gn(this,"anchor");Rn(this,fa,new Map);Rn(this,Ga,new Map);Rn(this,kr,new Map);Rn(this,$d,new Set);Rn(this,Lp,!0);Rn(this,Ip,e=>{if(ke(this,fa).has(e)){var t=ke(this,fa).get(e),i=ke(this,Ga).get(t);if(i)Uv(i),ke(this,$d).delete(t);else{var n=ke(this,kr).get(t);n&&(Uv(n.effect),ke(this,Ga).set(t,n.effect),ke(this,kr).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,r]of ke(this,fa)){if(ke(this,fa).delete(s),s===e)break;const a=ke(this,kr).get(r);a&&(Cr(a.effect),ke(this,kr).delete(r))}for(const[s,r]of ke(this,Ga)){if(s===t||ke(this,$d).has(s))continue;const a=()=>{if(Array.from(ke(this,fa).values()).includes(s)){var u=document.createDocumentFragment();u9(r,u),u.append(Rl()),ke(this,kr).set(s,{effect:r,fragment:u})}else Cr(r);ke(this,$d).delete(s),ke(this,Ga).delete(s)};ke(this,Lp)||!i?(ke(this,$d).add(s),Yd(r,a,!1)):a()}}});Rn(this,t_,e=>{ke(this,fa).delete(e);const t=Array.from(ke(this,fa).values());for(const[i,n]of ke(this,kr))t.includes(i)||(Cr(n.effect),ke(this,kr).delete(i))});this.anchor=e,Nn(this,Lp,t)}ensure(e,t){var i=vn,n=h6();if(t&&!ke(this,Ga).has(e)&&!ke(this,kr).has(e))if(n){var s=document.createDocumentFragment(),r=Rl();s.append(r),ke(this,kr).set(e,{effect:Kr(()=>t(r)),fragment:s})}else ke(this,Ga).set(e,Kr(()=>t(this.anchor)));if(ke(this,fa).set(i,e),n){for(const[a,d]of ke(this,Ga))a===e?i.unskip_effect(d):i.skip_effect(d);for(const[a,d]of ke(this,kr))a===e?i.unskip_effect(d.effect):i.skip_effect(d.effect);i.oncommit(ke(this,Ip)),i.ondiscard(ke(this,t_))}else ke(this,Ip).call(this,i)}}fa=new WeakMap,Ga=new WeakMap,kr=new WeakMap,$d=new WeakMap,Lp=new WeakMap,Ip=new WeakMap,t_=new WeakMap;function O(o,e,t=!1){var i=new uP(o),n=t?n0:0;function s(r,a){i.ensure(r,a)}c9(()=>{var r=!1;e((a,d=0)=>{r=!0,s(d,a)}),r||s(-1,null)},n)}function Hi(o,e){return e}function hP(o,e,t){for(var i=[],n=e.length,s,r=e.length,a=0;a<n;a++){let g=e[a];Yd(g,()=>{if(s){if(s.pending.delete(g),s.done.add(g),s.pending.size===0){var p=o.outrogroups;y1(o,hb(s.done)),p.delete(s),p.size===0&&(o.outrogroups=null)}}else r-=1},!1)}if(r===0){var d=i.length===0&&t!==null;if(d){var u=t,f=u.parentNode;KI(f),f.append(u),o.items.clear()}y1(o,e,!d)}else s={pending:new Set(e),done:new Set},(o.outrogroups??(o.outrogroups=new Set)).add(s)}function y1(o,e,t=!0){var i;if(o.pending.size>0){i=new Set;for(const r of o.pending.values())for(const a of r)i.add(o.items.get(a).e)}for(var n=0;n<e.length;n++){var s=e[n];if(i!=null&&i.has(s)){s.f|=el;const r=document.createDocumentFragment();u9(s,r)}else Cr(e[n],t)}}var x8;function ii(o,e,t,i,n,s=null){var r=o,a=new Map,d=(e&jk)!==0;if(d){var u=o;r=u.appendChild(Rl())}var f=null,g=n9(()=>{var T=t();return Jw(T)?T:T==null?[]:hb(T)}),p,C=new Map,b=!0;function E(T){(I.effect.f&ta)===0&&(I.pending.delete(T),I.fallback=f,fP(I,p,r,e,i),f!==null&&(p.length===0?(f.f&el)===0?Uv(f):(f.f^=el,sg(f,null,r)):Yd(f,()=>{f=null})))}function y(T){I.pending.delete(T)}var A=c9(()=>{p=l(g);for(var T=p.length,M=new Set,P=vn,V=h6(),U=0;U<T;U+=1){var J=p[U],oe=i(J,U),ce=b?null:a.get(oe);ce?(ce.v&&o0(ce.v,J),ce.i&&o0(ce.i,U),V&&P.unskip_effect(ce.e)):(ce=gP(a,b?r:x8??(x8=Rl()),J,oe,U,n,e,t),b||(ce.e.f|=el),a.set(oe,ce)),M.add(oe)}if(T===0&&s&&!f&&(b?f=Kr(()=>s(r)):(f=Kr(()=>s(x8??(x8=Rl()))),f.f|=el)),T>M.size&&QL(),!b)if(C.set(P,M),V){for(const[re,ue]of a)M.has(re)||P.skip_effect(ue.e);P.oncommit(E),P.ondiscard(y)}else E(P);l(g)}),I={effect:A,items:a,pending:C,outrogroups:null,fallback:f};b=!1}function U0(o){for(;o!==null&&(o.f&wa)===0;)o=o.next;return o}function fP(o,e,t,i,n){var ce,re,ue,we,Q,de,ye,Fe,xe;var s=(i&dI)!==0,r=e.length,a=o.items,d=U0(o.effect.first),u,f=null,g,p=[],C=[],b,E,y,A;if(s)for(A=0;A<r;A+=1)b=e[A],E=n(b,A),y=a.get(E).e,(y.f&el)===0&&((re=(ce=y.nodes)==null?void 0:ce.a)==null||re.measure(),(g??(g=new Set)).add(y));for(A=0;A<r;A+=1){if(b=e[A],E=n(b,A),y=a.get(E).e,o.outrogroups!==null)for(const Re of o.outrogroups)Re.pending.delete(y),Re.done.delete(y);if((y.f&tr)!==0&&(Uv(y),s&&((we=(ue=y.nodes)==null?void 0:ue.a)==null||we.unfix(),(g??(g=new Set)).delete(y))),(y.f&el)!==0)if(y.f^=el,y===d)sg(y,null,t);else{var I=f?f.next:d;y===o.effect.last&&(o.effect.last=y.prev),y.prev&&(y.prev.next=y.next),y.next&&(y.next.prev=y.prev),hc(o,f,y),hc(o,y,I),sg(y,I,t),f=y,p=[],C=[],d=U0(f.next);continue}if(y!==d){if(u!==void 0&&u.has(y)){if(p.length<C.length){var T=C[0],M;f=T.prev;var P=p[0],V=p[p.length-1];for(M=0;M<p.length;M+=1)sg(p[M],T,t);for(M=0;M<C.length;M+=1)u.delete(C[M]);hc(o,P.prev,V.next),hc(o,f,P),hc(o,V,T),d=T,f=V,A-=1,p=[],C=[]}else u.delete(y),sg(y,d,t),hc(o,y.prev,y.next),hc(o,y,f===null?o.effect.first:f.next),hc(o,f,y),f=y;continue}for(p=[],C=[];d!==null&&d!==y;)(u??(u=new Set)).add(d),C.push(d),d=U0(d.next);if(d===null)continue}(y.f&el)===0&&p.push(y),f=y,d=U0(y.next)}if(o.outrogroups!==null){for(const Re of o.outrogroups)Re.pending.size===0&&(y1(o,hb(Re.done)),(Q=o.outrogroups)==null||Q.delete(Re));o.outrogroups.size===0&&(o.outrogroups=null)}if(d!==null||u!==void 0){var U=[];if(u!==void 0)for(y of u)(y.f&tr)===0&&U.push(y);for(;d!==null;)(d.f&tr)===0&&d!==o.fallback&&U.push(d),d=U0(d.next);var J=U.length;if(J>0){var oe=(i&jk)!==0&&r===0?t:null;if(s){for(A=0;A<J;A+=1)(ye=(de=U[A].nodes)==null?void 0:de.a)==null||ye.measure();for(A=0;A<J;A+=1)(xe=(Fe=U[A].nodes)==null?void 0:Fe.a)==null||xe.fix()}hP(o,U,oe)}}s&&Nc(()=>{var Re,Ne;if(g!==void 0)for(y of g)(Ne=(Re=y.nodes)==null?void 0:Re.a)==null||Ne.apply()})}function gP(o,e,t,i,n,s,r,a){var d=(r&lI)!==0?(r&uI)===0?$I(t,!1,!1):qu(t):null,u=(r&cI)!==0?qu(n):null;return{v:d,i:u,e:Kr(()=>(s(e,d??t,u??n,a),()=>{o.delete(i)}))}}function sg(o,e,t){if(o.nodes)for(var i=o.nodes.start,n=o.nodes.end,s=e&&(e.f&el)===0?e.nodes.start:t;i!==null;){var r=Yp(i);if(s.before(i),i===n)return;i=r}}function hc(o,e,t){e===null?o.effect.first=t:e.next=t,t===null?o.effect.last=e:t.prev=e}function Fc(o,e,t=!1,i=!1,n=!1,s=!1){var r=o,a="";if(t)var d=o;W(()=>{var u=as;if(a!==(a=e()??"")){if(t){u.nodes=null,d.innerHTML=a,a!==""&&Gu(tl(d),d.lastChild);return}if(u.nodes!==null&&(x6(u.nodes.start,u.nodes.end),u.nodes=null),a!==""){var f=i?mI:n?_I:void 0,g=f6(i?"svg":n?"math":"template",f);g.innerHTML=a;var p=i||n?g:g.content;if(Gu(tl(p),p.lastChild),i||n)for(;tl(p);)r.before(tl(p));else r.before(p)}}})}function B6(o){var e,t,i="";if(typeof o=="string"||typeof o=="number")i+=o;else if(typeof o=="object")if(Array.isArray(o)){var n=o.length;for(e=0;e<n;e++)o[e]&&(t=B6(o[e]))&&(i&&(i+=" "),i+=t)}else for(t in o)o[t]&&(i&&(i+=" "),i+=t);return i}function pP(){for(var o,e,t=0,i="",n=arguments.length;t<n;t++)(o=arguments[t])&&(e=B6(o))&&(i&&(i+=" "),i+=e);return i}function Eg(o){return typeof o=="object"?pP(o):o??""}const v8=[...`
3
3
  \r\f \v\uFEFF`];function xP(o,e,t){var i=o==null?"":""+o;if(e&&(i=i?i+" "+e:e),t){for(var n of Object.keys(t))if(t[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,r=0;(r=i.indexOf(n,r))>=0;){var a=r+s;(r===0||v8.includes(i[r-1]))&&(a===i.length||v8.includes(i[a]))?i=(r===0?"":i.substring(0,r))+i.substring(a+1):r=a}}return i===""?null:i}function m8(o,e=!1){var t=e?" !important;":";",i="";for(var n of Object.keys(o)){var s=o[n];s!=null&&s!==""&&(i+=" "+n+": "+s+t)}return i}function sC(o){return o[0]!=="-"||o[1]!=="-"?o.toLowerCase():o}function vP(o,e){if(e){var t="",i,n;if(Array.isArray(e)?(i=e[0],n=e[1]):i=e,o){o=String(o).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,r=0,a=!1,d=[];i&&d.push(...Object.keys(i).map(sC)),n&&d.push(...Object.keys(n).map(sC));var u=0,f=-1;const E=o.length;for(var g=0;g<E;g++){var p=o[g];if(a?p==="/"&&o[g-1]==="*"&&(a=!1):s?s===p&&(s=!1):p==="/"&&o[g+1]==="*"?a=!0:p==='"'||p==="'"?s=p:p==="("?r++:p===")"&&r--,!a&&s===!1&&r===0){if(p===":"&&f===-1)f=g;else if(p===";"||g===E-1){if(f!==-1){var C=sC(o.substring(u,f).trim());if(!d.includes(C)){p!==";"&&g++;var b=o.substring(u,g).trim();t+=" "+b+";"}}u=g+1,f=-1}}}}return i&&(t+=m8(i)),n&&(t+=m8(n,!0)),t=t.trim(),t===""?null:t}return o==null?null:String(o)}function Dt(o,e,t,i,n,s){var r=o[f1];if(r!==t||r===void 0){var a=xP(t,i,s);a==null?o.removeAttribute("class"):e?o.className=a:o.setAttribute("class",a),o[f1]=t}else if(s&&n!==s)for(var d in s){var u=!!s[d];(n==null||u!==!!n[d])&&o.classList.toggle(d,u)}return s}function oC(o,e={},t,i){for(var n in t){var s=t[n];e[n]!==s&&(t[n]==null?o.style.removeProperty(n):o.style.setProperty(n,s,i))}}function Io(o,e,t,i){var n=o[g1];if(n!==e){var s=vP(e,i);s==null?o.removeAttribute("style"):o.style.cssText=s,o[g1]=e}else i&&(Array.isArray(i)?(oC(o,t==null?void 0:t[0],i[0]),oC(o,t==null?void 0:t[1],i[1],"important")):oC(o,t,i));return i}function qv(o,e,t=!1){if(o.multiple){if(e==null)return;if(!Jw(e))return CI();for(var i of o.options)i.selected=e.includes(yg(i));return}for(i of o.options){var n=yg(i);if(qI(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(o.selectedIndex=-1)}function w1(o){var e=new MutationObserver(()=>{qv(o,o.__value)});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),a9(()=>{e.disconnect()})}function $s(o,e,t=e){var i=new WeakSet,n=!0;o9(o,"change",s=>{var r=s?"[selected]":":checked",a;if(o.multiple)a=[].map.call(o.querySelectorAll(r),yg);else{var d=o.querySelector(r)??o.querySelector("option:not([disabled])");a=d&&yg(d)}t(a),o.__value=a,vn!==null&&i.add(vn)}),l9(()=>{var s=e();if(o===document.activeElement){var r=vn;if(i.has(r))return}if(qv(o,s,n),n&&s===void 0){var a=o.querySelector(":checked");a!==null&&(s=yg(a),t(s))}o.__value=s,n=!1}),w1(o)}function yg(o){return"__value"in o?o.__value:o.value}const mP=Symbol("is custom element"),_P=Symbol("is html"),bP=XL?"progress":"PROGRESS";function S1(o,e){var t=h9(o);t.value===(t.value=e??void 0)||o.value===e&&(e!==0||o.nodeName!==bP)||(o.value=e??"")}function vr(o,e){var t=h9(o);t.checked!==(t.checked=e??void 0)&&(o.checked=e)}function mn(o,e,t,i){var n=h9(o);n[e]!==(n[e]=t)&&(e==="loading"&&(o[ZL]=t),t==null?o.removeAttribute(e):typeof t!="string"&&CP(o).includes(e)?o[e]=t:o.setAttribute(e,t))}function h9(o){return o[rv]??(o[rv]={[mP]:o.nodeName.includes("-"),[_P]:o.namespaceURI===$k})}var _8=new Map;function CP(o){var e=o.getAttribute("is")||o.nodeName,t=_8.get(e);if(t)return t;_8.set(e,t=[]);for(var i,n=o,s=Element.prototype;s!==n;){i=zL(n);for(var r in i)i[r].set&&r!=="innerHTML"&&r!=="textContent"&&r!=="innerText"&&t.push(r);n=Hk(n)}return t}function St(o,e,t=e){var i=new WeakSet;o9(o,"input",async n=>{var s=n?o.defaultValue:o.value;if(s=rC(o)?aC(s):s,t(s),vn!==null&&i.add(vn),await kl(),s!==(s=e())){var r=o.selectionStart,a=o.selectionEnd,d=o.value.length;if(o.value=s??"",a!==null){var u=o.value.length;r===a&&a===d&&u>d?(o.selectionStart=u,o.selectionEnd=u):(o.selectionStart=r,o.selectionEnd=Math.min(a,u))}}}),tc(e)==null&&o.value&&(t(rC(o)?aC(o.value):o.value),vn!==null&&i.add(vn)),vb(()=>{var n=e();if(o===document.activeElement){var s=vn;if(i.has(s))return}rC(o)&&n===aC(o.value)||o.type==="date"&&!n&&!o.value||n!==o.value&&(o.value=n??"")})}function Rs(o,e,t=e){o9(o,"change",i=>{var n=i?o.defaultChecked:o.checked;t(n)}),tc(e)==null&&t(o.checked),vb(()=>{var i=e();o.checked=!!i})}function rC(o){var e=o.type;return e==="number"||e==="range"}function aC(o){return o===""?null:+o}var Ac,Mf,Pp,i_,F6;const n_=class n_{constructor(e){Rn(this,i_);Rn(this,Ac,new WeakMap);Rn(this,Mf);Rn(this,Pp);Nn(this,Pp,e)}observe(e,t){var i=ke(this,Ac).get(e)||new Set;return i.add(t),ke(this,Ac).set(e,i),bs(this,i_,F6).call(this).observe(e,ke(this,Pp)),()=>{var n=ke(this,Ac).get(e);n.delete(t),n.size===0&&(ke(this,Ac).delete(e),ke(this,Mf).unobserve(e))}}};Ac=new WeakMap,Mf=new WeakMap,Pp=new WeakMap,i_=new WeakSet,F6=function(){return ke(this,Mf)??Nn(this,Mf,new ResizeObserver(e=>{for(var t of e){n_.entries.set(t.target,t);for(var i of ke(this,Ac).get(t.target)||[])i(t)}}))},Gn(n_,"entries",new WeakMap);let D1=n_;var EP=new D1({box:"border-box"});function yP(o,e,t){var i=EP.observe(o,()=>t(o[e]));l9(()=>(tc(()=>t(o[e])),i))}function lC(o,e){return o===e||(o==null?void 0:o[Kd])===e}function Ds(o={},e,t,i){var n=Ro.r,s=as;return l9(()=>{var r,a;return vb(()=>{r=a,a=[],tc(()=>{lC(t(...a),o)||(e(o,...a),r&&lC(t(...r),o)&&e(null,...r))})}),()=>{let d=s;for(;d!==n&&d.parent!==null&&d.parent.f&h1;)d=d.parent;const u=()=>{a&&lC(t(...a),o)&&e(null,...a)},f=d.teardown;d.teardown=()=>{u(),f==null||f()}}}),o}function Ku(o,e,t,i){var M;var n=!0,s=(t&gI)!==0,r=(t&pI)!==0,a=i,d=!0,u=void 0,f=()=>r&&n?(u??(u=Xg(i)),l(u)):(d&&(d=!1,a=r?tc(i):i),a);let g;if(s){var p=Kd in o||KL in o;g=((M=yf(o,e))==null?void 0:M.set)??(p&&e in o?P=>o[e]=P:void 0)}var C,b=!1;s?[C,b]=AI(()=>o[e]):C=o[e],C===void 0&&i!==void 0&&(C=f(),g&&(nI(),g(C)));var E;if(E=()=>{var P=o[e];return P===void 0?f():(d=!0,P)},(t&fI)===0)return E;if(g){var y=o.$$legacy;return(function(P,V){return arguments.length>0?((!V||y||b)&&g(V?E():P),P):E()})}var A=!1,I=((t&hI)!==0?Xg:n9)(()=>(A=!1,E()));s&&l(I);var T=as;return(function(P,V){if(arguments.length>0){const U=V?l(I):s?xi(P):P;return x(I,U),A=!0,a!==void 0&&(a=U),P}return $l&&A||(T.f&ta)!==0?I.v:l(I)})}function oo(o){Ro===null&&Vk(),ps(()=>{const e=tc(o);if(typeof e=="function")return e})}function B0(o){Ro===null&&Vk(),oo(()=>()=>tc(o))}const wP="5";var aA;typeof window<"u"&&((aA=window.__svelte??(window.__svelte={})).v??(aA.v=new Set)).add(wP);/*!-----------------------------------------------------------------------------
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,7 +10,7 @@ var s3=Object.defineProperty;var kS=o=>{throw TypeError(o)};var o3=(o,e,t)=>e in
10
10
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
11
11
  * Released under the MIT license
12
12
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
13
- *-----------------------------------------------------------------------------*/var MP=Object.defineProperty,RP=Object.getOwnPropertyDescriptor,NP=Object.getOwnPropertyNames,OP=Object.prototype.hasOwnProperty,HP=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of NP(e))!OP.call(o,n)&&n!==t&&MP(o,n,{get:()=>e[n],enumerable:!(i=RP(e,n))||i.enumerable});return o},WP=(o,e,t)=>(HP(o,e,"default"),t),zP="5.4.5",a0={};WP(a0,cA);var P6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(P6||{}),T6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(T6||{}),M6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(M6||{}),R6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(R6||{}),N6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(N6||{}),O6=class{constructor(o,e,t,i,n){this._onDidChange=new a0.Emitter,this._onDidExtraLibsChange=new a0.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},VP=zP,H6={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},W6=new O6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},H6),z6=new O6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},H6),jP=()=>_b().then(o=>o.getTypeScriptWorker()),$P=()=>_b().then(o=>o.getJavaScriptWorker());a0.languages.typescript={ModuleKind:P6,JsxEmit:T6,NewLineKind:M6,ScriptTarget:R6,ModuleResolutionKind:N6,typescriptVersion:VP,typescriptDefaults:W6,javascriptDefaults:z6,getTypeScriptWorker:jP,getJavaScriptWorker:$P};function _b(){return lA(()=>import("./tsMode-xpfUxGc8.js"),__vite__mapDeps([3,1,2]))}a0.languages.onLanguage("typescript",()=>_b().then(o=>o.setupTypeScript(W6)));a0.languages.onLanguage("javascript",()=>_b().then(o=>o.setupJavaScript(z6)));class UP extends Ko{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:bi("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:nn.map,toggled:Ue.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ue.has("isInDiffEditor"),menu:{when:Ue.has("isInDiffEditor"),id:ri.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(ys),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class V6 extends Ko{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:bi("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(ys),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class j6 extends Ko{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:bi("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(ys),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const ex=bi("diffEditor","Diff Editor");class qP extends Sa{constructor(){super({id:"diffEditor.switchSide",title:bi("switchSide","Switch Side"),icon:nn.arrowSwap,precondition:Ue.has("isInDiffEditor"),f1:!0,category:ex})}runEditorCommand(e,t,i){const n=F0(e);if(n instanceof Tp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class GP extends Sa{constructor(){super({id:"diffEditor.exitCompareMove",title:bi("exitCompareMove","Exit Compare Move"),icon:nn.close,precondition:K.comparingMovedCode,f1:!1,category:ex,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Tp&&n.exitCompareMove()}}class KP extends Sa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:bi("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:nn.fold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:ex})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Tp&&n.collapseAllUnchangedRegions()}}class ZP extends Sa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:bi("showAllUnchangedRegions","Show All Unchanged Regions"),icon:nn.unfold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:ex})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Tp&&n.showAllUnchangedRegions()}}class A1 extends Ko{constructor(){super({id:"diffEditor.revert",title:bi("revert","Revert"),f1:!1,category:ex})}run(e,t){const i=XP(e,t.originalUri,t.modifiedUri);i instanceof Tp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const $6=bi("accessibleDiffViewer","Accessible Diff Viewer"),s_=class s_ extends Ko{constructor(){super({id:s_.id,title:bi("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:$6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerNext()}};s_.id="editor.action.accessibleDiffViewer.next";let Qg=s_;const o_=class o_ extends Ko{constructor(){super({id:o_.id,title:bi("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:$6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerPrev()}};o_.id="editor.action.accessibleDiffViewer.prev";let Gv=o_;function XP(o,e,t){return o.get(zs).listDiffEditors().find(s=>{var d,u;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((d=r.getModel())==null?void 0:d.uri.toString())===t.toString()&&a&&((u=a.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function F0(o){const t=o.get(zs).listDiffEditors(),i=dA();if(i)for(const n of t){const s=n.getContainerDomNode();if(YP(s,i))return n}return null}function YP(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}ls(UP);ls(V6);ls(j6);ia.appendMenuItem(ri.EditorTitle,{command:{id:new j6().desc.id,title:S("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ue.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ue.has("isInDiffEditor")},order:11,group:"1_diff",when:Ue.and(K.diffEditorRenderSideBySideInlineBreakpointReached,Ue.has("isInDiffEditor"))});ia.appendMenuItem(ri.EditorTitle,{command:{id:new V6().desc.id,title:S("showMoves","Show Moved Code Blocks"),icon:nn.move,toggled:r3.create("config.diffEditor.experimental.showMoves",!0),precondition:Ue.has("isInDiffEditor")},order:10,group:"1_diff",when:Ue.has("isInDiffEditor")});ls(A1);for(const o of[{icon:nn.arrowRight,key:K.diffEditorInlineMode.toNegated()},{icon:nn.discard,key:K.diffEditorInlineMode}])ia.appendMenuItem(ri.DiffEditorHunkToolbar,{command:{id:new A1().desc.id,title:S("revertHunk","Revert Block"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),ia.appendMenuItem(ri.DiffEditorSelectionToolbar,{command:{id:new A1().desc.id,title:S("revertSelection","Revert Selection"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"});ls(qP);ls(GP);ls(KP);ls(ZP);ia.appendMenuItem(ri.EditorTitle,{command:{id:Qg.id,title:S("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ue.has("isInDiffEditor")},order:10,group:"2_diff",when:Ue.and(K.accessibleDiffViewerVisible.negate(),Ue.has("isInDiffEditor"))});_s.registerCommandAlias("editor.action.diffReview.next",Qg.id);ls(Qg);_s.registerCommandAlias("editor.action.diffReview.prev",Gv.id);ls(Gv);var QP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},JP=function(o,e){return function(t,i){e(t,i,o)}},k1;const bb=new On("selectionAnchorSet",!1);var iu;let od=(iu=class{static get(e){return e.getContribution(k1.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=bb.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Xi.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Fo().appendText(S("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),na(S("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Xi.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},k1=iu,iu.ID="editor.contrib.selectionAnchorController",iu);od=k1=QP([JP(1,Zn)],od);class eT extends _t{constructor(){super({id:"editor.action.setSelectionAnchor",label:S("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:qs(2089,2080),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.setSelectionAnchor()}}class tT extends _t{constructor(){super({id:"editor.action.goToSelectionAnchor",label:S("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:bb})}async run(e,t){var i;(i=od.get(t))==null||i.goToSelectionAnchor()}}class iT extends _t{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:S("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:bb,kbOpts:{kbExpr:K.editorTextFocus,primary:qs(2089,2089),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.selectFromAnchorToCursor()}}class nT extends _t{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:S("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:bb,kbOpts:{kbExpr:K.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.cancelSelectionAnchor()}}Dn(od.ID,od,4);Me(eT);Me(tT);Me(iT);Me(nT);const sT=gi("editorOverviewRuler.bracketMatchForeground","#A0A0A0",S("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class oT extends _t{constructor(){super({id:"editor.action.jumpToBracket",label:S("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Zu.get(t))==null||i.jumpToBracket()}}class rT extends _t{constructor(){super({id:"editor.action.selectToBracket",label:S("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:bi("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=Zu.get(t))==null||s.selectToBracket(n)}}class aT extends _t{constructor(){super({id:"editor.action.removeBrackets",label:S("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Zu.get(t))==null||i.removeBrackets(this.id)}}class lT{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const bc=class bc extends Wt{static get(e){return e.getContribution(bc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new eo(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(r=d.range.getStartPosition())}}return r?new Xi(r.lineNumber,r.column,r.lineNumber,r.column):new Xi(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(r=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,d=null;if(r){r.sort(te.compareRangesUsingStarts);const[u,f]=r;if(a=e?u.getStartPosition():u.getEndPosition(),d=e?f.getEndPosition():f.getStartPosition(),f.containsPosition(s)){const g=a;a=d,d=g}}a&&d&&i.push(new Xi(a.lineNumber,a.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let g=0,p=e.length;g<p;g++){const C=e[g];C.isEmpty()&&(s[r++]=C.getStartPosition())}s.length>1&&s.sort(wi.compare);const a=[];let d=0,u=0;const f=n.length;for(let g=0,p=s.length;g<p;g++){const C=s[g];for(;u<f&&n[u].position.isBefore(C);)u++;if(u<f&&n[u].position.equals(C))a[d++]=n[u];else{let b=t.bracketPairs.matchBracket(C,20),E=bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!b&&this._matchBrackets==="always"&&(b=t.bracketPairs.findEnclosingBrackets(C,20),E=bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new lT(C,b,E)}}this._lastBracketsData=a,this._lastVersionId=i}};bc.ID="editor.contrib.bracketMatchingController",bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Pn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Xs(sT),position:nl.Center}}),bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Pn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Zu=bc;Dn(Zu.ID,Zu,1);Me(rT);Me(oT);Me(aT);ia.appendMenuItem(ri.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:S({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class cT{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new te(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new te(i,s,i,s),a)}else{const r=new te(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new te(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Xi(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Xi(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class U6 extends _t{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new cT(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class dT extends U6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:S("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:K.writable})}}class uT extends U6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:S("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:K.writable})}}Me(dT);Me(uT);class hT extends _t{constructor(){super({id:"editor.action.transposeLetters",label:S("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,d=r.startColumn,u=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&u===2))continue;const f=d===u?r.getPosition():Kb.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),g=Kb.leftPosition(i,f),p=Kb.leftPosition(i,g),C=i.getValueInRange(te.fromPositions(p,g)),b=i.getValueInRange(te.fromPositions(g,f)),E=te.fromPositions(p,f);n.push(new Mp(E,b+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Me(hT);const Cb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function f9(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function fT(o,e,t){const i={id:Cb(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class q6{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Pl.some(this,([i,n])=>n.asFile())&&t.push("files"),K6(Kv(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return Kv(e)}}function Kv(o){return o.toLowerCase()}function G6(o,e){return K6(Kv(o),e.map(Kv))}function K6(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const Eb=Object.freeze({create:o=>uA(o.map(e=>e.toString())).join(`\r
13
+ *-----------------------------------------------------------------------------*/var MP=Object.defineProperty,RP=Object.getOwnPropertyDescriptor,NP=Object.getOwnPropertyNames,OP=Object.prototype.hasOwnProperty,HP=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of NP(e))!OP.call(o,n)&&n!==t&&MP(o,n,{get:()=>e[n],enumerable:!(i=RP(e,n))||i.enumerable});return o},WP=(o,e,t)=>(HP(o,e,"default"),t),zP="5.4.5",a0={};WP(a0,cA);var P6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(P6||{}),T6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(T6||{}),M6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(M6||{}),R6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(R6||{}),N6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(N6||{}),O6=class{constructor(o,e,t,i,n){this._onDidChange=new a0.Emitter,this._onDidExtraLibsChange=new a0.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},VP=zP,H6={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},W6=new O6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},H6),z6=new O6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},H6),jP=()=>_b().then(o=>o.getTypeScriptWorker()),$P=()=>_b().then(o=>o.getJavaScriptWorker());a0.languages.typescript={ModuleKind:P6,JsxEmit:T6,NewLineKind:M6,ScriptTarget:R6,ModuleResolutionKind:N6,typescriptVersion:VP,typescriptDefaults:W6,javascriptDefaults:z6,getTypeScriptWorker:jP,getJavaScriptWorker:$P};function _b(){return lA(()=>import("./tsMode-w-m3uHER.js"),__vite__mapDeps([3,1,2]))}a0.languages.onLanguage("typescript",()=>_b().then(o=>o.setupTypeScript(W6)));a0.languages.onLanguage("javascript",()=>_b().then(o=>o.setupJavaScript(z6)));class UP extends Ko{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:bi("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:nn.map,toggled:Ue.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ue.has("isInDiffEditor"),menu:{when:Ue.has("isInDiffEditor"),id:ri.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(ys),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class V6 extends Ko{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:bi("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(ys),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class j6 extends Ko{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:bi("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(ys),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const ex=bi("diffEditor","Diff Editor");class qP extends Sa{constructor(){super({id:"diffEditor.switchSide",title:bi("switchSide","Switch Side"),icon:nn.arrowSwap,precondition:Ue.has("isInDiffEditor"),f1:!0,category:ex})}runEditorCommand(e,t,i){const n=F0(e);if(n instanceof Tp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class GP extends Sa{constructor(){super({id:"diffEditor.exitCompareMove",title:bi("exitCompareMove","Exit Compare Move"),icon:nn.close,precondition:K.comparingMovedCode,f1:!1,category:ex,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Tp&&n.exitCompareMove()}}class KP extends Sa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:bi("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:nn.fold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:ex})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Tp&&n.collapseAllUnchangedRegions()}}class ZP extends Sa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:bi("showAllUnchangedRegions","Show All Unchanged Regions"),icon:nn.unfold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:ex})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Tp&&n.showAllUnchangedRegions()}}class A1 extends Ko{constructor(){super({id:"diffEditor.revert",title:bi("revert","Revert"),f1:!1,category:ex})}run(e,t){const i=XP(e,t.originalUri,t.modifiedUri);i instanceof Tp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const $6=bi("accessibleDiffViewer","Accessible Diff Viewer"),s_=class s_ extends Ko{constructor(){super({id:s_.id,title:bi("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:$6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerNext()}};s_.id="editor.action.accessibleDiffViewer.next";let Qg=s_;const o_=class o_ extends Ko{constructor(){super({id:o_.id,title:bi("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:$6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerPrev()}};o_.id="editor.action.accessibleDiffViewer.prev";let Gv=o_;function XP(o,e,t){return o.get(zs).listDiffEditors().find(s=>{var d,u;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((d=r.getModel())==null?void 0:d.uri.toString())===t.toString()&&a&&((u=a.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function F0(o){const t=o.get(zs).listDiffEditors(),i=dA();if(i)for(const n of t){const s=n.getContainerDomNode();if(YP(s,i))return n}return null}function YP(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}ls(UP);ls(V6);ls(j6);ia.appendMenuItem(ri.EditorTitle,{command:{id:new j6().desc.id,title:S("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ue.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ue.has("isInDiffEditor")},order:11,group:"1_diff",when:Ue.and(K.diffEditorRenderSideBySideInlineBreakpointReached,Ue.has("isInDiffEditor"))});ia.appendMenuItem(ri.EditorTitle,{command:{id:new V6().desc.id,title:S("showMoves","Show Moved Code Blocks"),icon:nn.move,toggled:r3.create("config.diffEditor.experimental.showMoves",!0),precondition:Ue.has("isInDiffEditor")},order:10,group:"1_diff",when:Ue.has("isInDiffEditor")});ls(A1);for(const o of[{icon:nn.arrowRight,key:K.diffEditorInlineMode.toNegated()},{icon:nn.discard,key:K.diffEditorInlineMode}])ia.appendMenuItem(ri.DiffEditorHunkToolbar,{command:{id:new A1().desc.id,title:S("revertHunk","Revert Block"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),ia.appendMenuItem(ri.DiffEditorSelectionToolbar,{command:{id:new A1().desc.id,title:S("revertSelection","Revert Selection"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"});ls(qP);ls(GP);ls(KP);ls(ZP);ia.appendMenuItem(ri.EditorTitle,{command:{id:Qg.id,title:S("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ue.has("isInDiffEditor")},order:10,group:"2_diff",when:Ue.and(K.accessibleDiffViewerVisible.negate(),Ue.has("isInDiffEditor"))});_s.registerCommandAlias("editor.action.diffReview.next",Qg.id);ls(Qg);_s.registerCommandAlias("editor.action.diffReview.prev",Gv.id);ls(Gv);var QP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},JP=function(o,e){return function(t,i){e(t,i,o)}},k1;const bb=new On("selectionAnchorSet",!1);var iu;let od=(iu=class{static get(e){return e.getContribution(k1.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=bb.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Xi.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Fo().appendText(S("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),na(S("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Xi.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},k1=iu,iu.ID="editor.contrib.selectionAnchorController",iu);od=k1=QP([JP(1,Zn)],od);class eT extends _t{constructor(){super({id:"editor.action.setSelectionAnchor",label:S("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:qs(2089,2080),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.setSelectionAnchor()}}class tT extends _t{constructor(){super({id:"editor.action.goToSelectionAnchor",label:S("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:bb})}async run(e,t){var i;(i=od.get(t))==null||i.goToSelectionAnchor()}}class iT extends _t{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:S("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:bb,kbOpts:{kbExpr:K.editorTextFocus,primary:qs(2089,2089),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.selectFromAnchorToCursor()}}class nT extends _t{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:S("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:bb,kbOpts:{kbExpr:K.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.cancelSelectionAnchor()}}Dn(od.ID,od,4);Me(eT);Me(tT);Me(iT);Me(nT);const sT=gi("editorOverviewRuler.bracketMatchForeground","#A0A0A0",S("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class oT extends _t{constructor(){super({id:"editor.action.jumpToBracket",label:S("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Zu.get(t))==null||i.jumpToBracket()}}class rT extends _t{constructor(){super({id:"editor.action.selectToBracket",label:S("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:bi("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=Zu.get(t))==null||s.selectToBracket(n)}}class aT extends _t{constructor(){super({id:"editor.action.removeBrackets",label:S("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Zu.get(t))==null||i.removeBrackets(this.id)}}class lT{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const bc=class bc extends Wt{static get(e){return e.getContribution(bc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new eo(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(r=d.range.getStartPosition())}}return r?new Xi(r.lineNumber,r.column,r.lineNumber,r.column):new Xi(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(r=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,d=null;if(r){r.sort(te.compareRangesUsingStarts);const[u,f]=r;if(a=e?u.getStartPosition():u.getEndPosition(),d=e?f.getEndPosition():f.getStartPosition(),f.containsPosition(s)){const g=a;a=d,d=g}}a&&d&&i.push(new Xi(a.lineNumber,a.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let g=0,p=e.length;g<p;g++){const C=e[g];C.isEmpty()&&(s[r++]=C.getStartPosition())}s.length>1&&s.sort(wi.compare);const a=[];let d=0,u=0;const f=n.length;for(let g=0,p=s.length;g<p;g++){const C=s[g];for(;u<f&&n[u].position.isBefore(C);)u++;if(u<f&&n[u].position.equals(C))a[d++]=n[u];else{let b=t.bracketPairs.matchBracket(C,20),E=bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!b&&this._matchBrackets==="always"&&(b=t.bracketPairs.findEnclosingBrackets(C,20),E=bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new lT(C,b,E)}}this._lastBracketsData=a,this._lastVersionId=i}};bc.ID="editor.contrib.bracketMatchingController",bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Pn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Xs(sT),position:nl.Center}}),bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Pn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Zu=bc;Dn(Zu.ID,Zu,1);Me(rT);Me(oT);Me(aT);ia.appendMenuItem(ri.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:S({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class cT{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new te(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new te(i,s,i,s),a)}else{const r=new te(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new te(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Xi(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Xi(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class U6 extends _t{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new cT(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class dT extends U6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:S("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:K.writable})}}class uT extends U6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:S("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:K.writable})}}Me(dT);Me(uT);class hT extends _t{constructor(){super({id:"editor.action.transposeLetters",label:S("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:K.writable,kbOpts:{kbExpr:K.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,d=r.startColumn,u=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&u===2))continue;const f=d===u?r.getPosition():Kb.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),g=Kb.leftPosition(i,f),p=Kb.leftPosition(i,g),C=i.getValueInRange(te.fromPositions(p,g)),b=i.getValueInRange(te.fromPositions(g,f)),E=te.fromPositions(p,f);n.push(new Mp(E,b+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Me(hT);const Cb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function f9(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function fT(o,e,t){const i={id:Cb(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class q6{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Pl.some(this,([i,n])=>n.asFile())&&t.push("files"),K6(Kv(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return Kv(e)}}function Kv(o){return o.toLowerCase()}function G6(o,e){return K6(Kv(o),e.map(Kv))}function K6(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const Eb=Object.freeze({create:o=>uA(o.map(e=>e.toString())).join(`\r
14
14
  `),split:o=>o.split(`\r
15
15
  `),parse:o=>Eb.split(o).filter(e=>!e.startsWith("#"))}),Va=class Va{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Va.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Va((this.value?[this.value,...e]:e).join(Va.sep))}};Va.sep=".",Va.None=new Va("@@none@@"),Va.Empty=new Va("");let Es=Va;const b8={EDITORS:"CodeEditors",FILES:"CodeFiles"};class gT{}const pT={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Da.add(pT.DragAndDropContribution,new gT);const Mg=class Mg{constructor(){}static getInstance(){return Mg.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Mg.INSTANCE=new Mg;let B1=Mg;function Z6(o){const e=new q6;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,f9(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,xT(n))}}return e}function xT(o){const e=o.path?ds.parse(o.path):void 0;return fT(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const vT=Object.freeze([b8.EDITORS,b8.FILES,ZC.RESOURCES,ZC.INTERNAL_URI_LIST]);function X6(o,e=!1){const t=Z6(o),i=t.get(ZC.INTERNAL_URI_LIST);if(i)t.replace(po.uriList,i);else if(e||!t.has(po.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(ds.file(a).toString()):n.push(ds.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(po.uriList,f9(Eb.create(n)))}for(const n of vT)t.delete(n);return t}var g9=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jg=function(o,e){return function(t,i){e(t,i,o)}};class p9{async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Rg=class Rg extends p9{constructor(){super(...arguments),this.kind=Rg.kind,this.dropMimeTypes=[po.text],this.pasteMimeTypes=[po.text]}async getEdit(e,t){const i=e.get(po.text);if(!i||e.has(po.uriList))return;const n=await i.asString();return{handledMimeType:po.text,title:S("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Rg.id="text",Rg.kind=new Es("text.plain");let Xu=Rg;class Y6 extends p9{constructor(){super(...arguments),this.kind=new Es("uri.absolute"),this.dropMimeTypes=[po.uriList],this.pasteMimeTypes=[po.uriList]}async getEdit(e,t){const i=await Q6(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:d})=>a.scheme===jo.file?a.fsPath:(n++,d)).join(" ");let r;return n>0?r=i.length>1?S("defaultDropProvider.uriList.uris","Insert Uris"):S("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?S("defaultDropProvider.uriList.paths","Insert Paths"):S("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:po.uriList,insertText:s,title:r,kind:this.kind}}}let Zv=class extends p9{constructor(e){super(),this._workspaceContextService=e,this.kind=new Es("uri.relative"),this.dropMimeTypes=[po.uriList],this.pasteMimeTypes=[po.uriList]}async getEdit(e,t){const i=await Q6(e);if(!i.length||t.isCancellationRequested)return;const n=Hl(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?a3(r.uri,s):void 0}));if(n.length)return{handledMimeType:po.uriList,insertText:n.join(" "),title:i.length>1?S("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):S("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};Zv=g9([Jg(0,qf)],Zv);class mT{constructor(){this.kind=new Es("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:po.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var d;if(n.triggerKind!==XC.PasteAs&&!((d=n.only)!=null&&d.contains(this.kind)))return;const r=i.get("text/html"),a=await(r==null?void 0:r.asString());if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:S("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function Q6(o){const e=o.get(po.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of Eb.parse(t))try{i.push({uri:ds.parse(n),originalText:n})}catch{}return i}let F1=class extends Wt{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Xu)),this._register(e.documentDropEditProvider.register("*",new Y6)),this._register(e.documentDropEditProvider.register("*",new Zv(t)))}};F1=g9([Jg(0,Si),Jg(1,qf)],F1);let L1=class extends Wt{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Xu)),this._register(e.documentPasteEditProvider.register("*",new Y6)),this._register(e.documentPasteEditProvider.register("*",new Zv(t))),this._register(e.documentPasteEditProvider.register("*",new mT))}};L1=g9([Jg(0,Si),Jg(1,qf)],L1);const Wr=class Wr{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=Wr._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Wr.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(Wr.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Wr.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(Wr.isVariableCharacter(i)||Wr.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Wr._table[i]>"u"&&!Wr.isDigitCharacter(i)&&!Wr.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Wr._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let I1=Wr;class L0{constructor(){this._children=[]}appendChild(e){return e instanceof er&&this._children[this._children.length-1]instanceof er?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function r(a,d){for(const u of a)u.parent=d,r(u.children,u)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof tx)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let er=class J6 extends L0{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new J6(this.value)}};class e5 extends L0{}class Ir extends e5{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof I0?this._children[0]:void 0}clone(){const e=new Ir(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class I0 extends L0{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof er&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new I0;return this.options.forEach(e.appendChild,e),e}}class x9 extends L0{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof ga&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof ga){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new x9;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class ga extends L0{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new ga(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class ep extends e5{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new er(t)],!0):!1}clone(){const e=new ep(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function C8(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class tx extends L0{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Ir&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return C8([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Ir&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof ep&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new tx;return this._children=this.children.map(t=>t.clone()),e}walk(e){C8(this.children,e)}}class Yu{constructor(){this._scanner=new I1,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new tx;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(d=>(d instanceof Ir&&(d.isFinalTabstop?n.set(0,void 0):!n.has(d.index)&&d.children.length>0?n.set(d.index,d.children):s.push(d)),!0));const r=(d,u)=>{const f=n.get(d.index);if(!f)return;const g=new Ir(d.index);g.transform=d.transform;for(const p of f){const C=p.clone();g.appendChild(C),C instanceof Ir&&n.has(C.index)&&!u.has(C.index)&&(u.add(C.index),r(C,u),u.delete(C.index))}t.replace(d,[g])},a=new Set;for(const d of s)r(d,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new Ir(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new er(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Ir(Number(t)):new ep(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new Ir(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new er("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new I0;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new er(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new ep(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new er("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new x9;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new er(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new ga(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new ga(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new ga(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new ga(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new ga(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new ga(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new ga(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new er(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function t5(o,e,t){var i,n;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(s=>new l3(o,{range:s,text:typeof t.insertText=="string"?Yu.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function i5(o){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of o)for(const a of r.yieldTo??[])for(const d of o)if(d!==r&&e(a,d)){let u=t.get(r);u||(u=[],t.set(r,u)),u.push(d)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return s(r.slice(1));let d=[];const u=t.get(a);return u&&(n.push(a),d=s(u),n.pop()),i.add(a),[...d,a,...s(r.slice(1))]}return s(Array.from(o))}var _T=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bT=function(o,e){return function(t,i){e(t,i,o)}};const CT=Pn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:hA,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),r_=class r_ extends Wt{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=fi(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=fi("span.icon");this.domNode.append(t),t.classList.add(...Jn.asClassNameArray(nn.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(Kn(this.domNode,ks.CLICK,n=>{this.delegate.cancel()}))}getId(){return r_.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};r_.baseId="editor.widget.inlineProgressWidget";let P1=r_,Xv=class extends Wt{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Er),this._currentWidget=this._register(new Er),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Hg(()=>{const a=te.fromPositions(e);this._currentDecorations.set([{range:a,options:CT}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(P1,this.id,this._editor,a,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Xv=_T([bT(2,fn)],Xv);var ET=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},E8=function(o,e){return function(t,i){e(t,i,o)}},hv,Hc;let ir=(Hc=class{static get(e){return e.getContribution(hv.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Er,this._messageListeners=new Nt,this._mouseOverMessage=!1,this._editor=e,this._visible=hv.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){na(tv(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=tv(e)?c3(e,{actionHandler:{callback:n=>{this.closeMessage(),d3(this._openerService,n,tv(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new y8(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Js.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&u3(dA(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(Kn(this._messageWidget.value.getDomNode(),ks.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Kn(this._messageWidget.value.getDomNode(),ks.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new te(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(y8.fadeOut(this._messageWidget.value))}},hv=Hc,Hc.ID="editor.contrib.messageController",Hc.MESSAGE_VISIBLE=new On("messageVisible",!1,S("messageVisible","Whether the editor is currently showing an inline message")),Hc);ir=hv=ET([E8(1,Zn),E8(2,Aa)],ir);const yT=Zo.bindToContribution(ir.get);Fi(new yT({id:"leaveEditorMessage",precondition:ir.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let y8=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Dn(ir.ID,ir,4);function cC(o,e){return e&&(o.stack||o.stacktrace)?S("stackTrace.format","{0}: {1}",S8(o),w8(o.stack)||w8(o.stacktrace)):S8(o)}function w8(o){return Array.isArray(o)?o.join(`
16
16
  `):o}function S8(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?S("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Yv(o=null,e=!1){if(!o)return S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Hl(o),i=Yv(t[0],e);return t.length>1?S("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(fA(o))return o;if(o.detail){const t=o.detail;if(t.error)return cC(t.error,e);if(t.exception)return cC(t.exception,e)}return o.stack?cC(o,e):o.message?o.message:S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var n5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Sf=function(o,e){return function(t,i){e(t,i,o)}},T1,nu;let M1=(nu=class extends Wt{constructor(e,t,i,n,s,r,a,d,u,f){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=d,this._keybindingService=f,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(u),this.visibleContext.set(!0),this._register(Cs(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Cs((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(g=>{s.containsPosition(g.position)||this.dispose()})),this._register(Js.runAndSubscribe(f.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=fi(".post-edit-widget"),this.button=this._register(new h3(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(Kn(this.domNode,ks.CLICK,()=>this.showSelector()))}getId(){return T1.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Uo(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>f3({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},T1=nu,nu.baseId="editor.widget.postEditWidget",nu);M1=T1=n5([Sf(7,E0),Sf(8,Zn),Sf(9,Gs)],M1);let Qv=class extends Wt{constructor(e,t,i,n,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Er),this._register(Js.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const d=async y=>{const A=this._editor.getModel();A&&(await A.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:y,allEdits:t.allEdits},i,n,s))},u=(y,A)=>{dd(y)||(this._notificationService.error(A),i&&this.show(e[0],t,d))};let f;try{f=await n(a,s)}catch(y){return u(y,S("resolveError",`Error resolving edit '{0}':
@@ -231,4 +231,4 @@ declare const she: {
231
231
  `):Te:"",!0),x(b,de("max_connections"),!0),x(E,de("max_inflight_messages"),!0),x(y,de("max_queued_messages"),!0),x(A,de("max_packet_size"),!0),x(I,de("message_size_limit"),!0),x(T,de("max_keepalive"),!0),x(M,de("persistent_client_expiration"),!0),x(P,de("retain_available"),!0),x(V,de("set_tcp_nodelay"),!0),x(U,de("connection_messages"),!0),x(ue,ye("log_dest"),!0),x(we,ye("log_type"),!0),x(i,"")}catch(Te){x(i,Te.message??"Failed to load config",!0)}}async function xe(){if(l(t)){x(n,!0),x(s,""),x(r,!1);try{let Ce=function(ui,jt){jt!==""?Te[ui]=jt:delete Te[ui]};const Te={...l(t).managed};Ce("persistence",l(f)),Ce("persistence_location",l(g)),Ce("sys_interval",l(p));const Mt=l(C).split(`
232
232
  `).map(ui=>ui.trim()).filter(Boolean);Mt.length>0?Te.include_dir=Mt.length===1?Mt[0]:Mt:delete Te.include_dir,Ce("max_connections",l(b)),Ce("max_inflight_messages",l(E)),Ce("max_queued_messages",l(y)),Ce("max_packet_size",l(A)),Ce("message_size_limit",l(I)),Ce("max_keepalive",l(T)),Ce("persistent_client_expiration",l(M)),Ce("retain_available",l(P)),Ce("set_tcp_nodelay",l(V)),Ce("connection_messages",l(U)),l(ue).size>0?Te.log_dest=l(ue).size===1?[...l(ue)][0]:[...l(ue)]:delete Te.log_dest,l(we).size>0?Te.log_type=l(we).size===1?[...l(we)][0]:[...l(we)]:delete Te.log_type,await kF({listeners:l(t).listeners,managed:Te,passthrough:l(t).passthrough,checksum:l(u)}),x(r,!0),setTimeout(()=>x(r,!1),3e3),await Fe()}catch(Te){x(s,Te.message??"Save failed",!0)}finally{x(n,!1)}}}async function Re(){x(a,!0),x(d,"");try{const Te=await Vb();x(d,Te.stderr||Te.stdout||"Reloaded",!0)}catch(Te){x(d,"Error: "+(Te.message??"reload failed"))}finally{x(a,!1)}}var Ne=Bee(),be=m(Ne),ot=v(m(be),2),Lt=m(ot),Qe=m(Lt),yt=v(Lt,2),ge=m(yt),Ae=v(be,2);{var nt=Te=>{var Ce=J2(),Mt=m(Ce);W(()=>N(Mt,l(i))),D(Te,Ce)};O(Ae,Te=>{l(i)&&Te(nt)})}var vt=v(Ae,2);{var ct=Te=>{var Ce=J2(),Mt=m(Ce);W(()=>N(Mt,l(s))),D(Te,Ce)};O(vt,Te=>{l(s)&&Te(ct)})}var wt=v(vt,2);{var ai=Te=>{var Ce=See();D(Te,Ce)};O(wt,Te=>{l(r)&&Te(ai)})}var pi=v(wt,2);{var li=Te=>{var Ce=Dee(),Mt=m(Ce);W(()=>N(Mt,l(d))),D(Te,Ce)};O(pi,Te=>{l(d)&&Te(li)})}var mt=v(pi,2);{var di=Te=>{var Ce=kee(),Mt=dt(Ce),ui=v(m(Mt),2),jt=m(ui),Li=m(jt),Mi=v(m(Li),2),Ai=m(Mi);Ai.value=Ai.__value="";var sn=v(Ai);sn.value=sn.__value="true";var on=v(sn);on.value=on.__value="false";var gn=v(jt,2),yn=m(gn),ft=v(m(yn),2),Yt=v(gn,2),Ii=m(Yt),ki=v(m(Ii),2),mi=v(ui,2),Cn=m(mi),En=v(m(Cn),2);mn(En,"rows",3);var wn=v(Mt,2),$e=v(m(wn),2),ti=v(m($e),2);ii(ti,21,()=>J,Hi,(Ie,Be)=>{var ut=qC(),ht=m(ut),Xe=v(ht,3);W(Zt=>{vr(ht,Zt),N(Xe,` ${l(Be)??""}`)},[()=>l(ue).has(l(Be))]),z("change",ht,()=>{x(ue,Q(l(ue),l(Be)),!0)}),D(Ie,ut)});var Ci=v($e,2),Kt=v(m(Ci),2),Ri=m(Kt),Gi=v(m(Ri),2);ii(Gi,17,()=>oe,Hi,(Ie,Be)=>{var ut=qC(),ht=m(ut),Xe=v(ht,3);W(Zt=>{vr(ht,Zt),N(Xe,` ${l(Be)??""}`)},[()=>l(we).has(l(Be))]),z("change",ht,()=>{x(we,Q(l(we),l(Be)),!0)}),D(Ie,ut)});var Yi=v(Ri,2),Z=v(m(Yi),2);ii(Z,17,()=>ce,Hi,(Ie,Be)=>{var ut=qC(),ht=m(ut),Xe=v(ht,3);W(Zt=>{vr(ht,Zt),N(Xe,` ${l(Be)??""}`)},[()=>l(we).has(l(Be))]),z("change",ht,()=>{x(we,Q(l(we),l(Be)),!0)}),D(Ie,ut)});var Se=v(Yi,2),st=m(Se);ii(st,17,()=>re,Hi,(Ie,Be)=>{var ut=Aee(),ht=m(ut),Xe=v(ht,4),Zt=m(Xe);W(at=>{vr(ht,at),N(Zt,l(Be))},[()=>l(we).has(l(Be))]),z("change",ht,()=>{x(we,Q(l(we),l(Be)),!0)}),D(Ie,ut)});var qe=v(wn,2),It=v(m(qe),2),Jt=m(It),gt=m(Jt),Je=v(m(gt),2),rt=v(Jt,2),si=m(rt),De=v(m(si),2),je=v(rt,2),ji=m(je),rn=v(m(ji),2),Ki=v(je,2),he=m(Ki),Ye=v(m(he),2),Bt=v(qe,2),Ot=v(m(Bt),2),Le=m(Ot),ze=m(Le),Ht=v(m(ze),2),$t=v(Le,2),Qt=m($t),Pt=v(m(Qt),2),j=v(Bt,2),ae=v(m(j),2),ve=m(ae),pe=m(ve),it=v(m(pe),2),Ge=v(ve,2),pt=m(Ge),$=v(m(pt),2),q=m($);q.value=q.__value="";var R=v(q);R.value=R.__value="true";var G=v(R);G.value=G.__value="false";var Y=v(j,2),ne=v(m(Y),2),ie=m(ne),fe=m(ie),_e=v(m(fe),2),Ee=m(_e);Ee.value=Ee.__value="";var Oe=v(Ee);Oe.value=Oe.__value="true";var He=v(Oe);He.value=He.__value="false";var tt=v(ie,2),ei=m(tt),ee=v(m(ei),2),le=m(ee);le.value=le.__value="";var Ve=v(le);Ve.value=Ve.__value="true";var Tt=v(Ve);Tt.value=Tt.__value="false",$s(Mi,()=>l(f),Ie=>x(f,Ie)),St(ft,()=>l(g),Ie=>x(g,Ie)),St(ki,()=>l(p),Ie=>x(p,Ie)),St(En,()=>l(C),Ie=>x(C,Ie)),St(Je,()=>l(b),Ie=>x(b,Ie)),St(De,()=>l(T),Ie=>x(T,Ie)),St(rn,()=>l(E),Ie=>x(E,Ie)),St(Ye,()=>l(y),Ie=>x(y,Ie)),St(Ht,()=>l(A),Ie=>x(A,Ie)),St(Pt,()=>l(I),Ie=>x(I,Ie)),St(it,()=>l(M),Ie=>x(M,Ie)),$s($,()=>l(P),Ie=>x(P,Ie)),$s(_e,()=>l(V),Ie=>x(V,Ie)),$s(ee,()=>l(U),Ie=>x(U,Ie)),D(Te,Ce)};O(mt,Te=>{l(t)&&Te(di)})}W(()=>{Lt.disabled=l(n),N(Qe,l(n)?"Saving…":"Save"),yt.disabled=l(a),N(ge,l(a)?"Reloading…":"Apply & Reload")}),z("click",Lt,xe),z("click",yt,Re),D(o,Ne),Qs()}lo(["click","change"]);var _l=F('<div class="err svelte-9auejo"> </div>'),Lee=F('<div class="info-card svelte-9auejo"><dl class="svelte-9auejo"><dt class="svelte-9auejo">CN</dt><dd class="svelte-9auejo"> </dd> <dt class="svelte-9auejo">Fingerprint (SHA-256)</dt><dd class="mono small svelte-9auejo"> </dd> <dt class="svelte-9auejo">Expires</dt><dd> </dd></dl></div>'),Iee=F('<div class="empty svelte-9auejo">No managed server certificate. Use one of the options above, or configure <code>certfile</code>/<code>keyfile</code> manually in the Listeners tab.</div>'),Pee=F('<div class="empty svelte-9auejo">No trusted CA certs. Add one to enable client certificate authentication.</div>'),Tee=F('<tr><td class="mono svelte-9auejo"> </td><td class="mono small svelte-9auejo"> </td><td> </td><td class="actions svelte-9auejo"><button class="danger svelte-9auejo">✕</button></td></tr>'),Mee=F('<table class="svelte-9auejo"><thead><tr><th class="svelte-9auejo">CN</th><th class="svelte-9auejo">Fingerprint</th><th class="svelte-9auejo">Expires</th><th class="svelte-9auejo"></th></tr></thead><tbody></tbody></table>'),Ree=F('<div class="result-box svelte-9auejo"><p class="svelte-9auejo">✓ Certificate installed.</p> <dl class="svelte-9auejo"><dt class="svelte-9auejo">Fingerprint</dt><dd class="mono small svelte-9auejo"> </dd><dt class="svelte-9auejo">Expires</dt><dd class="svelte-9auejo"> </dd></dl></div>'),eA=F('<button class="btn-primary svelte-9auejo"> </button>'),Nee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal svelte-9auejo"><h3 class="svelte-9auejo">Generate self-signed server certificate</h3> <label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Validity (days)<input type="number" min="1" max="3650" class="svelte-9auejo"/></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div></div></div>'),Oee=F('<label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <p class="hint svelte-9auejo">A private key and CSR are generated on the server. Copy the CSR, have it signed by your CA, then paste the signed cert below.</p> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),Hee=F('<div class="ok svelte-9auejo">✓ Certificate installed.</div>'),Wee=F('<p class="hint svelte-9auejo">Key stored on server. Copy the CSR, get it signed, then paste the signed certificate to complete installation.</p> <label class="svelte-9auejo">Certificate Signing Request<textarea readonly="" rows="8" class="svelte-9auejo"></textarea></label> <div class="csr-actions svelte-9auejo"><button class="svelte-9auejo">Copy CSR</button> <a class="btn-download svelte-9auejo" download="server.csr">Download .csr</a></div> <hr class="svelte-9auejo"/> <label class="svelte-9auejo">Upload signed certificate (PEM)<textarea rows="6" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div>',1),zee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Generate key + CSR for server certificate</h3> <!></div></div>'),Vee=F('<label class="svelte-9auejo">Certificate (PEM)<textarea rows="5" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <label class="svelte-9auejo">Private key (PEM — leave blank if key is already on disk from a prior CSR)<textarea rows="4" placeholder="-----BEGIN PRIVATE KEY----- … -----END PRIVATE KEY-----" class="svelte-9auejo"></textarea></label>',1),jee=F('<span class="file-name mono small svelte-9auejo"> </span>'),$ee=F('<label class="svelte-9auejo">PKCS#12 file <div class="file-row svelte-9auejo"><input type="file" accept=".p12,.pfx" class="svelte-9auejo"/> <!></div></label> <label class="svelte-9auejo">Passphrase <div class="pw-row svelte-9auejo"><input autocomplete="off" class="svelte-9auejo"/> <button class="toggle-pw svelte-9auejo"> </button></div></label>',1),Uee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Import server certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>PEM files</button> <button>PKCS#12 (.p12 / .pfx)</button></div> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),GC=F("<option></option>"),qee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Use existing certificate files</h3> <p class="hint svelte-9auejo">Enter absolute paths on the broker host. Tab-completion is available for paths starting with /.</p> <label class="svelte-9auejo">Certificate file path <input list="set-cert-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/fullchain.pem" class="svelte-9auejo"/> <datalist id="set-cert-path-list"></datalist></label> <label class="svelte-9auejo">Private key file path <input list="set-key-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/privkey.pem" class="svelte-9auejo"/> <datalist id="set-key-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),Gee=F('<label class="svelte-9auejo">CA certificate (PEM)<textarea rows="8" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),Kee=F('<p class="hint svelte-9auejo">Enter the absolute path to the CA certificate file on the broker host.</p> <label class="svelte-9auejo">CA certificate path <input list="trusted-path-list" placeholder="/etc/ssl/certs/my-ca.pem" class="svelte-9auejo"/> <datalist id="trusted-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),Zee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Add trusted CA certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>Paste PEM</button> <button>From path</button></div> <!></div></div>'),Xee=F('<div class="certs-page svelte-9auejo"><div class="page-toolbar svelte-9auejo"><button class="reload-btn svelte-9auejo" title="Refresh">↺</button></div> <!> <!> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Server Certificate</h3> <button class="svelte-9auejo">Self-signed</button> <button class="svelte-9auejo">Generate CSR</button> <button class="svelte-9auejo">Import cert</button> <button class="svelte-9auejo">Use path</button></div> <!></div> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Trusted CA Certificates</h3> <button class="svelte-9auejo">+ Add CA cert</button></div> <!></div></div> <!> <!> <!> <!> <!>',1);function Yee(o,e){Ys(e,!0);let t=B(null),i=B(xi([])),n=B(""),s=B(""),r=B(!1),a=B(""),d=B(""),u=B(365),f=B(!1),g=B(""),p=B(null),C=B(!1),b=B(""),E=B(""),y=B(!1),A=B(""),I=B(""),T=B(""),M=B(!1),P=B(""),V=B(!1),U=B(!1),J=B("pem"),oe=B(""),ce=B(""),re=B(""),ue=B(""),we=B(""),Q=B(!1),de=B(!1),ye=B(""),Fe=B(!1),xe=B(""),Re=B(""),Ne=B(!1),be=B(""),ot=B(xi([])),Lt=B(xi([])),Qe=B(!1),yt=B("pem"),ge=B(""),Ae=B(!1),nt=B(""),vt=B(""),ct=B(xi([])),wt=B(!1),ai=B("");async function pi(){try{const[Le,ze]=await Promise.allSettled([tq(),sq()]);Le.status==="fulfilled"&&x(t,Le.value.server,!0),ze.status==="fulfilled"&&x(i,ze.value.certs,!0),x(n,"")}catch(Le){x(n,Le.message,!0)}}oo(()=>{pi()});async function li(){x(g,""),x(f,!0),x(p,null);try{const Le=l(d).split(",").map(Ht=>Ht.trim()).filter(Boolean),ze=await iq({cn:l(a),san:Le,days:l(u)});x(p,{fingerprint:ze.fingerprint,expires:ze.expires},!0),await pi()}catch(Le){x(g,Le.message,!0)}finally{x(f,!1)}}async function mt(){x(A,""),x(y,!0),x(I,"");try{const Le=l(E).split(",").map(Ht=>Ht.trim()).filter(Boolean),ze=await nq({cn:l(b),san:Le});x(I,ze.csrPem,!0)}catch(Le){x(A,Le.message,!0)}finally{x(y,!1)}}async function di(){x(P,""),x(M,!0),x(V,!1);try{if(!l(T).trim())throw new Error("Paste the signed certificate PEM");await VC({cert:l(T)}),x(V,!0),await pi()}catch(Le){x(P,Le.message,!0)}finally{x(M,!1)}}function Te(){navigator.clipboard.writeText(l(I)).catch(()=>{})}function Ce(Le){var $t;const ze=($t=Le.target.files)==null?void 0:$t[0];if(!ze)return;x(ue,ze.name,!0);const Ht=new FileReader;Ht.onload=()=>{const Qt=Ht.result;x(re,btoa(String.fromCharCode(...new Uint8Array(Qt))),!0)},Ht.readAsArrayBuffer(ze)}async function Mt(){x(ye,""),x(de,!0);try{if(l(J)==="p12"){if(!l(re))throw new Error("Select a .p12 / .pfx file");await VC({p12base64:l(re),passphrase:l(we)})}else{if(!l(oe).trim())throw new Error("Certificate PEM is required");await VC({cert:l(oe),key:l(ce)||void 0})}x(U,!1),await pi()}catch(Le){x(ye,Le.message,!0)}finally{x(de,!1)}}function ui(Le){let ze;return Ht=>{const $t=Ht.target.value;clearTimeout(ze),ze=setTimeout(async()=>{if(!$t.startsWith("/")||$t.length<2){Le([]);return}try{Le((await aq($t)).suggestions)}catch{Le([])}},280)}}const jt=ui(Le=>{x(ot,Le,!0)}),Li=ui(Le=>{x(Lt,Le,!0)}),Mi=ui(Le=>{x(ct,Le,!0)});async function Ai(){x(be,""),x(Ne,!0);try{await lq({certPath:l(xe),keyPath:l(Re)}),x(Fe,!1),await pi()}catch(Le){x(be,Le.message,!0)}finally{x(Ne,!1)}}async function sn(){x(nt,""),x(Ae,!0);try{await oq(l(ge)),x(ge,""),x(Qe,!1),await pi()}catch(Le){x(nt,Le.message,!0)}finally{x(Ae,!1)}}async function on(){x(ai,""),x(wt,!0);try{await cq(l(vt)),x(vt,""),x(Qe,!1),await pi()}catch(Le){x(ai,Le.message,!0)}finally{x(wt,!1)}}async function gn(Le){if(confirm("Remove this trusted CA cert?"))try{await rq(Le),await pi()}catch(ze){x(s,ze.message,!0)}}function yn(Le){const ze=new Date(Le).getTime()-Date.now();return ze<0?"expired":ze<30*864e5?"expiring":""}function ft(Le){return new Date(Le).toLocaleDateString()}var Yt=Xee(),Ii=dt(Yt),ki=m(Ii),mi=m(ki),Cn=v(ki,2);{var En=Le=>{var ze=_l(),Ht=m(ze);W(()=>N(Ht,l(n))),D(Le,ze)};O(Cn,Le=>{l(n)&&Le(En)})}var wn=v(Cn,2);{var $e=Le=>{var ze=_l(),Ht=m(ze);W(()=>N(Ht,l(s))),D(Le,ze)};O(wn,Le=>{l(s)&&Le($e)})}var ti=v(wn,2),Ci=m(ti),Kt=v(m(Ci),2),Ri=v(Kt,2),Gi=v(Ri,2),Yi=v(Gi,2),Z=v(Ci,2);{var Se=Le=>{var ze=Lee(),Ht=m(ze),$t=v(m(Ht)),Qt=m($t),Pt=v($t,3),j=m(Pt),ae=v(Pt,3),ve=m(ae);W((pe,it)=>{N(Qt,l(t).cn),N(j,l(t).fingerprint),Dt(ae,1,pe,"svelte-9auejo"),N(ve,it)},[()=>Eg(yn(l(t).expires)),()=>ft(l(t).expires)]),D(Le,ze)},st=Le=>{var ze=Iee();D(Le,ze)};O(Z,Le=>{l(t)?Le(Se):Le(st,-1)})}var qe=v(ti,2),It=m(qe),Jt=v(m(It),2),gt=v(It,2);{var Je=Le=>{var ze=Pee();D(Le,ze)},rt=Le=>{var ze=Mee(),Ht=v(m(ze));ii(Ht,21,()=>l(i),Hi,($t,Qt)=>{var Pt=Tee(),j=m(Pt),ae=m(j),ve=v(j),pe=m(ve),it=v(ve),Ge=m(it),pt=v(it),$=m(pt);W((q,R,G)=>{N(ae,l(Qt).cn),N(pe,`${q??""}…`),Dt(it,1,R,"svelte-9auejo"),N(Ge,G)},[()=>l(Qt).fingerprint.slice(0,29),()=>Eg(yn(l(Qt).expires)),()=>ft(l(Qt).expires)]),z("click",$,()=>gn(l(Qt).fingerprint)),D($t,Pt)}),D(Le,ze)};O(gt,Le=>{l(i).length===0?Le(Je):Le(rt,-1)})}var si=v(Ii,2);{var De=Le=>{var ze=Nee(),Ht=m(ze),$t=v(m(Ht),2),Qt=v(m($t)),Pt=v($t,2),j=v(m(Pt)),ae=v(Pt,2),ve=v(m(ae)),pe=v(ae,2);{var it=Y=>{var ne=_l(),ie=m(ne);W(()=>N(ie,l(g))),D(Y,ne)};O(pe,Y=>{l(g)&&Y(it)})}var Ge=v(pe,2);{var pt=Y=>{var ne=Ree(),ie=v(m(ne),2),fe=v(m(ie)),_e=m(fe),Ee=v(fe,2),Oe=m(Ee);W(He=>{N(_e,l(p).fingerprint),N(Oe,He)},[()=>ft(l(p).expires)]),D(Y,ne)};O(Ge,Y=>{l(p)&&Y(pt)})}var $=v(Ge,2),q=m($),R=v(q,2);{var G=Y=>{var ne=eA(),ie=m(ne);W(()=>{ne.disabled=l(f),N(ie,l(f)?"Generating…":"Generate")}),z("click",ne,li),D(Y,ne)};O(R,Y=>{l(p)||Y(G)})}St(Qt,()=>l(a),Y=>x(a,Y)),St(j,()=>l(d),Y=>x(d,Y)),St(ve,()=>l(u),Y=>x(u,Y)),z("click",q,()=>x(r,!1)),D(Le,ze)};O(si,Le=>{l(r)&&Le(De)})}var je=v(si,2);{var ji=Le=>{var ze=zee(),Ht=m(ze),$t=v(m(Ht),2);{var Qt=j=>{var ae=Oee(),ve=dt(ae),pe=v(m(ve)),it=v(ve,2),Ge=v(m(it)),pt=v(it,4);{var $=ne=>{var ie=_l(),fe=m(ie);W(()=>N(fe,l(A))),D(ne,ie)};O(pt,ne=>{l(A)&&ne($)})}var q=v(pt,2),R=m(q),G=v(R,2),Y=m(G);W(()=>{G.disabled=l(y),N(Y,l(y)?"Generating…":"Generate key + CSR")}),St(pe,()=>l(b),ne=>x(b,ne)),St(Ge,()=>l(E),ne=>x(E,ne)),z("click",R,()=>x(C,!1)),z("click",G,mt),D(j,ae)},Pt=j=>{var ae=Wee(),ve=v(dt(ae),2),pe=v(m(ve)),it=v(ve,2),Ge=m(it),pt=v(Ge,2),$=v(it,4),q=v(m($)),R=v($,2);{var G=Oe=>{var He=_l(),tt=m(He);W(()=>N(tt,l(P))),D(Oe,He)};O(R,Oe=>{l(P)&&Oe(G)})}var Y=v(R,2);{var ne=Oe=>{var He=Hee();D(Oe,He)};O(Y,Oe=>{l(V)&&Oe(ne)})}var ie=v(Y,2),fe=m(ie),_e=v(fe,2);{var Ee=Oe=>{var He=eA(),tt=m(He);W(ei=>{He.disabled=ei,N(tt,l(M)?"Uploading…":"Upload signed cert")},[()=>l(M)||!l(T).trim()]),z("click",He,di),D(Oe,He)};O(_e,Oe=>{l(V)||Oe(Ee)})}W(Oe=>{S1(pe,l(I)),mn(pt,"href",`data:application/pkcs10;charset=utf-8,${Oe??""}`)},[()=>encodeURIComponent(l(I))]),z("click",Ge,Te),St(q,()=>l(T),Oe=>x(T,Oe)),z("click",fe,()=>x(C,!1)),D(j,ae)};O($t,j=>{l(I)?j(Pt,-1):j(Qt)})}D(Le,ze)};O(je,Le=>{l(C)&&Le(ji)})}var rn=v(je,2);{var Ki=Le=>{var ze=Uee(),Ht=m(ze),$t=v(m(Ht),2),Qt=m($t);let Pt;var j=v(Qt,2);let ae;var ve=v($t,2);{var pe=Y=>{var ne=Vee(),ie=dt(ne),fe=v(m(ie)),_e=v(ie,2),Ee=v(m(_e));St(fe,()=>l(oe),Oe=>x(oe,Oe)),St(Ee,()=>l(ce),Oe=>x(ce,Oe)),D(Y,ne)},it=Y=>{var ne=$ee(),ie=dt(ne),fe=v(m(ie)),_e=m(fe),Ee=v(_e,2);{var Oe=Ve=>{var Tt=jee(),Ie=m(Tt);W(()=>N(Ie,l(ue))),D(Ve,Tt)};O(Ee,Ve=>{l(ue)&&Ve(Oe)})}var He=v(ie,2),tt=v(m(He)),ei=m(tt),ee=v(ei,2),le=m(ee);W(()=>{mn(ei,"type",l(Q)?"text":"password"),N(le,l(Q)?"Hide":"Show")}),z("change",_e,Ce),St(ei,()=>l(we),Ve=>x(we,Ve)),z("click",ee,()=>x(Q,!l(Q))),D(Y,ne)};O(ve,Y=>{l(J)==="pem"?Y(pe):Y(it,-1)})}var Ge=v(ve,2);{var pt=Y=>{var ne=_l(),ie=m(ne);W(()=>N(ie,l(ye))),D(Y,ne)};O(Ge,Y=>{l(ye)&&Y(pt)})}var $=v(Ge,2),q=m($),R=v(q,2),G=m(R);W(()=>{Pt=Dt(Qt,1,"svelte-9auejo",null,Pt,{active:l(J)==="pem"}),ae=Dt(j,1,"svelte-9auejo",null,ae,{active:l(J)==="p12"}),R.disabled=l(de),N(G,l(de)?"Importing…":"Import")}),z("click",Qt,()=>x(J,"pem")),z("click",j,()=>x(J,"p12")),z("click",q,()=>x(U,!1)),z("click",R,Mt),D(Le,ze)};O(rn,Le=>{l(U)&&Le(Ki)})}var he=v(rn,2);{var Ye=Le=>{var ze=qee(),Ht=m(ze),$t=v(m(Ht),4),Qt=v(m($t)),Pt=v(Qt,2);ii(Pt,21,()=>l(ot),Hi,(R,G)=>{var Y=GC(),ne={};W(()=>{ne!==(ne=l(G))&&(Y.value=(Y.__value=l(G))??"")}),D(R,Y)});var j=v($t,2),ae=v(m(j)),ve=v(ae,2);ii(ve,21,()=>l(Lt),Hi,(R,G)=>{var Y=GC(),ne={};W(()=>{ne!==(ne=l(G))&&(Y.value=(Y.__value=l(G))??"")}),D(R,Y)});var pe=v(j,2);{var it=R=>{var G=_l(),Y=m(G);W(()=>N(Y,l(be))),D(R,G)};O(pe,R=>{l(be)&&R(it)})}var Ge=v(pe,2),pt=m(Ge),$=v(pt,2),q=m($);W(R=>{$.disabled=R,N(q,l(Ne)?"Installing…":"Install")},[()=>l(Ne)||!l(xe).trim()||!l(Re).trim()]),z("input",Qt,jt),St(Qt,()=>l(xe),R=>x(xe,R)),z("input",ae,Li),St(ae,()=>l(Re),R=>x(Re,R)),z("click",pt,()=>x(Fe,!1)),z("click",$,Ai),D(Le,ze)};O(he,Le=>{l(Fe)&&Le(Ye)})}var Bt=v(he,2);{var Ot=Le=>{var ze=Zee(),Ht=m(ze),$t=v(m(Ht),2),Qt=m($t);let Pt;var j=v(Qt,2);let ae;var ve=v($t,2);{var pe=Ge=>{var pt=Gee(),$=dt(pt),q=v(m($)),R=v($,2);{var G=_e=>{var Ee=_l(),Oe=m(Ee);W(()=>N(Oe,l(nt))),D(_e,Ee)};O(R,_e=>{l(nt)&&_e(G)})}var Y=v(R,2),ne=m(Y),ie=v(ne,2),fe=m(ie);W(_e=>{ie.disabled=_e,N(fe,l(Ae)?"Adding…":"Add CA cert")},[()=>l(Ae)||!l(ge).trim()]),St(q,()=>l(ge),_e=>x(ge,_e)),z("click",ne,()=>x(Qe,!1)),z("click",ie,sn),D(Ge,pt)},it=Ge=>{var pt=Kee(),$=v(dt(pt),2),q=v(m($)),R=v(q,2);ii(R,21,()=>l(ct),Hi,(Ee,Oe)=>{var He=GC(),tt={};W(()=>{tt!==(tt=l(Oe))&&(He.value=(He.__value=l(Oe))??"")}),D(Ee,He)});var G=v($,2);{var Y=Ee=>{var Oe=_l(),He=m(Oe);W(()=>N(He,l(ai))),D(Ee,Oe)};O(G,Ee=>{l(ai)&&Ee(Y)})}var ne=v(G,2),ie=m(ne),fe=v(ie,2),_e=m(fe);W(Ee=>{fe.disabled=Ee,N(_e,l(wt)?"Adding…":"Add CA cert")},[()=>l(wt)||!l(vt).trim()]),z("input",q,Mi),St(q,()=>l(vt),Ee=>x(vt,Ee)),z("click",ie,()=>x(Qe,!1)),z("click",fe,on),D(Ge,pt)};O(ve,Ge=>{l(yt)==="pem"?Ge(pe):Ge(it,-1)})}W(()=>{Pt=Dt(Qt,1,"svelte-9auejo",null,Pt,{active:l(yt)==="pem"}),ae=Dt(j,1,"svelte-9auejo",null,ae,{active:l(yt)==="path"})}),z("click",Qt,()=>x(yt,"pem")),z("click",j,()=>x(yt,"path")),D(Le,ze)};O(Bt,Le=>{l(Qe)&&Le(Ot)})}z("click",mi,pi),z("click",Kt,()=>{x(r,!0),x(g,""),x(p,null)}),z("click",Ri,()=>{x(C,!0),x(A,""),x(I,""),x(T,""),x(V,!1),x(P,"")}),z("click",Gi,()=>{x(U,!0),x(ye,""),x(J,"pem"),x(oe,""),x(ce,""),x(re,""),x(ue,""),x(we,""),x(Q,!1)}),z("click",Yi,()=>{x(Fe,!0),x(be,""),x(xe,""),x(Re,""),x(ot,[],!0),x(Lt,[],!0)}),z("click",Jt,()=>{x(Qe,!0),x(nt,""),x(ge,""),x(yt,"pem"),x(ai,""),x(vt,""),x(ct,[],!0)}),D(o,Yt),Qs()}lo(["click","change","input"]);var Jx=F('<div class="err svelte-17yczfe"> </div>'),Qee=F('<div class="check-list svelte-17yczfe"><div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto_ctrl</code> <span> </span></div> <div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto</code> <span> </span></div></div>'),Jee=F('<div class="checking svelte-17yczfe">Checking…</div>'),ete=F('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Tool availability</h3> <p class="hint svelte-17yczfe">These tools must be installed and in the PATH of the she process. They are used by the Setup Wizard and cert installation.</p> <!> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div></div>'),tte=F('<label class="svelte-17yczfe">Install command (run locally) <div class="pubkey-row svelte-17yczfe"><input readonly="" class="svelte-17yczfe"/> <button class="copy-btn svelte-17yczfe">Copy</button></div></label>'),ite=F('<label class="svelte-17yczfe">Public key <div class="pubkey-row svelte-17yczfe"><textarea readonly="" rows="3" class="svelte-17yczfe"></textarea> <button class="copy-btn svelte-17yczfe">Copy</button></div></label> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>',1),nte=F('<div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>'),ste=F("<span> </span>"),ote=F('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH connection</h3> <p class="hint svelte-17yczfe">Used for file operations: reading/writing mosquitto.conf and installing certificates on the broker host. User/ACL management always uses the MQTT port directly.</p> <div class="fields svelte-17yczfe"><label class="svelte-17yczfe">Host<input placeholder="192.168.1.10 or broker.local" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Port<input type="number" min="1" max="65535" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">SSH user<input placeholder="root" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Identity file (private key)<input class="svelte-17yczfe"/></label></div></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH keypair</h3> <p class="hint svelte-17yczfe">Dedicated Ed25519 keypair for she to authenticate to the broker host. Private key stored at <code class="svelte-17yczfe"> </code>.</p> <!> <!></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Test connection</h3> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button> <!></div></div>',1),rte=F('<div class="ok svelte-17yczfe">Saved.</div>'),ate=F('<div class="mosquitto-page svelte-17yczfe"><!> <div class="mode-bar svelte-17yczfe"><span class="mode-label svelte-17yczfe">Connection mode</span> <div class="mode-toggle svelte-17yczfe"><button>Local</button> <button>SSH / Remote</button></div> <span class="mode-desc svelte-17yczfe"> </span></div> <!> <!> <!> <!> <div class="row svelte-17yczfe"><button class="btn-primary svelte-17yczfe"> </button></div></div>');function lte(o,e){Ys(e,!0);let t=B(xi({})),i=B(""),n=B(!1),s=B(!1),r=B(""),a=B("~/.she/ssh/broker_id_ed25519"),d=B("local"),u=B(null),f=B(!1),g=B(""),p=B(""),C=B(!1),b=B(""),E=B(!1),y=B(""),A=B(xi({}));oo(async()=>{try{const[ct,wt,ai]=await Promise.all([Zl(),zb(),fetch("/she/broker/ssh/pubkey").then(li=>li.json()).catch(()=>({publicKey:null}))]);x(A,ct,!0),wt.sshKeyDefault&&x(a,wt.sshKeyDefault,!0);const pi=l(A).broker??{};x(t,pi.ssh??{},!0),l(t).port||(l(t).port=22),l(t).identityFile||(l(t).identityFile=l(a)),ai.publicKey&&x(p,ai.publicKey,!0),x(d,l(t).host?"ssh":"local",!0),l(d)==="local"&&I()}catch(ct){x(i,ct.message,!0)}});async function I(){x(f,!0),x(g,"");try{x(u,await CU(),!0)}catch(ct){x(g,ct.message??"Check failed",!0)}finally{x(f,!1)}}async function T(){x(n,!0),x(r,""),x(s,!1);try{const ct=l(A).broker??{},wt=l(d)==="local"?{...l(t),host:""}:l(t),ai={...l(A),broker:{...ct,ssh:wt}};await Dp(ai),x(s,!0),setTimeout(()=>x(s,!1),3e3)}catch(ct){x(r,ct.message,!0)}finally{x(n,!1)}}async function M(){x(C,!0),x(b,"");try{const ct=await fetch("/she/broker/ssh/keygen",{method:"POST",headers:{"Content-Type":"application/json"}}),wt=await ct.json();if(!ct.ok)throw new Error(wt.error??ct.statusText);x(p,wt.publicKey,!0)}catch(ct){x(b,ct.message,!0)}finally{x(C,!1)}}async function P(){x(E,!0),x(y,"");try{const ct=await fetch("/she/broker/ssh/test",{method:"POST",headers:{"Content-Type":"application/json"}}),wt=await ct.json();if(!ct.ok)throw new Error(wt.error??ct.statusText);x(y,wt.ok?"✓ Connection successful":"✗ "+(wt.error??"Failed"),!0)}catch(ct){x(y,"✗ "+ct.message)}finally{x(E,!1)}}function V(ct){navigator.clipboard.writeText(ct).catch(()=>{})}const U=Ft(()=>l(t).identityFile&&l(t).user&&l(t).host?`ssh-copy-id -i ${l(t).identityFile}.pub ${l(t).user}@${l(t).host}`:"");var J=ate(),oe=m(J);{var ce=ct=>{var wt=Jx(),ai=m(wt);W(()=>N(ai,l(i))),D(ct,wt)};O(oe,ct=>{l(i)&&ct(ce)})}var re=v(oe,2),ue=v(m(re),2),we=m(ue);let Q;var de=v(we,2);let ye;var Fe=v(ue,2),xe=m(Fe),Re=v(re,2);{var Ne=ct=>{var wt=ete(),ai=v(m(wt),4);{var pi=ui=>{var jt=Jx(),Li=m(jt);W(()=>N(Li,l(g))),D(ui,jt)};O(ai,ui=>{l(g)&&ui(pi)})}var li=v(ai,2);{var mt=ui=>{var jt=Qee(),Li=m(jt),Mi=m(Li);let Ai;var sn=m(Mi),on=v(Mi,4);let gn;var yn=m(on),ft=v(Li,2),Yt=m(ft);let Ii;var ki=m(Yt),mi=v(Yt,4);let Cn;var En=m(mi);W(()=>{Ai=Dt(Mi,1,"check-icon svelte-17yczfe",null,Ai,{ok:l(u).mosquittoCtrl,fail:!l(u).mosquittoCtrl}),N(sn,l(u).mosquittoCtrl?"✓":"✗"),gn=Dt(on,1,"check-note svelte-17yczfe",null,gn,{ok:l(u).mosquittoCtrl,fail:!l(u).mosquittoCtrl}),N(yn,l(u).mosquittoCtrl?"found in PATH":"not found — install the mosquitto or mosquitto-clients package"),Ii=Dt(Yt,1,"check-icon svelte-17yczfe",null,Ii,{ok:l(u).mosquitto,fail:!l(u).mosquitto}),N(ki,l(u).mosquitto?"✓":"✗"),Cn=Dt(mi,1,"check-note svelte-17yczfe",null,Cn,{ok:l(u).mosquitto,fail:!l(u).mosquitto}),N(En,l(u).mosquitto?"found in PATH":"not found — install the mosquitto package")}),D(ui,jt)},di=ui=>{var jt=Jee();D(ui,jt)};O(li,ui=>{l(u)?ui(mt):l(f)&&ui(di,1)})}var Te=v(li,2),Ce=m(Te),Mt=m(Ce);W(()=>{Ce.disabled=l(f),N(Mt,l(f)?"Checking…":l(u)?"Re-check":"Check tools")}),z("click",Ce,I),D(ct,wt)};O(Re,ct=>{l(d)==="local"&&ct(Ne)})}var be=v(Re,2);{var ot=ct=>{var wt=ote(),ai=dt(wt),pi=v(m(ai),4),li=m(pi),mt=v(m(li)),di=v(li,2),Te=v(m(di)),Ce=v(di,2),Mt=v(m(Ce)),ui=v(Ce,2),jt=v(m(ui)),Li=v(ai,2),Mi=v(m(Li),2),Ai=v(m(Mi)),sn=m(Ai),on=v(Mi,2);{var gn=$e=>{var ti=ite(),Ci=dt(ti),Kt=v(m(Ci)),Ri=m(Kt),Gi=v(Ri,2),Yi=v(Ci,2);{var Z=It=>{var Jt=tte(),gt=v(m(Jt)),Je=m(gt),rt=v(Je,2);W(()=>S1(Je,l(U))),z("click",rt,()=>V(l(U))),D(It,Jt)};O(Yi,It=>{l(U)&&It(Z)})}var Se=v(Yi,2),st=m(Se),qe=m(st);W(()=>{S1(Ri,l(p)),st.disabled=l(C),N(qe,l(C)?"Generating…":"Regenerate keypair")}),z("click",Gi,()=>V(l(p))),z("click",st,M),D($e,ti)},yn=$e=>{var ti=nte(),Ci=m(ti),Kt=m(Ci);W(()=>{Ci.disabled=l(C),N(Kt,l(C)?"Generating…":"Generate keypair")}),z("click",Ci,M),D($e,ti)};O(on,$e=>{l(p)?$e(gn):$e(yn,-1)})}var ft=v(on,2);{var Yt=$e=>{var ti=Jx(),Ci=m(ti);W(()=>N(Ci,l(b))),D($e,ti)};O(ft,$e=>{l(b)&&$e(Yt)})}var Ii=v(Li,2),ki=v(m(Ii),2),mi=m(ki),Cn=m(mi),En=v(mi,2);{var wn=$e=>{var ti=ste();let Ci;var Kt=m(ti);W(Ri=>{Ci=Dt(ti,1,"test-result svelte-17yczfe",null,Ci,Ri),N(Kt,l(y))},[()=>({ok:l(y).startsWith("✓"),fail:l(y).startsWith("✗")})]),D($e,ti)};O(En,$e=>{l(y)&&$e(wn)})}W(()=>{mn(jt,"placeholder",l(a)),N(sn,l(t).identityFile||l(a)),mi.disabled=l(E)||!l(t).host,N(Cn,l(E)?"Testing…":"Test SSH connection")}),St(mt,()=>l(t).host,$e=>l(t).host=$e),St(Te,()=>l(t).port,$e=>l(t).port=$e),St(Mt,()=>l(t).user,$e=>l(t).user=$e),St(jt,()=>l(t).identityFile,$e=>l(t).identityFile=$e),z("click",mi,P),D(ct,wt)};O(be,ct=>{l(d)==="ssh"&&ct(ot)})}var Lt=v(be,2);{var Qe=ct=>{var wt=Jx(),ai=m(wt);W(()=>N(ai,l(r))),D(ct,wt)};O(Lt,ct=>{l(r)&&ct(Qe)})}var yt=v(Lt,2);{var ge=ct=>{var wt=rte();D(ct,wt)};O(yt,ct=>{l(s)&&ct(ge)})}var Ae=v(yt,2),nt=m(Ae),vt=m(nt);W(()=>{Q=Dt(we,1,"svelte-17yczfe",null,Q,{active:l(d)==="local"}),ye=Dt(de,1,"svelte-17yczfe",null,ye,{active:l(d)==="ssh"}),N(xe,l(d)==="local"?"she and mosquitto run on the same machine — local filesystem access":"mosquitto runs on a remote host — file operations go through SSH"),nt.disabled=l(n),N(vt,l(n)?"Saving…":"Save")}),z("click",we,()=>{x(d,"local"),l(u)||I()}),z("click",de,()=>x(d,"ssh")),z("click",nt,T),D(o,J),Qs()}lo(["click"]);var cte=F("<button> </button>"),dte=F('<code>log_dest topic</code> is not enabled in mosquitto.conf.<br/> <span class="hint svelte-1yc29ow">Enable it in the <strong>Config</strong> tab, then click <em>Apply &amp; Reload</em>.</span>',1),ute=F('<code>log_dest topic</code> is configured — waiting for messages&hellip;<br/> <span class="hint svelte-1yc29ow">If nothing appears, mosquitto may need a full restart for the change to take effect.</span>',1),hte=F('Waiting for log messages&hellip;<br/> <span class="hint svelte-1yc29ow">Make sure <code class="svelte-1yc29ow">log_dest topic</code> is set in mosquitto.conf.</span>',1),fte=F('<div class="empty svelte-1yc29ow"><!></div>'),gte=F('<div class="entry svelte-1yc29ow"><span class="ts svelte-1yc29ow"> </span> <span> </span> <span class="msg svelte-1yc29ow"> </span></div>'),pte=F('<div class="logs-page svelte-1yc29ow"><div class="toolbar svelte-1yc29ow"><div class="level-filters svelte-1yc29ow"></div> <div class="spacer svelte-1yc29ow"></div> <label class="autoscroll-label svelte-1yc29ow"><input type="checkbox" class="svelte-1yc29ow"/> <span class="checkmark svelte-1yc29ow"></span> Auto-scroll</label> <button class="btn-clear svelte-1yc29ow">Clear</button></div> <div class="log-container svelte-1yc29ow"><!></div></div>');function xte(o,e){Ys(e,!0);const t={D:"DBG",I:"INF",N:"NTC",W:"WRN",E:"ERR"},i={D:"lvl-d",I:"lvl-i",N:"lvl-n",W:"lvl-w",E:"lvl-e"},n=new Set(["D","I","N","W","E"]);let s=B(xi([])),r=B(!0),a=B(xi(new Set(["D","I","N","W","E"]))),d=B(void 0),u=B(!1),f=B(null),g=null;oo(async()=>{const ce=await yU().catch(()=>[]),re=hq(),ue=new Set,we=[...ce,...re].filter(Q=>n.has(Q.level)).map(Q=>({ts:Q.ts,level:Q.level,msg:Q.msg}));we.sort((Q,de)=>Q.ts-de.ts),x(s,we.filter(Q=>{const de=`${Q.ts}\0${Q.msg}`;return ue.has(de)?!1:(ue.add(de),!0)}).slice(-500),!0),l(s).length>0&&(x(u,!0),kl().then(p)),g=mr("brokerLog",Q=>{n.has(Q.level)&&(x(u,!0),x(s,[...l(s).slice(-499),{ts:Q.ts,level:Q.level,msg:Q.msg}],!0),l(r)&&kl().then(p))}),dx().then(Q=>{const de=Q.managed.log_dest,ye=Array.isArray(de)?de:de?[de]:[];x(f,ye.includes("topic"),!0)}).catch(()=>{x(f,null)})}),B0(()=>{g==null||g()});function p(){l(d)&&(l(d).scrollTop=l(d).scrollHeight)}function C(ce){const re=new Set(l(a));re.has(ce)?re.delete(ce):re.add(ce),x(a,re,!0)}function b(){x(s,[],!0),x(u,!1)}let E=Ft(()=>l(s).filter(ce=>l(a).has(ce.level)));var y=pte(),A=m(y),I=m(A);ii(I,20,()=>["D","I","N","W","E"],Hi,(ce,re)=>{var ue=cte();let we;var Q=m(ue);W(de=>{we=Dt(ue,1,`lvl-btn ${i[re]??""}`,"svelte-1yc29ow",we,de),mn(ue,"title",`Toggle ${re??""} messages`),N(Q,t[re])},[()=>({active:l(a).has(re)})]),z("click",ue,()=>C(re)),D(ce,ue)});var T=v(I,4),M=m(T),P=v(T,2),V=v(A,2),U=m(V);{var J=ce=>{var re=fte(),ue=m(re);{var we=de=>{var ye=Us(),Fe=dt(ye);{var xe=be=>{var ot=dte();D(be,ot)},Re=be=>{var ot=ute();D(be,ot)},Ne=be=>{var ot=hte();D(be,ot)};O(Fe,be=>{l(f)===!1?be(xe):l(f)===!0?be(Re,1):be(Ne,-1)})}D(de,ye)},Q=de=>{var ye=Co("No messages match the current filter.");D(de,ye)};O(ue,de=>{l(u)?de(Q,-1):de(we)})}D(ce,re)},oe=ce=>{var re=Us(),ue=dt(re);ii(ue,17,()=>l(E),Hi,(we,Q)=>{var de=gte(),ye=m(de),Fe=m(ye),xe=v(ye,2),Re=m(xe),Ne=v(xe,2),be=m(Ne);W(ot=>{N(Fe,ot),Dt(xe,1,`badge ${i[l(Q).level]??""}`,"svelte-1yc29ow"),N(Re,t[l(Q).level]),N(be,l(Q).msg)},[()=>cS(l(Q).ts)]),D(we,de)}),D(ce,re)};O(U,ce=>{l(E).length===0?ce(J):ce(oe,-1)})}Ds(V,ce=>x(d,ce),()=>l(d)),Rs(M,()=>l(r),ce=>x(r,ce)),z("click",P,b),D(o,y),Qs()}lo(["click"]);var vte=F('<div class="err svelte-d31be1"> </div>'),mte=F('<div class="step svelte-d31be1"><p class="svelte-d31be1">This wizard will configure the <strong>Mosquitto Dynamic Security plugin</strong> for use with she. It will:</p> <ul class="svelte-d31be1"><li>Create a <code class="svelte-d31be1">she-admin</code> service account with a random strong password.</li> <li>Write <code class="svelte-d31be1">dynamic-security.json</code> to your mosquitto config directory.</li> <li>Add the <code class="svelte-d31be1">plugin</code> line to <code class="svelte-d31be1">mosquitto.conf</code>.</li> <li>Ask you to restart mosquitto to activate the plugin.</li></ul> <p class="hint svelte-d31be1">In <strong>remote mode</strong> (SSH host configured), <code class="svelte-d31be1">mosquitto_ctrl</code> is invoked on the broker host via SSH. In local mode, it must be installed on this machine. <code class="svelte-d31be1">mosquitto_ctrl</code> is part of the <code class="svelte-d31be1">mosquitto</code> package.</p> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Start</button></div></div>'),_te=F('<div class="step svelte-d31be1"><p class="svelte-d31be1"> </p></div>'),bte=F('<div class="step svelte-d31be1"><p class="svelte-d31be1">dynsec is not yet active. Configure bootstrap settings:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" placeholder="(leave blank to auto-generate)" class="svelte-d31be1"/></label> <label class="svelte-d31be1">Mosquitto config directory<input class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1"> </button></div></div>'),Cte=F('<p class="hint svelte-d31be1">Restarting mosquitto… this may take a few seconds.</p>'),Ete=F(`<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec files written and credentials saved.</div> <p class="svelte-d31be1">The <code class="svelte-d31be1">plugin</code> line has been added to <code class="svelte-d31be1"> </code>.</p> <p class="svelte-d31be1">Enabling a new plugin requires a <strong>full mosquitto restart</strong> (not just SIGHUP):</p> <div class="actions svelte-d31be1"><button class="btn-warn svelte-d31be1"> </button> <button class="skip-step svelte-d31be1">Skip (I'll restart manually)</button></div> <!></div>`),yte=F('<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec is configured and connected.</div> <p class="svelte-d31be1">she is now managing broker users and ACLs via the Dynamic Security plugin. You can use the <strong>Users & Roles</strong> tab to add users, create roles, and define ACL rules.</p> <div class="actions svelte-d31be1"><button class="btn-primary svelte-d31be1">Done</button></div></div>'),wte=F('<div class="step svelte-d31be1"><p class="svelte-d31be1">Enter the credentials of an existing dynsec admin account:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Back</button> <button class="btn-primary svelte-d31be1"> </button></div></div>'),Ste=F('<div class="wizard svelte-d31be1"><div class="wizard-header svelte-d31be1"><h3 class="svelte-d31be1">dynsec Setup Wizard</h3> <button class="skip-btn svelte-d31be1">Manual setup instead</button></div> <!> <!></div>');function Dte(o,e){Ys(e,!0);let t=B("intro"),i=B(""),n=B(!1),s=B("she-admin"),r=B(""),a=B("/etc/mosquitto"),d=B(null),u=B(!1),f=B(!1),g=B("she-admin"),p=B(""),C=B(!1);async function b(){x(n,!0),x(i,"");try{(await(await fetch("/she/broker/wizard/probe",{method:"POST",headers:{"Content-Type":"application/json"}})).json()).active?x(t,"done"):x(t,"config")}catch(Q){x(i,Q.message,!0)}finally{x(n,!1)}}async function E(){x(n,!0),x(i,"");try{const Q=await fetch("/she/broker/wizard/bootstrap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminUsername:l(s),adminPassword:l(r)||void 0,configDir:l(a)})}),de=await Q.json();if(!Q.ok||!de.ok)throw new Error(de.error??"Bootstrap failed");x(d,de,!0);const ye=await Zl(),Fe=ye.broker??{};await Dp({...ye,broker:{...Fe,dynsec:{adminUsername:de.adminUsername,adminPassword:de.adminPassword}}}),await BU().catch(()=>{}),x(t,"restart")}catch(Q){x(i,Q.message,!0)}finally{x(n,!1)}}async function y(){x(f,!0),x(i,"");try{await AU(),await new Promise(Q=>setTimeout(Q,2e3)),x(u,!0),x(t,"done")}catch(Q){x(i,Q.message,!0)}finally{x(f,!1)}}async function A(){x(C,!0),x(i,"");try{const Q=await Zl(),de=Q.broker??{};await Dp({...Q,broker:{...de,dynsec:{adminUsername:l(g),adminPassword:l(p)}}}),x(t,"done")}catch(Q){x(i,Q.message,!0)}finally{x(C,!1)}}var I=Ste(),T=m(I),M=v(m(T),2),P=v(T,2);{var V=Q=>{var de=vte(),ye=m(de);W(()=>N(ye,l(i))),D(Q,de)};O(P,Q=>{l(i)&&Q(V)})}var U=v(P,2);{var J=Q=>{var de=mte(),ye=v(m(de),6),Fe=m(ye);W(()=>Fe.disabled=l(n)),z("click",Fe,()=>{x(t,"probe"),b()}),D(Q,de)},oe=Q=>{var de=_te(),ye=m(de),Fe=m(ye);W(()=>N(Fe,l(n)?"Probing dynsec…":"Checking dynsec status…")),D(Q,de)},ce=Q=>{var de=bte(),ye=v(m(de),2),Fe=v(m(ye)),xe=v(ye,2),Re=v(m(xe)),Ne=v(xe,2),be=v(m(Ne)),ot=v(Ne,2),Lt=m(ot),Qe=m(Lt);W(()=>{Lt.disabled=l(n)||!l(s),N(Qe,l(n)?"Bootstrapping…":"Bootstrap dynsec")}),St(Fe,()=>l(s),yt=>x(s,yt)),St(Re,()=>l(r),yt=>x(r,yt)),St(be,()=>l(a),yt=>x(a,yt)),z("click",Lt,E),D(Q,de)},re=Q=>{var de=Ete(),ye=v(m(de),2),Fe=v(m(ye),3),xe=m(Fe),Re=v(ye,4),Ne=m(Re),be=m(Ne),ot=v(Ne,2),Lt=v(Re,2);{var Qe=yt=>{var ge=Cte();D(yt,ge)};O(Lt,yt=>{l(f)&&yt(Qe)})}W(()=>{N(xe,l(d).confFilePath),Ne.disabled=l(f),N(be,l(f)?"Restarting…":"Restart mosquitto now")}),z("click",Ne,y),z("click",ot,()=>{x(t,"done")}),D(Q,de)},ue=Q=>{var de=yte(),ye=v(m(de),4),Fe=m(ye);z("click",Fe,function(...xe){var Re;(Re=e.onDone)==null||Re.apply(this,xe)}),D(Q,de)},we=Q=>{var de=wte(),ye=v(m(de),2),Fe=v(m(ye)),xe=v(ye,2),Re=v(m(xe)),Ne=v(xe,2),be=m(Ne),ot=v(be,2),Lt=m(ot);W(()=>{ot.disabled=l(C)||!l(g)||!l(p),N(Lt,l(C)?"Saving…":"Save credentials")}),St(Fe,()=>l(g),Qe=>x(g,Qe)),St(Re,()=>l(p),Qe=>x(p,Qe)),z("click",be,()=>x(t,"intro")),z("click",ot,A),D(Q,de)};O(U,Q=>{l(t)==="intro"?Q(J):l(t)==="probe"?Q(oe,1):l(t)==="config"?Q(ce,2):l(t)==="restart"&&l(d)?Q(re,3):l(t)==="done"?Q(ue,4):l(t)==="manual"&&Q(we,5)})}z("click",M,()=>x(t,"manual")),D(o,I),Qs()}lo(["click"]);var tA=F('<div class="err svelte-bwar3a"> </div>'),Ate=F('<div class="ok svelte-bwar3a">Saved.</div>'),kte=F('<div class="reload-msg svelte-bwar3a"> </div>'),Bte=F('<div class="loading svelte-bwar3a">Loading…</div>'),Fte=F('<li class="svelte-bwar3a"><span class="backup-name svelte-bwar3a"> </span> <button class="btn-restore svelte-bwar3a"> </button></li>'),Lte=F('<div class="backups-section svelte-bwar3a"><div class="backups-header svelte-bwar3a"><span class="backups-title svelte-bwar3a">Backups</span> <button class="btn-refresh svelte-bwar3a" title="Refresh backup list">↻</button></div> <ul class="backup-list svelte-bwar3a"></ul></div>'),Ite=F('<div class="advanced-page svelte-bwar3a"><div class="page-header svelte-bwar3a"><h3 class="svelte-bwar3a">Advanced — mosquitto.conf</h3> <div class="header-actions svelte-bwar3a"><button class="btn-save svelte-bwar3a"> </button> <button class="svelte-bwar3a"> </button></div></div> <!> <!> <!> <!> <div class="editor-wrap svelte-bwar3a"><!></div> <!></div> <!>',1);function Pte(o,e){Ys(e,!0);let t=B(""),i=B(null),n=B(xi([])),s=B(!0),r=B(""),a=B(!1),d=B(""),u=B(!1),f=B(!1),g=B(""),p=B(""),C;oo(()=>{b()});async function b(){x(s,!0),x(r,"");try{const Ae=await dx();x(t,Ae.raw??"",!0),x(i,Ae.checksum,!0),x(n,Ae.backups??[],!0)}catch(Ae){x(r,Ae.message??"Failed to load config",!0)}finally{x(s,!1)}}async function E(){var Ae;x(a,!0),x(d,""),x(u,!1);try{await wU(l(t),l(i)),x(u,!0),await b(),x(u,!0)}catch(nt){(Ae=nt.message)!=null&&Ae.includes("external_modify")||nt.status===409?x(d,"mosquitto.conf was modified externally since last read. Reload first."):x(d,nt.message??"Save failed",!0)}finally{x(a,!1)}}async function y(){x(f,!0),x(g,"");try{const Ae=await Vb();x(g,Ae.stderr||Ae.stdout||"Reloaded",!0)}catch(Ae){x(g,"Error: "+(Ae.message??"reload failed"))}finally{x(f,!1)}}async function A(Ae){if(await C.show(`Restore backup "${Ae}"? Current mosquitto.conf will be overwritten.`,{confirm:"Restore",danger:!0})){x(p,Ae,!0),x(d,"");try{await DU(Ae),await b()}catch(nt){x(d,nt.message??"Restore failed",!0)}finally{x(p,"")}}}async function I(){try{const Ae=await SU();x(n,Ae.backups,!0)}catch{}}function T(Ae){const nt=Ae.match(/\.bak-(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})/);return nt?`${nt[1]}-${nt[2]}-${nt[3]} ${nt[4]}:${nt[5]}:${nt[6]}`:Ae}var M=Ite(),P=dt(M),V=m(P),U=v(m(V),2),J=m(U),oe=m(J),ce=v(J,2),re=m(ce),ue=v(V,2);{var we=Ae=>{var nt=tA(),vt=m(nt);W(()=>N(vt,l(r))),D(Ae,nt)};O(ue,Ae=>{l(r)&&Ae(we)})}var Q=v(ue,2);{var de=Ae=>{var nt=tA(),vt=m(nt);W(()=>N(vt,l(d))),D(Ae,nt)};O(Q,Ae=>{l(d)&&Ae(de)})}var ye=v(Q,2);{var Fe=Ae=>{var nt=Ate();D(Ae,nt)};O(ye,Ae=>{l(u)&&Ae(Fe)})}var xe=v(ye,2);{var Re=Ae=>{var nt=kte(),vt=m(nt);W(()=>N(vt,l(g))),D(Ae,nt)};O(xe,Ae=>{l(g)&&Ae(Re)})}var Ne=v(xe,2),be=m(Ne);{var ot=Ae=>{var nt=Bte();D(Ae,nt)},Lt=Ae=>{Tg(Ae,{language:"ini",onSave:E,get value(){return l(t)},set value(nt){x(t,nt,!0)}})};O(be,Ae=>{l(s)?Ae(ot):Ae(Lt,-1)})}var Qe=v(Ne,2);{var yt=Ae=>{var nt=Lte(),vt=m(nt),ct=v(m(vt),2),wt=v(vt,2);ii(wt,21,()=>l(n),Hi,(ai,pi)=>{var li=Fte(),mt=m(li),di=m(mt),Te=v(mt,2),Ce=m(Te);W(Mt=>{N(di,Mt),Te.disabled=l(p)===l(pi),N(Ce,l(p)===l(pi)?"Restoring…":"Restore")},[()=>T(l(pi))]),z("click",Te,()=>A(l(pi))),D(ai,li)}),z("click",ct,I),D(Ae,nt)};O(Qe,Ae=>{l(n).length>0&&Ae(yt)})}var ge=v(P,2);Ds(gl(ge,{}),Ae=>C=Ae,()=>C),W(()=>{J.disabled=l(a)||l(s),N(oe,l(a)?"Saving…":"Save"),ce.disabled=l(f),N(re,l(f)?"Reloading…":"Apply & Reload")}),z("click",J,E),z("click",ce,y),D(o,M),Qs()}lo(["click"]);var Tte=F('<div class="reload-msg svelte-1q1ovna"> </div>'),KC=F('<div class="err svelte-1q1ovna"> </div>'),iA=F('<div class="ok svelte-1q1ovna"> </div>'),nA=F('<div class="loading svelte-1q1ovna">Loading…</div>'),Mte=F('<span class="inline-err svelte-1q1ovna"> </span>'),Rte=F('<div class="change-form svelte-1q1ovna"><input type="password" placeholder="New password" autocomplete="new-password" class="svelte-1q1ovna"/> <input type="password" placeholder="Confirm password" autocomplete="new-password" class="svelte-1q1ovna"/> <!> <button class="svelte-1q1ovna"> </button> <button class="svelte-1q1ovna">Cancel</button></div>'),Nte=F('<button class="svelte-1q1ovna">Change password</button> <button class="btn-danger svelte-1q1ovna"> </button>',1),Ote=F('<tr><td class="user-name svelte-1q1ovna"> </td><td class="user-actions svelte-1q1ovna"><!></td></tr>'),Hte=F('<table class="user-table svelte-1q1ovna"><thead><tr><th class="svelte-1q1ovna">Username</th><th class="svelte-1q1ovna"></th></tr></thead><tbody></tbody></table>'),Wte=F('<p class="empty svelte-1q1ovna">No users found — file may not exist yet.</p>'),zte=F('<!> <div class="add-form svelte-1q1ovna"><span class="add-title svelte-1q1ovna">Add user</span> <div class="add-fields svelte-1q1ovna"><input placeholder="Username" autocomplete="off" class="svelte-1q1ovna"/> <input type="password" placeholder="Password" autocomplete="new-password" class="svelte-1q1ovna"/> <input type="password" placeholder="Confirm password" autocomplete="new-password" class="svelte-1q1ovna"/> <button class="btn-add svelte-1q1ovna"> </button></div> <!></div>',1),Vte=F(`<div class="passwd-page svelte-1q1ovna"><section class="card svelte-1q1ovna"><div class="card-header svelte-1q1ovna"><h4 class="svelte-1q1ovna">Password File</h4> <div class="header-actions svelte-1q1ovna"><button class="svelte-1q1ovna"> </button></div></div> <div class="file-row svelte-1q1ovna"><label class="file-label svelte-1q1ovna"><span class="svelte-1q1ovna">File path</span> <input placeholder="/etc/mosquitto/passwd" class="svelte-1q1ovna"/></label> <button class="svelte-1q1ovna">↻</button></div> <!> <!> <!> <!></section> <section class="card acl-card svelte-1q1ovna"><div class="card-header svelte-1q1ovna"><h4 class="svelte-1q1ovna">ACL File</h4> <div class="header-actions svelte-1q1ovna"><button class="btn-save svelte-1q1ovna"> </button></div></div> <div class="file-row svelte-1q1ovna"><label class="file-label svelte-1q1ovna"><span class="svelte-1q1ovna">File path</span> <input placeholder="/etc/mosquitto/acl" class="svelte-1q1ovna"/></label> <button class="svelte-1q1ovna">↻</button></div> <!> <!> <div class="acl-editor-wrap svelte-1q1ovna"><!></div> <p class="hint svelte-1q1ovna">Static ACL file format: <code class="svelte-1q1ovna">user &lt;username&gt;</code> followed by <code class="svelte-1q1ovna">topic [read|write|readwrite] &lt;pattern&gt;</code>.
233
233
  Requires <code class="svelte-1q1ovna">acl_file</code> set in mosquitto.conf and no dynsec plugin.
234
- After saving, click <strong>Apply &amp; Reload</strong> above to activate changes.</p></section></div> <!>`,1);function jte(o,e){Ys(e,!0);let t=B("/etc/mosquitto/passwd"),i=B(xi([])),n=B(!1),s=B(""),r=B(""),a=B(""),d=B(""),u=B(""),f=B(!1),g=B(""),p=B(null),C=B(""),b=B(""),E=B(!1),y=B(""),A=B(null),I=B("/etc/mosquitto/acl"),T=B(""),M=B(!1),P=B(""),V=B(""),U=B(!1),J=B(!1),oe=B(""),ce;oo(async()=>{try{const $e=await dx(),ti=$e.listeners.find(Kt=>Kt.password_file);ti!=null&&ti.password_file&&x(t,ti.password_file,!0);const Ci=$e.listeners.find(Kt=>Kt.acl_file);Ci!=null&&Ci.acl_file&&x(I,Ci.acl_file,!0),!(ti!=null&&ti.password_file)&&$e.managed.password_file&&x(t,String($e.managed.password_file),!0),!(Ci!=null&&Ci.acl_file)&&$e.managed.acl_file&&x(I,String($e.managed.acl_file),!0)}catch{}await re(),await ye()});async function re(){if(l(t)){x(n,!0),x(s,""),x(r,"");try{const $e=await LU(l(t));x(i,$e.users,!0)}catch($e){x(s,$e.message??"Failed to load password file",!0)}finally{x(n,!1)}}}async function ue(){if(!l(a).trim()){x(g,"Username required");return}if(!l(d)){x(g,"Password required");return}if(l(d)!==l(u)){x(g,"Passwords do not match");return}x(f,!0),x(g,""),x(r,"");try{await f2(l(t),l(a).trim(),l(d)),x(a,""),x(d,""),x(u,""),x(r,"User added."),await re()}catch($e){x(g,$e.message??"Failed to add user",!0)}finally{x(f,!1)}}async function we($e){x(p,$e,!0),x(C,""),x(b,""),x(y,"")}async function Q(){if(!l(C)){x(y,"Password required");return}if(l(C)!==l(b)){x(y,"Passwords do not match");return}x(E,!0),x(y,""),x(r,"");try{await f2(l(t),l(p),l(C)),x(p,null),x(r,"Password updated.")}catch($e){x(y,$e.message??"Failed to change password",!0)}finally{x(E,!1)}}async function de($e){if(await ce.show(`Delete user "${$e}" from ${l(t)}?`,{confirm:"Delete",danger:!0})){x(A,$e,!0),x(s,""),x(r,"");try{await IU(l(t),$e),x(r,`User "${$e}" deleted.`),await re()}catch(ti){x(s,ti.message??"Delete failed",!0)}finally{x(A,null)}}}async function ye(){if(l(I)){x(M,!0),x(P,""),x(V,"");try{const $e=await PU(l(I));x(T,$e.content,!0)}catch($e){x(P,$e.message??"Failed to load ACL file",!0)}finally{x(M,!1)}}}async function Fe(){x(U,!0),x(P,""),x(V,"");try{await TU(l(I),l(T)),x(V,"ACL file saved.")}catch($e){x(P,$e.message??"Save failed",!0)}finally{x(U,!1)}}async function xe(){x(J,!0),x(oe,"");try{const $e=await Vb();x(oe,$e.stderr||$e.stdout||"Reloaded",!0)}catch($e){x(oe,"Error: "+($e.message??"reload failed"))}finally{x(J,!1)}}var Re=Vte(),Ne=dt(Re),be=m(Ne),ot=m(be),Lt=v(m(ot),2),Qe=m(Lt),yt=m(Qe),ge=v(ot,2),Ae=m(ge),nt=v(m(Ae),2),vt=v(Ae,2),ct=v(ge,2);{var wt=$e=>{var ti=Tte(),Ci=m(ti);W(()=>N(Ci,l(oe))),D($e,ti)};O(ct,$e=>{l(oe)&&$e(wt)})}var ai=v(ct,2);{var pi=$e=>{var ti=KC(),Ci=m(ti);W(()=>N(Ci,l(s))),D($e,ti)};O(ai,$e=>{l(s)&&$e(pi)})}var li=v(ai,2);{var mt=$e=>{var ti=iA(),Ci=m(ti);W(()=>N(Ci,l(r))),D($e,ti)};O(li,$e=>{l(r)&&$e(mt)})}var di=v(li,2);{var Te=$e=>{var ti=nA();D($e,ti)},Ce=$e=>{var ti=zte(),Ci=dt(ti);{var Kt=Je=>{var rt=Hte(),si=v(m(rt));ii(si,21,()=>l(i),Hi,(De,je)=>{var ji=Ote(),rn=m(ji),Ki=m(rn),he=v(rn),Ye=m(he);{var Bt=Le=>{var ze=Rte(),Ht=m(ze),$t=v(Ht,2),Qt=v($t,2);{var Pt=pe=>{var it=Mte(),Ge=m(it);W(()=>N(Ge,l(y))),D(pe,it)};O(Qt,pe=>{l(y)&&pe(Pt)})}var j=v(Qt,2),ae=m(j),ve=v(j,2);W(()=>{j.disabled=l(E),N(ae,l(E)?"…":"Save")}),St(Ht,()=>l(C),pe=>x(C,pe)),St($t,()=>l(b),pe=>x(b,pe)),z("click",j,Q),z("click",ve,()=>x(p,null)),D(Le,ze)},Ot=Le=>{var ze=Nte(),Ht=dt(ze),$t=v(Ht,2),Qt=m($t);W(()=>{$t.disabled=l(A)===l(je),N(Qt,l(A)===l(je)?"…":"Delete")}),z("click",Ht,()=>we(l(je))),z("click",$t,()=>de(l(je))),D(Le,ze)};O(Ye,Le=>{l(p)===l(je)?Le(Bt):Le(Ot,-1)})}W(()=>N(Ki,l(je))),D(De,ji)}),D(Je,rt)},Ri=Je=>{var rt=Wte();D(Je,rt)};O(Ci,Je=>{l(i).length>0?Je(Kt):l(s)||Je(Ri,1)})}var Gi=v(Ci,2),Yi=v(m(Gi),2),Z=m(Yi),Se=v(Z,2),st=v(Se,2),qe=v(st,2),It=m(qe),Jt=v(Yi,2);{var gt=Je=>{var rt=KC(),si=m(rt);W(()=>N(si,l(g))),D(Je,rt)};O(Jt,Je=>{l(g)&&Je(gt)})}W(()=>{qe.disabled=l(f),N(It,l(f)?"Adding…":"Add")}),St(Z,()=>l(a),Je=>x(a,Je)),St(Se,()=>l(d),Je=>x(d,Je)),St(st,()=>l(u),Je=>x(u,Je)),z("click",qe,ue),D($e,ti)};O(di,$e=>{l(n)?$e(Te):$e(Ce,-1)})}var Mt=v(be,2),ui=m(Mt),jt=v(m(ui),2),Li=m(jt),Mi=m(Li),Ai=v(ui,2),sn=m(Ai),on=v(m(sn),2),gn=v(sn,2),yn=v(Ai,2);{var ft=$e=>{var ti=KC(),Ci=m(ti);W(()=>N(Ci,l(P))),D($e,ti)};O(yn,$e=>{l(P)&&$e(ft)})}var Yt=v(yn,2);{var Ii=$e=>{var ti=iA(),Ci=m(ti);W(()=>N(Ci,l(V))),D($e,ti)};O(Yt,$e=>{l(V)&&$e(Ii)})}var ki=v(Yt,2),mi=m(ki);{var Cn=$e=>{var ti=nA();D($e,ti)},En=$e=>{Tg($e,{language:"plaintext",onSave:Fe,get value(){return l(T)},set value(ti){x(T,ti,!0)}})};O(mi,$e=>{l(M)?$e(Cn):$e(En,-1)})}var wn=v(Ne,2);Ds(gl(wn,{}),$e=>ce=$e,()=>ce),W(()=>{Qe.disabled=l(J),N(yt,l(J)?"Reloading…":"Apply & Reload"),vt.disabled=l(n),Li.disabled=l(U),N(Mi,l(U)?"Saving…":"Save"),gn.disabled=l(M)}),z("click",Qe,xe),z("change",nt,re),St(nt,()=>l(t),$e=>x(t,$e)),z("click",vt,re),z("click",Li,Fe),z("change",on,ye),St(on,()=>l(I),$e=>x(I,$e)),z("click",gn,ye),D(o,Re),Qs()}lo(["click","change"]);var $te=F('<div class="loading svelte-zuhcpo">Loading…</div>'),Ute=F('<div class="error-banner svelte-zuhcpo"> </div>'),qte=F('<div class="conn-row svelte-zuhcpo"><span></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span><!></span> <button class="btn-deactivate svelte-zuhcpo"> </button></div>'),Gte=F('<button class="btn-wizard-inline svelte-zuhcpo">Setup Wizard ↗</button>'),Kte=F('<div class="conn-row svelte-zuhcpo"><span class="dot dot-off svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span class="conn-detail muted svelte-zuhcpo">not configured</span> <!></div>'),Zte=F('<div class="error-inline svelte-zuhcpo"> </div>'),Xte=F('<button class="diag-btn svelte-zuhcpo"> </button>'),sA=F('<p class="diag-issue svelte-zuhcpo"> </p>'),Yte=F('<p class="diag-ok-msg svelte-zuhcpo">✓ dynamic-security.json looks correct. Verify mosquitto restarted with the plugin loaded.</p>'),Qte=F('<p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">File</span><code class="svelte-zuhcpo"> </code></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Admin user exists</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Has admin role</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">$CONTROL publish ACL</span><span> </span></p> <!> <!>',1),Jte=F('<div><!></div> <button class="diag-btn svelte-zuhcpo" style="margin-top:6px"> </button>',1),eie=F('<button class="wizard-btn svelte-zuhcpo">Run Setup Wizard</button>'),tie=F('<div class="diag-area svelte-zuhcpo"><!> <!></div>'),iie=F('<div class="stats-block svelte-zuhcpo"><dl class="svelte-zuhcpo"><dt class="svelte-zuhcpo">Version</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Uptime</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Clients</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Messages</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Topics</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Traffic</dt><dd class="svelte-zuhcpo"> </dd></dl></div>'),nie=F('<div style="margin-top: 20px;"><!></div>'),sie=F('<div class="status-layout svelte-zuhcpo"><div class="conn-block svelte-zuhcpo"><div class="conn-row svelte-zuhcpo"><span class="dot ok svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">mosquitto</span> <span class="conn-detail svelte-zuhcpo"> </span></div> <!> <!></div> <!> <!></div> <!>',1),oie=F('<div class="tab-content svelte-zuhcpo"><!></div>'),rie=F('<div class="broker-page svelte-zuhcpo"><div class="sub-nav svelte-zuhcpo"><button>Status</button> <button>Directory</button> <button>Config</button> <button>Advanced</button> <button>Auth Files</button> <button>Listeners</button> <button>Certificates</button> <button>Connection</button> <button>Logs</button></div> <!></div> <!>',1);function aie(o,e){Ys(e,!0);let t=B(!1),i,n=B(!1),s=B(""),r=B(!1),a=B(null);const d="she-broker-tab";let u=B(xi(localStorage.getItem(d)??"status"));ps(()=>{localStorage.setItem(d,l(u))});let f=B(null),g=B(""),p=B(!0);async function C(){try{x(f,await zb(),!0),x(g,"")}catch(mt){x(g,mt.message??"Failed to load broker status",!0)}finally{x(p,!1)}}oo(()=>{C();const mt=setInterval(C,1e4);return()=>clearInterval(mt)});async function b(){x(r,!0),x(a,null);try{x(a,await FU(),!0)}catch(mt){x(a,{ok:!1,dynSecPath:"",issues:[mt.message??"Diagnose request failed"]},!0)}finally{x(r,!1)}}async function E(){if(await i.show("Remove dynsec plugin lines from mosquitto.conf and clear credentials? You will need to restart mosquitto afterwards.",{confirm:"Deactivate",danger:!0})){x(n,!0),x(s,"");try{await kU(),await C()}catch(mt){x(s,mt.message??"Deactivate failed",!0)}finally{x(n,!1)}}}function y(mt){var Te;if(!((Te=l(f))!=null&&Te.sys))return"—";const di=l(f).sys[mt];return di?String(di.val??"—"):"—"}function A(mt){if(mt==="—")return mt;const di=mt.match(/^(\d+)/),Te=di?parseInt(di[1]):NaN;if(isNaN(Te))return mt;const Ce=Math.floor(Te/86400),Mt=Math.floor(Te%86400/3600),ui=Math.floor(Te%3600/60),jt=Te%60,Li=Mi=>String(Mi).padStart(2,"0");return Ce>0?`${Ce}d ${Li(Mt)}:${Li(ui)}:${Li(jt)}`:`${Li(Mt)}:${Li(ui)}:${Li(jt)}`}function I(mt){if(mt==="—")return mt;const di=parseInt(mt);return isNaN(di)?mt:di<1024?`${di} B`:di<1048576?`${(di/1024).toFixed(1)} KB`:di<1073741824?`${(di/1048576).toFixed(1)} MB`:`${(di/1073741824).toFixed(1)} GB`}var T=rie(),M=dt(T),P=m(M),V=m(P);let U;var J=v(V,2);let oe;var ce=v(J,2);let re;var ue=v(ce,2);let we;var Q=v(ue,2);let de;var ye=v(Q,2);let Fe;var xe=v(ye,2);let Re;var Ne=v(xe,2);let be;var ot=v(Ne,2);let Lt;var Qe=v(P,2);{var yt=mt=>{var di=oie(),Te=m(di);{var Ce=jt=>{var Li=$te();D(jt,Li)},Mt=jt=>{var Li=Ute(),Mi=m(Li);W(()=>N(Mi,l(g))),D(jt,Li)},ui=jt=>{var Li=sie(),Mi=dt(Li),Ai=m(Mi),sn=m(Ai),on=v(m(sn),4),gn=m(on),yn=v(sn,2);{var ft=Kt=>{var Ri=qte(),Gi=m(Ri);let Yi;var Z=v(Gi,4);let Se;var st=m(Z);{var qe=rt=>{var si=Co("plugin active");D(rt,si)},It=rt=>{var si=Co("connected — plugin not responding");D(rt,si)},Jt=rt=>{var si=Co("disconnected");D(rt,si)};O(st,rt=>{l(f).dynsec.dynsecReady?rt(qe):l(f).dynsec.connected?rt(It,1):rt(Jt,-1)})}var gt=v(Z,2),Je=m(gt);W(()=>{Yi=Dt(Gi,1,"dot svelte-zuhcpo",null,Yi,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,"dot-err":!l(f).dynsec.connected}),Se=Dt(Z,1,"conn-detail svelte-zuhcpo",null,Se,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,err:!l(f).dynsec.connected}),gt.disabled=l(n),N(Je,l(n)?"…":"deactivate")}),z("click",gt,E),D(Kt,Ri)},Yt=Kt=>{var Ri=Kte(),Gi=v(m(Ri),6);{var Yi=Z=>{var Se=Gte();z("click",Se,()=>x(t,!0)),D(Z,Se)};O(Gi,Z=>{l(t)||Z(Yi)})}D(Kt,Ri)};O(yn,Kt=>{l(f).dynsec.configured?Kt(ft):Kt(Yt,-1)})}var Ii=v(yn,2);{var ki=Kt=>{var Ri=Zte(),Gi=m(Ri);W(()=>N(Gi,l(s))),D(Kt,Ri)};O(Ii,Kt=>{l(s)&&Kt(ki)})}var mi=v(Ai,2);{var Cn=Kt=>{var Ri=tie(),Gi=m(Ri);{var Yi=qe=>{var It=Xte(),Jt=m(It);W(()=>{It.disabled=l(r),N(Jt,l(r)?"Running diagnostics…":"Run diagnostics")}),z("click",It,b),D(qe,It)},Z=qe=>{var It=Jte(),Jt=dt(It);let gt;var Je=m(Jt);{var rt=ji=>{var rn=sA(),Ki=m(rn);W(()=>N(Ki,`⚠ ${l(a).error??""}`)),D(ji,rn)},si=ji=>{var rn=Qte(),Ki=dt(rn),he=v(m(Ki)),Ye=m(he),Bt=v(Ki,2),Ot=v(m(Bt)),Le=m(Ot),ze=v(Bt,2),Ht=v(m(ze)),$t=m(Ht),Qt=v(ze,2),Pt=v(m(Qt)),j=m(Pt),ae=v(Qt,2);ii(ae,17,()=>l(a).issues,Hi,(it,Ge)=>{var pt=sA(),$=m(pt);W(()=>N($,`⚠ ${l(Ge)??""}`)),D(it,pt)});var ve=v(ae,2);{var pe=it=>{var Ge=Yte();D(it,Ge)};O(ve,it=>{l(a).ok&&it(pe)})}W(()=>{N(Ye,l(a).dynSecPath),Dt(Ot,1,Eg(l(a).adminClientExists?"ok":"fail"),"svelte-zuhcpo"),N(Le,l(a).adminClientExists?"✓ yes":"✗ no"),Dt(Ht,1,Eg(l(a).hasAdminRole?"ok":"fail"),"svelte-zuhcpo"),N($t,l(a).hasAdminRole?"✓ yes":"✗ no"),Dt(Pt,1,Eg(l(a).hasControlSendAcl?"ok":"fail"),"svelte-zuhcpo"),N(j,l(a).hasControlSendAcl?"✓ present":"✗ missing")}),D(ji,rn)};O(Je,ji=>{l(a).error?ji(rt):ji(si,-1)})}var De=v(Jt,2),je=m(De);W(()=>{gt=Dt(Jt,1,"diag-card svelte-zuhcpo",null,gt,{"diag-ok":l(a).ok,"diag-fail":!l(a).ok}),De.disabled=l(r),N(je,l(r)?"Running…":"Re-run")}),z("click",De,b),D(qe,It)};O(Gi,qe=>{l(a)?qe(Z,-1):qe(Yi)})}var Se=v(Gi,2);{var st=qe=>{var It=eie();z("click",It,()=>x(t,!0)),D(qe,It)};O(Se,qe=>{l(t)||qe(st)})}D(Kt,Ri)};O(mi,Kt=>{l(f).dynsec.configured&&l(f).dynsec.connected&&!l(f).dynsec.dynsecReady&&Kt(Cn)})}var En=v(mi,2);{var wn=Kt=>{var Ri=iie(),Gi=m(Ri),Yi=v(m(Gi)),Z=m(Yi),Se=v(Yi,3),st=m(Se),qe=v(Se,3),It=m(qe),Jt=v(qe,3),gt=m(Jt),Je=v(Jt,3),rt=m(Je),si=v(Je,3),De=m(si);W((je,ji,rn,Ki,he,Ye,Bt,Ot,Le,ze,Ht,$t)=>{N(Z,je),N(st,ji),N(It,`${rn??""} connected · ${Ki??""} max · ${he??""} total`),N(gt,`${Ye??""} rcv · ${Bt??""} sent · ${Ot??""} stored`),N(rt,`${Le??""} retained · ${ze??""} subscriptions`),N(De,`${Ht??""} in · ${$t??""} out`)},[()=>y("$SYS/broker/version"),()=>A(y("$SYS/broker/uptime")),()=>y("$SYS/broker/clients/connected"),()=>y("$SYS/broker/clients/maximum"),()=>y("$SYS/broker/clients/total"),()=>y("$SYS/broker/messages/received"),()=>y("$SYS/broker/messages/sent"),()=>y("$SYS/broker/messages/stored"),()=>y("$SYS/broker/retained messages/count"),()=>y("$SYS/broker/subscriptions/count"),()=>I(y("$SYS/broker/bytes/received")),()=>I(y("$SYS/broker/bytes/sent"))]),D(Kt,Ri)},$e=Ft(()=>Object.keys(l(f).sys).length>0);O(En,Kt=>{l($e)&&Kt(wn)})}var ti=v(Mi,2);{var Ci=Kt=>{var Ri=nie(),Gi=m(Ri);Dte(Gi,{onDone:()=>{x(t,!1),C()}}),D(Kt,Ri)};O(ti,Kt=>{l(t)&&(!l(f).dynsec.configured||!l(f).dynsec.dynsecReady)&&Kt(Ci)})}W(()=>N(gn,l(f).sshConfigured?`ssh — ${l(f).sshHost}`:"local")),D(jt,Li)};O(Te,jt=>{l(p)?jt(Ce):l(g)?jt(Mt,1):l(f)&&jt(ui,2)})}D(mt,di)},ge=mt=>{{let di=Ft(()=>{var Te;return((Te=l(f))==null?void 0:Te.dynsec.dynsecReady)??!1});dee(mt,{get dynsecReady(){return l(di)}})}},Ae=mt=>{Fee(mt,{})},nt=mt=>{Pte(mt,{})},vt=mt=>{jte(mt,{})},ct=mt=>{wee(mt,{})},wt=mt=>{Yee(mt,{})},ai=mt=>{lte(mt,{})},pi=mt=>{xte(mt,{})};O(Qe,mt=>{l(u)==="status"?mt(yt):l(u)==="users"?mt(ge,1):l(u)==="brokerconfig"?mt(Ae,2):l(u)==="advanced"?mt(nt,3):l(u)==="passwd"?mt(vt,4):l(u)==="listeners"?mt(ct,5):l(u)==="certs"?mt(wt,6):l(u)==="ssh"?mt(ai,7):l(u)==="logs"&&mt(pi,8)})}var li=v(M,2);Ds(gl(li,{}),mt=>i=mt,()=>i),W(()=>{U=Dt(V,1,"svelte-zuhcpo",null,U,{active:l(u)==="status"}),oe=Dt(J,1,"svelte-zuhcpo",null,oe,{active:l(u)==="users"}),re=Dt(ce,1,"svelte-zuhcpo",null,re,{active:l(u)==="brokerconfig"}),we=Dt(ue,1,"svelte-zuhcpo",null,we,{active:l(u)==="advanced"}),de=Dt(Q,1,"svelte-zuhcpo",null,de,{active:l(u)==="passwd"}),Fe=Dt(ye,1,"svelte-zuhcpo",null,Fe,{active:l(u)==="listeners"}),Re=Dt(xe,1,"svelte-zuhcpo",null,Re,{active:l(u)==="certs"}),be=Dt(Ne,1,"svelte-zuhcpo",null,be,{active:l(u)==="ssh"}),Lt=Dt(ot,1,"svelte-zuhcpo",null,Lt,{active:l(u)==="logs"})}),z("click",V,()=>x(u,"status")),z("click",J,()=>x(u,"users")),z("click",ce,()=>x(u,"brokerconfig")),z("click",ue,()=>x(u,"advanced")),z("click",Q,()=>x(u,"passwd")),z("click",ye,()=>x(u,"listeners")),z("click",xe,()=>x(u,"certs")),z("click",Ne,()=>x(u,"ssh")),z("click",ot,()=>x(u,"logs")),D(o,T),Qs()}lo(["click"]);var lie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),cie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),die=F('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),uie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),hie=F('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><circle cx="8" cy="10" r="2" class="svelte-1n46o8q"></circle><path d="M5,7 A4,4 0,0,1 11,7" class="svelte-1n46o8q"></path><path d="M3,5 A6.5,6.5 0,0,1 13,5" class="svelte-1n46o8q"></path><line x1="8" y1="12" x2="8" y2="15" class="svelte-1n46o8q"></line></svg> Broker</button>'),fie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),gie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),pie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),xie=F('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),vie=F('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),mie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),_ie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),bie=F('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Cie=F('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Eie=F('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),yie=F('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),wie=F('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),Sie=F('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Die=F('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),Aie=F('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),kie=F('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),Bie=F('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Fie=F('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),Lie=F('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Iie=F('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),Pie=F('<div class="shell svelte-1n46o8q"><nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),Tie=F('<div class="login-error svelte-1n46o8q"> </div>'),Mie=F('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),Rie=F('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),Nie=F('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),Oie=F("<!> <!> <!> <!>",1);function Hie(o,e){Ys(e,!0);const t=["scripts","mqtt","matter","security","db","logs","config","packages"];function i(){const vt=location.hash.slice(1);return t.includes(vt)?vt:"scripts"}let n=B(xi(i())),s=B(null),r=B(!1),a=B(!1),d=B(!1),u=B(!1),f=B("none"),g=B(""),p=B(!1),C=B(""),b=B(""),E=B(!1),y=B(!1);$$(()=>{x(p,!0)});async function A(){x(b,""),x(E,!0);try{await G$(l(C)),x(C,""),x(p,!1)}catch(vt){x(b,vt.message??"Login failed",!0)}finally{x(E,!1)}}async function I(){if(l(f)==="proxy"&&l(g)){window.location.href=l(g);return}await K$(),x(p,!0)}let T=B(null),M=B(!1),P=B(!1),V=B(!1),U=B(!1),J=B(xi([])),oe=B(0),ce=B(!1),re=B(xi([]));const ue=Ft(()=>l(re).filter(vt=>vt.online).length),we=Ft(()=>l(re).length===0?"none":l(ue)===l(re).length?"all":l(ue)>0?"some":"offline");let Q=B(!1),de=B(!1);async function ye(){if(!await l(T).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;x(M,!0);let vt;try{vt=(await xf()).startedAt}catch{}try{await _F()}catch{}const ct=Date.now()+6e4;for(;Date.now()<ct;){await new Promise(wt=>setTimeout(wt,250));try{const wt=await xf();if(vt===void 0||wt.startedAt!==vt){location.reload();return}}catch{}}location.reload()}async function Fe(){x(d,!0);try{const vt=await eU();l(s)&&x(s,{...l(s),latestVersion:vt.latestVersion??void 0},!0)}catch{}finally{x(d,!1)}}async function xe(){var wt,ai;if(!await l(T).show(`Update to v${(wt=l(s))==null?void 0:wt.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;x(a,!1),x(u,!0);const vt=(ai=l(s))==null?void 0:ai.startedAt;try{await J$()}catch{}const ct=Date.now()+18e4;for(;Date.now()<ct;){await new Promise(pi=>setTimeout(pi,1e3));try{const pi=await xf();if(vt===void 0||pi.startedAt!==vt){location.reload();return}}catch{x(u,!1),x(M,!0)}}location.reload()}function Re(vt){x(n,vt,!0),location.hash=vt}oo(async()=>{location.hash||(location.hash=l(n));const vt=()=>{x(n,i(),!0)};window.addEventListener("hashchange",vt);try{const Te=await q$();x(f,Te.mode,!0),x(g,Te.proxyLogoutUrl??"",!0),l(f)==="password"&&(await fetch("/she/scripts")).status===401&&x(p,!0)}catch{}x(y,!0);async function ct(){var Te,Ce,Mt;try{x(s,await xf(),!0)}catch{}try{const[ui,jt]=await Promise.all([EF(),Zl()]);x(J,Array.isArray(jt.pinnedPackages)?jt.pinnedPackages:[],!0),x(oe,Object.keys(ui).filter(Mi=>!l(J).includes(Mi)).length,!0);const Li=l(ce);x(ce,((Te=jt.broker)==null?void 0:Te.enabled)===!0),Li&&!l(ce)&&l(n)==="security"&&Re("scripts")}catch{}!((Ce=l(s))!=null&&Ce.matterEnabled)&&l(n)==="matter"&&Re("scripts"),!((Mt=l(s))!=null&&Mt.dbEnabled)&&l(n)==="db"&&Re("scripts")}ct();const wt=setInterval(ct,5e3),ai=mr("mqtt:status",Te=>{Te.connected===!1?(x(U,!0),x(P,!1),x(V,!1)):(x(U,!1),x(P,Te.ready===!1),x(V,Te.ready===!0))}),pi=mr("matter:deviceList",Te=>{Array.isArray(Te.devices)&&x(re,Te.devices.map(Ce=>({nodeId:String(Ce.nodeId),online:!!Ce.online})),!0)}),li=mr("matter:deviceStatus",Te=>{if(Te.nodeId===void 0)return;const Ce=String(Te.nodeId),Mt=!!Te.online;x(re,l(re).map(ui=>ui.nodeId===Ce?{...ui,online:Mt}:ui),!0)}),mt=FF();x(Q,mt.some(Te=>Te.level==="error"),!0),x(de,!l(Q)&&mt.some(Te=>Te.level==="warn"),!0);const di=lS(Te=>{Te.level==="error"?(x(Q,!0),x(de,!1)):Te.level==="warn"&&!l(Q)&&x(de,!0)});return()=>{window.removeEventListener("hashchange",vt),clearInterval(wt),ai(),pi(),li(),di()}});var Ne=Oie();Ms("click",l6,()=>{l(r)&&x(r,!1),l(a)&&x(a,!1)});var be=dt(Ne);{var ot=vt=>{var ct=Pie(),wt=m(ct),ai=v(m(wt),2);let pi;var li=v(ai,2);let mt;var di=v(m(li),2);{var Te=q=>{var R=lie();W(()=>mn(R,"title",`${l(oe)??""} package update${l(oe)===1?"":"s"} available`)),D(q,R)};O(di,q=>{l(oe)>0&&q(Te)})}var Ce=v(li,2);let Mt;var ui=v(m(Ce),2);{var jt=q=>{var R=cie();D(q,R)},Li=q=>{var R=die();D(q,R)},Mi=q=>{var R=uie();D(q,R)};O(ui,q=>{l(U)?q(jt):l(P)?q(Li,1):l(V)&&q(Mi,2)})}var Ai=v(Ce,2);{var sn=q=>{var R=hie();let G;W(()=>G=Dt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="security"})),z("click",R,()=>Re("security")),D(q,R)};O(Ai,q=>{l(ce)&&q(sn)})}var on=v(Ai,2);{var gn=q=>{var R=xie();let G;var Y=v(m(R),2);{var ne=_e=>{var Ee=fie();D(_e,Ee)},ie=_e=>{var Ee=gie();D(_e,Ee)},fe=_e=>{var Ee=pie();D(_e,Ee)};O(Y,_e=>{l(we)==="all"?_e(ne):l(we)==="some"?_e(ie,1):l(we)==="offline"&&_e(fe,2)})}W(()=>G=Dt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="matter"})),z("click",R,()=>Re("matter")),D(q,R)};O(on,q=>{var R;(R=l(s))!=null&&R.matterEnabled&&q(gn)})}var yn=v(on,2);{var ft=q=>{var R=vie();let G;W(()=>G=Dt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="db"})),z("click",R,()=>Re("db")),D(q,R)};O(yn,q=>{var R;(R=l(s))!=null&&R.dbEnabled&&q(ft)})}var Yt=v(yn,2);let Ii;var ki=v(m(Yt),2);{var mi=q=>{var R=mie();D(q,R)},Cn=q=>{var R=_ie();D(q,R)};O(ki,q=>{l(Q)?q(mi):l(de)&&q(Cn,1)})}var En=v(Yt,4),wn=v(m(En),2),$e=m(wn),ti=m($e);ti.nodeValue="v1.20.5 ";var Ci=v(ti);{var Kt=q=>{var R=bie();D(q,R)};O(Ci,q=>{var R,G;(R=l(s))!=null&&R.latestVersion&&!((G=l(s))!=null&&G.docker)&&q(Kt)})}var Ri=v($e,2);{var Gi=q=>{var R=wie(),G=m(R),Y=v(m(G));Y.textContent="v1.20.5";var ne=v(Y,2);{var ie=le=>{var Ve=Cie(),Tt=v(dt(Ve)),Ie=m(Tt);W(()=>N(Ie,`v${l(s).latestVersion??""}`)),D(le,Ve)},fe=le=>{var Ve=Eie();D(le,Ve)};O(ne,le=>{var Ve;(Ve=l(s))!=null&&Ve.latestVersion?le(ie):le(fe,-1)})}var _e=v(G,2),Ee=m(_e);{var Oe=le=>{var Ve=yie(),Tt=v(m(Ve));W(()=>N(Tt,` Update to v${l(s).latestVersion??""}`)),z("click",Ve,xe),D(le,Ve)};O(Ee,le=>{var Ve;(Ve=l(s))!=null&&Ve.latestVersion&&le(Oe)})}var He=v(Ee,2),tt=m(He);let ei;var ee=v(tt);W(()=>{He.disabled=l(d),ei=Dt(tt,0,"svelte-1n46o8q",null,ei,{spinning:l(d)}),N(ee,` ${l(d)?"Checking…":"Check for updates"}`)}),z("click",R,le=>le.stopPropagation()),z("click",He,Fe),D(q,R)};O(Ri,q=>{var R;l(a)&&!((R=l(s))!=null&&R.docker)&&q(Gi)})}var Yi=v(wn,2),Z=m(Yi),Se=v(Z,2);{var st=q=>{var R=Lie(),G=m(R);{var Y=Ee=>{var Oe=kie(),He=m(Oe);{var tt=qt=>{const Ei=Ft(()=>Math.floor((Date.now()-l(s).startedAt)/1e3)),Qi=Ft(()=>Math.floor(l(Ei)/86400)),Ui=Ft(()=>Math.floor(l(Ei)%86400/3600)),$i=Ft(()=>Math.floor(l(Ei)%3600/60));var Ze=Sie(),At=v(dt(Ze)),kt=m(At);W(()=>N(kt,`${l(Qi)>0?l(Qi)+"d ":""}${l(Ui)>0||l(Qi)>0?l(Ui)+"h ":""}${l($i)??""}m`)),D(qt,Ze)};O(He,qt=>{l(s).startedAt&&qt(tt)})}var ei=v(He,3),ee=m(ei),le=v(ei,3),Ve=m(le),Tt=v(le,3),Ie=m(Tt),Be=v(Tt,2);{var ut=qt=>{var Ei=Die(),Qi=v(dt(Ei)),Ui=m(Qi),$i=v(Qi,3),Ze=m($i);W(()=>{N(Ui,l(s).matterNodes??0),N(Ze,l(s).matterEndpoints??0)}),D(qt,Ei)};O(Be,qt=>{l(s).matterEnabled&&qt(ut)})}var ht=v(Be,2);{var Xe=qt=>{var Ei=Aie(),Qi=v(dt(Ei)),Ui=m(Qi),$i=v(Qi,3),Ze=m($i);W(()=>{N(Ui,l(s).dbDocs??"—"),N(Ze,l(s).dbViews??"—")}),D(qt,Ei)};O(ht,qt=>{l(s).dbEnabled&&qt(Xe)})}var Zt=v(ht,3),at=m(Zt),et=v(Zt,3),Et=m(et),Xt=v(et,3),Vt=m(Xt),oi=v(Xt,3),We=m(oi),Ct=v(oi,3),ni=m(Ct),zi=v(Ct,3),Ut=m(zi);W(()=>{N(ee,l(s).scripts),N(Ve,l(s).topics),N(Ie,l(s).mqttMsgPerSec??"—"),N(at,l(s).handlers??"—"),N(Et,l(s).memMb!=null?l(s).memMb+" MB":"—"),N(Vt,l(s).cpuPercent!=null?l(s).cpuPercent+" %":"—"),N(We,l(s).eluPercent!=null?l(s).eluPercent+" %":"—"),N(ni,l(s).elMeanMs!=null?l(s).elMeanMs+" ms":"—"),N(Ut,l(s).elMaxMs!=null?l(s).elMaxMs+" ms":"—")}),D(Ee,Oe)},ne=Ee=>{var Oe=Bie();D(Ee,Oe)};O(G,Ee=>{l(s)?Ee(Y):Ee(ne,-1)})}var ie=v(G,2),fe=m(ie);{var _e=Ee=>{var Oe=Fie();z("click",Oe,()=>{x(r,!1),ye()}),D(Ee,Oe)};O(fe,Ee=>{var Oe;(Oe=l(s))!=null&&Oe.docker||Ee(_e)})}z("click",R,Ee=>Ee.stopPropagation()),D(q,R)};O(Se,q=>{l(r)&&q(st)})}var qe=v(Yi,2);let It;var Jt=v(qe,2);{var gt=q=>{var R=Iie();z("click",R,I),D(q,R)};O(Jt,q=>{l(f)==="password"&&q(gt)})}var Je=v(wt,2),rt=m(Je);Ds(gl(rt,{}),q=>x(T,q,!0),()=>l(T));var si=v(rt,2);let De;var je=m(si);{let q=Ft(()=>l(n)==="scripts");DZ(je,{get active(){return l(q)}})}var ji=v(si,2);let rn;var Ki=m(ji);BJ(Ki,{});var he=v(ji,2);let Ye;var Bt=m(he);dJ(Bt,{});var Ot=v(he,2);let Le;var ze=m(Ot);kQ(ze,{});var Ht=v(Ot,2);let $t;var Qt=m(Ht);aie(Qt,{});var Pt=v(Ht,2);let j;var ae=m(Pt);BY(ae,{});var ve=v(Pt,2);let pe;var it=m(ve);vX(it,{});var Ge=v(ve,2);let pt;var $=m(Ge);yX($,{}),W(()=>{pi=Dt(ai,1,"svelte-1n46o8q",null,pi,{active:l(n)==="scripts"}),mt=Dt(li,1,"svelte-1n46o8q",null,mt,{active:l(n)==="packages"}),Mt=Dt(Ce,1,"svelte-1n46o8q",null,Mt,{active:l(n)==="mqtt"}),Ii=Dt(Yt,1,"svelte-1n46o8q",null,Ii,{active:l(n)==="logs"}),It=Dt(qe,1,"nav-settings svelte-1n46o8q",null,It,{active:l(n)==="config"}),De=Dt(si,1,"page-wrap svelte-1n46o8q",null,De,{hidden:l(n)!=="scripts"}),rn=Dt(ji,1,"page-wrap svelte-1n46o8q",null,rn,{hidden:l(n)!=="packages"}),Ye=Dt(he,1,"page-wrap svelte-1n46o8q",null,Ye,{hidden:l(n)!=="mqtt"}),Le=Dt(Ot,1,"page-wrap svelte-1n46o8q",null,Le,{hidden:l(n)!=="matter"}),$t=Dt(Ht,1,"page-wrap svelte-1n46o8q",null,$t,{hidden:l(n)!=="security"}),j=Dt(Pt,1,"page-wrap svelte-1n46o8q",null,j,{hidden:l(n)!=="db"}),pe=Dt(ve,1,"page-wrap svelte-1n46o8q",null,pe,{hidden:l(n)!=="config"}),pt=Dt(Ge,1,"page-wrap svelte-1n46o8q",null,pt,{hidden:l(n)!=="logs"})}),z("click",ai,()=>Re("scripts")),z("click",li,()=>Re("packages")),z("click",Ce,()=>Re("mqtt")),z("click",Yt,()=>{Re("logs"),x(Q,!1),x(de,!1)}),z("click",$e,q=>{q.stopPropagation(),x(a,!l(a)),x(r,!1)}),z("click",Z,q=>{q.stopPropagation(),x(r,!l(r)),x(a,!1)}),z("click",qe,()=>Re("config")),D(vt,ct)};O(be,vt=>{l(y)&&!l(p)&&vt(ot)})}var Lt=v(be,2);{var Qe=vt=>{var ct=Mie(),wt=m(ct),ai=v(m(wt),4),pi=v(m(ai),2),li=v(ai,2);{var mt=Ce=>{var Mt=Tie(),ui=m(Mt);W(()=>N(ui,l(b))),D(Ce,Mt)};O(li,Ce=>{l(b)&&Ce(mt)})}var di=v(li,2),Te=m(di);W(()=>{pi.disabled=l(E),di.disabled=l(E)||!l(C),N(Te,l(E)?"Signing in…":"Sign in")}),Ms("submit",wt,Ce=>{Ce.preventDefault(),A()}),St(pi,()=>l(C),Ce=>x(C,Ce)),D(vt,ct)};O(Lt,vt=>{l(p)&&vt(Qe)})}var yt=v(Lt,2);{var ge=vt=>{var ct=Rie();D(vt,ct)};O(yt,vt=>{l(M)&&vt(ge)})}var Ae=v(yt,2);{var nt=vt=>{var ct=Nie();D(vt,ct)};O(Ae,vt=>{l(u)&&vt(nt)})}D(o,Ne),Qs()}lo(["click"]);lP(Hie,{target:document.getElementById("app")});export{W6 as t};
234
+ After saving, click <strong>Apply &amp; Reload</strong> above to activate changes.</p></section></div> <!>`,1);function jte(o,e){Ys(e,!0);let t=B("/etc/mosquitto/passwd"),i=B(xi([])),n=B(!1),s=B(""),r=B(""),a=B(""),d=B(""),u=B(""),f=B(!1),g=B(""),p=B(null),C=B(""),b=B(""),E=B(!1),y=B(""),A=B(null),I=B("/etc/mosquitto/acl"),T=B(""),M=B(!1),P=B(""),V=B(""),U=B(!1),J=B(!1),oe=B(""),ce;oo(async()=>{try{const $e=await dx(),ti=$e.listeners.find(Kt=>Kt.password_file);ti!=null&&ti.password_file&&x(t,ti.password_file,!0);const Ci=$e.listeners.find(Kt=>Kt.acl_file);Ci!=null&&Ci.acl_file&&x(I,Ci.acl_file,!0),!(ti!=null&&ti.password_file)&&$e.managed.password_file&&x(t,String($e.managed.password_file),!0),!(Ci!=null&&Ci.acl_file)&&$e.managed.acl_file&&x(I,String($e.managed.acl_file),!0)}catch{}await re(),await ye()});async function re(){if(l(t)){x(n,!0),x(s,""),x(r,"");try{const $e=await LU(l(t));x(i,$e.users,!0)}catch($e){x(s,$e.message??"Failed to load password file",!0)}finally{x(n,!1)}}}async function ue(){if(!l(a).trim()){x(g,"Username required");return}if(!l(d)){x(g,"Password required");return}if(l(d)!==l(u)){x(g,"Passwords do not match");return}x(f,!0),x(g,""),x(r,"");try{await f2(l(t),l(a).trim(),l(d)),x(a,""),x(d,""),x(u,""),x(r,"User added."),await re()}catch($e){x(g,$e.message??"Failed to add user",!0)}finally{x(f,!1)}}async function we($e){x(p,$e,!0),x(C,""),x(b,""),x(y,"")}async function Q(){if(!l(C)){x(y,"Password required");return}if(l(C)!==l(b)){x(y,"Passwords do not match");return}x(E,!0),x(y,""),x(r,"");try{await f2(l(t),l(p),l(C)),x(p,null),x(r,"Password updated.")}catch($e){x(y,$e.message??"Failed to change password",!0)}finally{x(E,!1)}}async function de($e){if(await ce.show(`Delete user "${$e}" from ${l(t)}?`,{confirm:"Delete",danger:!0})){x(A,$e,!0),x(s,""),x(r,"");try{await IU(l(t),$e),x(r,`User "${$e}" deleted.`),await re()}catch(ti){x(s,ti.message??"Delete failed",!0)}finally{x(A,null)}}}async function ye(){if(l(I)){x(M,!0),x(P,""),x(V,"");try{const $e=await PU(l(I));x(T,$e.content,!0)}catch($e){x(P,$e.message??"Failed to load ACL file",!0)}finally{x(M,!1)}}}async function Fe(){x(U,!0),x(P,""),x(V,"");try{await TU(l(I),l(T)),x(V,"ACL file saved.")}catch($e){x(P,$e.message??"Save failed",!0)}finally{x(U,!1)}}async function xe(){x(J,!0),x(oe,"");try{const $e=await Vb();x(oe,$e.stderr||$e.stdout||"Reloaded",!0)}catch($e){x(oe,"Error: "+($e.message??"reload failed"))}finally{x(J,!1)}}var Re=Vte(),Ne=dt(Re),be=m(Ne),ot=m(be),Lt=v(m(ot),2),Qe=m(Lt),yt=m(Qe),ge=v(ot,2),Ae=m(ge),nt=v(m(Ae),2),vt=v(Ae,2),ct=v(ge,2);{var wt=$e=>{var ti=Tte(),Ci=m(ti);W(()=>N(Ci,l(oe))),D($e,ti)};O(ct,$e=>{l(oe)&&$e(wt)})}var ai=v(ct,2);{var pi=$e=>{var ti=KC(),Ci=m(ti);W(()=>N(Ci,l(s))),D($e,ti)};O(ai,$e=>{l(s)&&$e(pi)})}var li=v(ai,2);{var mt=$e=>{var ti=iA(),Ci=m(ti);W(()=>N(Ci,l(r))),D($e,ti)};O(li,$e=>{l(r)&&$e(mt)})}var di=v(li,2);{var Te=$e=>{var ti=nA();D($e,ti)},Ce=$e=>{var ti=zte(),Ci=dt(ti);{var Kt=Je=>{var rt=Hte(),si=v(m(rt));ii(si,21,()=>l(i),Hi,(De,je)=>{var ji=Ote(),rn=m(ji),Ki=m(rn),he=v(rn),Ye=m(he);{var Bt=Le=>{var ze=Rte(),Ht=m(ze),$t=v(Ht,2),Qt=v($t,2);{var Pt=pe=>{var it=Mte(),Ge=m(it);W(()=>N(Ge,l(y))),D(pe,it)};O(Qt,pe=>{l(y)&&pe(Pt)})}var j=v(Qt,2),ae=m(j),ve=v(j,2);W(()=>{j.disabled=l(E),N(ae,l(E)?"…":"Save")}),St(Ht,()=>l(C),pe=>x(C,pe)),St($t,()=>l(b),pe=>x(b,pe)),z("click",j,Q),z("click",ve,()=>x(p,null)),D(Le,ze)},Ot=Le=>{var ze=Nte(),Ht=dt(ze),$t=v(Ht,2),Qt=m($t);W(()=>{$t.disabled=l(A)===l(je),N(Qt,l(A)===l(je)?"…":"Delete")}),z("click",Ht,()=>we(l(je))),z("click",$t,()=>de(l(je))),D(Le,ze)};O(Ye,Le=>{l(p)===l(je)?Le(Bt):Le(Ot,-1)})}W(()=>N(Ki,l(je))),D(De,ji)}),D(Je,rt)},Ri=Je=>{var rt=Wte();D(Je,rt)};O(Ci,Je=>{l(i).length>0?Je(Kt):l(s)||Je(Ri,1)})}var Gi=v(Ci,2),Yi=v(m(Gi),2),Z=m(Yi),Se=v(Z,2),st=v(Se,2),qe=v(st,2),It=m(qe),Jt=v(Yi,2);{var gt=Je=>{var rt=KC(),si=m(rt);W(()=>N(si,l(g))),D(Je,rt)};O(Jt,Je=>{l(g)&&Je(gt)})}W(()=>{qe.disabled=l(f),N(It,l(f)?"Adding…":"Add")}),St(Z,()=>l(a),Je=>x(a,Je)),St(Se,()=>l(d),Je=>x(d,Je)),St(st,()=>l(u),Je=>x(u,Je)),z("click",qe,ue),D($e,ti)};O(di,$e=>{l(n)?$e(Te):$e(Ce,-1)})}var Mt=v(be,2),ui=m(Mt),jt=v(m(ui),2),Li=m(jt),Mi=m(Li),Ai=v(ui,2),sn=m(Ai),on=v(m(sn),2),gn=v(sn,2),yn=v(Ai,2);{var ft=$e=>{var ti=KC(),Ci=m(ti);W(()=>N(Ci,l(P))),D($e,ti)};O(yn,$e=>{l(P)&&$e(ft)})}var Yt=v(yn,2);{var Ii=$e=>{var ti=iA(),Ci=m(ti);W(()=>N(Ci,l(V))),D($e,ti)};O(Yt,$e=>{l(V)&&$e(Ii)})}var ki=v(Yt,2),mi=m(ki);{var Cn=$e=>{var ti=nA();D($e,ti)},En=$e=>{Tg($e,{language:"plaintext",onSave:Fe,get value(){return l(T)},set value(ti){x(T,ti,!0)}})};O(mi,$e=>{l(M)?$e(Cn):$e(En,-1)})}var wn=v(Ne,2);Ds(gl(wn,{}),$e=>ce=$e,()=>ce),W(()=>{Qe.disabled=l(J),N(yt,l(J)?"Reloading…":"Apply & Reload"),vt.disabled=l(n),Li.disabled=l(U),N(Mi,l(U)?"Saving…":"Save"),gn.disabled=l(M)}),z("click",Qe,xe),z("change",nt,re),St(nt,()=>l(t),$e=>x(t,$e)),z("click",vt,re),z("click",Li,Fe),z("change",on,ye),St(on,()=>l(I),$e=>x(I,$e)),z("click",gn,ye),D(o,Re),Qs()}lo(["click","change"]);var $te=F('<div class="loading svelte-zuhcpo">Loading…</div>'),Ute=F('<div class="error-banner svelte-zuhcpo"> </div>'),qte=F('<div class="conn-row svelte-zuhcpo"><span></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span><!></span> <button class="btn-deactivate svelte-zuhcpo"> </button></div>'),Gte=F('<button class="btn-wizard-inline svelte-zuhcpo">Setup Wizard ↗</button>'),Kte=F('<div class="conn-row svelte-zuhcpo"><span class="dot dot-off svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span class="conn-detail muted svelte-zuhcpo">not configured</span> <!></div>'),Zte=F('<div class="error-inline svelte-zuhcpo"> </div>'),Xte=F('<button class="diag-btn svelte-zuhcpo"> </button>'),sA=F('<p class="diag-issue svelte-zuhcpo"> </p>'),Yte=F('<p class="diag-ok-msg svelte-zuhcpo">✓ dynamic-security.json looks correct. Verify mosquitto restarted with the plugin loaded.</p>'),Qte=F('<p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">File</span><code class="svelte-zuhcpo"> </code></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Admin user exists</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Has admin role</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">$CONTROL publish ACL</span><span> </span></p> <!> <!>',1),Jte=F('<div><!></div> <button class="diag-btn svelte-zuhcpo" style="margin-top:6px"> </button>',1),eie=F('<button class="wizard-btn svelte-zuhcpo">Run Setup Wizard</button>'),tie=F('<div class="diag-area svelte-zuhcpo"><!> <!></div>'),iie=F('<div class="stats-block svelte-zuhcpo"><dl class="svelte-zuhcpo"><dt class="svelte-zuhcpo">Version</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Uptime</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Clients</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Messages</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Topics</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Traffic</dt><dd class="svelte-zuhcpo"> </dd></dl></div>'),nie=F('<div style="margin-top: 20px;"><!></div>'),sie=F('<div class="status-layout svelte-zuhcpo"><div class="conn-block svelte-zuhcpo"><div class="conn-row svelte-zuhcpo"><span class="dot ok svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">mosquitto</span> <span class="conn-detail svelte-zuhcpo"> </span></div> <!> <!></div> <!> <!></div> <!>',1),oie=F('<div class="tab-content svelte-zuhcpo"><!></div>'),rie=F('<div class="broker-page svelte-zuhcpo"><div class="sub-nav svelte-zuhcpo"><button>Status</button> <button>Directory</button> <button>Config</button> <button>Advanced</button> <button>Auth Files</button> <button>Listeners</button> <button>Certificates</button> <button>Connection</button> <button>Logs</button></div> <!></div> <!>',1);function aie(o,e){Ys(e,!0);let t=B(!1),i,n=B(!1),s=B(""),r=B(!1),a=B(null);const d="she-broker-tab";let u=B(xi(localStorage.getItem(d)??"status"));ps(()=>{localStorage.setItem(d,l(u))});let f=B(null),g=B(""),p=B(!0);async function C(){try{x(f,await zb(),!0),x(g,"")}catch(mt){x(g,mt.message??"Failed to load broker status",!0)}finally{x(p,!1)}}oo(()=>{C();const mt=setInterval(C,1e4);return()=>clearInterval(mt)});async function b(){x(r,!0),x(a,null);try{x(a,await FU(),!0)}catch(mt){x(a,{ok:!1,dynSecPath:"",issues:[mt.message??"Diagnose request failed"]},!0)}finally{x(r,!1)}}async function E(){if(await i.show("Remove dynsec plugin lines from mosquitto.conf and clear credentials? You will need to restart mosquitto afterwards.",{confirm:"Deactivate",danger:!0})){x(n,!0),x(s,"");try{await kU(),await C()}catch(mt){x(s,mt.message??"Deactivate failed",!0)}finally{x(n,!1)}}}function y(mt){var Te;if(!((Te=l(f))!=null&&Te.sys))return"—";const di=l(f).sys[mt];return di?String(di.val??"—"):"—"}function A(mt){if(mt==="—")return mt;const di=mt.match(/^(\d+)/),Te=di?parseInt(di[1]):NaN;if(isNaN(Te))return mt;const Ce=Math.floor(Te/86400),Mt=Math.floor(Te%86400/3600),ui=Math.floor(Te%3600/60),jt=Te%60,Li=Mi=>String(Mi).padStart(2,"0");return Ce>0?`${Ce}d ${Li(Mt)}:${Li(ui)}:${Li(jt)}`:`${Li(Mt)}:${Li(ui)}:${Li(jt)}`}function I(mt){if(mt==="—")return mt;const di=parseInt(mt);return isNaN(di)?mt:di<1024?`${di} B`:di<1048576?`${(di/1024).toFixed(1)} KB`:di<1073741824?`${(di/1048576).toFixed(1)} MB`:`${(di/1073741824).toFixed(1)} GB`}var T=rie(),M=dt(T),P=m(M),V=m(P);let U;var J=v(V,2);let oe;var ce=v(J,2);let re;var ue=v(ce,2);let we;var Q=v(ue,2);let de;var ye=v(Q,2);let Fe;var xe=v(ye,2);let Re;var Ne=v(xe,2);let be;var ot=v(Ne,2);let Lt;var Qe=v(P,2);{var yt=mt=>{var di=oie(),Te=m(di);{var Ce=jt=>{var Li=$te();D(jt,Li)},Mt=jt=>{var Li=Ute(),Mi=m(Li);W(()=>N(Mi,l(g))),D(jt,Li)},ui=jt=>{var Li=sie(),Mi=dt(Li),Ai=m(Mi),sn=m(Ai),on=v(m(sn),4),gn=m(on),yn=v(sn,2);{var ft=Kt=>{var Ri=qte(),Gi=m(Ri);let Yi;var Z=v(Gi,4);let Se;var st=m(Z);{var qe=rt=>{var si=Co("plugin active");D(rt,si)},It=rt=>{var si=Co("connected — plugin not responding");D(rt,si)},Jt=rt=>{var si=Co("disconnected");D(rt,si)};O(st,rt=>{l(f).dynsec.dynsecReady?rt(qe):l(f).dynsec.connected?rt(It,1):rt(Jt,-1)})}var gt=v(Z,2),Je=m(gt);W(()=>{Yi=Dt(Gi,1,"dot svelte-zuhcpo",null,Yi,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,"dot-err":!l(f).dynsec.connected}),Se=Dt(Z,1,"conn-detail svelte-zuhcpo",null,Se,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,err:!l(f).dynsec.connected}),gt.disabled=l(n),N(Je,l(n)?"…":"deactivate")}),z("click",gt,E),D(Kt,Ri)},Yt=Kt=>{var Ri=Kte(),Gi=v(m(Ri),6);{var Yi=Z=>{var Se=Gte();z("click",Se,()=>x(t,!0)),D(Z,Se)};O(Gi,Z=>{l(t)||Z(Yi)})}D(Kt,Ri)};O(yn,Kt=>{l(f).dynsec.configured?Kt(ft):Kt(Yt,-1)})}var Ii=v(yn,2);{var ki=Kt=>{var Ri=Zte(),Gi=m(Ri);W(()=>N(Gi,l(s))),D(Kt,Ri)};O(Ii,Kt=>{l(s)&&Kt(ki)})}var mi=v(Ai,2);{var Cn=Kt=>{var Ri=tie(),Gi=m(Ri);{var Yi=qe=>{var It=Xte(),Jt=m(It);W(()=>{It.disabled=l(r),N(Jt,l(r)?"Running diagnostics…":"Run diagnostics")}),z("click",It,b),D(qe,It)},Z=qe=>{var It=Jte(),Jt=dt(It);let gt;var Je=m(Jt);{var rt=ji=>{var rn=sA(),Ki=m(rn);W(()=>N(Ki,`⚠ ${l(a).error??""}`)),D(ji,rn)},si=ji=>{var rn=Qte(),Ki=dt(rn),he=v(m(Ki)),Ye=m(he),Bt=v(Ki,2),Ot=v(m(Bt)),Le=m(Ot),ze=v(Bt,2),Ht=v(m(ze)),$t=m(Ht),Qt=v(ze,2),Pt=v(m(Qt)),j=m(Pt),ae=v(Qt,2);ii(ae,17,()=>l(a).issues,Hi,(it,Ge)=>{var pt=sA(),$=m(pt);W(()=>N($,`⚠ ${l(Ge)??""}`)),D(it,pt)});var ve=v(ae,2);{var pe=it=>{var Ge=Yte();D(it,Ge)};O(ve,it=>{l(a).ok&&it(pe)})}W(()=>{N(Ye,l(a).dynSecPath),Dt(Ot,1,Eg(l(a).adminClientExists?"ok":"fail"),"svelte-zuhcpo"),N(Le,l(a).adminClientExists?"✓ yes":"✗ no"),Dt(Ht,1,Eg(l(a).hasAdminRole?"ok":"fail"),"svelte-zuhcpo"),N($t,l(a).hasAdminRole?"✓ yes":"✗ no"),Dt(Pt,1,Eg(l(a).hasControlSendAcl?"ok":"fail"),"svelte-zuhcpo"),N(j,l(a).hasControlSendAcl?"✓ present":"✗ missing")}),D(ji,rn)};O(Je,ji=>{l(a).error?ji(rt):ji(si,-1)})}var De=v(Jt,2),je=m(De);W(()=>{gt=Dt(Jt,1,"diag-card svelte-zuhcpo",null,gt,{"diag-ok":l(a).ok,"diag-fail":!l(a).ok}),De.disabled=l(r),N(je,l(r)?"Running…":"Re-run")}),z("click",De,b),D(qe,It)};O(Gi,qe=>{l(a)?qe(Z,-1):qe(Yi)})}var Se=v(Gi,2);{var st=qe=>{var It=eie();z("click",It,()=>x(t,!0)),D(qe,It)};O(Se,qe=>{l(t)||qe(st)})}D(Kt,Ri)};O(mi,Kt=>{l(f).dynsec.configured&&l(f).dynsec.connected&&!l(f).dynsec.dynsecReady&&Kt(Cn)})}var En=v(mi,2);{var wn=Kt=>{var Ri=iie(),Gi=m(Ri),Yi=v(m(Gi)),Z=m(Yi),Se=v(Yi,3),st=m(Se),qe=v(Se,3),It=m(qe),Jt=v(qe,3),gt=m(Jt),Je=v(Jt,3),rt=m(Je),si=v(Je,3),De=m(si);W((je,ji,rn,Ki,he,Ye,Bt,Ot,Le,ze,Ht,$t)=>{N(Z,je),N(st,ji),N(It,`${rn??""} connected · ${Ki??""} max · ${he??""} total`),N(gt,`${Ye??""} rcv · ${Bt??""} sent · ${Ot??""} stored`),N(rt,`${Le??""} retained · ${ze??""} subscriptions`),N(De,`${Ht??""} in · ${$t??""} out`)},[()=>y("$SYS/broker/version"),()=>A(y("$SYS/broker/uptime")),()=>y("$SYS/broker/clients/connected"),()=>y("$SYS/broker/clients/maximum"),()=>y("$SYS/broker/clients/total"),()=>y("$SYS/broker/messages/received"),()=>y("$SYS/broker/messages/sent"),()=>y("$SYS/broker/messages/stored"),()=>y("$SYS/broker/retained messages/count"),()=>y("$SYS/broker/subscriptions/count"),()=>I(y("$SYS/broker/bytes/received")),()=>I(y("$SYS/broker/bytes/sent"))]),D(Kt,Ri)},$e=Ft(()=>Object.keys(l(f).sys).length>0);O(En,Kt=>{l($e)&&Kt(wn)})}var ti=v(Mi,2);{var Ci=Kt=>{var Ri=nie(),Gi=m(Ri);Dte(Gi,{onDone:()=>{x(t,!1),C()}}),D(Kt,Ri)};O(ti,Kt=>{l(t)&&(!l(f).dynsec.configured||!l(f).dynsec.dynsecReady)&&Kt(Ci)})}W(()=>N(gn,l(f).sshConfigured?`ssh — ${l(f).sshHost}`:"local")),D(jt,Li)};O(Te,jt=>{l(p)?jt(Ce):l(g)?jt(Mt,1):l(f)&&jt(ui,2)})}D(mt,di)},ge=mt=>{{let di=Ft(()=>{var Te;return((Te=l(f))==null?void 0:Te.dynsec.dynsecReady)??!1});dee(mt,{get dynsecReady(){return l(di)}})}},Ae=mt=>{Fee(mt,{})},nt=mt=>{Pte(mt,{})},vt=mt=>{jte(mt,{})},ct=mt=>{wee(mt,{})},wt=mt=>{Yee(mt,{})},ai=mt=>{lte(mt,{})},pi=mt=>{xte(mt,{})};O(Qe,mt=>{l(u)==="status"?mt(yt):l(u)==="users"?mt(ge,1):l(u)==="brokerconfig"?mt(Ae,2):l(u)==="advanced"?mt(nt,3):l(u)==="passwd"?mt(vt,4):l(u)==="listeners"?mt(ct,5):l(u)==="certs"?mt(wt,6):l(u)==="ssh"?mt(ai,7):l(u)==="logs"&&mt(pi,8)})}var li=v(M,2);Ds(gl(li,{}),mt=>i=mt,()=>i),W(()=>{U=Dt(V,1,"svelte-zuhcpo",null,U,{active:l(u)==="status"}),oe=Dt(J,1,"svelte-zuhcpo",null,oe,{active:l(u)==="users"}),re=Dt(ce,1,"svelte-zuhcpo",null,re,{active:l(u)==="brokerconfig"}),we=Dt(ue,1,"svelte-zuhcpo",null,we,{active:l(u)==="advanced"}),de=Dt(Q,1,"svelte-zuhcpo",null,de,{active:l(u)==="passwd"}),Fe=Dt(ye,1,"svelte-zuhcpo",null,Fe,{active:l(u)==="listeners"}),Re=Dt(xe,1,"svelte-zuhcpo",null,Re,{active:l(u)==="certs"}),be=Dt(Ne,1,"svelte-zuhcpo",null,be,{active:l(u)==="ssh"}),Lt=Dt(ot,1,"svelte-zuhcpo",null,Lt,{active:l(u)==="logs"})}),z("click",V,()=>x(u,"status")),z("click",J,()=>x(u,"users")),z("click",ce,()=>x(u,"brokerconfig")),z("click",ue,()=>x(u,"advanced")),z("click",Q,()=>x(u,"passwd")),z("click",ye,()=>x(u,"listeners")),z("click",xe,()=>x(u,"certs")),z("click",Ne,()=>x(u,"ssh")),z("click",ot,()=>x(u,"logs")),D(o,T),Qs()}lo(["click"]);var lie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),cie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),die=F('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),uie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),hie=F('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><circle cx="8" cy="10" r="2" class="svelte-1n46o8q"></circle><path d="M5,7 A4,4 0,0,1 11,7" class="svelte-1n46o8q"></path><path d="M3,5 A6.5,6.5 0,0,1 13,5" class="svelte-1n46o8q"></path><line x1="8" y1="12" x2="8" y2="15" class="svelte-1n46o8q"></line></svg> Broker</button>'),fie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),gie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),pie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),xie=F('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),vie=F('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),mie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),_ie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),bie=F('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Cie=F('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Eie=F('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),yie=F('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),wie=F('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),Sie=F('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Die=F('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),Aie=F('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),kie=F('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),Bie=F('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Fie=F('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),Lie=F('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Iie=F('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),Pie=F('<div class="shell svelte-1n46o8q"><nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),Tie=F('<div class="login-error svelte-1n46o8q"> </div>'),Mie=F('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),Rie=F('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),Nie=F('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),Oie=F("<!> <!> <!> <!>",1);function Hie(o,e){Ys(e,!0);const t=["scripts","mqtt","matter","security","db","logs","config","packages"];function i(){const vt=location.hash.slice(1);return t.includes(vt)?vt:"scripts"}let n=B(xi(i())),s=B(null),r=B(!1),a=B(!1),d=B(!1),u=B(!1),f=B("none"),g=B(""),p=B(!1),C=B(""),b=B(""),E=B(!1),y=B(!1);$$(()=>{x(p,!0)});async function A(){x(b,""),x(E,!0);try{await G$(l(C)),x(C,""),x(p,!1)}catch(vt){x(b,vt.message??"Login failed",!0)}finally{x(E,!1)}}async function I(){if(l(f)==="proxy"&&l(g)){window.location.href=l(g);return}await K$(),x(p,!0)}let T=B(null),M=B(!1),P=B(!1),V=B(!1),U=B(!1),J=B(xi([])),oe=B(0),ce=B(!1),re=B(xi([]));const ue=Ft(()=>l(re).filter(vt=>vt.online).length),we=Ft(()=>l(re).length===0?"none":l(ue)===l(re).length?"all":l(ue)>0?"some":"offline");let Q=B(!1),de=B(!1);async function ye(){if(!await l(T).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;x(M,!0);let vt;try{vt=(await xf()).startedAt}catch{}try{await _F()}catch{}const ct=Date.now()+6e4;for(;Date.now()<ct;){await new Promise(wt=>setTimeout(wt,250));try{const wt=await xf();if(vt===void 0||wt.startedAt!==vt){location.reload();return}}catch{}}location.reload()}async function Fe(){x(d,!0);try{const vt=await eU();l(s)&&x(s,{...l(s),latestVersion:vt.latestVersion??void 0},!0)}catch{}finally{x(d,!1)}}async function xe(){var wt,ai;if(!await l(T).show(`Update to v${(wt=l(s))==null?void 0:wt.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;x(a,!1),x(u,!0);const vt=(ai=l(s))==null?void 0:ai.startedAt;try{await J$()}catch{}const ct=Date.now()+18e4;for(;Date.now()<ct;){await new Promise(pi=>setTimeout(pi,1e3));try{const pi=await xf();if(vt===void 0||pi.startedAt!==vt){location.reload();return}}catch{x(u,!1),x(M,!0)}}location.reload()}function Re(vt){x(n,vt,!0),location.hash=vt}oo(async()=>{location.hash||(location.hash=l(n));const vt=()=>{x(n,i(),!0)};window.addEventListener("hashchange",vt);try{const Te=await q$();x(f,Te.mode,!0),x(g,Te.proxyLogoutUrl??"",!0),l(f)==="password"&&(await fetch("/she/scripts")).status===401&&x(p,!0)}catch{}x(y,!0);async function ct(){var Te,Ce,Mt;try{x(s,await xf(),!0)}catch{}try{const[ui,jt]=await Promise.all([EF(),Zl()]);x(J,Array.isArray(jt.pinnedPackages)?jt.pinnedPackages:[],!0),x(oe,Object.keys(ui).filter(Mi=>!l(J).includes(Mi)).length,!0);const Li=l(ce);x(ce,((Te=jt.broker)==null?void 0:Te.enabled)===!0),Li&&!l(ce)&&l(n)==="security"&&Re("scripts")}catch{}!((Ce=l(s))!=null&&Ce.matterEnabled)&&l(n)==="matter"&&Re("scripts"),!((Mt=l(s))!=null&&Mt.dbEnabled)&&l(n)==="db"&&Re("scripts")}ct();const wt=setInterval(ct,5e3),ai=mr("mqtt:status",Te=>{Te.connected===!1?(x(U,!0),x(P,!1),x(V,!1)):(x(U,!1),x(P,Te.ready===!1),x(V,Te.ready===!0))}),pi=mr("matter:deviceList",Te=>{Array.isArray(Te.devices)&&x(re,Te.devices.map(Ce=>({nodeId:String(Ce.nodeId),online:!!Ce.online})),!0)}),li=mr("matter:deviceStatus",Te=>{if(Te.nodeId===void 0)return;const Ce=String(Te.nodeId),Mt=!!Te.online;x(re,l(re).map(ui=>ui.nodeId===Ce?{...ui,online:Mt}:ui),!0)}),mt=FF();x(Q,mt.some(Te=>Te.level==="error"),!0),x(de,!l(Q)&&mt.some(Te=>Te.level==="warn"),!0);const di=lS(Te=>{Te.level==="error"?(x(Q,!0),x(de,!1)):Te.level==="warn"&&!l(Q)&&x(de,!0)});return()=>{window.removeEventListener("hashchange",vt),clearInterval(wt),ai(),pi(),li(),di()}});var Ne=Oie();Ms("click",l6,()=>{l(r)&&x(r,!1),l(a)&&x(a,!1)});var be=dt(Ne);{var ot=vt=>{var ct=Pie(),wt=m(ct),ai=v(m(wt),2);let pi;var li=v(ai,2);let mt;var di=v(m(li),2);{var Te=q=>{var R=lie();W(()=>mn(R,"title",`${l(oe)??""} package update${l(oe)===1?"":"s"} available`)),D(q,R)};O(di,q=>{l(oe)>0&&q(Te)})}var Ce=v(li,2);let Mt;var ui=v(m(Ce),2);{var jt=q=>{var R=cie();D(q,R)},Li=q=>{var R=die();D(q,R)},Mi=q=>{var R=uie();D(q,R)};O(ui,q=>{l(U)?q(jt):l(P)?q(Li,1):l(V)&&q(Mi,2)})}var Ai=v(Ce,2);{var sn=q=>{var R=hie();let G;W(()=>G=Dt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="security"})),z("click",R,()=>Re("security")),D(q,R)};O(Ai,q=>{l(ce)&&q(sn)})}var on=v(Ai,2);{var gn=q=>{var R=xie();let G;var Y=v(m(R),2);{var ne=_e=>{var Ee=fie();D(_e,Ee)},ie=_e=>{var Ee=gie();D(_e,Ee)},fe=_e=>{var Ee=pie();D(_e,Ee)};O(Y,_e=>{l(we)==="all"?_e(ne):l(we)==="some"?_e(ie,1):l(we)==="offline"&&_e(fe,2)})}W(()=>G=Dt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="matter"})),z("click",R,()=>Re("matter")),D(q,R)};O(on,q=>{var R;(R=l(s))!=null&&R.matterEnabled&&q(gn)})}var yn=v(on,2);{var ft=q=>{var R=vie();let G;W(()=>G=Dt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="db"})),z("click",R,()=>Re("db")),D(q,R)};O(yn,q=>{var R;(R=l(s))!=null&&R.dbEnabled&&q(ft)})}var Yt=v(yn,2);let Ii;var ki=v(m(Yt),2);{var mi=q=>{var R=mie();D(q,R)},Cn=q=>{var R=_ie();D(q,R)};O(ki,q=>{l(Q)?q(mi):l(de)&&q(Cn,1)})}var En=v(Yt,4),wn=v(m(En),2),$e=m(wn),ti=m($e);ti.nodeValue="v1.20.6 ";var Ci=v(ti);{var Kt=q=>{var R=bie();D(q,R)};O(Ci,q=>{var R,G;(R=l(s))!=null&&R.latestVersion&&!((G=l(s))!=null&&G.docker)&&q(Kt)})}var Ri=v($e,2);{var Gi=q=>{var R=wie(),G=m(R),Y=v(m(G));Y.textContent="v1.20.6";var ne=v(Y,2);{var ie=le=>{var Ve=Cie(),Tt=v(dt(Ve)),Ie=m(Tt);W(()=>N(Ie,`v${l(s).latestVersion??""}`)),D(le,Ve)},fe=le=>{var Ve=Eie();D(le,Ve)};O(ne,le=>{var Ve;(Ve=l(s))!=null&&Ve.latestVersion?le(ie):le(fe,-1)})}var _e=v(G,2),Ee=m(_e);{var Oe=le=>{var Ve=yie(),Tt=v(m(Ve));W(()=>N(Tt,` Update to v${l(s).latestVersion??""}`)),z("click",Ve,xe),D(le,Ve)};O(Ee,le=>{var Ve;(Ve=l(s))!=null&&Ve.latestVersion&&le(Oe)})}var He=v(Ee,2),tt=m(He);let ei;var ee=v(tt);W(()=>{He.disabled=l(d),ei=Dt(tt,0,"svelte-1n46o8q",null,ei,{spinning:l(d)}),N(ee,` ${l(d)?"Checking…":"Check for updates"}`)}),z("click",R,le=>le.stopPropagation()),z("click",He,Fe),D(q,R)};O(Ri,q=>{var R;l(a)&&!((R=l(s))!=null&&R.docker)&&q(Gi)})}var Yi=v(wn,2),Z=m(Yi),Se=v(Z,2);{var st=q=>{var R=Lie(),G=m(R);{var Y=Ee=>{var Oe=kie(),He=m(Oe);{var tt=qt=>{const Ei=Ft(()=>Math.floor((Date.now()-l(s).startedAt)/1e3)),Qi=Ft(()=>Math.floor(l(Ei)/86400)),Ui=Ft(()=>Math.floor(l(Ei)%86400/3600)),$i=Ft(()=>Math.floor(l(Ei)%3600/60));var Ze=Sie(),At=v(dt(Ze)),kt=m(At);W(()=>N(kt,`${l(Qi)>0?l(Qi)+"d ":""}${l(Ui)>0||l(Qi)>0?l(Ui)+"h ":""}${l($i)??""}m`)),D(qt,Ze)};O(He,qt=>{l(s).startedAt&&qt(tt)})}var ei=v(He,3),ee=m(ei),le=v(ei,3),Ve=m(le),Tt=v(le,3),Ie=m(Tt),Be=v(Tt,2);{var ut=qt=>{var Ei=Die(),Qi=v(dt(Ei)),Ui=m(Qi),$i=v(Qi,3),Ze=m($i);W(()=>{N(Ui,l(s).matterNodes??0),N(Ze,l(s).matterEndpoints??0)}),D(qt,Ei)};O(Be,qt=>{l(s).matterEnabled&&qt(ut)})}var ht=v(Be,2);{var Xe=qt=>{var Ei=Aie(),Qi=v(dt(Ei)),Ui=m(Qi),$i=v(Qi,3),Ze=m($i);W(()=>{N(Ui,l(s).dbDocs??"—"),N(Ze,l(s).dbViews??"—")}),D(qt,Ei)};O(ht,qt=>{l(s).dbEnabled&&qt(Xe)})}var Zt=v(ht,3),at=m(Zt),et=v(Zt,3),Et=m(et),Xt=v(et,3),Vt=m(Xt),oi=v(Xt,3),We=m(oi),Ct=v(oi,3),ni=m(Ct),zi=v(Ct,3),Ut=m(zi);W(()=>{N(ee,l(s).scripts),N(Ve,l(s).topics),N(Ie,l(s).mqttMsgPerSec??"—"),N(at,l(s).handlers??"—"),N(Et,l(s).memMb!=null?l(s).memMb+" MB":"—"),N(Vt,l(s).cpuPercent!=null?l(s).cpuPercent+" %":"—"),N(We,l(s).eluPercent!=null?l(s).eluPercent+" %":"—"),N(ni,l(s).elMeanMs!=null?l(s).elMeanMs+" ms":"—"),N(Ut,l(s).elMaxMs!=null?l(s).elMaxMs+" ms":"—")}),D(Ee,Oe)},ne=Ee=>{var Oe=Bie();D(Ee,Oe)};O(G,Ee=>{l(s)?Ee(Y):Ee(ne,-1)})}var ie=v(G,2),fe=m(ie);{var _e=Ee=>{var Oe=Fie();z("click",Oe,()=>{x(r,!1),ye()}),D(Ee,Oe)};O(fe,Ee=>{var Oe;(Oe=l(s))!=null&&Oe.docker||Ee(_e)})}z("click",R,Ee=>Ee.stopPropagation()),D(q,R)};O(Se,q=>{l(r)&&q(st)})}var qe=v(Yi,2);let It;var Jt=v(qe,2);{var gt=q=>{var R=Iie();z("click",R,I),D(q,R)};O(Jt,q=>{l(f)==="password"&&q(gt)})}var Je=v(wt,2),rt=m(Je);Ds(gl(rt,{}),q=>x(T,q,!0),()=>l(T));var si=v(rt,2);let De;var je=m(si);{let q=Ft(()=>l(n)==="scripts");DZ(je,{get active(){return l(q)}})}var ji=v(si,2);let rn;var Ki=m(ji);BJ(Ki,{});var he=v(ji,2);let Ye;var Bt=m(he);dJ(Bt,{});var Ot=v(he,2);let Le;var ze=m(Ot);kQ(ze,{});var Ht=v(Ot,2);let $t;var Qt=m(Ht);aie(Qt,{});var Pt=v(Ht,2);let j;var ae=m(Pt);BY(ae,{});var ve=v(Pt,2);let pe;var it=m(ve);vX(it,{});var Ge=v(ve,2);let pt;var $=m(Ge);yX($,{}),W(()=>{pi=Dt(ai,1,"svelte-1n46o8q",null,pi,{active:l(n)==="scripts"}),mt=Dt(li,1,"svelte-1n46o8q",null,mt,{active:l(n)==="packages"}),Mt=Dt(Ce,1,"svelte-1n46o8q",null,Mt,{active:l(n)==="mqtt"}),Ii=Dt(Yt,1,"svelte-1n46o8q",null,Ii,{active:l(n)==="logs"}),It=Dt(qe,1,"nav-settings svelte-1n46o8q",null,It,{active:l(n)==="config"}),De=Dt(si,1,"page-wrap svelte-1n46o8q",null,De,{hidden:l(n)!=="scripts"}),rn=Dt(ji,1,"page-wrap svelte-1n46o8q",null,rn,{hidden:l(n)!=="packages"}),Ye=Dt(he,1,"page-wrap svelte-1n46o8q",null,Ye,{hidden:l(n)!=="mqtt"}),Le=Dt(Ot,1,"page-wrap svelte-1n46o8q",null,Le,{hidden:l(n)!=="matter"}),$t=Dt(Ht,1,"page-wrap svelte-1n46o8q",null,$t,{hidden:l(n)!=="security"}),j=Dt(Pt,1,"page-wrap svelte-1n46o8q",null,j,{hidden:l(n)!=="db"}),pe=Dt(ve,1,"page-wrap svelte-1n46o8q",null,pe,{hidden:l(n)!=="config"}),pt=Dt(Ge,1,"page-wrap svelte-1n46o8q",null,pt,{hidden:l(n)!=="logs"})}),z("click",ai,()=>Re("scripts")),z("click",li,()=>Re("packages")),z("click",Ce,()=>Re("mqtt")),z("click",Yt,()=>{Re("logs"),x(Q,!1),x(de,!1)}),z("click",$e,q=>{q.stopPropagation(),x(a,!l(a)),x(r,!1)}),z("click",Z,q=>{q.stopPropagation(),x(r,!l(r)),x(a,!1)}),z("click",qe,()=>Re("config")),D(vt,ct)};O(be,vt=>{l(y)&&!l(p)&&vt(ot)})}var Lt=v(be,2);{var Qe=vt=>{var ct=Mie(),wt=m(ct),ai=v(m(wt),4),pi=v(m(ai),2),li=v(ai,2);{var mt=Ce=>{var Mt=Tie(),ui=m(Mt);W(()=>N(ui,l(b))),D(Ce,Mt)};O(li,Ce=>{l(b)&&Ce(mt)})}var di=v(li,2),Te=m(di);W(()=>{pi.disabled=l(E),di.disabled=l(E)||!l(C),N(Te,l(E)?"Signing in…":"Sign in")}),Ms("submit",wt,Ce=>{Ce.preventDefault(),A()}),St(pi,()=>l(C),Ce=>x(C,Ce)),D(vt,ct)};O(Lt,vt=>{l(p)&&vt(Qe)})}var yt=v(Lt,2);{var ge=vt=>{var ct=Rie();D(vt,ct)};O(yt,vt=>{l(M)&&vt(ge)})}var Ae=v(yt,2);{var nt=vt=>{var ct=Nie();D(vt,ct)};O(Ae,vt=>{l(u)&&vt(nt)})}D(o,Ne),Qs()}lo(["click"]);lP(Hie,{target:document.getElementById("app")});export{W6 as t};
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-Dt8a9eeo.js";import{t as I}from"./index-DvxIhiIs.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-Dt8a9eeo.js";import{t as I}from"./index-D-DESdgj.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -172,7 +172,7 @@
172
172
  }
173
173
  })();
174
174
  </script>
175
- <script type="module" crossorigin src="/assets/index-DvxIhiIs.js"></script>
175
+ <script type="module" crossorigin src="/assets/index-D-DESdgj.js"></script>
176
176
  <link rel="modulepreload" crossorigin href="/assets/monaco-langs-Dt8a9eeo.js">
177
177
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
178
178
  <link rel="stylesheet" crossorigin href="/assets/index-B4M4MeEk.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "1.20.5",
3
+ "version": "1.20.6",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -547,8 +547,13 @@ if (config.url) {
547
547
  state.ts = new Date().getTime();
548
548
  }
549
549
  oldState = store.getObject('mqtt::' + topic) || {};
550
- if (oldState.val !== state.val) {
551
- state.lc = state.ts;
550
+ // lc (last change): prefer a payload-provided value; otherwise set it
551
+ // on value change and carry the previous lc over when the value is
552
+ // unchanged. Previously the old lc was simply lost on repeated
553
+ // identical values, so she.mqtt.age() returned NaN for topics whose
554
+ // payloads don't carry their own lc (B5).
555
+ if (state.lc === undefined) {
556
+ state.lc = oldState.val !== state.val ? state.ts : (oldState.lc ?? state.ts);
552
557
  }
553
558
  store.setObject('mqtt::' + topic, state);
554
559
  stateChange(topic, state, oldState, msg);
@@ -52,9 +52,15 @@ module.exports = function (she, ctx = {}) {
52
52
  she.setValue(target, val);
53
53
  });
54
54
  },
55
- /** Seconds since the topic's value last changed. */
56
- age: function Sandbox_mqtt_age(topic) {
57
- return Math.round((new Date().getTime() - she.getProp(topic, 'lc')) / 1000);
55
+ /**
56
+ * Seconds since the topic's value last changed.
57
+ * Pass 'message' (or 'ts') as second argument to get the seconds since
58
+ * the last received message instead — repeated identical values reset
59
+ * that clock, useful for sensor heartbeat checks.
60
+ */
61
+ age: function Sandbox_mqtt_age(topic, mode) {
62
+ const prop = mode === 'message' || mode === 'ts' ? 'ts' : 'lc';
63
+ return Math.round((new Date().getTime() - she.getProp(topic, prop)) / 1000);
58
64
  },
59
65
  /**
60
66
  * Publish 1 to target when any source is truthy, 0 otherwise.
@@ -148,7 +154,8 @@ module.exports = function (she, ctx = {}) {
148
154
  she.http = {
149
155
  /**
150
156
  * Fetch a URL and return a Promise that resolves to the response body.
151
- * Resolves to parsed JSON when the Content-Type is application/json, plain text otherwise.
157
+ * Resolves to parsed JSON when the Content-Type is application/json and
158
+ * the body parses; falls back to the raw text body when parsing fails.
152
159
  * Rejects on non-2xx responses.
153
160
  * @param {string} url
154
161
  * @param {RequestInit} [options]
@@ -171,7 +178,15 @@ module.exports = function (she, ctx = {}) {
171
178
  const promise = fetch(url, { ...options, signal })
172
179
  .then(async (r) => {
173
180
  const ct = r.headers.get('content-type') || '';
174
- const body = ct.includes('json') ? await r.json() : await r.text();
181
+ const text = await r.text();
182
+ let body = text;
183
+ if (ct.includes('json')) {
184
+ try {
185
+ body = JSON.parse(text);
186
+ } catch {
187
+ // Content-Type lied — deliver the raw body instead of throwing
188
+ }
189
+ }
175
190
  const headers = {};
176
191
  r.headers.forEach((v, k) => {
177
192
  headers[k] = v;