smart-home-engine 2.0.1 → 2.1.0

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-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-20i8zomj.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-DmHeR7H2.js"])))=>i.map(i=>d[i]);
2
2
  var mI=Object.defineProperty;var T8=r=>{throw TypeError(r)};var _I=(r,e,t)=>e in r?mI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Cs=(r,e,t)=>_I(r,typeof e!="symbol"?e+"":e,t),Jb=(r,e,t)=>e.has(r)||T8("Cannot "+t);var oi=(r,e,t)=>(Jb(r,e,"read from private field"),t?t.call(r):e.get(r)),ds=(r,e,t)=>e.has(r)?T8("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),us=(r,e,t,i)=>(Jb(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),$s=(r,e,t)=>(Jb(r,e,"access private method"),t);import{_ as q5,m as U5,l as En,A as Nr,C as Ei,I as Gs,D as S0,a as vo,g as G5,M as pn,b as Wn,E as wl,c as Le,r as Ls,d as Ya,e as M,f as bI,h as js,R as hs,S as Nn,i as xr,j as Xa,k as ws,n as ns,o as pi,p as Vi,K as _o,q as yn,s as nn,t as Ao,u as ut,v as as,O as ec,w as Eo,P as kn,x as eC,y as k0,z as K5,B as Fc,F as El,G as sw,H as Yo,U as Ts,J as Ip,L as Dn,N as Nc,Q as CI,T as Lr,V as ow,W as yI,X as Z5,$ as Cn,Y as Ss,Z as ys,a0 as to,a1 as qn,a2 as pa,a3 as Fv,a4 as tn,a5 as Zx,a6 as wI,a7 as EI,a8 as Do,a9 as SI,aa as Sl,ab as Rr,ac as Bn,ad as Y5,ae as Vs,af as kI,ag as DI,ah as Pr,ai as hg,aj as bo,ak as j1,al as Sr,am as iu,an as TS,ao as $1,ap as qo,aq as Pp,ar as Uo,as as V1,at as q1,au as AI,av as D0,aw as fg,ax as Gc,ay as BI,az as pg,aA as FI,aB as MS,aC as LI,aD as II,aE as M8,aF as go,aG as Lc,aH as kr,aI as Qn,aJ as Sc,aK as PI,aL as oc,aM as ua,aN as Ro,aO as kl,aP as NS,aQ as Bo,aR as ho,aS as Sm,aT as Xn,aU as X5,aV as TI,aW as RS,aX as U1,aY as OS,aZ as zS,a_ as Lu,a$ as MI,b0 as HS,b1 as NI,b2 as WS,b3 as Kc,b4 as Zc,b5 as Tp,b6 as Lv,b7 as Yr,b8 as A0,b9 as km,ba as tC,bb as Rs,bc as jS,bd as B0,be as G1,bf as RI,bg as Q5,bh as Iv,bi as Mp,bj as Pv,bk as F0,bl as K1,bm as Es,bn as nu,bo as L0,bp as OI,bq as zI,br as $S,bs as HI,bt as Dm,bu as Da,bv as VS,bw as Np,bx as Yc,by as gg,bz as rs,bA as Rp,bB as J5,bC as I0,bD as WI,bE as Iu,bF as mn,bG as N8,bH as Yx,bI as e4,bJ as el,bK as _l,bL as zs,bM as Op,bN as $a,bO as zp,bP as Js,bQ as Tv,bR as Zh,bS as rw,bT as t4,bU as i4,bV as n4,bW as qS,bX as jr,bY as Bs,bZ as P0,b_ as s4,b$ as Ic,c0 as Z1,c1 as jI,c2 as Wf,c3 as R8,c4 as T0,c5 as o4,c6 as jf,c7 as $I,c8 as Ta,c9 as Y1,ca as VI,cb as Or,cc as Dl,cd as M0,ce as Mv,cf as r4,cg as wa,ch as N0,ci as X1,cj as qI,ck as UI,cl as GI,cm as vg,cn as rc,co as Oo,cp as KI,cq as US,cr as ZI,cs as YI,ct as O8,cu as XI,cv as R0,cw as Rc,cx as aw,cy as Bh,cz as Oc,cA as QI,cB as tc,cC as Va,cD as aa,cE as z8,cF as _r,cG as O0,cH as Ud,cI as ac,cJ as JI,cK as Al,cL as Nv,cM as Q1,cN as a4,cO as eP,cP as tP,cQ as GS,cR as iP,cS as Rv,cT as nP,cU as bd,cV as Ov,cW as H8,cX as sP,cY as oP,cZ as dc,c_ as rP,c$ as KS,d0 as l4,d1 as c4,d2 as d4,d3 as u4,d4 as aP,d5 as lP,d6 as h4,d7 as f4,d8 as cP,d9 as ZS,da as dP,db as uP,dc as so,dd as hP,de as YS,df as fP,dg as $f,dh as W8,di as pP,dj as gP,dk as vP,dl as xP,dm as mP,dn as _P,dp as Hp,dq as J1,dr as lw,ds as bP,dt as CP,du as j8,dv as cw,dw as yP,dx as $8,dy as iC,dz as wP,dA as p4,dB as EP,dC as g4,dD as dw,dE as SP,dF as kP,dG as DP,dH as v4,dI as x4,dJ as AP,dK as Am,dL as m4,dM as eb,dN as BP,dO as FP,dP as Gd,dQ as XS,dR as LP,dS as V8,dT as q8,dU as IP,dV as Vf,dW as _4,dX as PP,dY as TP,dZ as MP,d_ as NP,d$ as b4,e0 as C4,e1 as y4,e2 as w4,e3 as RP,e4 as ic,e5 as U8,e6 as OP,e7 as z0,e8 as zP,e9 as Vg,ea as E4,eb as G8,ec as zv,ed as S4,ee as Bm,ef as HP,eg as k4,eh as WP,ei as D4,ej as jP,ek as $P,el as A4,em as B4,en as zc,eo as tb,ep as VP,eq as F4,er as ha,es as Pu,et as L4,eu as qP,ev as UP,ew as I4,ex as P4,ey as GP,ez as T4,eA as M4,eB as Hv,eC as KP,eD as ZP,eE as YP,eF as XP,eG as Fg,eH as K8,eI as QP,eJ as JP,eK as eT,eL as Fm,eM as ir,eN as tT,eO as uw,eP as Yh,eQ as iT,eR as Ec,eS as nT,eT as sT,eU as N4,eV as oT,eW as cv,eX as rT,eY as aT,eZ as lT,e_ as cT,e$ as Z8,f0 as Y8,f1 as X8,f2 as Xh,f3 as QS,f4 as R4,f5 as hw,f6 as Xx,f7 as O4,f8 as Lm,f9 as dT,fa as uT,fb as hT,fc as fT,fd as JS,fe as z4,ff as pT,fg as Im,fh as H4,fi as W4,fj as gT,fk as vT,fl as xT,fm as mT,fn as _T,fo as bT,fp as CT,fq as yT,fr as j4,fs as wT,ft as Pm,fu as $4,fv as ET,fw as V4,fx as ST,fy as q4,fz as U4,fA as kT,fB as Q8,fC as G4,fD as J8,fE as DT,fF as nC,fG as ek,fH as AT,fI as BT,fJ as FT,fK as Kl,fL as Kd,fM as LT,fN as tk,fO as Qx,fP as IT,fQ as kc,fR as ib,fS as fw,fT as PT,fU as K4,fV as Z4,fW as br,fX as ik,fY as ux,fZ as e9,f_ as TT,f$ as MT,g0 as NT,g1 as RT,g2 as OT,g3 as zT,g4 as HT,g5 as WT,g6 as nk,g7 as jT,g8 as $T,g9 as VT,ga as Wp,gb as dv,gc as Y4,gd as qT,ge as t9,gf as Jx,gg as hx,gh as sC,gi as UT,gj as GT,gk as X4,gl as KT,gm as i9,gn as ZT,go as YT,gp as Q4,gq as nb,gr as XT,gs as Tm,gt as n9,gu as s9,gv as o9,gw as J4,gx as e3,gy as t3,gz as i3,gA as n3,gB as s3,gC as o3,gD as sk,gE as r3,gF as vf,gG as QT,gH as JT,gI as eM,gJ as tM,gK as a3,gL as iM,gM as nM,gN as ok,gO as pw,gP as Dd,gQ as sM,gR as oM,gS as rM,gT as aM,gU as lM,gV as cM,gW as rk,gX as r9,gY as gw,gZ as dM,g_ as vw,g$ as uM,h0 as hM,h1 as fM,h2 as pM,h3 as a9,h4 as l3,h5 as ak,h6 as lk,h7 as gM,h8 as vM,h9 as xM,ha as ck,hb as oC,hc as mM,hd as _M,he as bM,hf as rC,hg as c3,hh as d3,hi as u3,hj as h3,hk as Hc,hl as f3,hm as l9,hn as dk,ho as CM,hp as p3,hq as yM,hr as wM,hs as sb,ht as ob,hu as Qh,hv as rb,hw as H0,hx as EM,hy as ab,hz as SM,hA as kM,hB as DM,hC as g3,hD as Lg,hE as AM,hF as BM,hG as FM,hH as LM,hI as W0,hJ as IM,hK as v3,hL as x3,hM as m3,hN as xw,hO as PM,hP as TM,hQ as MM,hR as NM,hS as RM,hT as mw,hU as OM,hV as zM,hW as HM,hX as WM,hY as jM,hZ as $M,h_ as VM,h$ as qM,i0 as _3,i1 as UM,i2 as GM,i3 as KM,i4 as uk,i5 as ZM,i6 as YM,i7 as xl,i8 as vr,i9 as _w,ia as b3,ib as XM,ic as QM}from"./monaco-langs-DKJI_o9J.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();const C3=!1;var c9=Array.isArray,JM=Array.prototype.indexOf,Mm=Array.prototype.includes,lb=Array.from,eN=Object.defineProperty,rp=Object.getOwnPropertyDescriptor,tN=Object.getOwnPropertyDescriptors,iN=Object.prototype,nN=Array.prototype,y3=Object.getPrototypeOf,hk=Object.isExtensible;const lr=()=>{};function sN(r){for(var e=0;e<r.length;e++)r[e]()}function w3(){var r,e,t=new Promise((i,s)=>{r=i,e=s});return{promise:t,resolve:r,reject:e}}function oN(r,e,t=!1){return r===void 0?t?e():e:r}function jp(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const i of r)if(t.push(i),t.length===e)break;return t}const wr=2,$p=4,cb=8,E3=1<<24,bl=16,yl=32,Zd=64,bw=128,Ga=512,nr=1024,cr=2048,lc=4096,Ur=8192,Ka=16384,xg=32768,Cw=1<<25,Vp=65536,Nm=1<<17,rN=1<<18,mg=1<<19,aN=1<<20,Ql=1<<25,Fh=65536,Rm=1<<21,ap=1<<22,Ad=1<<23,Tu=Symbol("$state"),lN=Symbol("legacy props"),cN=Symbol(""),em=Symbol("attributes"),yw=Symbol("class"),ww=Symbol("style"),qg=Symbol("text"),tm=Symbol("form reset"),db=new class extends Error{constructor(){super(...arguments);Cs(this,"name","StaleReactionError");Cs(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var j5;const dN=!!((j5=globalThis.document)!=null&&j5.contentType)&&globalThis.document.contentType.includes("xml");function S3(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function uN(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hN(r,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function fN(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function pN(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gN(r){throw new Error("https://svelte.dev/e/effect_orphan")}function vN(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xN(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function mN(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function _N(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function bN(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function CN(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const yN=1,wN=2,k3=4,EN=8,SN=16,kN=1,DN=4,AN=8,BN=16,D3=1,FN=2,tr=Symbol("uninitialized"),A3="http://www.w3.org/1999/xhtml",LN="http://www.w3.org/2000/svg",IN="http://www.w3.org/1998/Math/MathML";function PN(){console.warn("https://svelte.dev/e/derived_inert")}function TN(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function MN(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function B3(r){return r===this.v}function NN(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function F3(r){return!NN(r,this.v)}let RN=!1,yr=null;function qp(r){yr=r}function gs(r,e=!1,t){yr={p:yr,i:!1,c:null,e:null,s:r,x:null,r:Fs,l:null}}function vs(r){var e=yr,t=e.e;if(t!==null){e.e=null;for(var i of t)J3(i)}return r!==void 0&&(e.x=r),e.i=!0,yr=e.p,r??{}}function L3(){return!0}let yu=[];function I3(){var r=yu;yu=[],sN(r)}function nc(r){if(yu.length===0&&!hv){var e=yu;queueMicrotask(()=>{e===yu&&I3()})}yu.push(r)}function ON(){for(;yu.length>0;)I3()}function P3(r){var e=Fs;if(e===null)return As.f|=Ad,r;if((e.f&xg)===0&&(e.f&$p)===0)throw r;Cd(r,e)}function Cd(r,e){for(;e!==null;){if((e.f&bw)!==0){if((e.f&xg)===0)throw r;try{e.b.error(r);return}catch(t){r=t}}e=e.parent}throw r}const zN=-7169;function Mo(r,e){r.f=r.f&zN|e}function d9(r){(r.f&Ga)!==0||r.deps===null?Mo(r,nr):Mo(r,lc)}function T3(r){if(r!==null)for(const e of r)(e.f&wr)===0||(e.f&Fh)===0||(e.f^=Fh,T3(e.deps))}function M3(r,e,t){(r.f&cr)!==0?e.add(r):(r.f&lc)!==0&&t.add(r),T3(r.deps),Mo(r,nr)}let fx=!1;function HN(r){var e=fx;try{return fx=!1,[r(),fx]}finally{fx=e}}let aC=null,xf=null,Zn=null,uv=null,mr=null,Ew=null,hv=!1,lC=!1,qf=null,im=null;var fk=0;let WN=1;var pp,xd,ku,gp,vp,xp,bc,mp,sa,_0,Cc,ll,Vl,_p,Du,oo,Sw,Ug,kw,N3,R3,Mf,jN,Gg;const Z_=class Z_{constructor(){ds(this,oo);Cs(this,"id",WN++);ds(this,pp,!1);Cs(this,"linked",!0);ds(this,xd,null);ds(this,ku,null);Cs(this,"async_deriveds",new Map);Cs(this,"current",new Map);Cs(this,"previous",new Map);ds(this,gp,new Set);ds(this,vp,new Set);ds(this,xp,0);ds(this,bc,new Map);ds(this,mp,null);ds(this,sa,[]);ds(this,_0,[]);ds(this,Cc,new Set);ds(this,ll,new Set);ds(this,Vl,new Map);ds(this,_p,new Set);Cs(this,"is_fork",!1);ds(this,Du,!1);xf===null?aC=xf=this:(us(xf,ku,this),us(this,xd,xf)),xf=this}skip_effect(e){oi(this,Vl).has(e)||oi(this,Vl).set(e,{d:[],m:[]}),oi(this,_p).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=oi(this,Vl).get(e);if(i){oi(this,Vl).delete(e);for(var s of i.d)Mo(s,cr),t(s);for(s of i.m)Mo(s,lc),t(s)}oi(this,_p).add(e)}capture(e,t,i=!1){e.v!==tr&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Ad)===0&&(this.current.set(e,[t,i]),mr==null||mr.set(e,t)),this.is_fork||(e.v=t)}activate(){Zn=this}deactivate(){Zn=null,mr=null}flush(){try{lC=!0,Zn=this,$s(this,oo,Ug).call(this)}finally{fk=0,Ew=null,qf=null,im=null,lC=!1,Zn=null,mr=null,Mu.clear()}}discard(){var e;for(const t of oi(this,vp))t(this);oi(this,vp).clear(),$s(this,oo,Gg).call(this),(e=oi(this,mp))==null||e.resolve()}register_created_effect(e){oi(this,_0).push(e)}increment(e,t){if(us(this,xp,oi(this,xp)+1),e){let i=oi(this,bc).get(t)??0;oi(this,bc).set(t,i+1)}}decrement(e,t){if(us(this,xp,oi(this,xp)-1),e){let i=oi(this,bc).get(t)??0;i===1?oi(this,bc).delete(t):oi(this,bc).set(t,i-1)}oi(this,Du)||(us(this,Du,!0),nc(()=>{us(this,Du,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)oi(this,Cc).add(i);for(const i of t)oi(this,ll).add(i);e.clear(),t.clear()}oncommit(e){oi(this,gp).add(e)}ondiscard(e){oi(this,vp).add(e)}settled(){return(oi(this,mp)??us(this,mp,w3())).promise}static ensure(){if(Zn===null){const e=Zn=new Z_;!lC&&!hv&&nc(()=>{oi(e,pp)||e.flush()})}return Zn}apply(){{mr=null;return}}schedule(e){var s;if(Ew=e,(s=e.b)!=null&&s.is_pending&&(e.f&($p|cb|E3))!==0&&(e.f&xg)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(qf!==null&&t===Fs&&(As===null||(As.f&wr)===0))return;if((i&(Zd|yl))!==0){if((i&nr)===0)return;t.f^=nr}}oi(this,sa).push(t)}};pp=new WeakMap,xd=new WeakMap,ku=new WeakMap,gp=new WeakMap,vp=new WeakMap,xp=new WeakMap,bc=new WeakMap,mp=new WeakMap,sa=new WeakMap,_0=new WeakMap,Cc=new WeakMap,ll=new WeakMap,Vl=new WeakMap,_p=new WeakMap,Du=new WeakMap,oo=new WeakSet,Sw=function(){if(this.is_fork)return!0;for(const i of oi(this,bc).keys()){for(var e=i,t=!1;e.parent!==null;){if(oi(this,Vl).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},Ug=function(){var c,u,g,v;us(this,pp,!0),fk++>1e3&&($s(this,oo,Gg).call(this),VN());for(const m of oi(this,Cc))oi(this,ll).delete(m),Mo(m,cr),this.schedule(m);for(const m of oi(this,ll))Mo(m,lc),this.schedule(m);const e=oi(this,sa);us(this,sa,[]),this.apply();var t=qf=[],i=[],s=im=[];for(const m of e)try{$s(this,oo,kw).call(this,m,t,i)}catch(b){throw H3(m),$s(this,oo,Sw).call(this)||this.discard(),b}if(Zn=null,s.length>0){var o=Z_.ensure();for(const m of s)o.schedule(m)}if(qf=null,im=null,$s(this,oo,Sw).call(this)){$s(this,oo,Mf).call(this,i),$s(this,oo,Mf).call(this,t);for(const[m,b]of oi(this,Vl))z3(m,b);s.length>0&&$s(c=Zn,oo,Ug).call(c);return}const a=$s(this,oo,N3).call(this);if(a){$s(this,oo,Mf).call(this,i),$s(this,oo,Mf).call(this,t),$s(u=a,oo,R3).call(u,this);return}oi(this,Cc).clear(),oi(this,ll).clear();for(const m of oi(this,gp))m(this);oi(this,gp).clear(),uv=this,pk(i),pk(t),uv=null,(g=oi(this,mp))==null||g.resolve();var l=Zn;if(oi(this,xp)===0&&(oi(this,sa).length===0||l!==null)&&$s(this,oo,Gg).call(this),oi(this,sa).length>0)if(l!==null){const m=l;oi(m,sa).push(...oi(this,sa).filter(b=>!oi(m,sa).includes(b)))}else l=this;l!==null&&$s(v=l,oo,Ug).call(v)},kw=function(e,t,i){e.f^=nr;for(var s=e.first;s!==null;){var o=s.f,a=(o&(yl|Zd))!==0,l=a&&(o&nr)!==0,c=l||(o&Ur)!==0||oi(this,Vl).has(s);if(!c&&s.fn!==null){a?s.f^=nr:(o&$p)!==0?t.push(s):V0(s)&&((o&bl)!==0&&oi(this,ll).add(s),Gp(s));var u=s.first;if(u!==null){s=u;continue}}for(;s!==null;){var g=s.next;if(g!==null){s=g;break}s=s.parent}}},N3=function(){for(var e=oi(this,xd);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=oi(e,xd)}return null},R3=function(e){var i;for(const[s,o]of e.current)!this.previous.has(s)&&e.previous.has(s)&&this.previous.set(s,e.previous.get(s)),this.current.set(s,o);for(const[s,o]of e.async_deriveds){const a=this.async_deriveds.get(s);a&&o.promise.then(a.resolve).catch(a.reject)}this.transfer_effects(oi(e,Cc),oi(e,ll));const t=s=>{var o=s.reactions;if(o!==null)for(const c of o){var a=c.f;if((a&wr)!==0)t(c);else{var l=c;a&(ap|bl)&&!this.async_deriveds.has(l)&&(oi(this,ll).delete(l),Mo(l,cr),this.schedule(l))}}};for(const s of this.current.keys())t(s);this.oncommit(()=>e.discard()),$s(i=e,oo,Gg).call(i),Zn=this,$s(this,oo,Ug).call(this)},Mf=function(e){for(var t=0;t<e.length;t+=1)M3(e[t],oi(this,Cc),oi(this,ll))},jN=function(){var g;for(let v=aC;v!==null;v=oi(v,ku)){var e=v.id<this.id,t=[];for(const[m,[b,_]]of this.current){if(v.current.has(m)){var i=v.current.get(m)[0];if(e&&b!==i)v.current.set(m,[b,_]);else continue}t.push(m)}if(e)for(const[m,b]of this.async_deriveds){const _=v.async_deriveds.get(m);_&&b.promise.then(_.resolve).catch(_.reject)}if(oi(v,pp)){var s=[...v.current.keys()].filter(m=>!v.current.get(m)[1]&&!this.current.has(m));if(s.length===0)e&&v.discard();else if(t.length>0){if(e)for(const m of oi(this,_p))v.unskip_effect(m,b=>{var _;(b.f&(bl|ap))!==0?v.schedule(b):$s(_=v,oo,Mf).call(_,[b])});v.activate();var o=new Set,a=new Map;for(var l of t)O3(l,s,o,a);a=new Map;var c=[...v.current].filter(([m,b])=>{const _=this.current.get(m);return _?_[0]!==b[0]||_[1]!==b[1]:!0}).map(([m])=>m);if(c.length>0)for(const m of oi(this,_0))(m.f&(Ka|Ur|Nm))===0&&u9(m,c,a)&&((m.f&(ap|bl))!==0?(Mo(m,cr),v.schedule(m)):oi(v,Cc).add(m));if(oi(v,sa).length>0&&!oi(v,Du)){v.apply();for(var u of oi(v,sa))$s(g=v,oo,kw).call(g,u,[],[]);us(v,sa,[])}v.deactivate()}}}},Gg=function(){if(this.linked){var e=oi(this,xd),t=oi(this,ku);e===null?aC=t:us(e,ku,t),t===null?xf=e:us(t,xd,e),this.linked=!1}};let Lh=Z_;function $N(r){var e=hv;hv=!0;try{for(var t;;){if(ON(),Zn===null)return t;Zn.flush()}}finally{hv=e}}function VN(){try{vN()}catch(r){Cd(r,Ew)}}let ol=null;function pk(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var i=r[t++];if((i.f&(Ka|Ur))===0&&V0(i)&&(ol=new Set,Gp(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&iB(i),(ol==null?void 0:ol.size)>0)){Mu.clear();for(const s of ol){if((s.f&(Ka|Ur))!==0)continue;const o=[s];let a=s.parent;for(;a!==null;)ol.has(a)&&(ol.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){const c=o[l];(c.f&(Ka|Ur))===0&&Gp(c)}}ol.clear()}}ol=null}}function O3(r,e,t,i){if(!t.has(r)&&(t.add(r),r.reactions!==null))for(const s of r.reactions){const o=s.f;(o&wr)!==0?O3(s,e,t,i):(o&(ap|bl))!==0&&(o&cr)===0&&u9(s,e,i)&&(Mo(s,cr),h9(s))}}function u9(r,e,t){const i=t.get(r);if(i!==void 0)return i;if(r.deps!==null)for(const s of r.deps){if(Mm.call(e,s))return!0;if((s.f&wr)!==0&&u9(s,e,t))return t.set(s,!0),!0}return t.set(r,!1),!1}function h9(r){Zn.schedule(r)}function z3(r,e){if(!((r.f&yl)!==0&&(r.f&nr)!==0)){(r.f&cr)!==0?e.d.push(r):(r.f&lc)!==0&&e.m.push(r),Mo(r,nr);for(var t=r.first;t!==null;)z3(t,e),t=t.next}}function H3(r){Mo(r,nr);for(var e=r.first;e!==null;)H3(e),e=e.next}function qN(r){let e=0,t=Ih(0),i;return()=>{g9()&&(n(t),$0(()=>(e===0&&(i=io(()=>r(()=>fv(t)))),e+=1,()=>{nc(()=>{e-=1,e===0&&(i==null||i(),i=void 0,fv(t))})})))}}var UN=Vp|mg;function GN(r,e,t,i){new KN(r,e,t,i)}var Na,PS,Ra,Au,oa,Oa,Hr,_a,yc,Bu,md,bp,b0,C0,wc,Y_,No,ZN,YN,XN,Dw,nm,sm,Aw,Bw;class KN{constructor(e,t,i,s){ds(this,No);Cs(this,"parent");Cs(this,"is_pending",!1);Cs(this,"transform_error");ds(this,Na);ds(this,PS,null);ds(this,Ra);ds(this,Au);ds(this,oa);ds(this,Oa,null);ds(this,Hr,null);ds(this,_a,null);ds(this,yc,null);ds(this,Bu,0);ds(this,md,0);ds(this,bp,!1);ds(this,b0,new Set);ds(this,C0,new Set);ds(this,wc,null);ds(this,Y_,qN(()=>(us(this,wc,Ih(oi(this,Bu))),()=>{us(this,wc,null)})));var o;us(this,Na,e),us(this,Ra,t),us(this,Au,a=>{var l=Fs;l.b=this,l.f|=bw,i(a)}),this.parent=Fs.b,this.transform_error=s??((o=this.parent)==null?void 0:o.transform_error)??(a=>a),us(this,oa,pb(()=>{$s(this,No,Dw).call(this)},UN))}defer_effect(e){M3(e,oi(this,b0),oi(this,C0))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!oi(this,Ra).pending}update_pending_count(e,t){$s(this,No,Aw).call(this,e,t),us(this,Bu,oi(this,Bu)+e),!(!oi(this,wc)||oi(this,bp))&&(us(this,bp,!0),nc(()=>{us(this,bp,!1),oi(this,wc)&&Up(oi(this,wc),oi(this,Bu))}))}get_effect_pending(){return oi(this,Y_).call(this),n(oi(this,wc))}error(e){if(!oi(this,Ra).onerror&&!oi(this,Ra).failed)throw e;Zn!=null&&Zn.is_fork?(oi(this,Oa)&&Zn.skip_effect(oi(this,Oa)),oi(this,Hr)&&Zn.skip_effect(oi(this,Hr)),oi(this,_a)&&Zn.skip_effect(oi(this,_a)),Zn.oncommit(()=>{$s(this,No,Bw).call(this,e)})):$s(this,No,Bw).call(this,e)}}Na=new WeakMap,PS=new WeakMap,Ra=new WeakMap,Au=new WeakMap,oa=new WeakMap,Oa=new WeakMap,Hr=new WeakMap,_a=new WeakMap,yc=new WeakMap,Bu=new WeakMap,md=new WeakMap,bp=new WeakMap,b0=new WeakMap,C0=new WeakMap,wc=new WeakMap,Y_=new WeakMap,No=new WeakSet,ZN=function(){try{us(this,Oa,za(()=>oi(this,Au).call(this,oi(this,Na))))}catch(e){this.error(e)}},YN=function(e){const t=oi(this,Ra).failed;t&&us(this,_a,za(()=>{t(oi(this,Na),()=>e,()=>()=>{})}))},XN=function(){const e=oi(this,Ra).pending;e&&(this.is_pending=!0,us(this,Hr,za(()=>e(oi(this,Na)))),nc(()=>{var t=us(this,yc,document.createDocumentFragment()),i=Pc();t.append(i),us(this,Oa,$s(this,No,sm).call(this,()=>za(()=>oi(this,Au).call(this,i)))),oi(this,md)===0&&(oi(this,Na).before(t),us(this,yc,null),Nu(oi(this,Hr),()=>{us(this,Hr,null)}),$s(this,No,nm).call(this,Zn))}))},Dw=function(){try{if(this.is_pending=this.has_pending_snippet(),us(this,md,0),us(this,Bu,0),us(this,Oa,za(()=>{oi(this,Au).call(this,oi(this,Na))})),oi(this,md)>0){var e=us(this,yc,document.createDocumentFragment());m9(oi(this,Oa),e);const t=oi(this,Ra).pending;us(this,Hr,za(()=>t(oi(this,Na))))}else $s(this,No,nm).call(this,Zn)}catch(t){this.error(t)}},nm=function(e){this.is_pending=!1,e.transfer_effects(oi(this,b0),oi(this,C0))},sm=function(e){var t=Fs,i=As,s=yr;cc(oi(this,oa)),Qa(oi(this,oa)),qp(oi(this,oa).ctx);try{return Lh.ensure(),e()}catch(o){return P3(o),null}finally{cc(t),Qa(i),qp(s)}},Aw=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&$s(i=this.parent,No,Aw).call(i,e,t);return}us(this,md,oi(this,md)+e),oi(this,md)===0&&($s(this,No,nm).call(this,t),oi(this,Hr)&&Nu(oi(this,Hr),()=>{us(this,Hr,null)}),oi(this,yc)&&(oi(this,Na).before(oi(this,yc)),us(this,yc,null)))},Bw=function(e){oi(this,Oa)&&(fa(oi(this,Oa)),us(this,Oa,null)),oi(this,Hr)&&(fa(oi(this,Hr)),us(this,Hr,null)),oi(this,_a)&&(fa(oi(this,_a)),us(this,_a,null));var t=oi(this,Ra).onerror;let i=oi(this,Ra).failed;var s=!1,o=!1;const a=()=>{if(s){MN();return}s=!0,o&&CN(),oi(this,_a)!==null&&Nu(oi(this,_a),()=>{us(this,_a,null)}),$s(this,No,sm).call(this,()=>{$s(this,No,Dw).call(this)})},l=c=>{try{o=!0,t==null||t(c,a),o=!1}catch(u){Cd(u,oi(this,oa)&&oi(this,oa).parent)}i&&us(this,_a,$s(this,No,sm).call(this,()=>{try{return za(()=>{var u=Fs;u.b=this,u.f|=bw,i(oi(this,Na),()=>c,()=>a)})}catch(u){return Cd(u,oi(this,oa).parent),null}}))};nc(()=>{var c;try{c=this.transform_error(e)}catch(u){Cd(u,oi(this,oa)&&oi(this,oa).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(l,u=>Cd(u,oi(this,oa)&&oi(this,oa).parent)):l(c)})};function QN(r,e,t,i){const s=Wv;var o=r.filter(m=>!m.settled);if(t.length===0&&o.length===0){i(e.map(s));return}var a=Fs,l=JN(),c=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(m=>m.promise)):null;function u(m){if((a.f&Ka)===0){l();try{i(m)}catch(b){Cd(b,a)}Om()}}var g=W3();if(t.length===0){c.then(()=>u(e.map(s))).finally(g);return}function v(){Promise.all(t.map(m=>eR(m))).then(m=>u([...e.map(s),...m])).catch(m=>Cd(m,a)).finally(g)}c?c.then(()=>{l(),v(),Om()}):v()}function JN(){var r=Fs,e=As,t=yr,i=Zn;return function(o=!0){cc(r),Qa(e),qp(t),o&&(r.f&Ka)===0&&(i==null||i.activate(),i==null||i.apply())}}function Om(r=!0){cc(null),Qa(null),qp(null),r&&(Zn==null||Zn.deactivate())}function W3(){var r=Fs,e=r.b,t=Zn,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(i,r),()=>{e==null||e.update_pending_count(-1,t),t.decrement(i,r)}}function Wv(r){var e=wr|cr;return Fs!==null&&(Fs.f|=mg),{ctx:yr,deps:null,effects:null,equals:B3,f:e,fn:r,reactions:null,rv:0,v:tr,wv:0,parent:Fs,ac:null}}const px=Symbol("obsolete");function eR(r,e,t){let i=Fs;i===null&&uN();var s=void 0,o=Ih(tr),a=!As,l=new Set;return uR(()=>{var b,_;var c=Fs,u=w3();s=u.promise;try{Promise.resolve(r()).then(u.resolve,w=>{w!==db&&u.reject(w)}).finally(Om)}catch(w){u.reject(w),Om()}var g=Zn;if(a){if((c.f&xg)!==0)var v=W3();if((b=i.b)!=null&&b.is_rendered())(_=g.async_deriveds.get(c))==null||_.reject(px);else for(const w of l.values())w.reject(px);l.add(u),g.async_deriveds.set(c,u)}const m=(w,k=void 0)=>{v==null||v(),l.delete(u),k!==px&&(g.activate(),k?(o.f|=Ad,Up(o,k)):((o.f&Ad)!==0&&(o.f^=Ad),Up(o,w)),g.deactivate())};u.promise.then(m,w=>m(null,w||"unknown"))}),fb(()=>{for(const c of l)c.reject(px)}),new Promise(c=>{function u(g){function v(){g===s?c(o):u(s)}g.then(v,v)}u(s)})}function Ke(r){const e=Wv(r);return oB(e),e}function f9(r){const e=Wv(r);return e.equals=F3,e}function tR(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)fa(e[t])}}function p9(r){var e,t=Fs,i=r.parent;if(!Wc&&i!==null&&r.v!==tr&&(i.f&(Ka|Ur))!==0)return PN(),r.v;cc(i);try{r.f&=~Fh,tR(r),e=cB(r)}finally{cc(t)}return e}function j3(r){var e=p9(r);if(!r.equals(e)&&(r.wv=aB(),(!(Zn!=null&&Zn.is_fork)||r.deps===null)&&(Zn!==null?(Zn.capture(r,e,!0),uv==null||uv.capture(r,e,!0)):r.v=e,r.deps===null))){Mo(r,nr);return}Wc||(mr!==null?(g9()||Zn!=null&&Zn.is_fork)&&mr.set(r,e):d9(r))}function iR(r){var e,t;if(r.effects!==null)for(const i of r.effects)(i.teardown||i.ac)&&((e=i.teardown)==null||e.call(i),(t=i.ac)==null||t.abort(db),i.fn!==null&&(i.teardown=lr),i.ac=null,jv(i,0),x9(i))}function $3(r){if(r.effects!==null)for(const e of r.effects)e.teardown&&e.fn!==null&&Gp(e)}let zm=new Set;const Mu=new Map;let V3=!1;function Ih(r,e){var t={f:0,v:r,reactions:null,equals:B3,rv:0,wv:0};return t}function A(r,e){const t=Ih(r);return oB(t),t}function nR(r,e=!1,t=!0){const i=Ih(r);return e||(i.equals=F3),i}function p(r,e,t=!1){As!==null&&(!Cl||(As.f&Nm)!==0)&&L3()&&(As.f&(wr|bl|ap|Nm))!==0&&(sc===null||!sc.has(r))&&bN();let i=t?Mi(e):e;return Up(r,i,im)}function Up(r,e,t=null){if(!r.equals(e)){Mu.set(r,Wc?e:r.v);var i=Lh.ensure();if(i.capture(r,e),(r.f&wr)!==0){const s=r;(r.f&cr)!==0&&p9(s),mr===null&&d9(s)}r.wv=aB(),q3(r,cr,t),Fs!==null&&(Fs.f&nr)!==0&&(Fs.f&(yl|Zd))===0&&(Ma===null?fR([r]):Ma.push(r)),!i.is_fork&&zm.size>0&&!V3&&sR()}return e}function sR(){V3=!1;for(const r of zm){(r.f&nr)!==0&&Mo(r,lc);let e;try{e=V0(r)}catch{e=!0}e&&Gp(r)}zm.clear()}function Fw(r,e=1){var t=n(r),i=e===1?t++:t--;return p(r,t),i}function fv(r){p(r,r.v+1)}function q3(r,e,t){var i=r.reactions;if(i!==null)for(var s=i.length,o=0;o<s;o++){var a=i[o],l=a.f,c=(l&cr)===0;if(c&&Mo(a,e),(l&Nm)!==0)zm.add(a);else if((l&wr)!==0){var u=a;mr==null||mr.delete(u),(l&Fh)===0&&(l&Ga&&(Fs===null||(Fs.f&Rm)===0)&&(a.f|=Fh),q3(u,lc,t))}else if(c){var g=a;(l&bl)!==0&&ol!==null&&ol.add(g),t!==null?t.push(g):h9(g)}}}function Mi(r){if(typeof r!="object"||r===null||Tu in r)return r;const e=y3(r);if(e!==iN&&e!==nN)return r;var t=new Map,i=c9(r),s=A(0),o=Ru,a=l=>{if(Ru===o)return l();var c=As,u=Ru;Qa(null),mk(o);var g=l();return Qa(c),mk(u),g};return i&&t.set("length",A(r.length)),new Proxy(r,{defineProperty(l,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&mN();var g=t.get(c);return g===void 0?a(()=>{var v=A(u.value);return t.set(c,v),v}):p(g,u.value,!0),!0},deleteProperty(l,c){var u=t.get(c);if(u===void 0){if(c in l){const g=a(()=>A(tr));t.set(c,g),fv(s)}}else p(u,tr),fv(s);return!0},get(l,c,u){var b;if(c===Tu)return r;var g=t.get(c),v=c in l;if(g===void 0&&(!v||(b=rp(l,c))!=null&&b.writable)&&(g=a(()=>{var _=Mi(v?l[c]:tr),w=A(_);return w}),t.set(c,g)),g!==void 0){var m=n(g);return m===tr?void 0:m}return Reflect.get(l,c,u)},getOwnPropertyDescriptor(l,c){var u=Reflect.getOwnPropertyDescriptor(l,c);if(u&&"value"in u){var g=t.get(c);g&&(u.value=n(g))}else if(u===void 0){var v=t.get(c),m=v==null?void 0:v.v;if(v!==void 0&&m!==tr)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(l,c){var m;if(c===Tu)return!0;var u=t.get(c),g=u!==void 0&&u.v!==tr||Reflect.has(l,c);if(u!==void 0||Fs!==null&&(!g||(m=rp(l,c))!=null&&m.writable)){u===void 0&&(u=a(()=>{var b=g?Mi(l[c]):tr,_=A(b);return _}),t.set(c,u));var v=n(u);if(v===tr)return!1}return g},set(l,c,u,g){var R;var v=t.get(c),m=c in l;if(i&&c==="length")for(var b=u;b<v.v;b+=1){var _=t.get(b+"");_!==void 0?p(_,tr):b in l&&(_=a(()=>A(tr)),t.set(b+"",_))}if(v===void 0)(!m||(R=rp(l,c))!=null&&R.writable)&&(v=a(()=>A(void 0)),p(v,Mi(u)),t.set(c,v));else{m=v.v!==tr;var w=a(()=>Mi(u));p(v,w)}var k=Reflect.getOwnPropertyDescriptor(l,c);if(k!=null&&k.set&&k.set.call(g,u),!m){if(i&&typeof c=="string"){var B=t.get("length"),T=Number(c);Number.isInteger(T)&&T>=B.v&&p(B,T+1)}fv(s)}return!0},ownKeys(l){n(s);var c=Reflect.ownKeys(l).filter(v=>{var m=t.get(v);return m===void 0||m.v!==tr});for(var[u,g]of t)g.v!==tr&&!(u in l)&&c.push(u);return c},setPrototypeOf(){_N()}})}function gk(r){try{if(r!==null&&typeof r=="object"&&Tu in r)return r[Tu]}catch{}return r}function U3(r,e){return Object.is(gk(r),gk(e))}var Za,G3,K3,Z3,Y3;function oR(){if(Za===void 0){Za=window,G3=document,K3=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;Z3=rp(e,"firstChild").get,Y3=rp(e,"nextSibling").get,hk(r)&&(r[yw]=void 0,r[em]=null,r[ww]=void 0,r.__e=void 0),hk(t)&&(t[qg]=void 0)}}function Pc(r=""){return document.createTextNode(r)}function Sa(r){return Z3.call(r)}function j0(r){return Y3.call(r)}function f(r,e){return Sa(r)}function pt(r,e=!1){{var t=Sa(r);return t instanceof Comment&&t.data===""?j0(t):t}}function h(r,e=1,t=!1){let i=r;for(;e--;)i=j0(i);return i}function rR(r){r.textContent=""}function X3(){return!1}function Q3(r,e,t){return e==null||e===A3?t?document.createElement(r,{is:t}):document.createElement(r):t?document.createElementNS(e,r,{is:t}):document.createElementNS(e,r)}let vk=!1;function aR(){vk||(vk=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(const t of r.target.elements)(e=t[tm])==null||e.call(t)})},{capture:!0}))}function ub(r){var e=As,t=Fs;Qa(null),cc(null);try{return r()}finally{Qa(e),cc(t)}}function hb(r,e,t,i=t){r.addEventListener(e,()=>ub(t));const s=r[tm];s?r[tm]=()=>{s(),i(!0)}:r[tm]=()=>i(!0),aR()}function lR(r){Fs===null&&(As===null&&gN(),pN()),Wc&&fN()}function cR(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Xc(r,e){var t=Fs;t!==null&&(t.f&Ur)!==0&&(r|=Ur);var i={ctx:yr,deps:null,nodes:null,f:r|cr|Ga,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};Zn==null||Zn.register_created_effect(i);var s=i;if((r&$p)!==0)qf!==null?qf.push(i):Lh.ensure().schedule(i);else if(e!==null){try{Gp(i)}catch(a){throw fa(i),a}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&mg)===0&&(s=s.first,(r&bl)!==0&&(r&Vp)!==0&&s!==null&&(s.f|=Vp))}if(s!==null&&(s.parent=t,t!==null&&cR(s,t),As!==null&&(As.f&wr)!==0&&(r&Zd)===0)){var o=As;(o.effects??(o.effects=[])).push(s)}return i}function g9(){return As!==null&&!Cl}function fb(r){const e=Xc(cb,null);return Mo(e,nr),e.teardown=r,e}function dn(r){lR();var e=Fs.f,t=!As&&(e&yl)!==0&&yr!==null&&!yr.i;if(t){var i=yr;(i.e??(i.e=[])).push(r)}else return J3(r)}function J3(r){return Xc($p|aN,r)}function dR(r){Lh.ensure();const e=Xc(Zd|mg,r);return(t={})=>new Promise(i=>{t.outro?Nu(e,()=>{fa(e),i(void 0)}):(fa(e),i(void 0))})}function v9(r){return Xc($p,r)}function uR(r){return Xc(ap|mg,r)}function $0(r,e=0){return Xc(cb|e,r)}function I(r,e=[],t=[],i=[]){QN(i,e,t,s=>{Xc(cb,()=>r(...s.map(n)))})}function pb(r,e=0){var t=Xc(bl|e,r);return t}function za(r){return Xc(yl|mg,r)}function eB(r){var e=r.teardown;if(e!==null){const t=Wc,i=As;xk(!0),Qa(null);try{e.call(null)}finally{xk(t),Qa(i)}}}function x9(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const s=t.ac;s!==null&&ub(()=>{s.abort(db)});var i=t.next;(t.f&Zd)!==0?t.parent=null:fa(t,e),t=i}}function hR(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&yl)===0&&fa(e),e=t}}function fa(r,e=!0){var t=!1;(e||(r.f&rN)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(tB(r.nodes.start,r.nodes.end),t=!0),Mo(r,Cw),x9(r,e&&!t),jv(r,0);var i=r.nodes&&r.nodes.t;if(i!==null)for(const o of i)o.stop();eB(r),r.f^=Cw,r.f|=Ka;var s=r.parent;s!==null&&s.first!==null&&iB(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=r.b=null}function tB(r,e){for(;r!==null;){var t=r===e?null:j0(r);r.remove(),r=t}}function iB(r){var e=r.parent,t=r.prev,i=r.next;t!==null&&(t.next=i),i!==null&&(i.prev=t),e!==null&&(e.first===r&&(e.first=i),e.last===r&&(e.last=t))}function Nu(r,e,t=!0){var i=[];nB(r,i,!0);var s=()=>{t&&fa(r),e&&e()},o=i.length;if(o>0){var a=()=>--o||s();for(var l of i)l.out(a)}else s()}function nB(r,e,t){if((r.f&Ur)===0){r.f^=Ur;var i=r.nodes&&r.nodes.t;if(i!==null)for(const l of i)(l.is_global||t)&&e.push(l);for(var s=r.first;s!==null;){var o=s.next;if((s.f&Zd)===0){var a=(s.f&Vp)!==0||(s.f&yl)!==0&&(r.f&bl)!==0;nB(s,e,a?t:!1)}s=o}}}function Hm(r){sB(r,!0)}function sB(r,e){if((r.f&Ur)!==0){r.f^=Ur,(r.f&nr)===0&&(Mo(r,cr),Lh.ensure().schedule(r));for(var t=r.first;t!==null;){var i=t.next,s=(t.f&Vp)!==0||(t.f&yl)!==0;sB(t,s?e:!1),t=i}var o=r.nodes&&r.nodes.t;if(o!==null)for(const a of o)(a.is_global||e)&&a.in()}}function m9(r,e){if(r.nodes)for(var t=r.nodes.start,i=r.nodes.end;t!==null;){var s=t===i?null:j0(t);e.append(t),t=s}}let om=!1,Wc=!1;function xk(r){Wc=r}let As=null,Cl=!1;function Qa(r){As=r}let Fs=null;function cc(r){Fs=r}let sc=null;function oB(r){As!==null&&(sc??(sc=new Set)).add(r)}let ra=null,xa=0,Ma=null;function fR(r){Ma=r}let rB=1,wu=0,Ru=wu;function mk(r){Ru=r}function aB(){return++rB}function V0(r){var e=r.f;if((e&cr)!==0)return!0;if(e&wr&&(r.f&=~Fh),(e&lc)!==0){for(var t=r.deps,i=t.length,s=0;s<i;s++){var o=t[s];if(V0(o)&&j3(o),o.wv>r.wv)return!0}(e&Ga)!==0&&mr===null&&Mo(r,nr)}return!1}function lB(r,e,t=!0){var i=r.reactions;if(i!==null&&!(sc!==null&&sc.has(r)))for(var s=0;s<i.length;s++){var o=i[s];(o.f&wr)!==0?lB(o,e,!1):e===o&&(t?Mo(o,cr):(o.f&nr)!==0&&Mo(o,lc),h9(o))}}function cB(r){var w;var e=ra,t=xa,i=Ma,s=As,o=sc,a=yr,l=Cl,c=Ru,u=r.f;ra=null,xa=0,Ma=null,As=(u&(yl|Zd))===0?r:null,sc=null,qp(r.ctx),Cl=!1,Ru=++wu,r.ac!==null&&(ub(()=>{r.ac.abort(db)}),r.ac=null);try{r.f|=Rm;var g=r.fn,v=g();r.f|=xg;var m=r.deps,b=Zn==null?void 0:Zn.is_fork;if(ra!==null){var _;if(b||jv(r,xa),m!==null&&xa>0)for(m.length=xa+ra.length,_=0;_<ra.length;_++)m[xa+_]=ra[_];else r.deps=m=ra;if(g9()&&(r.f&Ga)!==0)for(_=xa;_<m.length;_++)((w=m[_]).reactions??(w.reactions=[])).push(r)}else!b&&m!==null&&xa<m.length&&(jv(r,xa),m.length=xa);if(L3()&&Ma!==null&&!Cl&&m!==null&&(r.f&(wr|lc|cr))===0)for(_=0;_<Ma.length;_++)lB(Ma[_],r);if(s!==null&&s!==r){if(wu++,s.deps!==null)for(let k=0;k<t;k+=1)s.deps[k].rv=wu;if(e!==null)for(const k of e)k.rv=wu;Ma!==null&&(i===null?i=Ma:i.push(...Ma))}return(r.f&Ad)!==0&&(r.f^=Ad),v}catch(k){return P3(k)}finally{r.f^=Rm,ra=e,xa=t,Ma=i,As=s,sc=o,qp(a),Cl=l,Ru=c}}function pR(r,e){let t=e.reactions;if(t!==null){var i=JM.call(t,r);if(i!==-1){var s=t.length-1;s===0?t=e.reactions=null:(t[i]=t[s],t.pop())}}if(t===null&&(e.f&wr)!==0&&(ra===null||!Mm.call(ra,e))){var o=e;(o.f&Ga)!==0&&(o.f^=Ga,o.f&=~Fh),o.v!==tr&&d9(o),iR(o),jv(o,0)}}function jv(r,e){var t=r.deps;if(t!==null)for(var i=e;i<t.length;i++)pR(r,t[i])}function Gp(r){var e=r.f;if((e&Ka)===0){Mo(r,nr);var t=Fs,i=om;Fs=r,om=!0;try{(e&(bl|E3))!==0?hR(r):x9(r),eB(r);var s=cB(r);r.teardown=typeof s=="function"?s:null,r.wv=rB;var o;C3&&RN&&(r.f&cr)!==0&&r.deps}finally{om=i,Fs=t}}}async function Wa(){await Promise.resolve(),$N()}function n(r){var e=r.f,t=(e&wr)!==0;if(As!==null&&!Cl){var i=Fs!==null&&(Fs.f&Ka)!==0;if(!i&&(sc===null||!sc.has(r))){var s=As.deps;if((As.f&Rm)!==0)r.rv<wu&&(r.rv=wu,ra===null&&s!==null&&s[xa]===r?xa++:ra===null?ra=[r]:ra.push(r));else{As.deps??(As.deps=[]),Mm.call(As.deps,r)||As.deps.push(r);var o=r.reactions;o===null?r.reactions=[As]:Mm.call(o,As)||o.push(As)}}}if(Wc&&Mu.has(r))return Mu.get(r);if(t){var a=r;if(Wc){var l=a.v;return((a.f&nr)===0&&a.reactions!==null||uB(a))&&(l=p9(a)),Mu.set(a,l),l}var c=(a.f&Ga)===0&&!Cl&&As!==null&&(om||(As.f&Ga)!==0),u=(a.f&xg)===0;V0(a)&&(c&&(a.f|=Ga),j3(a)),c&&!u&&($3(a),dB(a))}if(mr!=null&&mr.has(r))return mr.get(r);if((r.f&Ad)!==0)throw r.v;return r.v}function dB(r){if(r.f|=Ga,r.deps!==null)for(const e of r.deps)(e.reactions??(e.reactions=[])).push(r),(e.f&wr)!==0&&(e.f&Ga)===0&&($3(e),dB(e))}function uB(r){if(r.v===tr)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(Mu.has(e)||(e.f&wr)!==0&&uB(e))return!0;return!1}function io(r){var e=Cl;try{return Cl=!0,r()}finally{Cl=e}}const gR=["touchstart","touchmove"];function vR(r){return gR.includes(r)}const Eu=Symbol("events"),hB=new Set,Lw=new Set;function xR(r,e,t,i={}){function s(o){if(i.capture||Iw.call(e,o),!o.cancelBubble)return ub(()=>t==null?void 0:t.call(this,o))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?nc(()=>{e.addEventListener(r,s,i)}):e.addEventListener(r,s,i),s}function Ds(r,e,t,i,s){var o={capture:i,passive:s},a=xR(r,e,t,o);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&fb(()=>{e.removeEventListener(r,a,o)})}function O(r,e,t){(e[Eu]??(e[Eu]={}))[r]=t}function bs(r){for(var e=0;e<r.length;e++)hB.add(r[e]);for(var t of Lw)t(r)}let _k=null;function Iw(r){var w,k;var e=this,t=e.ownerDocument,i=r.type,s=((w=r.composedPath)==null?void 0:w.call(r))||[],o=s[0]||r.target;_k=r;var a=0,l=_k===r&&r[Eu];if(l){var c=s.indexOf(l);if(c!==-1&&(e===document||e===window)){r[Eu]=e;return}var u=s.indexOf(e);if(u===-1)return;c<=u&&(a=c)}if(o=s[a]||r.target,o!==e){eN(r,"currentTarget",{configurable:!0,get(){return o||t}});var g=As,v=Fs;Qa(null),cc(null);try{for(var m,b=[];o!==null&&o!==e;){try{var _=(k=o[Eu])==null?void 0:k[i];_!=null&&(!o.disabled||r.target===o)&&_.call(o,r)}catch(B){m?b.push(B):m=B}if(r.cancelBubble)break;a++,o=a<s.length?s[a]:null}if(m){for(let B of b)queueMicrotask(()=>{throw B});throw m}}finally{r[Eu]=e,delete r.currentTarget,Qa(g),cc(v)}}}var $5;const cC=(($5=globalThis==null?void 0:globalThis.window)==null?void 0:$5.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function mR(r){return(cC==null?void 0:cC.createHTML(r))??r}function fB(r){var e=Q3("template");return e.innerHTML=mR(r.replaceAll("<!>","<!---->")),e.content}function Yd(r,e){var t=Fs;t.nodes===null&&(t.nodes={start:r,end:e,a:null,t:null})}function E(r,e){var t=(e&D3)!==0,i=(e&FN)!==0,s,o=!r.startsWith("<!>");return()=>{s===void 0&&(s=fB(o?r:"<!>"+r),t||(s=Sa(s)));var a=i||K3?document.importNode(s,!0):s.cloneNode(!0);if(t){var l=Sa(a),c=a.lastChild;Yd(l,c)}else Yd(a,a);return a}}function _R(r,e,t="svg"){var i=!r.startsWith("<!>"),s=(e&D3)!==0,o=`<${t}>${i?r:"<!>"+r}</${t}>`,a;return()=>{if(!a){var l=fB(o),c=Sa(l);if(s)for(a=document.createDocumentFragment();Sa(c);)a.appendChild(Sa(c));else a=Sa(c)}var u=a.cloneNode(!0);if(s){var g=Sa(u),v=u.lastChild;Yd(g,v)}else Yd(u,u);return u}}function Fo(r,e){return _R(r,e,"svg")}function On(r=""){{var e=Pc(r+"");return Yd(e,e),e}}function ks(){var r=document.createDocumentFragment(),e=document.createComment(""),t=Pc();return r.append(e,t),Yd(e,t),r}function C(r,e){r!==null&&r.before(e)}function D(r,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(r[qg]??(r[qg]=r.nodeValue))&&(r[qg]=t,r.nodeValue=`${t}`)}function bR(r,e){return CR(r,e)}const gx=new Map;function CR(r,{target:e,anchor:t,props:i={},events:s,context:o,intro:a=!0,transformError:l}){oR();var c=void 0,u=dR(()=>{var g=t??e.appendChild(Pc());GN(g,{pending:()=>{}},b=>{gs({});var _=yr;o&&(_.c=o),s&&(i.$$events=s),c=r(b,i)||{},vs()},l);var v=new Set,m=b=>{for(var _=0;_<b.length;_++){var w=b[_];if(!v.has(w)){v.add(w);var k=vR(w);for(const R of[e,document]){var B=gx.get(R);B===void 0&&(B=new Map,gx.set(R,B));var T=B.get(w);T===void 0?(R.addEventListener(w,Iw,{passive:k}),B.set(w,1)):B.set(w,T+1)}}}};return m(lb(hB)),Lw.add(m),()=>{var k;for(var b of v)for(const B of[e,document]){var _=gx.get(B),w=_.get(b);--w==0?(B.removeEventListener(b,Iw),_.delete(b),_.size===0&&gx.delete(B)):_.set(b,w)}Lw.delete(m),g!==t&&((k=g.parentNode)==null||k.removeChild(g))}});return yR.set(c,u),c}let yR=new WeakMap;var cl,ql,ba,Fu,y0,w0,X_;class pB{constructor(e,t=!0){Cs(this,"anchor");ds(this,cl,new Map);ds(this,ql,new Map);ds(this,ba,new Map);ds(this,Fu,new Set);ds(this,y0,!0);ds(this,w0,e=>{if(oi(this,cl).has(e)){var t=oi(this,cl).get(e),i=oi(this,ql).get(t);if(i)Hm(i),oi(this,Fu).delete(t);else{var s=oi(this,ba).get(t);s&&(Hm(s.effect),oi(this,ql).set(t,s.effect),oi(this,ba).delete(t),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),i=s.effect)}for(const[o,a]of oi(this,cl)){if(oi(this,cl).delete(o),o===e)break;const l=oi(this,ba).get(a);l&&(fa(l.effect),oi(this,ba).delete(a))}for(const[o,a]of oi(this,ql)){if(o===t||oi(this,Fu).has(o))continue;const l=()=>{if(Array.from(oi(this,cl).values()).includes(o)){var u=document.createDocumentFragment();m9(a,u),u.append(Pc()),oi(this,ba).set(o,{effect:a,fragment:u})}else fa(a);oi(this,Fu).delete(o),oi(this,ql).delete(o)};oi(this,y0)||!i?(oi(this,Fu).add(o),Nu(a,l,!1)):l()}}});ds(this,X_,e=>{oi(this,cl).delete(e);const t=Array.from(oi(this,cl).values());for(const[i,s]of oi(this,ba))t.includes(i)||(fa(s.effect),oi(this,ba).delete(i))});this.anchor=e,us(this,y0,t)}ensure(e,t){var i=Zn,s=X3();if(t&&!oi(this,ql).has(e)&&!oi(this,ba).has(e))if(s){var o=document.createDocumentFragment(),a=Pc();o.append(a),oi(this,ba).set(e,{effect:za(()=>t(a)),fragment:o})}else oi(this,ql).set(e,za(()=>t(this.anchor)));if(oi(this,cl).set(i,e),s){for(const[l,c]of oi(this,ql))l===e?i.unskip_effect(c):i.skip_effect(c);for(const[l,c]of oi(this,ba))l===e?i.unskip_effect(c.effect):i.skip_effect(c.effect);i.oncommit(oi(this,w0)),i.ondiscard(oi(this,X_))}else oi(this,w0).call(this,i)}}cl=new WeakMap,ql=new WeakMap,ba=new WeakMap,Fu=new WeakMap,y0=new WeakMap,w0=new WeakMap,X_=new WeakMap;function P(r,e,t=!1){var i=new pB(r),s=t?Vp:0;function o(a,l){i.ensure(a,l)}pb(()=>{var a=!1;e((l,c=0)=>{a=!0,o(c,l)}),a||o(-1,null)},s)}const wR=Symbol("NaN");function gB(r,e,t){var i=new pB(r);pb(()=>{var s=e();s!==s&&(s=wR),i.ensure(s,t)})}function hn(r,e){return e}function ER(r,e,t){for(var i=[],s=e.length,o,a=e.length,l=0;l<s;l++){let v=e[l];Nu(v,()=>{if(o){if(o.pending.delete(v),o.done.add(v),o.pending.size===0){var m=r.outrogroups;Pw(r,lb(o.done)),m.delete(o),m.size===0&&(r.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=i.length===0&&t!==null;if(c){var u=t,g=u.parentNode;rR(g),g.append(u),r.items.clear()}Pw(r,e,!c)}else o={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(o)}function Pw(r,e,t=!0){var i;if(r.pending.size>0){i=new Set;for(const a of r.pending.values())for(const l of a)i.add(r.items.get(l).e)}for(var s=0;s<e.length;s++){var o=e[s];if(i!=null&&i.has(o)){o.f|=Ql;const a=document.createDocumentFragment();m9(o,a)}else fa(e[s],t)}}var bk;function di(r,e,t,i,s,o=null){var a=r,l=new Map,c=(e&k3)!==0;if(c){var u=r;a=u.appendChild(Pc())}var g=null,v=f9(()=>{var R=t();return c9(R)?R:R==null?[]:lb(R)}),m,b=new Map,_=!0;function w(R){(T.effect.f&Ka)===0&&(T.pending.delete(R),T.fallback=g,SR(T,m,a,e,i),g!==null&&(m.length===0?(g.f&Ql)===0?Hm(g):(g.f^=Ql,Kg(g,null,a)):Nu(g,()=>{g=null})))}function k(R){T.pending.delete(R)}var B=pb(()=>{m=n(v);for(var R=m.length,N=new Set,H=Zn,q=X3(),V=0;V<R;V+=1){var J=m[V],ae=i(J,V),oe=_?null:l.get(ae);oe?(oe.v&&Up(oe.v,J),oe.i&&Up(oe.i,V),q&&H.unskip_effect(oe.e)):(oe=kR(l,_?a:bk??(bk=Pc()),J,ae,V,s,e,t),_||(oe.e.f|=Ql),l.set(ae,oe)),N.add(ae)}if(R===0&&o&&!g&&(_?g=za(()=>o(a)):(g=za(()=>o(bk??(bk=Pc()))),g.f|=Ql)),R>N.size&&hN(),!_)if(b.set(H,N),q){for(const[Q,se]of l)N.has(Q)||H.skip_effect(se.e);H.oncommit(w),H.ondiscard(k)}else w(H);n(v)}),T={effect:B,items:l,pending:b,outrogroups:null,fallback:g};_=!1}function Ig(r){for(;r!==null&&(r.f&yl)===0;)r=r.next;return r}function SR(r,e,t,i,s){var oe,Q,se,fe,ne,ye,_e,Ne,xe;var o=(i&EN)!==0,a=e.length,l=r.items,c=Ig(r.effect.first),u,g=null,v,m=[],b=[],_,w,k,B;if(o)for(B=0;B<a;B+=1)_=e[B],w=s(_,B),k=l.get(w).e,(k.f&Ql)===0&&((Q=(oe=k.nodes)==null?void 0:oe.a)==null||Q.measure(),(v??(v=new Set)).add(k));for(B=0;B<a;B+=1){if(_=e[B],w=s(_,B),k=l.get(w).e,r.outrogroups!==null)for(const mt of r.outrogroups)mt.pending.delete(k),mt.done.delete(k);if((k.f&Ur)!==0&&(Hm(k),o&&((fe=(se=k.nodes)==null?void 0:se.a)==null||fe.unfix(),(v??(v=new Set)).delete(k))),(k.f&Ql)!==0)if(k.f^=Ql,k===c)Kg(k,null,t);else{var T=g?g.next:c;k===r.effect.last&&(r.effect.last=k.prev),k.prev&&(k.prev.next=k.next),k.next&&(k.next.prev=k.prev),id(r,g,k),id(r,k,T),Kg(k,T,t),g=k,m=[],b=[],c=Ig(g.next);continue}if(k!==c){if(u!==void 0&&u.has(k)){if(m.length<b.length){var R=b[0],N;g=R.prev;var H=m[0],q=m[m.length-1];for(N=0;N<m.length;N+=1)Kg(m[N],R,t);for(N=0;N<b.length;N+=1)u.delete(b[N]);id(r,H.prev,q.next),id(r,g,H),id(r,q,R),c=R,g=q,B-=1,m=[],b=[]}else u.delete(k),Kg(k,c,t),id(r,k.prev,k.next),id(r,k,g===null?r.effect.first:g.next),id(r,g,k),g=k;continue}for(m=[],b=[];c!==null&&c!==k;)(u??(u=new Set)).add(c),b.push(c),c=Ig(c.next);if(c===null)continue}(k.f&Ql)===0&&m.push(k),g=k,c=Ig(k.next)}if(r.outrogroups!==null){for(const mt of r.outrogroups)mt.pending.size===0&&(Pw(r,lb(mt.done)),(ne=r.outrogroups)==null||ne.delete(mt));r.outrogroups.size===0&&(r.outrogroups=null)}if(c!==null||u!==void 0){var V=[];if(u!==void 0)for(k of u)(k.f&Ur)===0&&V.push(k);for(;c!==null;)(c.f&Ur)===0&&c!==r.fallback&&V.push(c),c=Ig(c.next);var J=V.length;if(J>0){var ae=(i&k3)!==0&&a===0?t:null;if(o){for(B=0;B<J;B+=1)(_e=(ye=V[B].nodes)==null?void 0:ye.a)==null||_e.measure();for(B=0;B<J;B+=1)(xe=(Ne=V[B].nodes)==null?void 0:Ne.a)==null||xe.fix()}ER(r,V,ae)}}o&&nc(()=>{var mt,He;if(v!==void 0)for(k of v)(He=(mt=k.nodes)==null?void 0:mt.a)==null||He.apply()})}function kR(r,e,t,i,s,o,a,l){var c=(a&yN)!==0?(a&SN)===0?nR(t,!1,!1):Ih(t):null,u=(a&wN)!==0?Ih(s):null;return{v:c,i:u,e:za(()=>(o(e,c??t,u??s,l),()=>{r.delete(i)}))}}function Kg(r,e,t){if(r.nodes)for(var i=r.nodes.start,s=r.nodes.end,o=e&&(e.f&Ql)===0?e.nodes.start:t;i!==null;){var a=j0(i);if(o.before(i),i===s)return;i=a}}function id(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function yd(r,e,t=!1,i=!1,s=!1,o=!1){var a=r,l="";if(t)var c=r;I(()=>{var u=Fs;if(l!==(l=e()??"")){if(t){u.nodes=null,c.innerHTML=l,l!==""&&Yd(Sa(c),c.lastChild);return}if(u.nodes!==null&&(tB(u.nodes.start,u.nodes.end),u.nodes=null),l!==""){var g=i?LN:s?IN:void 0,v=Q3(i?"svg":s?"math":"template",g);v.innerHTML=l;var m=i||s?v:v.content;if(Yd(Sa(m),m.lastChild),i||s)for(;Sa(m);)a.before(Sa(m));else a.before(m)}}})}function vB(r){var e,t,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(e=0;e<s;e++)r[e]&&(t=vB(r[e]))&&(i&&(i+=" "),i+=t)}else for(t in r)r[t]&&(i&&(i+=" "),i+=t);return i}function DR(){for(var r,e,t=0,i="",s=arguments.length;t<s;t++)(r=arguments[t])&&(e=vB(r))&&(i&&(i+=" "),i+=e);return i}function lp(r){return typeof r=="object"?DR(r):r??""}const Ck=[...`
3
3
  \r\f \v\uFEFF`];function AR(r,e,t){var i=r==null?"":""+r;if(e&&(i=i?i+" "+e:e),t){for(var s of Object.keys(t))if(t[s])i=i?i+" "+s:s;else if(i.length)for(var o=s.length,a=0;(a=i.indexOf(s,a))>=0;){var l=a+o;(a===0||Ck.includes(i[a-1]))&&(l===i.length||Ck.includes(i[l]))?i=(a===0?"":i.substring(0,a))+i.substring(l+1):a=l}}return i===""?null:i}function yk(r,e=!1){var t=e?" !important;":";",i="";for(var s of Object.keys(r)){var o=r[s];o!=null&&o!==""&&(i+=" "+s+": "+o+t)}return i}function dC(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function BR(r,e){if(e){var t="",i,s;if(Array.isArray(e)?(i=e[0],s=e[1]):i=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,a=0,l=!1,c=[];i&&c.push(...Object.keys(i).map(dC)),s&&c.push(...Object.keys(s).map(dC));var u=0,g=-1;const w=r.length;for(var v=0;v<w;v++){var m=r[v];if(l?m==="/"&&r[v-1]==="*"&&(l=!1):o?o===m&&(o=!1):m==="/"&&r[v+1]==="*"?l=!0:m==='"'||m==="'"?o=m:m==="("?a++:m===")"&&a--,!l&&o===!1&&a===0){if(m===":"&&g===-1)g=v;else if(m===";"||v===w-1){if(g!==-1){var b=dC(r.substring(u,g).trim());if(!c.includes(b)){m!==";"&&v++;var _=r.substring(u,v).trim();t+=" "+_+";"}}u=v+1,g=-1}}}}return i&&(t+=yk(i)),s&&(t+=yk(s,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function Mt(r,e,t,i,s,o){var a=r[yw];if(a!==t||a===void 0){var l=AR(t,i,o);l==null?r.removeAttribute("class"):e?r.className=l:r.setAttribute("class",l),r[yw]=t}else if(o&&s!==o)for(var c in o){var u=!!o[c];(s==null||u!==!!s[c])&&r.classList.toggle(c,u)}return o}function uC(r,e={},t,i){for(var s in t){var o=t[s];e[s]!==o&&(t[s]==null?r.style.removeProperty(s):r.style.setProperty(s,o,i))}}function Vo(r,e,t,i){var s=r[ww];if(s!==e){var o=BR(e,i);o==null?r.removeAttribute("style"):r.style.cssText=o,r[ww]=e}else i&&(Array.isArray(i)?(uC(r,t==null?void 0:t[0],i[0]),uC(r,t==null?void 0:t[1],i[1],"important")):uC(r,t,i));return i}function Ph(r,e,t=!1){if(r.multiple){if(e==null)return;if(!c9(e))return TN();for(var i of r.options)i.selected=e.includes(pv(i));return}for(i of r.options){var s=pv(i);if(U3(s,e)){i.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Kp(r){var e=new MutationObserver(()=>{Ph(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),fb(()=>{e.disconnect()})}function Zs(r,e,t=e){var i=new WeakSet,s=!0;hb(r,"change",o=>{var a=o?"[selected]":":checked",l;if(r.multiple)l=[].map.call(r.querySelectorAll(a),pv);else{var c=r.querySelector(a)??r.querySelector("option:not([disabled])");l=c&&pv(c)}t(l),r.__value=l,Zn!==null&&i.add(Zn)}),v9(()=>{var o=e();if(r===document.activeElement){var a=Zn;if(i.has(a))return}if(Ph(r,o,s),s&&o===void 0){var l=r.querySelector(":checked");l!==null&&(o=pv(l),t(o))}r.__value=o,s=!1}),Kp(r)}function pv(r){return"__value"in r?r.__value:r.value}const FR=Symbol("is custom element"),LR=Symbol("is html"),IR=dN?"progress":"PROGRESS";function ml(r,e){var t=_9(r);t.value===(t.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!==IR)||(r.value=e??"")}function Xo(r,e){var t=_9(r);t.checked!==(t.checked=e??void 0)&&(r.checked=e)}function li(r,e,t,i){var s=_9(r);s[e]!==(s[e]=t)&&(e==="loading"&&(r[cN]=t),t==null?r.removeAttribute(e):typeof t!="string"&&PR(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function _9(r){return r[em]??(r[em]={[FR]:r.nodeName.includes("-"),[LR]:r.namespaceURI===A3})}var wk=new Map;function PR(r){var e=r.getAttribute("is")||r.nodeName,t=wk.get(e);if(t)return t;wk.set(e,t=[]);for(var i,s=r,o=Element.prototype;o!==s;){i=tN(s);for(var a in i)i[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&t.push(a);s=y3(s)}return t}function wi(r,e,t=e){var i=new WeakSet;hb(r,"input",async s=>{var o=s?r.defaultValue:r.value;if(o=fC(r)?pC(o):o,t(o),Zn!==null&&i.add(Zn),await Wa(),o!==(o=e())){var a=r.selectionStart,l=r.selectionEnd,c=r.value.length;if(r.value=o??"",l!==null){var u=r.value.length;a===l&&l===c&&u>c?(r.selectionStart=u,r.selectionEnd=u):(r.selectionStart=a,r.selectionEnd=Math.min(l,u))}}}),io(e)==null&&r.value&&(t(fC(r)?pC(r.value):r.value),Zn!==null&&i.add(Zn)),$0(()=>{var s=e();if(r===document.activeElement){var o=Zn;if(i.has(o))return}fC(r)&&s===pC(r.value)||r.type==="date"&&!s&&!r.value||s!==r.value&&(r.value=s??"")})}const hC=new Set;function Ou(r,e,t,i,s=i){var o=t.getAttribute("type")==="checkbox",a=r;if(e!==null)for(var l of e)a=a[l]??(a[l]=[]);a.push(t),hb(t,"change",()=>{var c=t.__value;o&&(c=TR(a,c,t.checked)),s(c)},()=>s(o?[]:null)),$0(()=>{var c=i();o?(c=c||[],t.checked=c.includes(t.__value)):t.checked=U3(t.__value,c)}),fb(()=>{var c=a.indexOf(t);c!==-1&&a.splice(c,1)}),hC.has(a)||(hC.add(a),nc(()=>{a.sort((c,u)=>c.compareDocumentPosition(u)===4?-1:1),hC.delete(a)})),nc(()=>{})}function Ps(r,e,t=e){hb(r,"change",i=>{var s=i?r.defaultChecked:r.checked;t(s)}),io(e)==null&&t(r.checked),$0(()=>{var i=e();r.checked=!!i})}function TR(r,e,t){for(var i=new Set,s=0;s<r.length;s+=1)r[s].checked&&i.add(r[s].__value);return t||i.delete(e),Array.from(i)}function fC(r){var e=r.type;return e==="number"||e==="range"}function pC(r){return r===""?null:+r}var _d,Cp,E0,Q_,xB;const J_=class J_{constructor(e){ds(this,Q_);ds(this,_d,new WeakMap);ds(this,Cp);ds(this,E0);us(this,E0,e)}observe(e,t){var i=oi(this,_d).get(e)||new Set;return i.add(t),oi(this,_d).set(e,i),$s(this,Q_,xB).call(this).observe(e,oi(this,E0)),()=>{var s=oi(this,_d).get(e);s.delete(t),s.size===0&&(oi(this,_d).delete(e),oi(this,Cp).unobserve(e))}}};_d=new WeakMap,Cp=new WeakMap,E0=new WeakMap,Q_=new WeakSet,xB=function(){return oi(this,Cp)??us(this,Cp,new ResizeObserver(e=>{for(var t of e){J_.entries.set(t.target,t);for(var i of oi(this,_d).get(t.target)||[])i(t)}}))},Cs(J_,"entries",new WeakMap);let Tw=J_;var MR=new Tw({box:"border-box"});function NR(r,e,t){var i=MR.observe(r,()=>t(r[e]));v9(()=>(io(()=>t(r[e])),i))}function gC(r,e){return r===e||(r==null?void 0:r[Tu])===e}function ls(r={},e,t,i){var s=yr.r,o=Fs;return v9(()=>{var a,l;return $0(()=>{a=l,l=[],io(()=>{gC(t(...l),r)||(e(r,...l),a&&gC(t(...a),r)&&e(null,...a))})}),()=>{let c=o;for(;c!==s&&c.parent!==null&&c.parent.f&Cw;)c=c.parent;const u=()=>{l&&gC(t(...l),r)&&e(null,...l)},g=c.teardown;c.teardown=()=>{u(),g==null||g()}}}),r}function jn(r,e,t,i){var N;var s=!0,o=(t&AN)!==0,a=(t&BN)!==0,l=i,c=!0,u=void 0,g=()=>a&&s?(u??(u=Wv(i)),n(u)):(c&&(c=!1,l=a?io(i):i),l);let v;if(o){var m=Tu in r||lN in r;v=((N=rp(r,e))==null?void 0:N.set)??(m&&e in r?H=>r[e]=H:void 0)}var b,_=!1;o?[b,_]=HN(()=>r[e]):b=r[e],b===void 0&&i!==void 0&&(b=g(),v&&(xN(),v(b)));var w;if(w=()=>{var H=r[e];return H===void 0?g():(c=!0,H)},(t&DN)===0)return w;if(v){var k=r.$$legacy;return(function(H,q){return arguments.length>0?((!q||k||_)&&v(q?w():H),H):w()})}var B=!1,T=((t&kN)!==0?Wv:f9)(()=>(B=!1,w()));o&&n(T);var R=Fs;return(function(H,q){if(arguments.length>0){const V=q?n(T):o?Mi(H):H;return p(T,V),B=!0,l!==void 0&&(l=V),H}return Wc&&B||(R.f&Ka)!==0?T.v:n(T)})}function Us(r){yr===null&&S3(),dn(()=>{const e=io(r);if(typeof e=="function")return e})}function da(r){yr===null&&S3(),Us(()=>()=>io(r))}const RR="5";var V5;typeof window<"u"&&((V5=window.__svelte??(window.__svelte={})).v??(V5.v=new Set)).add(RR);/*!-----------------------------------------------------------------------------
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,7 +10,7 @@ var mI=Object.defineProperty;var T8=r=>{throw TypeError(r)};var _I=(r,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 KR=Object.defineProperty,ZR=Object.getOwnPropertyDescriptor,YR=Object.getOwnPropertyNames,XR=Object.prototype.hasOwnProperty,QR=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of YR(e))!XR.call(r,s)&&s!==t&&KR(r,s,{get:()=>e[s],enumerable:!(i=ZR(e,s))||i.enumerable});return r},JR=(r,e,t)=>(QR(r,e,"default"),t),eO="5.4.5",Zp={};JR(Zp,U5);var bB=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(bB||{}),CB=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(CB||{}),yB=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(yB||{}),wB=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(wB||{}),EB=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(EB||{}),SB=class{constructor(r,e,t,i,s){this._onDidChange=new Zp.Emitter,this._onDidExtraLibsChange=new Zp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(s),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(r,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===r)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:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[t];s&&s.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},tO=eO,kB={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},DB=new SB({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},kB),AB=new SB({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},kB),iO=()=>gb().then(r=>r.getTypeScriptWorker()),nO=()=>gb().then(r=>r.getJavaScriptWorker());Zp.languages.typescript={ModuleKind:bB,JsxEmit:CB,NewLineKind:yB,ScriptTarget:wB,ModuleResolutionKind:EB,typescriptVersion:tO,typescriptDefaults:DB,javascriptDefaults:AB,getTypeScriptWorker:iO,getJavaScriptWorker:nO};function gb(){return q5(()=>import("./tsMode-20i8zomj.js"),__vite__mapDeps([3,1,2]))}Zp.languages.onLanguage("typescript",()=>gb().then(r=>r.setupTypeScript(DB)));Zp.languages.onLanguage("javascript",()=>gb().then(r=>r.setupJavaScript(AB)));class sO extends Nr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:En("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Wn.map,toggled:Ei.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ei.has("isInDiffEditor"),menu:{when:Ei.has("isInDiffEditor"),id:pn.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Gs),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class BB extends Nr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:En("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ei.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gs),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class FB extends Nr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:En("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ei.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gs),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const U0=En("diffEditor","Diff Editor");class oO extends wl{constructor(){super({id:"diffEditor.switchSide",title:En("switchSide","Switch Side"),icon:Wn.arrowSwap,precondition:Ei.has("isInDiffEditor"),f1:!0,category:U0})}runEditorCommand(e,t,i){const s=_g(e);if(s instanceof S0){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class rO extends wl{constructor(){super({id:"diffEditor.exitCompareMove",title:En("exitCompareMove","Exit Compare Move"),icon:Wn.close,precondition:Le.comparingMovedCode,f1:!1,category:U0,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const s=_g(e);s instanceof S0&&s.exitCompareMove()}}class aO extends wl{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:En("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Wn.fold,precondition:Ei.has("isInDiffEditor"),f1:!0,category:U0})}runEditorCommand(e,t,...i){const s=_g(e);s instanceof S0&&s.collapseAllUnchangedRegions()}}class lO extends wl{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:En("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Wn.unfold,precondition:Ei.has("isInDiffEditor"),f1:!0,category:U0})}runEditorCommand(e,t,...i){const s=_g(e);s instanceof S0&&s.showAllUnchangedRegions()}}class Mw extends Nr{constructor(){super({id:"diffEditor.revert",title:En("revert","Revert"),f1:!1,category:U0})}run(e,t){const i=cO(e,t.originalUri,t.modifiedUri);i instanceof S0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const LB=En("accessibleDiffViewer","Accessible Diff Viewer"),e1=class e1 extends Nr{constructor(){super({id:e1.id,title:En("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:LB,precondition:Ei.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=_g(e);t==null||t.accessibleDiffViewerNext()}};e1.id="editor.action.accessibleDiffViewer.next";let $v=e1;const t1=class t1 extends Nr{constructor(){super({id:t1.id,title:En("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:LB,precondition:Ei.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=_g(e);t==null||t.accessibleDiffViewerPrev()}};t1.id="editor.action.accessibleDiffViewer.prev";let Wm=t1;function cO(r,e,t){return r.get(vo).listDiffEditors().find(o=>{var c,u;const a=o.getModifiedEditor(),l=o.getOriginalEditor();return a&&((c=a.getModel())==null?void 0:c.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function _g(r){const t=r.get(vo).listDiffEditors(),i=G5();if(i)for(const s of t){const o=s.getContainerDomNode();if(dO(o,i))return s}return null}function dO(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}Ls(sO);Ls(BB);Ls(FB);Ya.appendMenuItem(pn.EditorTitle,{command:{id:new FB().desc.id,title:M("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ei.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ei.has("isInDiffEditor")},order:11,group:"1_diff",when:Ei.and(Le.diffEditorRenderSideBySideInlineBreakpointReached,Ei.has("isInDiffEditor"))});Ya.appendMenuItem(pn.EditorTitle,{command:{id:new BB().desc.id,title:M("showMoves","Show Moved Code Blocks"),icon:Wn.move,toggled:bI.create("config.diffEditor.experimental.showMoves",!0),precondition:Ei.has("isInDiffEditor")},order:10,group:"1_diff",when:Ei.has("isInDiffEditor")});Ls(Mw);for(const r of[{icon:Wn.arrowRight,key:Le.diffEditorInlineMode.toNegated()},{icon:Wn.discard,key:Le.diffEditorInlineMode}])Ya.appendMenuItem(pn.DiffEditorHunkToolbar,{command:{id:new Mw().desc.id,title:M("revertHunk","Revert Block"),icon:r.icon},when:Ei.and(Le.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),Ya.appendMenuItem(pn.DiffEditorSelectionToolbar,{command:{id:new Mw().desc.id,title:M("revertSelection","Revert Selection"),icon:r.icon},when:Ei.and(Le.diffEditorModifiedWritable,r.key),order:5,group:"primary"});Ls(oO);Ls(rO);Ls(aO);Ls(lO);Ya.appendMenuItem(pn.EditorTitle,{command:{id:$v.id,title:M("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ei.has("isInDiffEditor")},order:10,group:"2_diff",when:Ei.and(Le.accessibleDiffViewerVisible.negate(),Ei.has("isInDiffEditor"))});js.registerCommandAlias("editor.action.diffReview.next",$v.id);Ls($v);js.registerCommandAlias("editor.action.diffReview.prev",Wm.id);Ls(Wm);var uO=function(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},hO=function(r,e){return function(t,i){e(t,i,r)}},Nw;const vb=new hs("selectionAnchorSet",!1);var ju;let Xd=(ju=class{static get(e){return e.getContribution(Nw.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=vb.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(Nn.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new xr().appendText(M("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Xa(M("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(Nn.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()}},Nw=ju,ju.ID="editor.contrib.selectionAnchorController",ju);Xd=Nw=uO([hO(1,ws)],Xd);class fO extends Vi{constructor(){super({id:"editor.action.setSelectionAnchor",label:M("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Le.editorTextFocus,primary:_o(2089,2080),weight:100}})}async run(e,t){var i;(i=Xd.get(t))==null||i.setSelectionAnchor()}}class pO extends Vi{constructor(){super({id:"editor.action.goToSelectionAnchor",label:M("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:vb})}async run(e,t){var i;(i=Xd.get(t))==null||i.goToSelectionAnchor()}}class gO extends Vi{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:M("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:vb,kbOpts:{kbExpr:Le.editorTextFocus,primary:_o(2089,2089),weight:100}})}async run(e,t){var i;(i=Xd.get(t))==null||i.selectFromAnchorToCursor()}}class vO extends Vi{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:M("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:vb,kbOpts:{kbExpr:Le.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Xd.get(t))==null||i.cancelSelectionAnchor()}}ns(Xd.ID,Xd,4);pi(fO);pi(pO);pi(gO);pi(vO);const xO=yn("editorOverviewRuler.bracketMatchForeground","#A0A0A0",M("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class mO extends Vi{constructor(){super({id:"editor.action.jumpToBracket",label:M("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:Le.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Th.get(t))==null||i.jumpToBracket()}}class _O extends Vi{constructor(){super({id:"editor.action.selectToBracket",label:M("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:En("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 o;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(o=Th.get(t))==null||o.selectToBracket(s)}}class bO extends Vi{constructor(){super({id:"editor.action.removeBrackets",label:M("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:Le.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Th.get(t))==null||i.removeBrackets(this.id)}}class CO{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const ud=class ud extends nn{static get(e){return e.getContribution(ud.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Ao(()=>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 s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let a=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?a=o[1].getStartPosition():o[1].containsPosition(s)&&(a=o[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(s);if(l)a=l[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(s);c&&c.range&&(a=c.range.getStartPosition())}}return a?new Nn(a.lineNumber,a.column,a.lineNumber,a.column):new Nn(s.lineNumber,s.column,s.lineNumber,s.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(s=>{const o=s.getStartPosition();let a=t.bracketPairs.matchBracket(o);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(o),!a)){const u=t.bracketPairs.findNextBracket(o);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,c=null;if(a){a.sort(ut.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),c=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(o)){const v=l;l=c,c=v}}l&&c&&i.push(new Nn(l.lineNumber,l.column,c.lineNumber,c.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 s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[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 s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[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 s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let a=0;for(let v=0,m=e.length;v<m;v++){const b=e[v];b.isEmpty()&&(o[a++]=b.getStartPosition())}o.length>1&&o.sort(kn.compare);const l=[];let c=0,u=0;const g=s.length;for(let v=0,m=o.length;v<m;v++){const b=o[v];for(;u<g&&s[u].position.isBefore(b);)u++;if(u<g&&s[u].position.equals(b))l[c++]=s[u];else{let _=t.bracketPairs.matchBracket(b,20),w=ud._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(b,20),w=ud._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[c++]=new CO(b,_,w)}}this._lastBracketsData=l,this._lastVersionId=i}};ud.ID="editor.contrib.bracketMatchingController",ud._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=as.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Eo(xO),position:ec.Center}}),ud._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=as.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Th=ud;ns(Th.ID,Th,1);pi(_O);pi(mO);pi(bO);Ya.appendMenuItem(pn.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:M({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class yO{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,s=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&s===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new ut(i,s-1,i,s),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new ut(i,o,i,o),l)}else{const a=new ut(i,o,i,o+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new ut(i,s,i,s),l)}}computeCursorState(e,t){return this._isMovingLeft?new Nn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Nn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class IB extends Vi{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],s=t.getSelections();for(const o of s)i.push(new yO(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class wO extends IB{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:M("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:Le.writable})}}class EO extends IB{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:M("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:Le.writable})}}pi(wO);pi(EO);class SO extends Vi{constructor(){super({id:"editor.action.transposeLetters",label:M("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:Le.writable,kbOpts:{kbExpr:Le.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=[],o=t.getSelections();for(const a of o){if(!a.isEmpty())continue;const l=a.startLineNumber,c=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(c===1||c===2&&u===2))continue;const g=c===u?a.getPosition():eC.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),v=eC.leftPosition(i,g),m=eC.leftPosition(i,v),b=i.getValueInRange(ut.fromPositions(m,v)),_=i.getValueInRange(ut.fromPositions(v,g)),w=ut.fromPositions(m,g);s.push(new k0(w,_+b))}s.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}pi(SO);const xb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let s=0;s<i.length;s++)i[s]=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(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let s=0,o="";return o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o}})();function b9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function kO(r,e,t){const i={id:xb(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class PB{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 Fc.some(this,([i,s])=>s.asFile())&&t.push("files"),MB(jm(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 jm(e)}}function jm(r){return r.toLowerCase()}function TB(r,e){return MB(jm(r),e.map(jm))}function MB(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(a=>a.startsWith(s+"/")):!1}const mb=Object.freeze({create:r=>K5(r.map(e=>e.toString())).join(`\r
13
+ *-----------------------------------------------------------------------------*/var KR=Object.defineProperty,ZR=Object.getOwnPropertyDescriptor,YR=Object.getOwnPropertyNames,XR=Object.prototype.hasOwnProperty,QR=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of YR(e))!XR.call(r,s)&&s!==t&&KR(r,s,{get:()=>e[s],enumerable:!(i=ZR(e,s))||i.enumerable});return r},JR=(r,e,t)=>(QR(r,e,"default"),t),eO="5.4.5",Zp={};JR(Zp,U5);var bB=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(bB||{}),CB=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(CB||{}),yB=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(yB||{}),wB=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(wB||{}),EB=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(EB||{}),SB=class{constructor(r,e,t,i,s){this._onDidChange=new Zp.Emitter,this._onDidExtraLibsChange=new Zp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(s),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(r,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===r)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:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[t];s&&s.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},tO=eO,kB={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},DB=new SB({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},kB),AB=new SB({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},kB),iO=()=>gb().then(r=>r.getTypeScriptWorker()),nO=()=>gb().then(r=>r.getJavaScriptWorker());Zp.languages.typescript={ModuleKind:bB,JsxEmit:CB,NewLineKind:yB,ScriptTarget:wB,ModuleResolutionKind:EB,typescriptVersion:tO,typescriptDefaults:DB,javascriptDefaults:AB,getTypeScriptWorker:iO,getJavaScriptWorker:nO};function gb(){return q5(()=>import("./tsMode-DmHeR7H2.js"),__vite__mapDeps([3,1,2]))}Zp.languages.onLanguage("typescript",()=>gb().then(r=>r.setupTypeScript(DB)));Zp.languages.onLanguage("javascript",()=>gb().then(r=>r.setupJavaScript(AB)));class sO extends Nr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:En("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Wn.map,toggled:Ei.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ei.has("isInDiffEditor"),menu:{when:Ei.has("isInDiffEditor"),id:pn.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Gs),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class BB extends Nr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:En("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ei.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gs),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class FB extends Nr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:En("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ei.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gs),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const U0=En("diffEditor","Diff Editor");class oO extends wl{constructor(){super({id:"diffEditor.switchSide",title:En("switchSide","Switch Side"),icon:Wn.arrowSwap,precondition:Ei.has("isInDiffEditor"),f1:!0,category:U0})}runEditorCommand(e,t,i){const s=_g(e);if(s instanceof S0){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class rO extends wl{constructor(){super({id:"diffEditor.exitCompareMove",title:En("exitCompareMove","Exit Compare Move"),icon:Wn.close,precondition:Le.comparingMovedCode,f1:!1,category:U0,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const s=_g(e);s instanceof S0&&s.exitCompareMove()}}class aO extends wl{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:En("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Wn.fold,precondition:Ei.has("isInDiffEditor"),f1:!0,category:U0})}runEditorCommand(e,t,...i){const s=_g(e);s instanceof S0&&s.collapseAllUnchangedRegions()}}class lO extends wl{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:En("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Wn.unfold,precondition:Ei.has("isInDiffEditor"),f1:!0,category:U0})}runEditorCommand(e,t,...i){const s=_g(e);s instanceof S0&&s.showAllUnchangedRegions()}}class Mw extends Nr{constructor(){super({id:"diffEditor.revert",title:En("revert","Revert"),f1:!1,category:U0})}run(e,t){const i=cO(e,t.originalUri,t.modifiedUri);i instanceof S0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const LB=En("accessibleDiffViewer","Accessible Diff Viewer"),e1=class e1 extends Nr{constructor(){super({id:e1.id,title:En("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:LB,precondition:Ei.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=_g(e);t==null||t.accessibleDiffViewerNext()}};e1.id="editor.action.accessibleDiffViewer.next";let $v=e1;const t1=class t1 extends Nr{constructor(){super({id:t1.id,title:En("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:LB,precondition:Ei.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=_g(e);t==null||t.accessibleDiffViewerPrev()}};t1.id="editor.action.accessibleDiffViewer.prev";let Wm=t1;function cO(r,e,t){return r.get(vo).listDiffEditors().find(o=>{var c,u;const a=o.getModifiedEditor(),l=o.getOriginalEditor();return a&&((c=a.getModel())==null?void 0:c.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function _g(r){const t=r.get(vo).listDiffEditors(),i=G5();if(i)for(const s of t){const o=s.getContainerDomNode();if(dO(o,i))return s}return null}function dO(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}Ls(sO);Ls(BB);Ls(FB);Ya.appendMenuItem(pn.EditorTitle,{command:{id:new FB().desc.id,title:M("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ei.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ei.has("isInDiffEditor")},order:11,group:"1_diff",when:Ei.and(Le.diffEditorRenderSideBySideInlineBreakpointReached,Ei.has("isInDiffEditor"))});Ya.appendMenuItem(pn.EditorTitle,{command:{id:new BB().desc.id,title:M("showMoves","Show Moved Code Blocks"),icon:Wn.move,toggled:bI.create("config.diffEditor.experimental.showMoves",!0),precondition:Ei.has("isInDiffEditor")},order:10,group:"1_diff",when:Ei.has("isInDiffEditor")});Ls(Mw);for(const r of[{icon:Wn.arrowRight,key:Le.diffEditorInlineMode.toNegated()},{icon:Wn.discard,key:Le.diffEditorInlineMode}])Ya.appendMenuItem(pn.DiffEditorHunkToolbar,{command:{id:new Mw().desc.id,title:M("revertHunk","Revert Block"),icon:r.icon},when:Ei.and(Le.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),Ya.appendMenuItem(pn.DiffEditorSelectionToolbar,{command:{id:new Mw().desc.id,title:M("revertSelection","Revert Selection"),icon:r.icon},when:Ei.and(Le.diffEditorModifiedWritable,r.key),order:5,group:"primary"});Ls(oO);Ls(rO);Ls(aO);Ls(lO);Ya.appendMenuItem(pn.EditorTitle,{command:{id:$v.id,title:M("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ei.has("isInDiffEditor")},order:10,group:"2_diff",when:Ei.and(Le.accessibleDiffViewerVisible.negate(),Ei.has("isInDiffEditor"))});js.registerCommandAlias("editor.action.diffReview.next",$v.id);Ls($v);js.registerCommandAlias("editor.action.diffReview.prev",Wm.id);Ls(Wm);var uO=function(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},hO=function(r,e){return function(t,i){e(t,i,r)}},Nw;const vb=new hs("selectionAnchorSet",!1);var ju;let Xd=(ju=class{static get(e){return e.getContribution(Nw.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=vb.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(Nn.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new xr().appendText(M("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Xa(M("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(Nn.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()}},Nw=ju,ju.ID="editor.contrib.selectionAnchorController",ju);Xd=Nw=uO([hO(1,ws)],Xd);class fO extends Vi{constructor(){super({id:"editor.action.setSelectionAnchor",label:M("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Le.editorTextFocus,primary:_o(2089,2080),weight:100}})}async run(e,t){var i;(i=Xd.get(t))==null||i.setSelectionAnchor()}}class pO extends Vi{constructor(){super({id:"editor.action.goToSelectionAnchor",label:M("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:vb})}async run(e,t){var i;(i=Xd.get(t))==null||i.goToSelectionAnchor()}}class gO extends Vi{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:M("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:vb,kbOpts:{kbExpr:Le.editorTextFocus,primary:_o(2089,2089),weight:100}})}async run(e,t){var i;(i=Xd.get(t))==null||i.selectFromAnchorToCursor()}}class vO extends Vi{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:M("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:vb,kbOpts:{kbExpr:Le.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Xd.get(t))==null||i.cancelSelectionAnchor()}}ns(Xd.ID,Xd,4);pi(fO);pi(pO);pi(gO);pi(vO);const xO=yn("editorOverviewRuler.bracketMatchForeground","#A0A0A0",M("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class mO extends Vi{constructor(){super({id:"editor.action.jumpToBracket",label:M("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:Le.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Th.get(t))==null||i.jumpToBracket()}}class _O extends Vi{constructor(){super({id:"editor.action.selectToBracket",label:M("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:En("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 o;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(o=Th.get(t))==null||o.selectToBracket(s)}}class bO extends Vi{constructor(){super({id:"editor.action.removeBrackets",label:M("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:Le.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Th.get(t))==null||i.removeBrackets(this.id)}}class CO{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const ud=class ud extends nn{static get(e){return e.getContribution(ud.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Ao(()=>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 s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let a=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?a=o[1].getStartPosition():o[1].containsPosition(s)&&(a=o[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(s);if(l)a=l[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(s);c&&c.range&&(a=c.range.getStartPosition())}}return a?new Nn(a.lineNumber,a.column,a.lineNumber,a.column):new Nn(s.lineNumber,s.column,s.lineNumber,s.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(s=>{const o=s.getStartPosition();let a=t.bracketPairs.matchBracket(o);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(o),!a)){const u=t.bracketPairs.findNextBracket(o);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,c=null;if(a){a.sort(ut.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),c=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(o)){const v=l;l=c,c=v}}l&&c&&i.push(new Nn(l.lineNumber,l.column,c.lineNumber,c.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 s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[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 s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[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 s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let a=0;for(let v=0,m=e.length;v<m;v++){const b=e[v];b.isEmpty()&&(o[a++]=b.getStartPosition())}o.length>1&&o.sort(kn.compare);const l=[];let c=0,u=0;const g=s.length;for(let v=0,m=o.length;v<m;v++){const b=o[v];for(;u<g&&s[u].position.isBefore(b);)u++;if(u<g&&s[u].position.equals(b))l[c++]=s[u];else{let _=t.bracketPairs.matchBracket(b,20),w=ud._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(b,20),w=ud._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[c++]=new CO(b,_,w)}}this._lastBracketsData=l,this._lastVersionId=i}};ud.ID="editor.contrib.bracketMatchingController",ud._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=as.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Eo(xO),position:ec.Center}}),ud._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=as.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Th=ud;ns(Th.ID,Th,1);pi(_O);pi(mO);pi(bO);Ya.appendMenuItem(pn.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:M({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class yO{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,s=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&s===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new ut(i,s-1,i,s),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new ut(i,o,i,o),l)}else{const a=new ut(i,o,i,o+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new ut(i,s,i,s),l)}}computeCursorState(e,t){return this._isMovingLeft?new Nn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Nn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class IB extends Vi{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],s=t.getSelections();for(const o of s)i.push(new yO(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class wO extends IB{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:M("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:Le.writable})}}class EO extends IB{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:M("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:Le.writable})}}pi(wO);pi(EO);class SO extends Vi{constructor(){super({id:"editor.action.transposeLetters",label:M("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:Le.writable,kbOpts:{kbExpr:Le.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=[],o=t.getSelections();for(const a of o){if(!a.isEmpty())continue;const l=a.startLineNumber,c=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(c===1||c===2&&u===2))continue;const g=c===u?a.getPosition():eC.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),v=eC.leftPosition(i,g),m=eC.leftPosition(i,v),b=i.getValueInRange(ut.fromPositions(m,v)),_=i.getValueInRange(ut.fromPositions(v,g)),w=ut.fromPositions(m,g);s.push(new k0(w,_+b))}s.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}pi(SO);const xb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let s=0;s<i.length;s++)i[s]=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(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let s=0,o="";return o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+="-",o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o+=t[e[s++]],o}})();function b9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function kO(r,e,t){const i={id:xb(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class PB{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 Fc.some(this,([i,s])=>s.asFile())&&t.push("files"),MB(jm(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 jm(e)}}function jm(r){return r.toLowerCase()}function TB(r,e){return MB(jm(r),e.map(jm))}function MB(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(a=>a.startsWith(s+"/")):!1}const mb=Object.freeze({create:r=>K5(r.map(e=>e.toString())).join(`\r
14
14
  `),split:r=>r.split(`\r
15
15
  `),parse:r=>mb.split(r).filter(e=>!e.startsWith("#"))}),Hl=class Hl{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+Hl.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Hl((this.value?[this.value,...e]:e).join(Hl.sep))}};Hl.sep=".",Hl.None=new Hl("@@none@@"),Hl.Empty=new Hl("");let qs=Hl;const Ek={EDITORS:"CodeEditors",FILES:"CodeFiles"};class DO{}const AO={DragAndDropContribution:"workbench.contributions.dragAndDrop"};El.add(AO.DragAndDropContribution,new DO);const kv=class kv{constructor(){}static getInstance(){return kv.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};kv.INSTANCE=new kv;let Rw=kv;function NB(r){const e=new PB;for(const t of r.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,b9(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,BO(s))}}return e}function BO(r){const e=r.path?Ts.parse(r.path):void 0;return kO(r.name,e,async()=>new Uint8Array(await r.arrayBuffer()))}const FO=Object.freeze([Ek.EDITORS,Ek.FILES,sw.RESOURCES,sw.INTERNAL_URI_LIST]);function RB(r,e=!1){const t=NB(r),i=t.get(sw.INTERNAL_URI_LIST);if(i)t.replace(Yo.uriList,i);else if(e||!t.has(Yo.uriList)){const s=[];for(const o of r.items){const a=o.getAsFile();if(a){const l=a.path;try{l?s.push(Ts.file(l).toString()):s.push(Ts.parse(a.name,!0).toString())}catch{}}}s.length&&t.replace(Yo.uriList,b9(mb.create(s)))}for(const s of FO)t.delete(s);return t}var C9=function(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Vv=function(r,e){return function(t,i){e(t,i,r)}};class y9{async provideDocumentPasteEdits(e,t,i,s,o){const a=await this.getEdit(i,o);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,s){const o=await this.getEdit(i,s);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}const Dv=class Dv extends y9{constructor(){super(...arguments),this.kind=Dv.kind,this.dropMimeTypes=[Yo.text],this.pasteMimeTypes=[Yo.text]}async getEdit(e,t){const i=e.get(Yo.text);if(!i||e.has(Yo.uriList))return;const s=await i.asString();return{handledMimeType:Yo.text,title:M("text.label","Insert Plain Text"),insertText:s,kind:this.kind}}};Dv.id="text",Dv.kind=new qs("text.plain");let Mh=Dv;class OB extends y9{constructor(){super(...arguments),this.kind=new qs("uri.absolute"),this.dropMimeTypes=[Yo.uriList],this.pasteMimeTypes=[Yo.uriList]}async getEdit(e,t){const i=await zB(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:l,originalText:c})=>l.scheme===Lr.file?l.fsPath:(s++,c)).join(" ");let a;return s>0?a=i.length>1?M("defaultDropProvider.uriList.uris","Insert Uris"):M("defaultDropProvider.uriList.uri","Insert Uri"):a=i.length>1?M("defaultDropProvider.uriList.paths","Insert Paths"):M("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Yo.uriList,insertText:o,title:a,kind:this.kind}}}let $m=class extends y9{constructor(e){super(),this._workspaceContextService=e,this.kind=new qs("uri.relative"),this.dropMimeTypes=[Yo.uriList],this.pasteMimeTypes=[Yo.uriList]}async getEdit(e,t){const i=await zB(e);if(!i.length||t.isCancellationRequested)return;const s=Nc(i.map(({uri:o})=>{const a=this._workspaceContextService.getWorkspaceFolder(o);return a?CI(a.uri,o):void 0}));if(s.length)return{handledMimeType:Yo.uriList,insertText:s.join(" "),title:i.length>1?M("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):M("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};$m=C9([Vv(0,Ip)],$m);class LO{constructor(){this.kind=new qs("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Yo.text}]}async provideDocumentPasteEdits(e,t,i,s,o){var c;if(s.triggerKind!==ow.PasteAs&&!((c=s.only)!=null&&c.contains(this.kind)))return;const a=i.get("text/html"),l=await(a==null?void 0:a.asString());if(!(!l||o.isCancellationRequested))return{dispose(){},edits:[{insertText:l,yieldTo:this._yieldTo,title:M("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function zB(r){const e=r.get(Yo.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const s of mb.parse(t))try{i.push({uri:Ts.parse(s),originalText:s})}catch{}return i}let Ow=class extends nn{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Mh)),this._register(e.documentDropEditProvider.register("*",new OB)),this._register(e.documentDropEditProvider.register("*",new $m(t)))}};Ow=C9([Vv(0,Dn),Vv(1,Ip)],Ow);let zw=class extends nn{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Mh)),this._register(e.documentPasteEditProvider.register("*",new OB)),this._register(e.documentPasteEditProvider.register("*",new $m(t))),this._register(e.documentPasteEditProvider.register("*",new LO))}};zw=C9([Vv(0,Dn),Vv(1,Ip)],zw);const La=class La{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),s;if(s=La._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(La.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(La.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(La.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(La.isVariableCharacter(i)||La.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof La._table[i]>"u"&&!La.isDigitCharacter(i)&&!La.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}};La._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let Hw=La;class bg{constructor(){this._children=[]}appendChild(e){return e instanceof $r&&this._children[this._children.length-1]instanceof $r?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o,(function a(l,c){for(const u of l)u.parent=c,a(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 G0)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let $r=class HB extends bg{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new HB(this.value)}};class WB extends bg{}class Ea extends WB{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 Cg?this._children[0]:void 0}clone(){const e=new Ea(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Cg extends bg{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof $r&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Cg;return this.options.forEach(e.appendChild,e),e}}class w9 extends bg{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof dl&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof dl){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){const e=new w9;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 dl extends bg{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}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,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new dl(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class qv extends WB{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 $r(t)],!0):!1}clone(){const e=new qv(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Sk(r,e){const t=[...r];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class G0 extends bg{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Ea&&(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(s=>s===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return Sk([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Ea&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof qv&&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 G0;return this._children=this.children.map(t=>t.clone()),e}walk(e){Sk(this.children,e)}}class Nh{constructor(){this._scanner=new Hw,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 s=new G0;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i??!1,t??!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(c=>(c instanceof Ea&&(c.isFinalTabstop?s.set(0,void 0):!s.has(c.index)&&c.children.length>0?s.set(c.index,c.children):o.push(c)),!0));const a=(c,u)=>{const g=s.get(c.index);if(!g)return;const v=new Ea(c.index);v.transform=c.transform;for(const m of g){const b=m.clone();v.appendChild(b),b instanceof Ea&&s.has(b.index)&&!u.has(b.index)&&(u.add(b.index),a(b,u),u.delete(b.index))}t.replace(c,[v])},l=new Set;for(const c of o)a(c,l);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Ea(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 s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.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 $r(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 Ea(Number(t)):new qv(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 o=new Ea(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new $r("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const a=new Cg;for(;;){if(this._parseChoiceElement(a)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(a),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new $r(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 o=new qv(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new $r("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new w9;let i="",s="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new $r(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}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 s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new dl(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new dl(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new dl(Number(s),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new dl(Number(s),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new dl(Number(s),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const a=this._until(4);if(a)return e.appendChild(new dl(Number(s),void 0,o,a)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new dl(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new $r(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function jB(r,e,t){var i,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(o=>new yI(r,{range:o,text:typeof t.insertText=="string"?Nh.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((s=t.additionalEdit)==null?void 0:s.edits)??[]]}}function $B(r){function e(a,l){return"mimeType"in a?a.mimeType===l.handledMimeType:!!l.kind&&a.kind.contains(l.kind)}const t=new Map;for(const a of r)for(const l of a.yieldTo??[])for(const c of r)if(c!==a&&e(l,c)){let u=t.get(a);u||(u=[],t.set(a,u)),u.push(c)}if(!t.size)return Array.from(r);const i=new Set,s=[];function o(a){if(!a.length)return[];const l=a[0];if(s.includes(l))return console.warn("Yield to cycle detected",l),a;if(i.has(l))return o(a.slice(1));let c=[];const u=t.get(l);return u&&(s.push(l),c=o(u),s.pop()),i.add(l),[...c,l,...o(a.slice(1))]}return o(Array.from(r))}var IO=function(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},PO=function(r,e){return function(t,i){e(t,i,r)}};const TO=as.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Z5,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),i1=class i1 extends nn{constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Cn(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Cn("span.icon");this.domNode.append(t),t.classList.add(...Ss.asClassNameArray(Wn.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(67);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(52)||s.hasChanged(67))&&i()})),this._register(ys(this.domNode,to.CLICK,s=>{this.delegate.cancel()}))}getId(){return i1.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)}};i1.baseId="editor.widget.inlineProgressWidget";let Ww=i1,Vm=class extends nn{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new pa),this._currentWidget=this._register(new pa),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,s,o){const a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=Fv(()=>{const l=ut.fromPositions(e);this._currentDecorations.set([{range:l,options:TO}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Ww,this.id,this._editor,l,t,s))},o??this._showDelay);try{return await i}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Vm=IO([PO(2,qn)],Vm);var MO=function(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kk=function(r,e){return function(t,i){e(t,i,r)}},rm,Fd;let Gr=(Fd=class{static get(e){return e.getContribution(rm.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new pa,this._messageListeners=new tn,this._mouseOverMessage=!1,this._editor=e,this._visible=rm.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){Xa(Zx(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Zx(e)?wI(e,{actionHandler:{callback:s=>{this.closeMessage(),EI(this._openerService,s,Zx(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Dk(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Do.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&SI(G5(),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(ys(this._messageWidget.value.getDomNode(),to.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ys(this._messageWidget.value.getDomNode(),to.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new ut(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Dk.fadeOut(this._messageWidget.value))}},rm=Fd,Fd.ID="editor.contrib.messageController",Fd.MESSAGE_VISIBLE=new hs("messageVisible",!1,M("messageVisible","Whether the editor is currently showing an inline message")),Fd);Gr=rm=MO([kk(1,ws),kk(2,Sl)],Gr);const NO=Rr.bindToContribution(Gr.get);Bn(new NO({id:"leaveEditorMessage",precondition:Gr.MESSAGE_VISIBLE,handler:r=>r.closeMessage(),kbOpts:{weight:130,primary:9}}));let Dk=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},s){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 o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const a=document.createElement("div");typeof s=="string"?(a.classList.add("message"),a.textContent=s):(s.classList.add("message"),a.appendChild(s)),this._domNode.appendChild(a);const l=document.createElement("div");l.classList.add("anchor","below"),this._domNode.appendChild(l),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)}};ns(Gr.ID,Gr,4);function vC(r,e){return e&&(r.stack||r.stacktrace)?M("stackTrace.format","{0}: {1}",Bk(r),Ak(r.stack)||Ak(r.stacktrace)):Bk(r)}function Ak(r){return Array.isArray(r)?r.join(`
16
16
  `):r}function Bk(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?M("nodeExceptionMessage","A system error occurred ({0})",r.message):r.message||M("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function qm(r=null,e=!1){if(!r)return M("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){const t=Nc(r),i=qm(t[0],e);return t.length>1?M("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Y5(r))return r;if(r.detail){const t=r.detail;if(t.error)return vC(t.error,e);if(t.exception)return vC(t.exception,e)}return r.stack?vC(r,e):r.message?r.message:M("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var VB=function(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cp=function(r,e){return function(t,i){e(t,i,r)}},jw,$u;let $w=($u=class extends nn{constructor(e,t,i,s,o,a,l,c,u,g){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=a,this.onSelectNewEdit=l,this._contextMenuService=c,this._keybindingService=g,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(u),this.visibleContext.set(!0),this._register(Vs(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Vs((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(v=>{o.containsPosition(v.position)||this.dispose()})),this._register(Do.runAndSubscribe(g.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=Cn(".post-edit-widget"),this.button=this._register(new kI(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ys(this.domNode,to.CLICK,()=>this.showSelector()))}getId(){return jw.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Pr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>DI({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},jw=$u,$u.baseId="editor.widget.postEditWidget",$u);$w=jw=VB([cp(7,hg),cp(8,ws),cp(9,bo)],$w);let Um=class extends nn{constructor(e,t,i,s,o,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._instantiationService=o,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new pa),this._register(Do.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,s,o){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits.at(t.activeEditIndex);if(!l)return;const c=async k=>{const B=this._editor.getModel();B&&(await B.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:k,allEdits:t.allEdits},i,s,o))},u=(k,B)=>{iu(k)||(this._notificationService.error(B),i&&this.show(e[0],t,c))};let g;try{g=await s(l,o)}catch(k){return u(k,M("resolveError",`Error resolving edit '{0}':
@@ -160,13 +160,37 @@ declare const she: {
160
160
  warn(...args: any[]): void;
161
161
  error(...args: any[]): void;
162
162
  now(): number;
163
+ /** The sandbox's setTimeout / clearTimeout (tracked, cleared on reload); a delay that is not a number is logged with the script name. */
164
+ setTimeout(fn: (...args: any[]) => void, ms?: number, ...args: any[]): any;
165
+ clearTimeout(id: any): void;
166
+ /** A restartable one-shot timer (milliseconds), created idle: restart() arms it, another restart() starts over, cancel() disarms. */
167
+ timeout(ms: number, cb: () => void, opts?: { name?: string }): { restart(ms?: number): any; start(ms?: number): any; cancel(): any; pending(): boolean; remaining(): number };
168
+ /** Bundle calls: fn runs with the last call's arguments after 'wait' ms of quiet, at the latest after opts.maxWait ms. Milliseconds. */
169
+ debounce: {
170
+ <F extends (...args: any[]) => any>(fn: F, wait: number, opts?: { maxWait?: number; leading?: boolean; trailing?: boolean; flushOnUnload?: boolean; name?: string }): F & { cancel(): void; flush(): any; pending(): boolean };
171
+ /** One debounce state per key — the first argument, or opts.key(...args). */
172
+ keyed<F extends (...args: any[]) => any>(fn: F, wait: number, opts?: { maxWait?: number; leading?: boolean; trailing?: boolean; flushOnUnload?: boolean; name?: string; key?: (...args: Parameters<F>) => any }): F & { cancel(key?: any): void; flush(key?: any): any; pending(key?: any): boolean; keys(): any[] };
173
+ };
174
+ /** Rate-limit calls: the first at once, then at most once per 'wait' ms (with the last arguments). Milliseconds. */
175
+ throttle: {
176
+ <F extends (...args: any[]) => any>(fn: F, wait: number, opts?: { leading?: boolean; trailing?: boolean; name?: string }): F & { cancel(): void; flush(): any; pending(): boolean };
177
+ keyed<F extends (...args: any[]) => any>(fn: F, wait: number, opts?: { leading?: boolean; trailing?: boolean; name?: string; key?: (...args: Parameters<F>) => any }): F & { cancel(key?: any): void; flush(key?: any): any; pending(key?: any): boolean; keys(): any[] };
178
+ };
179
+ /** Call fn(attempt) until it succeeds; waits opts.delay ms (× opts.backoff per failure) between attempts; after the last failure onFail(err, tries) or a rejection. */
180
+ retry<T>(fn: (attempt: number) => T | Promise<T>, opts?: { tries?: number; delay?: number; backoff?: number; onFail?: (err: any, tries: number) => any; name?: string }): Promise<T>;
163
181
  /** Schedule with a cron string, Date, node-schedule literal, array of any of those,
164
182
  * or a suncalc event name ('sunrise', 'sunset', 'dawn', 'dusk', …) for solar scheduling.
165
183
  * opts.shift (seconds) offsets solar events; opts.random adds a random delay. */
166
184
  schedule(pattern: string | Date | object | (string | Date | object)[], opts?: { shift?: number; random?: number }, cb?: () => void): void;
167
185
  mqtt: {
168
- sub(topic: string | string[], opts?: any, cb?: (topic: string, val: any, obj: any, prev: any, msg: any) => void): void;
169
- pub(topic: string | string[], payload: any, opts?: { qos?: number; retain?: boolean }): void;
186
+ /** opts: change, retain, shift, random, condition — and debounce / maxWait / throttle (SECONDS), perTopic, name, flushOnUnload */
187
+ sub(
188
+ topic: string | string[],
189
+ opts?: { change?: boolean; retain?: boolean; shift?: number; random?: number; condition?: string | ((...args: any[]) => any); debounce?: number; maxWait?: number; throttle?: number; perTopic?: boolean; name?: string; flushOnUnload?: boolean } | string | ((...args: any[]) => any),
190
+ cb?: (topic: string, val: any, obj: any, prev: any, msg: any) => void,
191
+ ): void;
192
+ /** opts.changed: publish only when the payload differs from this script's last publish to the topic */
193
+ pub(topic: string | string[], payload: any, opts?: { qos?: number; retain?: boolean; changed?: boolean }): void;
170
194
  get(topic: string): any;
171
195
  getProp(topic: string, ...prop: string[]): any;
172
196
  link(source: string | string[], target: string | string[], value?: any): void;
@@ -303,4 +327,4 @@ ${Ve.length===1?"There is an instance":"There are "+Ve.length+" instances"} of i
303
327
  `)]),C(Yt,Si)};P(ii,Yt=>{"error"in n(Dt)&&n(Dt).error&&!("ok"in n(Dt))?Yt(Fi):"ok"in n(Dt)&&n(Dt).ok?Yt(Hi,1):"ok"in n(Dt)&&Yt(Tt,2)})}I(()=>Ye=Mt(Et,1,"deploy-box in-card svelte-ns6riw",null,Ye,{"deploy-ok":"ok"in n(Dt)&&n(Dt).ok})),C(Ue,Et)};P(le,Ue=>{n(J)[$()]&&Ue(We)})}C(K,j)};let a=jn(e,"generation",3,0),l=jn(e,"origin",3,null),c=A(Mi([])),u=A(""),g=A(Mi([])),v=A(!0),m=A(!1),b=A(""),_=A(""),w=A(""),k=A(void 0),B=A("list"),T=A(null),R=A(null),N=A(Mi({})),H=A(null),q=Ke(()=>n(g).filter(K=>K.ok&&K.helperOutdated).length);dn(()=>{var K;(K=e.onupdates)==null||K.call(e,n(q))});let V=A(null),J=A(Mi({}));async function ae(K){var $;p(V,K,!0);try{const j=await AA(K);p(J,{...n(J),[K]:j},!0),j.ok&&(p(g,(await Ha(!0)).hosts,!0),($=e.onchanged)==null||$.call(e))}catch(j){p(J,{...n(J),[K]:{error:j.message??String(j)}},!0)}finally{p(V,null)}}let oe=A(!1),Q=A(""),se=Ke(()=>n(g).filter(K=>K.ok&&K.helperOutdated).map(K=>K.name));async function fe(){var $;const K=n(se);if(!(K.length===0||n(oe))){p(oe,!0);try{for(const[j,le]of K.entries()){p(Q,`${j+1} of ${K.length}: ${le}`);try{p(J,{...n(J),[le]:await AA(le)},!0)}catch(We){p(J,{...n(J),[le]:{error:We.message??String(We)}},!0)}}p(g,(await Ha(!0)).hosts,!0),($=e.onchanged)==null||$.call(e)}finally{p(oe,!1),p(Q,"")}}}let ne=A(null),ye=A(Mi({})),_e=A(null),Ne=A(Mi({})),xe=A(null);const mt=[{key:"stable",label:"stable"},{key:"lts",label:"LTS"},{key:"latest",label:"latest"}],He=K=>{var $,j;return(K==null?void 0:K.arch)&&((j=($=n(xe))==null?void 0:$.byArch)==null?void 0:j[K.arch])||n(xe)||null},Ie=(K,$)=>{const j=He($);return(K==="latest"?j==null?void 0:j.latest:j==null?void 0:j.lts)??null};function Ve(K,$){if(!K||!$)return null;const j=Ue=>Ue.replace(/^v/,"").split(".").map(Dt=>Number(Dt)||0),[le,We]=[j(K),j($)];for(let Ue=0;Ue<Math.max(le.length,We.length);Ue++)if((le[Ue]??0)!==(We[Ue]??0))return(le[Ue]??0)<(We[Ue]??0)?-1:1;return 0}const Xe=K=>K&&Number(K.replace(/^v/,"").split(".")[0])||0;let ue=Ke(()=>n(g).filter(K=>{if(!K.ok||!K.node||!n(xe))return!1;const $=He(K),le=!!($!=null&&$.latest)&&Xe(K.node)===Xe($.latest)?$==null?void 0:$.latest:$==null?void 0:$.lts;return!!le&&Ve(le,K.node)===1}).length);dn(()=>{var K;(K=e.onnodeupdates)==null||K.call(e,n(ue))});function me(K){return mt.map($=>{const j=Ie($.key,K);return{...$,target:j,current:!!j&&j===K.node,downgrade:Ve(j,K.node)===-1}})}async function Oe(K,$){var Dt,Et;const j=Wt(K)??null,le=(j==null?void 0:j.local)===!0,We=Ie($,j);if(await((Dt=n(k))==null?void 0:Dt.show(`Install Node.js ${We??`"${$}"`} on ${K} with n install ${We??$}? This replaces the host's node binary; running adapters keep the current version until they are restarted.`+(le?" she runs on this host too — it keeps the old binary until the daemon itself is restarted.":""),{confirm:"Update Node.js"}))){p(ne,K,!0),p(Ne,{...n(Ne),[K]:void 0},!0);try{const Ye=await PX(K,$,We);p(ye,{...n(ye),[K]:Ye},!0),p(g,(await Ha(!0)).hosts,!0),(Et=e.onchanged)==null||Et.call(e)}catch(Ye){p(ye,{...n(ye),[K]:{error:Ye.message??String(Ye)}},!0)}finally{p(ne,null)}}}async function qe(K){var $;p(_e,K,!0);try{p(Ne,{...n(Ne),[K]:await MX(K)},!0),($=e.onchanged)==null||$.call(e)}catch(j){p(Ne,{...n(Ne),[K]:{error:j.message??String(j)}},!0)}finally{p(_e,null)}}let Ae=A(null),tt=A(""),qt=A(!1),Ft=A(!1),Re=A(Mi({host:"",port:"",user:"",identityFile:"",hostname:""})),dt=A(null),zt=A(!1),Bt=A(Mi(location.origin)),ui=A(null),ee=A(null),ve=A(""),Ce=A(!1),at=A(""),Ze=A(!1),At=null;const Lt=Ke(()=>JSON.stringify({remotes:n(c)})!==n(u)),Wt=K=>n(g).find($=>$.name===K)??null,je=Ke(()=>n(g).find(K=>K.local)??null),ze=(K,$)=>(K.hostname||K.host).localeCompare($.hostname||$.host,void 0,{numeric:!0,sensitivity:"base"});function ct(K){const $=K.services,j=Array.isArray($==null?void 0:$.hosts)?$.hosts:null;p(c,(j??[]).filter(le=>le&&le.ssh).map(le=>({host:String(le.ssh.host??""),port:typeof le.ssh.port=="number"?le.ssh.port:"",user:String(le.ssh.user??""),identityFile:String(le.ssh.identityFile??""),hostname:String(le.hostname??"")})).sort(ze),!0),p(u,JSON.stringify({remotes:n(c)}),!0)}async function S(K=!1){p(v,!0),p(b,"");try{const[$,j]=await Promise.all([Uc(),Ha(K).catch(()=>({hosts:[]}))]);ct($),p(g,j.hosts,!0)}catch($){p(b,$.message??String($),!0)}finally{p(v,!1)}W()}async function W(){try{const K=await FX();p(Ae,K.publicKey,!0),p(tt,K.identityFile,!0)}catch{}try{p(w,(await vd()).user??"",!0)}catch{}}Us(()=>S());let ce=0;dn(()=>{const K=a();K!==ce&&(ce=K,io(()=>{l()!=="hostsconf"&&(async()=>{if(n(Lt))try{p(g,(await Ha(!0)).hosts,!0)}catch{}else await S(!0)})()}))}),Us(async()=>{try{p(xe,await TX(),!0)}catch{}}),da(()=>kt());function De(K){p(_,K,!0),setTimeout(()=>{n(_)===K&&p(_,"")},3e3)}async function Pe(){var K;p(m,!0),p(b,"");try{const $=[{name:"local"}];for(const j of n(c)){if(!j.host.trim())continue;const le={host:j.host.trim()};j.port!==""&&Number(j.port)>0&&(le.port=Number(j.port)),j.user.trim()&&(le.user=j.user.trim()),j.identityFile.trim()&&(le.identityFile=j.identityFile.trim()),$.push({...j.hostname.trim()?{hostname:j.hostname.trim()}:{},ssh:le})}await x0("services.hosts",$),window.dispatchEvent(new CustomEvent("she:config-changed")),p(u,JSON.stringify({remotes:n(c)}),!0),p(T,null),De("saved"),(K=e.onchanged)==null||K.call(e),p(g,(await Ha(!0)).hosts,!0)}catch($){p(b,$.message??String($),!0)}finally{p(m,!1)}}function lt(){const K=JSON.parse(n(u));p(c,K.remotes,!0),p(T,null)}async function G(K){const $=K.host;p(H,$,!0);try{const j=await DA({host:K.host.trim(),port:K.port,user:K.user.trim(),identityFile:K.identityFile.trim()});p(N,{...n(N),[$]:j.ok?{ok:!0,msg:`helper v${j.helper??"?"}`}:{ok:!1,msg:`${j.code}: ${j.error}`}},!0)}catch(j){p(N,{...n(N),[$]:{ok:!1,msg:j.message??String(j)}},!0)}finally{p(H,null)}}async function it(){p(H,"local");try{const K=await IX("local");p(N,{...n(N),local:K.ok?{ok:!0,msg:`helper v${K.helper??"?"}`}:{ok:!1,msg:`${K.code}: ${K.error}`}},!0)}catch(K){p(N,{...n(N),local:{ok:!1,msg:K.message??String(K)}},!0)}finally{p(H,null)}}async function wt(K){var j;const $=n(c)[K];await((j=n(k))==null?void 0:j.show(`Remove ${$.hostname||$.host} from the list? she stops managing it; nothing on the host is changed (use "Remove from host…" for that).`,{confirm:"Remove",danger:!0}))&&(p(c,n(c).filter((le,We)=>We!==K),!0),n(T)===K&&p(T,null))}function ke(){p(Re,{host:"",port:"",user:"",identityFile:"",hostname:""},!0),p(dt,null),p(at,""),p(B,"add")}async function Qe(){if(!n(Re).host.trim()){p(dt,{ok:!1,msg:"enter a host first"},!0);return}p(zt,!0);try{const K=await DA({host:n(Re).host.trim(),port:n(Re).port,user:n(Re).user.trim(),identityFile:n(Re).identityFile.trim()});p(dt,K.ok?{ok:!0,msg:`helper v${K.helper??"?"}`}:{ok:!1,msg:`${K.code}: ${K.error}`},!0)}catch(K){p(dt,{ok:!1,msg:K.message??String(K)},!0)}finally{p(zt,!1)}}function _t(){n(Re).host.trim()&&(p(c,[...n(c),{...n(Re),host:n(Re).host.trim(),user:n(Re).user.trim(),identityFile:n(Re).identityFile.trim(),hostname:n(Re).hostname.trim()}].sort(ze),!0),p(B,"list"),De("host added — Save to keep it"))}function kt(){At&&(clearInterval(At),At=null)}async function Gt(){p(Ce,!0),p(at,""),p(ui,null),p(ee,null),p(ve,""),p(Ze,!1),kt();try{p(ui,await NX(n(Bt).trim().replace(/\/+$/,"")),!0),p(ee,"pending"),W(),At=setInterval(async()=>{var K;if(!n(ui))return kt();try{const $=await RX(n(ui).token);p(ee,$.status,!0),$.status==="done"?(p(ve,$.host??"",!0),kt(),ct(await Uc()),p(g,(await Ha(!0)).hosts,!0),(K=e.onchanged)==null||K.call(e)):$.status==="expired"&&kt()}catch{}},3e3)}catch(K){p(at,K.message??String(K),!0)}finally{p(Ce,!1)}}async function Be(K,$){try{await navigator.clipboard.writeText(K),$(!0),setTimeout(()=>$(!1),2e3)}catch{}}async function gt(){var K;if(!(n(Ae)&&!await((K=n(k))==null?void 0:K.show("Regenerate the services SSH key? Every remote host then needs the new public key (re-run the setup command, or replace it in authorized_keys).",{confirm:"Regenerate",danger:!0})))){p(qt,!0);try{const $=await LX();p(Ae,$.publicKey,!0),p(tt,$.identityFile,!0),De("key generated")}catch($){p(b,$.message??String($),!0)}finally{p(qt,!1)}}}var Y=w0e(),Me=pt(Y);ls(ur(Me,{}),K=>p(k,K,!0),()=>n(k));var Ge=h(Me,2),yt=f(Ge);{var St=K=>{var $=o0e(),j=pt($),le=f(j),We=h(j,2),Ue=f(We),Dt=h(f(Ue),4),Et=h(f(Dt),2),Ye=h(Et,2),ei=f(Ye),ii=h(Dt,2);{var Fi=Fe=>{var ht=e0e(),bt=f(ht);I(()=>D(bt,n(at))),C(Fe,ht)};P(ii,Fe=>{n(at)&&Fe(Fi)})}var Hi=h(ii,2);{var Tt=Fe=>{var ht=s0e(),bt=pt(ht),Rt=f(bt),Pt=f(Rt),Nt=h(Rt),Ht=f(Nt),Kt=h(bt,2),si=f(Kt),$i=h(si),en=f($i),_i=h($i,2),Yi=f(_i),ln=h(Kt,2),Je=f(ln);{var $t=gi=>{var nt=t0e();C(gi,nt)},hi=gi=>{var nt=i0e();C(gi,nt)},Ii=gi=>{var nt=n0e(),ft=pt(nt),jt=f(ft),Gi=h(jt),Ki=f(Gi),qi=h(ft,2);I(()=>{D(jt,`✓ ${n(ve)??""} registered as `),D(Ki,n(ui).user)}),O("click",qi,()=>p(B,"list")),C(gi,nt)},Bi=gi=>{var nt=On("command expired — create a new one.");C(gi,nt)};P(Je,gi=>{n(ee)==="pending"?gi($t):n(ee)==="fetched"?gi(hi,1):n(ee)==="done"?gi(Ii,2):n(ee)==="expired"&&gi(Bi,3)})}I(gi=>{D(Pt,n(ui).command),D(Ht,n(Ze)?"Copied":"Copy"),D(si,`Valid until ${gi??""}, single use. To read it first: `),D(en,`curl -fsSL '${n(ui).scriptUrl??""}' -o she-setup.sh`),D(Yi,n(ui).sha256)},[()=>new Date(n(ui).expires).toLocaleTimeString()]),O("click",Nt,()=>Be(n(ui).command,gi=>p(Ze,gi,!0))),C(Fe,ht)};P(Hi,Fe=>{n(ui)&&Fe(Tt)})}var Yt=h(Ue,2),Si=h(f(Yt),4),Di=f(Si),ge=h(f(Di)),U=h(Di,2),X=h(f(U)),de=h(U,2),$e=h(f(de)),Ee=h(de,2),vt=h(f(Ee)),re=h(Si,2),Se=f(re),Z=f(Se),ie=h(Se,2);{var be=Fe=>{var ht=O5();let bt;var Rt=f(ht);I(()=>{bt=Mt(ht,1,"test-mark svelte-ns6riw",null,bt,{ok:n(dt).ok,err:!n(dt).ok}),D(Rt,n(dt).ok?`✓ ${n(dt).msg}`:`✗ ${n(dt).msg}`)}),C(Fe,ht)};P(ie,Fe=>{n(dt)&&Fe(be)})}var et=h(ie,4);I(Fe=>{Ye.disabled=n(Ce),D(ei,n(Ce)?"Preparing…":"Create setup command"),li($e,"placeholder",n(w)?`${n(w)} (default)`:"user she runs as"),Se.disabled=n(zt),D(Z,n(zt)?"Testing…":"Test connection"),et.disabled=Fe},[()=>!n(Re).host.trim()]),O("click",le,()=>p(B,"list")),wi(Et,()=>n(Bt),Fe=>p(Bt,Fe)),O("click",Ye,Gt),wi(ge,()=>n(Re).host,Fe=>n(Re).host=Fe),wi(X,()=>n(Re).port,Fe=>n(Re).port=Fe),wi($e,()=>n(Re).user,Fe=>n(Re).user=Fe),wi(vt,()=>n(Re).identityFile,Fe=>n(Re).identityFile=Fe),O("click",Se,Qe),O("click",et,_t),C(K,$)},Ut=K=>{var $=y0e(),j=pt($),le=f(j),We=f(le);let Ue;var Dt=h(le,2),Et=h(Dt,2),Ye=f(Et),ei=h(Et,2);{var ii=gi=>{var nt=r0e();C(gi,nt)};P(ei,gi=>{n(v)&&gi(ii)})}var Fi=h(ei,2);{var Hi=gi=>{var nt=a0e(),ft=f(nt);I(()=>{nt.disabled=n(oe)||n(V)!==null,D(ft,n(oe)?`Updating ${n(Q)}…`:`Update all helpers (${n(se).length})`)}),O("click",nt,fe),C(gi,nt)};P(Fi,gi=>{n(se).length>1&&gi(Hi)})}var Tt=h(Fi,4);{var Yt=gi=>{var nt=l0e(),ft=f(nt);I(()=>D(ft,n(_))),C(gi,nt)};P(Tt,gi=>{n(_)&&gi(Yt)})}var Si=h(Tt,2);{var Di=gi=>{var nt=c0e(),ft=h(pt(nt),2),jt=h(ft,2),Gi=f(jt);I(()=>{ft.disabled=n(m),jt.disabled=n(m),D(Gi,n(m)?"Saving…":"Save")}),O("click",ft,lt),O("click",jt,Pe),C(gi,nt)};P(Si,gi=>{n(Lt)&&gi(Di)})}var ge=h(j,2);{var U=gi=>{var nt=d0e(),ft=f(nt);I(()=>D(ft,n(b))),C(gi,nt)};P(ge,gi=>{n(b)&&gi(U)})}var X=h(ge,2),de=f(X),$e=f(de),Ee=f($e);let vt;var re=h(Ee,2),Se=f(re),Z=h(re,2);{var ie=gi=>{R5(gi,()=>n(je).arch)};P(Z,gi=>{var nt;(nt=n(je))!=null&&nt.arch&&gi(ie)})}var be=h(Z,6);{var et=gi=>{i(gi,()=>"local",()=>n(je))};P(be,gi=>{var nt;(nt=n(je))!=null&&nt.ok&&gi(et)})}var Fe=h(be,2),ht=h(Fe);t(ht,()=>"local");var bt=h($e,2);{var Rt=gi=>{s(gi,()=>"local",()=>n(je))};P(bt,gi=>{var nt;(nt=n(je))!=null&&nt.ok&&gi(Rt)})}var Pt=h(bt,2);o(Pt,()=>"local");var Nt=h(Pt,2);{var Ht=gi=>{var nt=h0e(),ft=f(nt),jt=h(ft);{var Gi=Ki=>{var qi=u0e(),Zt=pt(qi);Zt.nodeValue=" — run ",C(Ki,qi)};P(jt,Ki=>{n(je).code==="HELPER_MISSING"&&Ki(Gi)})}I(()=>D(ft,n(je).error)),C(gi,nt)};P(Nt,gi=>{n(je)&&!n(je).ok&&gi(Ht)})}var Kt=h(de,2);di(Kt,17,()=>n(c),hn,(gi,nt,ft)=>{const jt=Ke(()=>Wt(n(nt).host));var Gi=m0e(),Ki=f(Gi),qi=f(Ki);let Zt;var xi=h(qi,2),Oi=f(xi),we=h(xi,2);{var pe=Xt=>{R5(Xt,()=>n(jt).arch)};P(we,Xt=>{var ki;(ki=n(jt))!=null&&ki.arch&&Xt(pe)})}var ti=h(we,2),fi=f(ti),ri=h(ti,2);{var zi=Xt=>{var ki=f0e();I(()=>li(ki,"title",n(nt).identityFile)),C(Xt,ki)};P(ri,Xt=>{n(nt).identityFile&&Xt(zi)})}var Ni=h(ri,4);{var on=Xt=>{i(Xt,()=>n(nt).host,()=>n(jt))},cn=Xt=>{var ki=p0e(),Pi=f(ki);I(()=>{ki.disabled=n(V)!==null,D(Pi,n(V)===n(nt).host?"Deploying…":"Deploy helper")}),O("click",ki,()=>ae(n(nt).host)),C(Xt,ki)};P(Ni,Xt=>{var ki;(ki=n(jt))!=null&&ki.ok?Xt(on):n(jt)&&!n(jt).ok&&Xt(cn,1)})}var un=h(Ni,2),Mn=h(un);t(Mn,()=>n(nt).host);var In=h(Mn,2);let ts;var Te=h(In,2);let st;var rt=h(Te,2),Qt=h(Ki,2);{var ai=Xt=>{s(Xt,()=>n(nt).host,()=>n(jt))};P(Qt,Xt=>{var ki;(ki=n(jt))!=null&&ki.ok&&Xt(ai)})}var vi=h(Qt,2);o(vi,()=>n(nt).host);var bi=h(vi,2);{var Vt=Xt=>{var ki=g0e(),Pi=f(ki);I(()=>D(Pi,n(jt).error)),C(Xt,ki)};P(bi,Xt=>{n(jt)&&!n(jt).ok&&Xt(Vt)})}var ci=h(bi,2);{var xt=Xt=>{var ki=v0e(),Pi=f(ki),Zi=h(f(Pi)),Qi=h(Pi,2),sn=h(f(Qi)),gn=h(Qi,2),bn=h(f(gn)),rn=h(gn,2),An=h(f(rn)),_n=h(rn,2),Xi=h(f(_n));I(()=>li(bn,"placeholder",n(w)?`${n(w)} (default)`:"user she runs as")),wi(Zi,()=>n(nt).host,Jt=>n(nt).host=Jt),wi(sn,()=>n(nt).port,Jt=>n(nt).port=Jt),wi(bn,()=>n(nt).user,Jt=>n(nt).user=Jt),wi(An,()=>n(nt).identityFile,Jt=>n(nt).identityFile=Jt),wi(Xi,()=>n(nt).hostname,Jt=>n(nt).hostname=Jt),C(Xt,ki)};P(ci,Xt=>{n(T)===ft&&Xt(xt)})}var Li=h(ci,2);{var Ri=Xt=>{var ki=x0e(),Pi=f(ki);{let Zi=Ke(()=>n(nt).hostname||n(nt).host);Nve(Pi,{get host(){return n(nt).host},get label(){return n(Zi)},onclose:()=>p(R,null),ondone:()=>{var Qi;p(R,null),S(!0),(Qi=e.onchanged)==null||Qi.call(e)}})}C(Xt,ki)};P(Li,Xt=>{n(R)===ft&&Xt(Ri)})}I(Xt=>{var ki,Pi;Zt=Mt(qi,1,"dot svelte-ns6riw",null,Zt,{ok:(ki=n(jt))==null?void 0:ki.ok,err:n(jt)&&!n(jt).ok}),D(Oi,n(nt).hostname||((Pi=n(jt))==null?void 0:Pi.hostname)||n(nt).host),D(fi,`${(n(nt).user||n(w)||"?")??""}@${n(nt).host??""}${n(nt).port?`:${n(nt).port}`:""}`),un.disabled=Xt,ts=Mt(In,1,"ghost sm svelte-ns6riw",null,ts,{active:n(T)===ft}),st=Mt(Te,1,"ghost sm svelte-ns6riw",null,st,{active:n(R)===ft})},[()=>n(H)!==null||!n(nt).host.trim()]),O("click",un,()=>G(n(nt))),O("click",In,()=>p(T,n(T)===ft?null:ft,!0)),O("click",Te,()=>p(R,n(R)===ft?null:ft,!0)),O("click",rt,()=>wt(ft)),C(gi,Gi)});var si=h(Kt,2);{var $i=gi=>{var nt=_0e();C(gi,nt)};P(si,gi=>{n(c).length===0&&!n(v)&&gi($i)})}var en=h(si,2),_i=f(en),Yi=h(f(_i),6);{var ln=gi=>{var nt=b0e(),ft=f(nt);I(()=>D(ft,n(Ft)?"Copied":"Copy public key")),O("click",nt,()=>Be(n(Ae),jt=>p(Ft,jt,!0))),C(gi,nt)};P(Yi,gi=>{n(Ae)&&gi(ln)})}var Je=h(Yi,2),$t=f(Je),hi=h(_i,2);{var Ii=gi=>{var nt=C0e(),ft=pt(nt),jt=f(ft),Gi=h(ft,2),Ki=f(Gi);I(()=>{D(jt,n(Ae)),D(Ki,n(tt))}),C(gi,nt)},Bi=gi=>{var nt=z5(),ft=f(nt);I(()=>D(ft,`No services key yet (${(n(tt)||"data-dir/ssh/services_id_ed25519")??""}) — the setup command creates it.`)),C(gi,nt)};P(hi,gi=>{n(Ae)?gi(Ii):gi(Bi,-1)})}I(()=>{var gi,nt;le.disabled=n(v),Ue=Mt(We,1,"svelte-ns6riw",null,Ue,{spinning:n(v)}),D(Ye,`${n(c).length+1} host${n(c).length===0?"":"s"}`),vt=Mt(Ee,1,"dot svelte-ns6riw",null,vt,{ok:(gi=n(je))==null?void 0:gi.ok,err:n(je)&&!n(je).ok}),D(Se,((nt=n(je))==null?void 0:nt.hostname)??"this host"),Fe.disabled=n(H)!==null,Je.disabled=n(qt),D($t,n(qt)?"Generating…":n(Ae)?"Regenerate":"Generate key")}),O("click",le,()=>S(!0)),O("click",Dt,ke),O("click",Fe,it),O("click",Je,gt),C(K,$)};P(yt,K=>{n(B)==="add"?K(St):K(Ut,-1)})}C(r,Y),vs()}bs(["click"]);var H5=E('<span class="tab-dot svelte-ymmv06"></span>'),S0e=E('<div class="services-page svelte-ymmv06"><div class="sub-nav svelte-ymmv06"><button>Instances</button> <button>Installations <!></button> <button>Catalog</button> <button>Hosts <!></button></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></div>');function k0e(r,e){gs(e,!0);let t=jn(e,"active",3,!1),i=jn(e,"sub",3,null);const s=["instances","hosts","catalog","hostsconf"],o="she-services-tab",a=localStorage.getItem(o);let l=A(Mi(a&&s.includes(a)?a:"instances"));dn(()=>{localStorage.setItem(o,n(l))});const c={instances:"instances",hosts:"installations",catalog:"catalog",hostsconf:"hosts"},u=dt=>Object.keys(c).find(zt=>c[zt]===dt)??null;let g;dn(()=>{if(i()===g)return;g=i();const dt=u(i());dt&&io(()=>{dt!==n(l)&&p(l,dt,!0)})}),dn(()=>{var dt;t()&&((dt=e.onsub)==null||dt.call(e,c[n(l)]))});let v=A(0),m=A(null);function b(dt){p(m,dt,!0),Fw(v)}let _=A(null),w=0;function k(dt,zt){p(_,{host:dt,adapter:zt,n:++w},!0),b("catalog"),p(l,"hosts")}let B=A(0),T=A(0),R=A(0),N=A("none"),H=A(""),q=Ke(()=>[n(B)>0?`${n(B)} adapter update${n(B)===1?"":"s"} available`:"",n(T)>0?`${n(T)} host${n(T)===1?"":"s"} with an outdated helper`:"",n(R)>0?`${n(R)} host${n(R)===1?"":"s"} with a newer Node.js`:""].filter(Boolean).join(" · "));dn(()=>{var dt,zt;n(q)?(dt=e.onstatus)==null||dt.call(e,"warn",n(q)):(zt=e.onstatus)==null||zt.call(e,n(N),n(H))});var V=S0e(),J=f(V),ae=f(J);let oe;var Q=h(ae,2);let se;var fe=h(f(Q));{var ne=dt=>{var zt=H5();I(()=>li(zt,"title",`${n(B)??""} adapter update${n(B)===1?"":"s"} available`)),C(dt,zt)};P(fe,dt=>{n(B)>0&&dt(ne)})}var ye=h(Q,2);let _e;var Ne=h(ye,2);let xe;var mt=h(f(Ne));{var He=dt=>{var zt=H5();I(Bt=>li(zt,"title",Bt),[()=>[n(T)>0?`${n(T)} host${n(T)===1?"":"s"} running an outdated she-servicectl`:"",n(R)>0?`${n(R)} host${n(R)===1?"":"s"} with a newer Node.js available`:""].filter(Boolean).join(" · ")]),C(dt,zt)};P(mt,dt=>{n(T)+n(R)>0&&dt(He)})}var Ie=h(J,2);let Ve;var Xe=f(Ie);qpe(Xe,{onstatus:(dt,zt)=>{p(N,dt,!0),p(H,zt,!0)},get generation(){return n(v)},get origin(){return n(m)},onchanged:()=>b("instances")});var ue=h(Ie,2);let me;var Oe=f(ue);sve(Oe,{onchanged:()=>b("hosts"),onupdates:dt=>p(B,dt,!0),get generation(){return n(v)},get origin(){return n(m)},get addPreset(){return n(_)}});var qe=h(ue,2);let Ae;var tt=f(qe);{let dt=Ke(()=>t()&&n(l)==="catalog");Lve(tt,{get active(){return n(dt)},oninstalled:k,get generation(){return n(v)},get origin(){return n(m)}})}var qt=h(qe,2);let Ft;var Re=f(qt);E0e(Re,{onchanged:()=>b("hostsconf"),onupdates:dt=>p(T,dt,!0),onnodeupdates:dt=>p(R,dt,!0),get generation(){return n(v)},get origin(){return n(m)}}),I(()=>{oe=Mt(ae,1,"svelte-ymmv06",null,oe,{active:n(l)==="instances"}),se=Mt(Q,1,"svelte-ymmv06",null,se,{active:n(l)==="hosts"}),_e=Mt(ye,1,"svelte-ymmv06",null,_e,{active:n(l)==="catalog"}),xe=Mt(Ne,1,"svelte-ymmv06",null,xe,{active:n(l)==="hostsconf"}),Ve=Mt(Ie,1,"tab-wrap svelte-ymmv06",null,Ve,{hidden:n(l)!=="instances"}),me=Mt(ue,1,"tab-wrap svelte-ymmv06",null,me,{hidden:n(l)!=="hosts"}),Ae=Mt(qe,1,"tab-wrap svelte-ymmv06",null,Ae,{hidden:n(l)!=="catalog"}),Ft=Mt(qt,1,"tab-wrap svelte-ymmv06",null,Ft,{hidden:n(l)!=="hostsconf"})}),O("click",ae,()=>p(l,"instances")),O("click",Q,()=>p(l,"hosts")),O("click",ye,()=>p(l,"catalog")),O("click",Ne,()=>p(l,"hostsconf")),C(r,V),vs()}bs(["click"]);const nw=(r,e=lr)=>{var t=B0e(),i=h(f(t));{var s=a=>{var l=D0e();C(a,l)},o=a=>{var l=A0e();C(a,l)};P(i,a=>{e()?a(s):a(o,-1)})}C(r,t)};var D0e=Fo('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"></path>'),A0e=Fo('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0"></path>'),B0e=Fo('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="7" width="10" height="7" rx="1.5"></rect><!></svg>'),F0e=E('<span class="ok svelte-1az45ix"> </span>'),L0e=E('<span class="muted svelte-1az45ix"> </span>'),I0e=E('<div class="err-box svelte-1az45ix"> <button class="ghost sm svelte-1az45ix">×</button></div>'),P0e=E(`<div class="err-box svelte-1az45ix"><b>Secrets store locked:</b> <code class="svelte-1az45ix">SHE_SECRETS_KEY</code> in the daemon's environment or restore <code class="svelte-1az45ix"> </code>, then restart she. Starting over means deleting <code class="svelte-1az45ix"> </code>.</div>`),T0e=E('<button><span class="name svelte-1az45ix"> </span> <span class="count svelte-1az45ix"> </span></button>'),M0e=E('<div class="muted empty svelte-1az45ix">No secrets yet.</div>'),N0e=E("<!> <!>",1),R0e=E('<button type="button" class="lock is-secret svelte-1az45ix" disabled="" title="secret — write-only, never shown again"><!></button> <input placeholder="•••••• (type to replace)" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>',1),O0e=E('<textarea spellcheck="false" class="svelte-1az45ix"></textarea>'),z0e=E('<input type="text" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>'),H0e=E('<button type="button" class="lock svelte-1az45ix" title="plain — shown in clear; click to mark it secret (never shown again)"><!></button> <!>',1),W0e=E('<tr><td class="mono svelte-1az45ix"> </td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><!> <button type="submit" class="sm svelte-1az45ix">Save</button></form></td><td class="muted svelte-1az45ix"> </td><td class="c-act svelte-1az45ix"><button class="ghost sm svelte-1az45ix" title="Delete">×</button></td></tr>'),j0e=E('<textarea placeholder="value" spellcheck="false" class="svelte-1az45ix"></textarea>'),$0e=E('<input type="password" placeholder="value" autocomplete="off" class="svelte-1az45ix"/>'),V0e=E('<div class="fields-head svelte-1az45ix"><span class="title svelte-1az45ix"> </span> <span class="muted svelte-1az45ix"> </span> <span class="spacer svelte-1az45ix"></span> <label class="reveal check-label svelte-1az45ix"><input type="checkbox" class="svelte-1az45ix"/><span class="checkmark svelte-1az45ix"></span> show while typing</label> <button class="ghost sm danger svelte-1az45ix">Delete group</button></div> <table class="svelte-1az45ix"><colgroup><col class="c-name svelte-1az45ix"/><col class="c-value"/><col class="c-changed svelte-1az45ix"/><col class="c-act svelte-1az45ix"/></colgroup><thead><tr><th class="svelte-1az45ix">field</th><th class="svelte-1az45ix">value</th><th class="svelte-1az45ix">changed</th><th class="svelte-1az45ix"></th></tr></thead><tbody><!><tr class="new svelte-1az45ix"><td class="svelte-1az45ix"><input type="text" placeholder="new field" spellcheck="false" class="svelte-1az45ix"/></td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><button type="button"><!></button> <!> <button type="submit" class="sm svelte-1az45ix">Add</button></form></td><td class="muted svelte-1az45ix" colspan="2">the lock decides the kind: secret fields are write-only forever, plain fields (user names, hosts) stay readable here. Multi-line values: tick <i>show while typing</i> and paste.</td></tr></tbody></table> <div class="hint svelte-1az45ix"><code class="svelte-1az45ix"> </code> returns the string, <code class="svelte-1az45ix"> </code> the whole group as a frozen object, <code class="svelte-1az45ix">she.secrets.has(…)</code> checks without a warning. Scripts that read a secret at load time keep the old value until they are reloaded.</div>',1),q0e=E('Create a group on the left, then add fields to it — e.g. group <code class="svelte-1az45ix">smtp</code> with <code class="svelte-1az45ix">host</code>, <code class="svelte-1az45ix">user</code>, <code class="svelte-1az45ix">password</code>.',1),U0e=E('<div class="muted empty svelte-1az45ix"><!></div>'),G0e=E(`<!> <div class="sec-shell svelte-1az45ix"><div class="bar svelte-1az45ix"><span class="muted svelte-1az45ix">Values are stored encrypted and never sent back to the browser — scripts read them with <code class="svelte-1az45ix">she.secrets.get('group/field')</code>.</span> <span class="spacer svelte-1az45ix"></span> <!> <!> <button class="ghost svelte-1az45ix" title="Reload">↺</button></div> <!> <!> <div class="body svelte-1az45ix"><div class="groups svelte-1az45ix"><div class="groups-head svelte-1az45ix">Groups</div> <!> <form class="add-group svelte-1az45ix"><input type="text" placeholder="new group" spellcheck="false" class="svelte-1az45ix"/> <button type="submit" class="ghost sm svelte-1az45ix">+</button></form></div> <div class="fields svelte-1az45ix"><!></div></div></div>`,1);function K0e(r,e){gs(e,!0);let t=jn(e,"active",3,!0),i=jn(e,"sub",3,null),s=A(null),o=A(null),a=A(""),l=A(""),c=A(!1),u=A(""),g=A(""),v=A(""),m=A(!0),b=A(Mi({})),_=A(!1),w=A(void 0),k=!1;const B=/^[A-Za-z0-9_.-]{1,64}$/,T=Ke(()=>{var ee;return((ee=n(s))==null?void 0:ee.groups.find(ve=>ve.name===n(o)))??null}),R=Ke(()=>{var ee,ve;return((ee=n(s))==null?void 0:ee.status)==="locked"||((ve=n(s))==null?void 0:ve.status)==="error"});async function N(){try{p(s,await uZ(),!0),p(a,""),n(o)&&!n(s).groups.some(ee=>ee.name===n(o))&&p(o,null),!n(o)&&n(s).groups.length>0&&p(o,n(s).groups[0].name,!0)}catch(ee){p(a,ee.message??String(ee),!0)}}dn(()=>{t()&&!k&&(k=!0,N())});let H;dn(()=>{const ee=i();ee!==H&&(H=ee,ee&&ee!==n(o)&&p(o,ee,!0))}),dn(()=>{var ee;t()&&(H=n(o)??"",(ee=e.onsub)==null||ee.call(e,n(o)??""))});function q(ee){p(l,ee,!0),setTimeout(()=>{n(l)===ee&&p(l,"")},2500)}async function V(ee,ve,Ce,at=!0){if(Ce){p(c,!0);try{await hZ(ee,ve,Ce,at),p(b,{...n(b),[`${ee}/${ve}`]:""},!0),p(g,""),p(v,""),p(m,!0),q(`saved ${ee}/${ve}`),await N(),p(o,ee,!0)}catch(Ze){p(a,Ze.message??String(Ze),!0)}finally{p(c,!1)}}}async function J(){var ve;const ee=n(u).trim();if(!B.test(ee)){p(a,"group name: letters, digits, _ . - (max 64)");return}(ve=n(s))!=null&&ve.groups.some(Ce=>Ce.name===ee)||p(s,n(s)?{...n(s),groups:[...n(s).groups,{name:ee,changed:0,fields:[]}].sort((Ce,at)=>Ce.name.localeCompare(at.name))}:n(s),!0),p(o,ee,!0),p(u,""),p(a,"")}async function ae(ee,ve){var Ce;if(await((Ce=n(w))==null?void 0:Ce.show(`Mark ${ee}/${ve} as secret? Its value will never be shown again — not here, not through the API. Scripts keep reading it. This cannot be undone (delete and re-create to change your mind).`,{confirm:"Mark secret",danger:!0}))){p(c,!0);try{await fZ(ee,ve),p(b,{...n(b),[`${ee}/${ve}`]:""},!0),q(`${ee}/${ve} is secret now`),await N()}catch(at){p(a,at.message??String(at),!0)}finally{p(c,!1)}}}async function oe(ee,ve){var Ce;if(await((Ce=n(w))==null?void 0:Ce.show(`Delete secret ${ee}/${ve}? Scripts reading it get undefined from now on.`,{confirm:"Delete",danger:!0}))){p(c,!0);try{await uA(ee,ve),q(`deleted ${ee}/${ve}`),await N()}catch(at){p(a,at.message??String(at),!0)}finally{p(c,!1)}}}async function Q(ee){var Ce,at,Ze,At;const ve=((Ce=n(T))==null?void 0:Ce.fields.length)??0;if(ve===0){p(s,n(s)?{...n(s),groups:n(s).groups.filter(Lt=>Lt.name!==ee)}:n(s),!0),p(o,((Ze=(at=n(s))==null?void 0:at.groups[0])==null?void 0:Ze.name)??null,!0);return}if(await((At=n(w))==null?void 0:At.show(`Delete the group ${ee} with its ${ve} secret${ve===1?"":"s"}?`,{confirm:"Delete group",danger:!0}))){p(c,!0);try{await uA(ee),q(`deleted ${ee}`),p(o,null),await N()}catch(Lt){p(a,Lt.message??String(Lt),!0)}finally{p(c,!1)}}}function se(ee){return ee?new Date(ee).toLocaleString():"—"}var fe=G0e(),ne=pt(fe);ls(ur(ne,{}),ee=>p(w,ee,!0),()=>n(w));var ye=h(ne,2),_e=f(ye),Ne=h(f(_e),4);{var xe=ee=>{var ve=F0e(),Ce=f(ve);I(()=>D(Ce,n(l))),C(ee,ve)};P(Ne,ee=>{n(l)&&ee(xe)})}var mt=h(Ne,2);{var He=ee=>{var ve=L0e(),Ce=f(ve);I(()=>{li(ve,"title",n(s).file),D(Ce,`key: ${(n(s).keySource==="env"?"SHE_SECRETS_KEY":n(s).keySource==="file"?n(s).keyFile:"none yet — generated on first save")??""}`)}),C(ee,ve)};P(mt,ee=>{n(s)&&ee(He)})}var Ie=h(mt,2),Ve=h(_e,2);{var Xe=ee=>{var ve=I0e(),Ce=f(ve),at=h(Ce);I(()=>D(Ce,`${n(a)??""} `)),O("click",at,()=>p(a,"")),C(ee,ve)};P(Ve,ee=>{n(a)&&ee(Xe)})}var ue=h(Ve,2);{var me=ee=>{var ve=P0e(),Ce=h(f(ve)),at=h(Ce,3),Ze=f(at),At=h(at,2),Lt=f(At);I(()=>{D(Ce,` ${n(s).error??""}. Values cannot be read or changed until the key is back — set `),D(Ze,n(s).keyFile),D(Lt,n(s).file)}),C(ee,ve)};P(ue,ee=>{n(R)&&n(s)&&ee(me)})}var Oe=h(ue,2),qe=f(Oe),Ae=h(f(qe),2);{var tt=ee=>{var ve=N0e(),Ce=pt(ve);di(Ce,17,()=>n(s).groups,At=>At.name,(At,Lt)=>{var Wt=T0e();let je;var ze=f(Wt),ct=f(ze),S=h(ze,2),W=f(S);I(()=>{je=Mt(Wt,1,"group svelte-1az45ix",null,je,{active:n(o)===n(Lt).name}),D(ct,n(Lt).name),D(W,n(Lt).fields.length)}),O("click",Wt,()=>p(o,n(Lt).name,!0)),C(At,Wt)});var at=h(Ce,2);{var Ze=At=>{var Lt=M0e();C(At,Lt)};P(at,At=>{n(s).groups.length===0&&At(Ze)})}C(ee,ve)};P(Ae,ee=>{n(s)&&ee(tt)})}var qt=h(Ae,2),Ft=f(qt),Re=h(Ft,2),dt=h(qe,2),zt=f(dt);{var Bt=ee=>{var ve=V0e(),Ce=pt(ve),at=f(Ce),Ze=f(at),At=h(at,2),Lt=f(At),Wt=h(At,4),je=f(Wt),ze=h(Wt,2),ct=h(Ce,2),S=h(f(ct),2),W=f(S);di(W,17,()=>n(T).fields,St=>St.name,(St,Ut)=>{const K=Ke(()=>`${n(T).name}/${n(Ut).name}`),$=Ke(()=>n(b)[n(K)]??(n(Ut).secret?"":n(Ut).value??"")),j=Ke(()=>n(Ut).secret?n($)!=="":n($)!==(n(Ut).value??""));var le=W0e(),We=f(le),Ue=f(We),Dt=h(We),Et=f(Dt),Ye=f(Et);{var ei=Di=>{var ge=R0e(),U=pt(ge),X=f(U);nw(X,()=>!0);var de=h(U,2);I(()=>{li(de,"type",n(_)?"text":"password"),ml(de,n($)),de.disabled=n(R)}),O("input",de,$e=>p(b,{...n(b),[n(K)]:$e.target.value},!0)),C(Di,ge)},ii=Di=>{var ge=H0e(),U=pt(ge),X=f(U);nw(X,()=>!1);var de=h(U,2);{var $e=re=>{var Se=O0e();li(Se,"rows",4),I(()=>{ml(Se,n($)),Se.disabled=n(R)}),O("input",Se,Z=>p(b,{...n(b),[n(K)]:Z.target.value},!0)),C(re,Se)},Ee=Ke(()=>n($).includes(`
304
328
  `)),vt=re=>{var Se=z0e();I(()=>{ml(Se,n($)),Se.disabled=n(R)}),O("input",Se,Z=>p(b,{...n(b),[n(K)]:Z.target.value},!0)),C(re,Se)};P(de,re=>{n(Ee)?re($e):re(vt,-1)})}I(()=>U.disabled=n(c)||n(R)),O("click",U,()=>ae(n(T).name,n(Ut).name)),C(Di,ge)};P(Ye,Di=>{n(Ut).secret?Di(ei):Di(ii,-1)})}var Fi=h(Ye,2),Hi=h(Dt),Tt=f(Hi),Yt=h(Hi),Si=f(Yt);I(Di=>{li(We,"title",`she.secrets.get('${n(K)??""}')`),D(Ue,n(Ut).name),Fi.disabled=n(c)||n(R)||!n(j)||!n($),D(Tt,Di),Si.disabled=n(c)||n(R)},[()=>se(n(Ut).changed)]),Ds("submit",Et,Di=>{Di.preventDefault(),n(j)&&V(n(T).name,n(Ut).name,n($),n(Ut).secret)}),O("click",Si,()=>oe(n(T).name,n(Ut).name)),C(St,le)});var ce=h(W),De=f(ce),Pe=f(De),lt=h(De),G=f(lt),it=f(G);let wt;var ke=f(it);nw(ke,()=>n(m));var Qe=h(it,2);{var _t=St=>{var Ut=j0e();I(K=>{li(Ut,"rows",K),Ut.disabled=n(R)},[()=>n(v).includes(`
305
329
  `)?4:1]),wi(Ut,()=>n(v),K=>p(v,K)),C(St,Ut)},kt=Ke(()=>n(v).includes(`
306
- `)||n(_)||!n(m)),Gt=St=>{var Ut=$0e();I(()=>Ut.disabled=n(R)),wi(Ut,()=>n(v),K=>p(v,K)),C(St,Ut)};P(Qe,St=>{n(kt)?St(_t):St(Gt,-1)})}var Be=h(Qe,2),gt=h(ct,2),Y=f(gt),Me=f(Y),Ge=h(Y,2),yt=f(Ge);I((St,Ut)=>{D(Ze,n(T).name),D(Lt,`changed ${St??""}`),ze.disabled=n(c)||n(R),Pe.disabled=n(R),wt=Mt(it,1,"lock svelte-1az45ix",null,wt,{"is-secret":n(m)}),it.disabled=n(R),li(it,"title",n(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Be.disabled=Ut,D(Me,`she.secrets.get('${n(T).name??""}/<field>')`),D(yt,`she.secrets.get('${n(T).name??""}')`)},[()=>se(n(T).changed),()=>n(c)||n(R)||!n(g).trim()||!n(v)]),Ps(je,()=>n(_),St=>p(_,St)),O("click",ze,()=>Q(n(T).name)),wi(Pe,()=>n(g),St=>p(g,St)),Ds("submit",G,St=>{St.preventDefault(),B.test(n(g).trim())?V(n(T).name,n(g).trim(),n(v),n(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),O("click",it,()=>p(m,!n(m))),C(ee,ve)},ui=ee=>{var ve=U0e(),Ce=f(ve);{var at=At=>{var Lt=q0e();C(At,Lt)},Ze=At=>{var Lt=On("Select a group.");C(At,Lt)};P(Ce,At=>{n(s).groups.length===0?At(at):At(Ze,-1)})}C(ee,ve)};P(zt,ee=>{n(T)?ee(Bt):n(s)&&!n(R)&&ee(ui,1)})}I(ee=>{Ft.disabled=n(R),Re.disabled=ee},[()=>n(R)||!n(u).trim()]),O("click",Ie,N),Ds("submit",qt,ee=>{ee.preventDefault(),J()}),wi(Ft,()=>n(u),ee=>p(u,ee)),C(r,fe),vs()}bs(["click","input"]);var Z0e=E('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),W5=E('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Y0e=E('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),X0e=E('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),Q0e=E('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),J0e=E('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),exe=E('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),txe=E('<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"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),ixe=E('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),nxe=E('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),sxe=E('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),oxe=E('<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>'),rxe=E('<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>'),axe=E('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),lxe=E('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),cxe=E('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),dxe=E('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),uxe=E('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),hxe=E('<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>'),fxe=E('<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>'),pxe=E('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),gxe=E('<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),vxe=E('<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),xxe=E('<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>'),mxe=E('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),_xe=E('<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>'),bxe=E('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Cxe=E('<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>'),yxe=E("<div><!></div>"),wxe=E('<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="12" height="12" 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" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</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> <div><!></div></main></div>'),Exe=E('<div class="login-error svelte-1n46o8q"> </div>'),Sxe=E('<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>'),kxe=E('<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>'),Dxe=E('<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>'),Axe=E("<!> <!> <!> <!>",1);function Bxe(r,e){gs(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function s(){const Ze=location.hash.replace(/^#\/?/,""),[At,...Lt]=Ze.split("/"),Wt=i[At]??At;if(!t.includes(Wt))return{page:"scripts",sub:null};const je=Lt.map(ze=>{try{return decodeURIComponent(ze)}catch{return ze}}).join("/");return{page:Wt,sub:je||null}}let o=A(Mi(s().page)),a=A(Mi(s().sub)),l=A(null),c=A(!1),u=A(!1),g=A(!1),v=A(!1),m=A("none"),b=A(""),_=A(!1),w=A(""),k=A(""),B=A(!1),T=A(!1);nZ(()=>{p(_,!0)});async function R(){p(k,""),p(B,!0);try{await rZ(n(w)),p(w,""),p(_,!1)}catch(Ze){p(k,Ze.message??"Login failed",!0)}finally{p(B,!1)}}async function N(){if(n(m)==="proxy"&&n(b)){window.location.href=n(b);return}await aZ(),p(_,!0)}let H=A(null),q=A(!1),V=A(!1),J=A(!1),ae=A(!1),oe=A(Mi([])),Q=A(0),se=A(!1),fe=A(!1),ne=A("none"),ye=A(""),_e=A(Mi([]));const Ne=Ke(()=>n(_e).filter(Ze=>Ze.online).length),xe=Ke(()=>n(_e).length===0?"none":n(Ne)===n(_e).length?"all":n(Ne)>0?"some":"offline");let mt=A(!1),He=A(!1);async function Ie(){if(!await n(H).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(q,!0);let Ze;try{Ze=(await vd()).startedAt}catch{}try{await aL()}catch{}const At=Date.now()+6e4;for(;Date.now()<At;){await new Promise(Lt=>setTimeout(Lt,250));try{const Lt=await vd();if(Ze===void 0||Lt.startedAt!==Ze){location.reload();return}}catch{}}location.reload()}async function Ve(){p(g,!0);try{const Ze=await gZ();n(l)&&p(l,{...n(l),latestVersion:Ze.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function Xe(){var Lt,Wt;if(!await n(H).show(`Update to v${(Lt=n(l))==null?void 0:Lt.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(v,!0);const Ze=(Wt=n(l))==null?void 0:Wt.startedAt;try{await pZ()}catch{}const At=Date.now()+18e4;for(;Date.now()<At;){await new Promise(je=>setTimeout(je,1e3));try{const je=await vd();if(Ze===void 0||je.startedAt!==Ze){location.reload();return}}catch{p(v,!1),p(q,!0)}}location.reload()}let ue=A(void 0),me=A(0);function Oe(){if(!n(ue))return;const Ze=getComputedStyle(n(ue)),At=parseFloat(Ze.columnGap)||0,Lt=[...n(ue).children];let Wt=parseFloat(Ze.paddingLeft)+parseFloat(Ze.paddingRight)+At*Math.max(0,Lt.length-1);for(const ze of Lt)ze.classList.contains("nav-spacer")||(Wt+=ze.getBoundingClientRect().width);const je=Math.ceil(Wt)+8;je>0&&je!==n(me)&&p(me,je)}let qe=null;function Ae(){if(!(!n(ue)||!qe)){qe.disconnect(),qe.observe(n(ue));for(const Ze of n(ue).children)qe.observe(Ze);Oe()}}Us(()=>(qe=new ResizeObserver(()=>Oe()),Ae(),()=>{qe==null||qe.disconnect(),qe=null})),dn(()=>{var Ze,At,Lt,Wt;n(se),n(fe),(Ze=n(l))==null||Ze.matterEnabled,(At=n(l))==null||At.dbEnabled,(Lt=n(l))==null||Lt.latestVersion,(Wt=n(l))==null||Wt.docker,Wa().then(()=>io(Ae))});function tt(Ze){p(o,Ze,!0),p(a,null),location.hash=qt(Ze,null)}function qt(Ze,At){const Lt=At?At.split("/").map(encodeURIComponent).join("/"):"";return`#/${Ze}${Lt?"/"+Lt:""}`}function Ft(Ze,At){const Lt=At||null;n(o)!==Ze||n(a)===Lt||(p(a,Lt,!0),history.replaceState(null,"",qt(Ze,Lt)))}Us(async()=>{const Ze=qt(n(o),n(a));location.hash!==Ze&&history.replaceState(null,"",Ze);const At=()=>{const De=s();p(o,De.page,!0),p(a,De.sub,!0)};window.addEventListener("hashchange",At);const Lt=()=>{document.visibilityState==="visible"&&(YX(),vd().then(De=>{p(l,De,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",Lt);try{const De=await oZ();p(m,De.mode,!0),p(b,De.proxyLogoutUrl??"",!0),n(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(T,!0);async function Wt(){var De,Pe,lt,G;try{p(l,await vd(),!0)}catch{}try{const[it,wt]=await Promise.all([dL(),Uc()]);p(oe,Array.isArray(wt.pinnedPackages)?wt.pinnedPackages:[],!0),p(Q,Object.keys(it).filter(_t=>!n(oe).includes(_t)).length,!0);const ke=n(se);p(se,((De=wt.broker)==null?void 0:De.enabled)===!0),ke&&!n(se)&&n(o)==="broker"&&tt("scripts");const Qe=n(fe);p(fe,((Pe=wt.services)==null?void 0:Pe.enabled)===!0),Qe&&!n(fe)&&n(o)==="adapters"&&tt("scripts")}catch{}!((lt=n(l))!=null&&lt.matterEnabled)&&n(o)==="matter"&&tt("scripts"),!((G=n(l))!=null&&G.dbEnabled)&&n(o)==="db"&&tt("scripts")}Wt();const je=setInterval(Wt,5e3),ze=eo("mqtt:status",De=>{De.connected===!1?(p(ae,!0),p(V,!1),p(J,!1)):(p(ae,!1),p(V,De.ready===!1),p(J,De.ready===!0))}),ct=eo("matter:deviceList",De=>{Array.isArray(De.devices)&&p(_e,De.devices.map(Pe=>({nodeId:String(Pe.nodeId),online:!!Pe.online})),!0)}),S=eo("matter:deviceStatus",De=>{if(De.nodeId===void 0)return;const Pe=String(De.nodeId),lt=!!De.online;p(_e,n(_e).map(G=>G.nodeId===Pe?{...G,online:lt}:G),!0)}),W=_L();p(mt,W.some(De=>De.level==="error"),!0),p(He,!n(mt)&&W.some(De=>De.level==="warn"),!0);const ce=p8(De=>{De.level==="error"?(p(mt,!0),p(He,!1)):De.level==="warn"&&!n(mt)&&p(He,!0)});return()=>{window.removeEventListener("hashchange",At),document.removeEventListener("visibilitychange",Lt),clearInterval(je),ze(),ct(),S(),ce()}});var Re=Axe();Ds("click",G3,()=>{n(c)&&p(c,!1),n(u)&&p(u,!1)});var dt=pt(Re);{var zt=Ze=>{var At=wxe(),Lt=f(At);{var Wt=nt=>{var ft=Z0e(),jt=h(f(ft)),Gi=h(jt);I(()=>D(jt,` — no user script is running and the script directory is not watched. ${n(l).safeModeReason==="--safe-mode"?"Started with --safe-mode.":`${n(l).safeModeReason??"She was killed shortly after start repeatedly"} — the daemon died shortly after start several times in a row, which usually means a script blocks the event loop or crashes it at load.`} Edit or delete it, then restart. `)),O("click",Gi,Ie),C(nt,ft)};P(Lt,nt=>{var ft;(ft=n(l))!=null&&ft.safeMode&&nt(Wt)})}var je=h(Lt,2),ze=h(f(je),2);let ct;var S=h(ze,2);let W;var ce=h(f(S),2);{var De=nt=>{var ft=W5();I(()=>li(ft,"title",`${n(Q)??""} package update${n(Q)===1?"":"s"} available`)),C(nt,ft)};P(ce,nt=>{n(Q)>0&&nt(De)})}var Pe=h(S,2);let lt;var G=h(f(Pe),2);{var it=nt=>{var ft=Y0e();C(nt,ft)},wt=nt=>{var ft=X0e();C(nt,ft)},ke=nt=>{var ft=Q0e();C(nt,ft)};P(G,nt=>{n(ae)?nt(it):n(V)?nt(wt,1):n(J)&&nt(ke,2)})}var Qe=h(Pe,2);{var _t=nt=>{var ft=J0e();let jt;I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="broker"})),O("click",ft,()=>tt("broker")),C(nt,ft)};P(Qe,nt=>{n(se)&&nt(_t)})}var kt=h(Qe,2);{var Gt=nt=>{var ft=txe();let jt;var Gi=h(f(ft),2);{var Ki=Zt=>{var xi=W5();I(()=>li(xi,"title",n(ye))),C(Zt,xi)},qi=Zt=>{var xi=exe();C(Zt,xi)};P(Gi,Zt=>{n(ne)==="warn"?Zt(Ki):Zt(qi,-1)})}I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="adapters"})),O("click",ft,()=>tt("adapters")),C(nt,ft)};P(kt,nt=>{n(fe)&&nt(Gt)})}var Be=h(kt,2);{var gt=nt=>{var ft=oxe();let jt;var Gi=h(f(ft),2);{var Ki=xi=>{var Oi=ixe();C(xi,Oi)},qi=xi=>{var Oi=nxe();C(xi,Oi)},Zt=xi=>{var Oi=sxe();C(xi,Oi)};P(Gi,xi=>{n(xe)==="all"?xi(Ki):n(xe)==="some"?xi(qi,1):n(xe)==="offline"&&xi(Zt,2)})}I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="matter"})),O("click",ft,()=>tt("matter")),C(nt,ft)};P(Be,nt=>{var ft;(ft=n(l))!=null&&ft.matterEnabled&&nt(gt)})}var Y=h(Be,2);{var Me=nt=>{var ft=rxe();let jt;I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="db"})),O("click",ft,()=>tt("db")),C(nt,ft)};P(Y,nt=>{var ft;(ft=n(l))!=null&&ft.dbEnabled&&nt(Me)})}var Ge=h(Y,2);let yt;var St=h(Ge,2);let Ut;var K=h(f(St),2);{var $=nt=>{var ft=axe();C(nt,ft)},j=nt=>{var ft=lxe();C(nt,ft)};P(K,nt=>{n(mt)?nt($):n(He)&&nt(j,1)})}var le=h(St,4),We=h(f(le),2),Ue=f(We),Dt=f(Ue);Dt.nodeValue="v2.0.1 ";var Et=h(Dt);{var Ye=nt=>{var ft=cxe();C(nt,ft)};P(Et,nt=>{var ft,jt;(ft=n(l))!=null&&ft.latestVersion&&!((jt=n(l))!=null&&jt.docker)&&nt(Ye)})}var ei=h(Ue,2);{var ii=nt=>{var ft=fxe(),jt=f(ft),Gi=h(f(jt));Gi.textContent="v2.0.1";var Ki=h(Gi,2);{var qi=zi=>{var Ni=dxe(),on=h(pt(Ni)),cn=f(on);I(()=>D(cn,`v${n(l).latestVersion??""}`)),C(zi,Ni)},Zt=zi=>{var Ni=uxe();C(zi,Ni)};P(Ki,zi=>{var Ni;(Ni=n(l))!=null&&Ni.latestVersion?zi(qi):zi(Zt,-1)})}var xi=h(jt,2),Oi=f(xi);{var we=zi=>{var Ni=hxe(),on=h(f(Ni));I(()=>D(on,` Update to v${n(l).latestVersion??""}`)),O("click",Ni,Xe),C(zi,Ni)};P(Oi,zi=>{var Ni;(Ni=n(l))!=null&&Ni.latestVersion&&zi(we)})}var pe=h(Oi,2),ti=f(pe);let fi;var ri=h(ti);I(()=>{pe.disabled=n(g),fi=Mt(ti,0,"svelte-1n46o8q",null,fi,{spinning:n(g)}),D(ri,` ${n(g)?"Checking…":"Check for updates"}`)}),O("click",ft,zi=>zi.stopPropagation()),O("click",pe,Ve),C(nt,ft)};P(ei,nt=>{var ft;n(u)&&!((ft=n(l))!=null&&ft.docker)&&nt(ii)})}var Fi=h(We,2),Hi=f(Fi),Tt=h(Hi,2);{var Yt=nt=>{var ft=bxe(),jt=f(ft);{var Gi=Oi=>{var we=xxe(),pe=f(we);{var ti=Xt=>{const ki=Ke(()=>Math.floor((Date.now()-n(l).startedAt)/1e3)),Pi=Ke(()=>Math.floor(n(ki)/86400)),Zi=Ke(()=>Math.floor(n(ki)%86400/3600)),Qi=Ke(()=>Math.floor(n(ki)%3600/60));var sn=pxe(),gn=h(pt(sn)),bn=f(gn);I(()=>D(bn,`${n(Pi)>0?n(Pi)+"d ":""}${n(Zi)>0||n(Pi)>0?n(Zi)+"h ":""}${n(Qi)??""}m`)),C(Xt,sn)};P(pe,Xt=>{n(l).startedAt&&Xt(ti)})}var fi=h(pe,3),ri=f(fi),zi=h(fi,3),Ni=f(zi),on=h(zi,3),cn=f(on),un=h(on,2);{var Mn=Xt=>{var ki=gxe(),Pi=h(pt(ki)),Zi=f(Pi),Qi=h(Pi,3),sn=f(Qi);I(()=>{D(Zi,n(l).matterNodes??0),D(sn,n(l).matterEndpoints??0)}),C(Xt,ki)};P(un,Xt=>{n(l).matterEnabled&&Xt(Mn)})}var In=h(un,2);{var ts=Xt=>{var ki=vxe(),Pi=h(pt(ki)),Zi=f(Pi),Qi=h(Pi,3),sn=f(Qi);I(()=>{D(Zi,n(l).dbDocs??"—"),D(sn,n(l).dbViews??"—")}),C(Xt,ki)};P(In,Xt=>{n(l).dbEnabled&&Xt(ts)})}var Te=h(In,3),st=f(Te),rt=h(Te,3),Qt=f(rt),ai=h(rt,3),vi=f(ai),bi=h(ai,3),Vt=f(bi),ci=h(bi,3),xt=f(ci),Li=h(ci,3),Ri=f(Li);I(()=>{D(ri,n(l).scripts),D(Ni,n(l).topics),D(cn,n(l).mqttMsgPerSec??"—"),D(st,n(l).handlers??"—"),D(Qt,n(l).memMb!=null?n(l).memMb+" MB":"—"),D(vi,n(l).cpuPercent!=null?n(l).cpuPercent+" %":"—"),D(Vt,n(l).eluPercent!=null?n(l).eluPercent+" %":"—"),D(xt,n(l).elMeanMs!=null?n(l).elMeanMs+" ms":"—"),D(Ri,n(l).elMaxMs!=null?n(l).elMaxMs+" ms":"—")}),C(Oi,we)},Ki=Oi=>{var we=mxe();C(Oi,we)};P(jt,Oi=>{n(l)?Oi(Gi):Oi(Ki,-1)})}var qi=h(jt,2),Zt=f(qi);{var xi=Oi=>{var we=_xe();O("click",we,()=>{p(c,!1),Ie()}),C(Oi,we)};P(Zt,Oi=>{var we;(we=n(l))!=null&&we.docker||Oi(xi)})}O("click",ft,Oi=>Oi.stopPropagation()),C(nt,ft)};P(Tt,nt=>{n(c)&&nt(Yt)})}var Si=h(Fi,2);let Di;var ge=h(Si,2);{var U=nt=>{var ft=Cxe();O("click",ft,N),C(nt,ft)};P(ge,nt=>{n(m)==="password"&&nt(U)})}ls(je,nt=>p(ue,nt),()=>n(ue));var X=h(je,2),de=f(X);ls(ur(de,{}),nt=>p(H,nt,!0),()=>n(H));var $e=h(de,2);let Ee;var vt=f($e);{let nt=Ke(()=>n(o)==="scripts"),ft=Ke(()=>n(o)==="scripts"?n(a):null);zte(vt,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("scripts",jt)})}var re=h($e,2);let Se;var Z=f(re);Xce(Z,{});var ie=h(re,2);let be;var et=f(ie);{let nt=Ke(()=>n(o)==="mqtt"),ft=Ke(()=>n(o)==="mqtt"?n(a):null);Ice(et,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("mqtt",jt)})}var Fe=h(ie,2);let ht;var bt=f(Fe);{let nt=Ke(()=>n(o)==="matter"),ft=Ke(()=>n(o)==="matter"?n(a):null);Sle(bt,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("matter",jt)})}var Rt=h(Fe,2);let Pt;var Nt=f(Rt);{let nt=Ke(()=>n(o)==="broker"),ft=Ke(()=>n(o)==="broker"?n(a):null);Bhe(Nt,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("broker",jt)})}var Ht=h(Rt,2);{var Kt=nt=>{var ft=yxe();let jt;var Gi=f(ft);{let Ki=Ke(()=>n(o)==="adapters"),qi=Ke(()=>n(o)==="adapters"?n(a):null);k0e(Gi,{onstatus:(Zt,xi)=>{p(ne,Zt,!0),p(ye,xi,!0)},get active(){return n(Ki)},get sub(){return n(qi)},onsub:Zt=>Ft("adapters",Zt)})}I(()=>jt=Mt(ft,1,"page-wrap svelte-1n46o8q",null,jt,{hidden:n(o)!=="adapters"})),C(nt,ft)};P(Ht,nt=>{n(fe)&&nt(Kt)})}var si=h(Ht,2);let $i;var en=f(si);{let nt=Ke(()=>n(o)==="secrets"),ft=Ke(()=>n(o)==="secrets"?n(a):null);K0e(en,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("secrets",jt)})}var _i=h(si,2);let Yi;var ln=f(_i);{let nt=Ke(()=>n(o)==="db"),ft=Ke(()=>n(o)==="db"?n(a):null);qne(ln,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("db",jt)})}var Je=h(_i,2);let $t;var hi=f(Je);Pie(hi,{});var Ii=h(Je,2);let Bi;var gi=f(Ii);zie(gi,{}),I(()=>{Vo(At,n(me)?`min-width: ${n(me)}px`:void 0),ct=Mt(ze,1,"svelte-1n46o8q",null,ct,{active:n(o)==="scripts"}),W=Mt(S,1,"svelte-1n46o8q",null,W,{active:n(o)==="packages"}),lt=Mt(Pe,1,"svelte-1n46o8q",null,lt,{active:n(o)==="mqtt"}),yt=Mt(Ge,1,"svelte-1n46o8q",null,yt,{active:n(o)==="secrets"}),Ut=Mt(St,1,"svelte-1n46o8q",null,Ut,{active:n(o)==="logs"}),Di=Mt(Si,1,"nav-settings svelte-1n46o8q",null,Di,{active:n(o)==="config"}),Ee=Mt($e,1,"page-wrap svelte-1n46o8q",null,Ee,{hidden:n(o)!=="scripts"}),Se=Mt(re,1,"page-wrap svelte-1n46o8q",null,Se,{hidden:n(o)!=="packages"}),be=Mt(ie,1,"page-wrap svelte-1n46o8q",null,be,{hidden:n(o)!=="mqtt"}),ht=Mt(Fe,1,"page-wrap svelte-1n46o8q",null,ht,{hidden:n(o)!=="matter"}),Pt=Mt(Rt,1,"page-wrap svelte-1n46o8q",null,Pt,{hidden:n(o)!=="broker"}),$i=Mt(si,1,"page-wrap svelte-1n46o8q",null,$i,{hidden:n(o)!=="secrets"}),Yi=Mt(_i,1,"page-wrap svelte-1n46o8q",null,Yi,{hidden:n(o)!=="db"}),$t=Mt(Je,1,"page-wrap svelte-1n46o8q",null,$t,{hidden:n(o)!=="config"}),Bi=Mt(Ii,1,"page-wrap svelte-1n46o8q",null,Bi,{hidden:n(o)!=="logs"})}),O("click",ze,()=>tt("scripts")),O("click",S,()=>tt("packages")),O("click",Pe,()=>tt("mqtt")),O("click",Ge,()=>tt("secrets")),O("click",St,()=>{tt("logs"),p(mt,!1),p(He,!1)}),O("click",Ue,nt=>{nt.stopPropagation(),p(u,!n(u)),p(c,!1)}),O("click",Hi,nt=>{nt.stopPropagation(),p(c,!n(c)),p(u,!1)}),O("click",Si,()=>tt("config")),C(Ze,At)};P(dt,Ze=>{n(T)&&!n(_)&&Ze(zt)})}var Bt=h(dt,2);{var ui=Ze=>{var At=Sxe(),Lt=f(At),Wt=h(f(Lt),4),je=h(f(Wt),2),ze=h(Wt,2);{var ct=ce=>{var De=Exe(),Pe=f(De);I(()=>D(Pe,n(k))),C(ce,De)};P(ze,ce=>{n(k)&&ce(ct)})}var S=h(ze,2),W=f(S);I(()=>{je.disabled=n(B),S.disabled=n(B)||!n(w),D(W,n(B)?"Signing in…":"Sign in")}),Ds("submit",Lt,ce=>{ce.preventDefault(),R()}),wi(je,()=>n(w),ce=>p(w,ce)),C(Ze,At)};P(Bt,Ze=>{n(_)&&Ze(ui)})}var ee=h(Bt,2);{var ve=Ze=>{var At=kxe();C(Ze,At)};P(ee,Ze=>{n(q)&&Ze(ve)})}var Ce=h(ee,2);{var at=Ze=>{var At=Dxe();C(Ze,At)};P(Ce,Ze=>{n(v)&&Ze(at)})}C(r,Re),vs()}bs(["click"]);bR(Bxe,{target:document.getElementById("app")});export{DB as t};
330
+ `)||n(_)||!n(m)),Gt=St=>{var Ut=$0e();I(()=>Ut.disabled=n(R)),wi(Ut,()=>n(v),K=>p(v,K)),C(St,Ut)};P(Qe,St=>{n(kt)?St(_t):St(Gt,-1)})}var Be=h(Qe,2),gt=h(ct,2),Y=f(gt),Me=f(Y),Ge=h(Y,2),yt=f(Ge);I((St,Ut)=>{D(Ze,n(T).name),D(Lt,`changed ${St??""}`),ze.disabled=n(c)||n(R),Pe.disabled=n(R),wt=Mt(it,1,"lock svelte-1az45ix",null,wt,{"is-secret":n(m)}),it.disabled=n(R),li(it,"title",n(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Be.disabled=Ut,D(Me,`she.secrets.get('${n(T).name??""}/<field>')`),D(yt,`she.secrets.get('${n(T).name??""}')`)},[()=>se(n(T).changed),()=>n(c)||n(R)||!n(g).trim()||!n(v)]),Ps(je,()=>n(_),St=>p(_,St)),O("click",ze,()=>Q(n(T).name)),wi(Pe,()=>n(g),St=>p(g,St)),Ds("submit",G,St=>{St.preventDefault(),B.test(n(g).trim())?V(n(T).name,n(g).trim(),n(v),n(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),O("click",it,()=>p(m,!n(m))),C(ee,ve)},ui=ee=>{var ve=U0e(),Ce=f(ve);{var at=At=>{var Lt=q0e();C(At,Lt)},Ze=At=>{var Lt=On("Select a group.");C(At,Lt)};P(Ce,At=>{n(s).groups.length===0?At(at):At(Ze,-1)})}C(ee,ve)};P(zt,ee=>{n(T)?ee(Bt):n(s)&&!n(R)&&ee(ui,1)})}I(ee=>{Ft.disabled=n(R),Re.disabled=ee},[()=>n(R)||!n(u).trim()]),O("click",Ie,N),Ds("submit",qt,ee=>{ee.preventDefault(),J()}),wi(Ft,()=>n(u),ee=>p(u,ee)),C(r,fe),vs()}bs(["click","input"]);var Z0e=E('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),W5=E('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Y0e=E('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),X0e=E('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),Q0e=E('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),J0e=E('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),exe=E('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),txe=E('<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"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),ixe=E('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),nxe=E('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),sxe=E('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),oxe=E('<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>'),rxe=E('<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>'),axe=E('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),lxe=E('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),cxe=E('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),dxe=E('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),uxe=E('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),hxe=E('<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>'),fxe=E('<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>'),pxe=E('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),gxe=E('<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),vxe=E('<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),xxe=E('<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>'),mxe=E('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),_xe=E('<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>'),bxe=E('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Cxe=E('<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>'),yxe=E("<div><!></div>"),wxe=E('<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="12" height="12" 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" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</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> <div><!></div></main></div>'),Exe=E('<div class="login-error svelte-1n46o8q"> </div>'),Sxe=E('<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>'),kxe=E('<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>'),Dxe=E('<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>'),Axe=E("<!> <!> <!> <!>",1);function Bxe(r,e){gs(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function s(){const Ze=location.hash.replace(/^#\/?/,""),[At,...Lt]=Ze.split("/"),Wt=i[At]??At;if(!t.includes(Wt))return{page:"scripts",sub:null};const je=Lt.map(ze=>{try{return decodeURIComponent(ze)}catch{return ze}}).join("/");return{page:Wt,sub:je||null}}let o=A(Mi(s().page)),a=A(Mi(s().sub)),l=A(null),c=A(!1),u=A(!1),g=A(!1),v=A(!1),m=A("none"),b=A(""),_=A(!1),w=A(""),k=A(""),B=A(!1),T=A(!1);nZ(()=>{p(_,!0)});async function R(){p(k,""),p(B,!0);try{await rZ(n(w)),p(w,""),p(_,!1)}catch(Ze){p(k,Ze.message??"Login failed",!0)}finally{p(B,!1)}}async function N(){if(n(m)==="proxy"&&n(b)){window.location.href=n(b);return}await aZ(),p(_,!0)}let H=A(null),q=A(!1),V=A(!1),J=A(!1),ae=A(!1),oe=A(Mi([])),Q=A(0),se=A(!1),fe=A(!1),ne=A("none"),ye=A(""),_e=A(Mi([]));const Ne=Ke(()=>n(_e).filter(Ze=>Ze.online).length),xe=Ke(()=>n(_e).length===0?"none":n(Ne)===n(_e).length?"all":n(Ne)>0?"some":"offline");let mt=A(!1),He=A(!1);async function Ie(){if(!await n(H).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(q,!0);let Ze;try{Ze=(await vd()).startedAt}catch{}try{await aL()}catch{}const At=Date.now()+6e4;for(;Date.now()<At;){await new Promise(Lt=>setTimeout(Lt,250));try{const Lt=await vd();if(Ze===void 0||Lt.startedAt!==Ze){location.reload();return}}catch{}}location.reload()}async function Ve(){p(g,!0);try{const Ze=await gZ();n(l)&&p(l,{...n(l),latestVersion:Ze.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function Xe(){var Lt,Wt;if(!await n(H).show(`Update to v${(Lt=n(l))==null?void 0:Lt.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(v,!0);const Ze=(Wt=n(l))==null?void 0:Wt.startedAt;try{await pZ()}catch{}const At=Date.now()+18e4;for(;Date.now()<At;){await new Promise(je=>setTimeout(je,1e3));try{const je=await vd();if(Ze===void 0||je.startedAt!==Ze){location.reload();return}}catch{p(v,!1),p(q,!0)}}location.reload()}let ue=A(void 0),me=A(0);function Oe(){if(!n(ue))return;const Ze=getComputedStyle(n(ue)),At=parseFloat(Ze.columnGap)||0,Lt=[...n(ue).children];let Wt=parseFloat(Ze.paddingLeft)+parseFloat(Ze.paddingRight)+At*Math.max(0,Lt.length-1);for(const ze of Lt)ze.classList.contains("nav-spacer")||(Wt+=ze.getBoundingClientRect().width);const je=Math.ceil(Wt)+8;je>0&&je!==n(me)&&p(me,je)}let qe=null;function Ae(){if(!(!n(ue)||!qe)){qe.disconnect(),qe.observe(n(ue));for(const Ze of n(ue).children)qe.observe(Ze);Oe()}}Us(()=>(qe=new ResizeObserver(()=>Oe()),Ae(),()=>{qe==null||qe.disconnect(),qe=null})),dn(()=>{var Ze,At,Lt,Wt;n(se),n(fe),(Ze=n(l))==null||Ze.matterEnabled,(At=n(l))==null||At.dbEnabled,(Lt=n(l))==null||Lt.latestVersion,(Wt=n(l))==null||Wt.docker,Wa().then(()=>io(Ae))});function tt(Ze){p(o,Ze,!0),p(a,null),location.hash=qt(Ze,null)}function qt(Ze,At){const Lt=At?At.split("/").map(encodeURIComponent).join("/"):"";return`#/${Ze}${Lt?"/"+Lt:""}`}function Ft(Ze,At){const Lt=At||null;n(o)!==Ze||n(a)===Lt||(p(a,Lt,!0),history.replaceState(null,"",qt(Ze,Lt)))}Us(async()=>{const Ze=qt(n(o),n(a));location.hash!==Ze&&history.replaceState(null,"",Ze);const At=()=>{const De=s();p(o,De.page,!0),p(a,De.sub,!0)};window.addEventListener("hashchange",At);const Lt=()=>{document.visibilityState==="visible"&&(YX(),vd().then(De=>{p(l,De,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",Lt);try{const De=await oZ();p(m,De.mode,!0),p(b,De.proxyLogoutUrl??"",!0),n(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(T,!0);async function Wt(){var De,Pe,lt,G;try{p(l,await vd(),!0)}catch{}try{const[it,wt]=await Promise.all([dL(),Uc()]);p(oe,Array.isArray(wt.pinnedPackages)?wt.pinnedPackages:[],!0),p(Q,Object.keys(it).filter(_t=>!n(oe).includes(_t)).length,!0);const ke=n(se);p(se,((De=wt.broker)==null?void 0:De.enabled)===!0),ke&&!n(se)&&n(o)==="broker"&&tt("scripts");const Qe=n(fe);p(fe,((Pe=wt.services)==null?void 0:Pe.enabled)===!0),Qe&&!n(fe)&&n(o)==="adapters"&&tt("scripts")}catch{}!((lt=n(l))!=null&&lt.matterEnabled)&&n(o)==="matter"&&tt("scripts"),!((G=n(l))!=null&&G.dbEnabled)&&n(o)==="db"&&tt("scripts")}Wt();const je=setInterval(Wt,5e3),ze=eo("mqtt:status",De=>{De.connected===!1?(p(ae,!0),p(V,!1),p(J,!1)):(p(ae,!1),p(V,De.ready===!1),p(J,De.ready===!0))}),ct=eo("matter:deviceList",De=>{Array.isArray(De.devices)&&p(_e,De.devices.map(Pe=>({nodeId:String(Pe.nodeId),online:!!Pe.online})),!0)}),S=eo("matter:deviceStatus",De=>{if(De.nodeId===void 0)return;const Pe=String(De.nodeId),lt=!!De.online;p(_e,n(_e).map(G=>G.nodeId===Pe?{...G,online:lt}:G),!0)}),W=_L();p(mt,W.some(De=>De.level==="error"),!0),p(He,!n(mt)&&W.some(De=>De.level==="warn"),!0);const ce=p8(De=>{De.level==="error"?(p(mt,!0),p(He,!1)):De.level==="warn"&&!n(mt)&&p(He,!0)});return()=>{window.removeEventListener("hashchange",At),document.removeEventListener("visibilitychange",Lt),clearInterval(je),ze(),ct(),S(),ce()}});var Re=Axe();Ds("click",G3,()=>{n(c)&&p(c,!1),n(u)&&p(u,!1)});var dt=pt(Re);{var zt=Ze=>{var At=wxe(),Lt=f(At);{var Wt=nt=>{var ft=Z0e(),jt=h(f(ft)),Gi=h(jt);I(()=>D(jt,` — no user script is running and the script directory is not watched. ${n(l).safeModeReason==="--safe-mode"?"Started with --safe-mode.":`${n(l).safeModeReason??"She was killed shortly after start repeatedly"} — the daemon died shortly after start several times in a row, which usually means a script blocks the event loop or crashes it at load.`} Edit or delete it, then restart. `)),O("click",Gi,Ie),C(nt,ft)};P(Lt,nt=>{var ft;(ft=n(l))!=null&&ft.safeMode&&nt(Wt)})}var je=h(Lt,2),ze=h(f(je),2);let ct;var S=h(ze,2);let W;var ce=h(f(S),2);{var De=nt=>{var ft=W5();I(()=>li(ft,"title",`${n(Q)??""} package update${n(Q)===1?"":"s"} available`)),C(nt,ft)};P(ce,nt=>{n(Q)>0&&nt(De)})}var Pe=h(S,2);let lt;var G=h(f(Pe),2);{var it=nt=>{var ft=Y0e();C(nt,ft)},wt=nt=>{var ft=X0e();C(nt,ft)},ke=nt=>{var ft=Q0e();C(nt,ft)};P(G,nt=>{n(ae)?nt(it):n(V)?nt(wt,1):n(J)&&nt(ke,2)})}var Qe=h(Pe,2);{var _t=nt=>{var ft=J0e();let jt;I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="broker"})),O("click",ft,()=>tt("broker")),C(nt,ft)};P(Qe,nt=>{n(se)&&nt(_t)})}var kt=h(Qe,2);{var Gt=nt=>{var ft=txe();let jt;var Gi=h(f(ft),2);{var Ki=Zt=>{var xi=W5();I(()=>li(xi,"title",n(ye))),C(Zt,xi)},qi=Zt=>{var xi=exe();C(Zt,xi)};P(Gi,Zt=>{n(ne)==="warn"?Zt(Ki):Zt(qi,-1)})}I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="adapters"})),O("click",ft,()=>tt("adapters")),C(nt,ft)};P(kt,nt=>{n(fe)&&nt(Gt)})}var Be=h(kt,2);{var gt=nt=>{var ft=oxe();let jt;var Gi=h(f(ft),2);{var Ki=xi=>{var Oi=ixe();C(xi,Oi)},qi=xi=>{var Oi=nxe();C(xi,Oi)},Zt=xi=>{var Oi=sxe();C(xi,Oi)};P(Gi,xi=>{n(xe)==="all"?xi(Ki):n(xe)==="some"?xi(qi,1):n(xe)==="offline"&&xi(Zt,2)})}I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="matter"})),O("click",ft,()=>tt("matter")),C(nt,ft)};P(Be,nt=>{var ft;(ft=n(l))!=null&&ft.matterEnabled&&nt(gt)})}var Y=h(Be,2);{var Me=nt=>{var ft=rxe();let jt;I(()=>jt=Mt(ft,1,"svelte-1n46o8q",null,jt,{active:n(o)==="db"})),O("click",ft,()=>tt("db")),C(nt,ft)};P(Y,nt=>{var ft;(ft=n(l))!=null&&ft.dbEnabled&&nt(Me)})}var Ge=h(Y,2);let yt;var St=h(Ge,2);let Ut;var K=h(f(St),2);{var $=nt=>{var ft=axe();C(nt,ft)},j=nt=>{var ft=lxe();C(nt,ft)};P(K,nt=>{n(mt)?nt($):n(He)&&nt(j,1)})}var le=h(St,4),We=h(f(le),2),Ue=f(We),Dt=f(Ue);Dt.nodeValue="v2.1.0 ";var Et=h(Dt);{var Ye=nt=>{var ft=cxe();C(nt,ft)};P(Et,nt=>{var ft,jt;(ft=n(l))!=null&&ft.latestVersion&&!((jt=n(l))!=null&&jt.docker)&&nt(Ye)})}var ei=h(Ue,2);{var ii=nt=>{var ft=fxe(),jt=f(ft),Gi=h(f(jt));Gi.textContent="v2.1.0";var Ki=h(Gi,2);{var qi=zi=>{var Ni=dxe(),on=h(pt(Ni)),cn=f(on);I(()=>D(cn,`v${n(l).latestVersion??""}`)),C(zi,Ni)},Zt=zi=>{var Ni=uxe();C(zi,Ni)};P(Ki,zi=>{var Ni;(Ni=n(l))!=null&&Ni.latestVersion?zi(qi):zi(Zt,-1)})}var xi=h(jt,2),Oi=f(xi);{var we=zi=>{var Ni=hxe(),on=h(f(Ni));I(()=>D(on,` Update to v${n(l).latestVersion??""}`)),O("click",Ni,Xe),C(zi,Ni)};P(Oi,zi=>{var Ni;(Ni=n(l))!=null&&Ni.latestVersion&&zi(we)})}var pe=h(Oi,2),ti=f(pe);let fi;var ri=h(ti);I(()=>{pe.disabled=n(g),fi=Mt(ti,0,"svelte-1n46o8q",null,fi,{spinning:n(g)}),D(ri,` ${n(g)?"Checking…":"Check for updates"}`)}),O("click",ft,zi=>zi.stopPropagation()),O("click",pe,Ve),C(nt,ft)};P(ei,nt=>{var ft;n(u)&&!((ft=n(l))!=null&&ft.docker)&&nt(ii)})}var Fi=h(We,2),Hi=f(Fi),Tt=h(Hi,2);{var Yt=nt=>{var ft=bxe(),jt=f(ft);{var Gi=Oi=>{var we=xxe(),pe=f(we);{var ti=Xt=>{const ki=Ke(()=>Math.floor((Date.now()-n(l).startedAt)/1e3)),Pi=Ke(()=>Math.floor(n(ki)/86400)),Zi=Ke(()=>Math.floor(n(ki)%86400/3600)),Qi=Ke(()=>Math.floor(n(ki)%3600/60));var sn=pxe(),gn=h(pt(sn)),bn=f(gn);I(()=>D(bn,`${n(Pi)>0?n(Pi)+"d ":""}${n(Zi)>0||n(Pi)>0?n(Zi)+"h ":""}${n(Qi)??""}m`)),C(Xt,sn)};P(pe,Xt=>{n(l).startedAt&&Xt(ti)})}var fi=h(pe,3),ri=f(fi),zi=h(fi,3),Ni=f(zi),on=h(zi,3),cn=f(on),un=h(on,2);{var Mn=Xt=>{var ki=gxe(),Pi=h(pt(ki)),Zi=f(Pi),Qi=h(Pi,3),sn=f(Qi);I(()=>{D(Zi,n(l).matterNodes??0),D(sn,n(l).matterEndpoints??0)}),C(Xt,ki)};P(un,Xt=>{n(l).matterEnabled&&Xt(Mn)})}var In=h(un,2);{var ts=Xt=>{var ki=vxe(),Pi=h(pt(ki)),Zi=f(Pi),Qi=h(Pi,3),sn=f(Qi);I(()=>{D(Zi,n(l).dbDocs??"—"),D(sn,n(l).dbViews??"—")}),C(Xt,ki)};P(In,Xt=>{n(l).dbEnabled&&Xt(ts)})}var Te=h(In,3),st=f(Te),rt=h(Te,3),Qt=f(rt),ai=h(rt,3),vi=f(ai),bi=h(ai,3),Vt=f(bi),ci=h(bi,3),xt=f(ci),Li=h(ci,3),Ri=f(Li);I(()=>{D(ri,n(l).scripts),D(Ni,n(l).topics),D(cn,n(l).mqttMsgPerSec??"—"),D(st,n(l).handlers??"—"),D(Qt,n(l).memMb!=null?n(l).memMb+" MB":"—"),D(vi,n(l).cpuPercent!=null?n(l).cpuPercent+" %":"—"),D(Vt,n(l).eluPercent!=null?n(l).eluPercent+" %":"—"),D(xt,n(l).elMeanMs!=null?n(l).elMeanMs+" ms":"—"),D(Ri,n(l).elMaxMs!=null?n(l).elMaxMs+" ms":"—")}),C(Oi,we)},Ki=Oi=>{var we=mxe();C(Oi,we)};P(jt,Oi=>{n(l)?Oi(Gi):Oi(Ki,-1)})}var qi=h(jt,2),Zt=f(qi);{var xi=Oi=>{var we=_xe();O("click",we,()=>{p(c,!1),Ie()}),C(Oi,we)};P(Zt,Oi=>{var we;(we=n(l))!=null&&we.docker||Oi(xi)})}O("click",ft,Oi=>Oi.stopPropagation()),C(nt,ft)};P(Tt,nt=>{n(c)&&nt(Yt)})}var Si=h(Fi,2);let Di;var ge=h(Si,2);{var U=nt=>{var ft=Cxe();O("click",ft,N),C(nt,ft)};P(ge,nt=>{n(m)==="password"&&nt(U)})}ls(je,nt=>p(ue,nt),()=>n(ue));var X=h(je,2),de=f(X);ls(ur(de,{}),nt=>p(H,nt,!0),()=>n(H));var $e=h(de,2);let Ee;var vt=f($e);{let nt=Ke(()=>n(o)==="scripts"),ft=Ke(()=>n(o)==="scripts"?n(a):null);zte(vt,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("scripts",jt)})}var re=h($e,2);let Se;var Z=f(re);Xce(Z,{});var ie=h(re,2);let be;var et=f(ie);{let nt=Ke(()=>n(o)==="mqtt"),ft=Ke(()=>n(o)==="mqtt"?n(a):null);Ice(et,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("mqtt",jt)})}var Fe=h(ie,2);let ht;var bt=f(Fe);{let nt=Ke(()=>n(o)==="matter"),ft=Ke(()=>n(o)==="matter"?n(a):null);Sle(bt,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("matter",jt)})}var Rt=h(Fe,2);let Pt;var Nt=f(Rt);{let nt=Ke(()=>n(o)==="broker"),ft=Ke(()=>n(o)==="broker"?n(a):null);Bhe(Nt,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("broker",jt)})}var Ht=h(Rt,2);{var Kt=nt=>{var ft=yxe();let jt;var Gi=f(ft);{let Ki=Ke(()=>n(o)==="adapters"),qi=Ke(()=>n(o)==="adapters"?n(a):null);k0e(Gi,{onstatus:(Zt,xi)=>{p(ne,Zt,!0),p(ye,xi,!0)},get active(){return n(Ki)},get sub(){return n(qi)},onsub:Zt=>Ft("adapters",Zt)})}I(()=>jt=Mt(ft,1,"page-wrap svelte-1n46o8q",null,jt,{hidden:n(o)!=="adapters"})),C(nt,ft)};P(Ht,nt=>{n(fe)&&nt(Kt)})}var si=h(Ht,2);let $i;var en=f(si);{let nt=Ke(()=>n(o)==="secrets"),ft=Ke(()=>n(o)==="secrets"?n(a):null);K0e(en,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("secrets",jt)})}var _i=h(si,2);let Yi;var ln=f(_i);{let nt=Ke(()=>n(o)==="db"),ft=Ke(()=>n(o)==="db"?n(a):null);qne(ln,{get active(){return n(nt)},get sub(){return n(ft)},onsub:jt=>Ft("db",jt)})}var Je=h(_i,2);let $t;var hi=f(Je);Pie(hi,{});var Ii=h(Je,2);let Bi;var gi=f(Ii);zie(gi,{}),I(()=>{Vo(At,n(me)?`min-width: ${n(me)}px`:void 0),ct=Mt(ze,1,"svelte-1n46o8q",null,ct,{active:n(o)==="scripts"}),W=Mt(S,1,"svelte-1n46o8q",null,W,{active:n(o)==="packages"}),lt=Mt(Pe,1,"svelte-1n46o8q",null,lt,{active:n(o)==="mqtt"}),yt=Mt(Ge,1,"svelte-1n46o8q",null,yt,{active:n(o)==="secrets"}),Ut=Mt(St,1,"svelte-1n46o8q",null,Ut,{active:n(o)==="logs"}),Di=Mt(Si,1,"nav-settings svelte-1n46o8q",null,Di,{active:n(o)==="config"}),Ee=Mt($e,1,"page-wrap svelte-1n46o8q",null,Ee,{hidden:n(o)!=="scripts"}),Se=Mt(re,1,"page-wrap svelte-1n46o8q",null,Se,{hidden:n(o)!=="packages"}),be=Mt(ie,1,"page-wrap svelte-1n46o8q",null,be,{hidden:n(o)!=="mqtt"}),ht=Mt(Fe,1,"page-wrap svelte-1n46o8q",null,ht,{hidden:n(o)!=="matter"}),Pt=Mt(Rt,1,"page-wrap svelte-1n46o8q",null,Pt,{hidden:n(o)!=="broker"}),$i=Mt(si,1,"page-wrap svelte-1n46o8q",null,$i,{hidden:n(o)!=="secrets"}),Yi=Mt(_i,1,"page-wrap svelte-1n46o8q",null,Yi,{hidden:n(o)!=="db"}),$t=Mt(Je,1,"page-wrap svelte-1n46o8q",null,$t,{hidden:n(o)!=="config"}),Bi=Mt(Ii,1,"page-wrap svelte-1n46o8q",null,Bi,{hidden:n(o)!=="logs"})}),O("click",ze,()=>tt("scripts")),O("click",S,()=>tt("packages")),O("click",Pe,()=>tt("mqtt")),O("click",Ge,()=>tt("secrets")),O("click",St,()=>{tt("logs"),p(mt,!1),p(He,!1)}),O("click",Ue,nt=>{nt.stopPropagation(),p(u,!n(u)),p(c,!1)}),O("click",Hi,nt=>{nt.stopPropagation(),p(c,!n(c)),p(u,!1)}),O("click",Si,()=>tt("config")),C(Ze,At)};P(dt,Ze=>{n(T)&&!n(_)&&Ze(zt)})}var Bt=h(dt,2);{var ui=Ze=>{var At=Sxe(),Lt=f(At),Wt=h(f(Lt),4),je=h(f(Wt),2),ze=h(Wt,2);{var ct=ce=>{var De=Exe(),Pe=f(De);I(()=>D(Pe,n(k))),C(ce,De)};P(ze,ce=>{n(k)&&ce(ct)})}var S=h(ze,2),W=f(S);I(()=>{je.disabled=n(B),S.disabled=n(B)||!n(w),D(W,n(B)?"Signing in…":"Sign in")}),Ds("submit",Lt,ce=>{ce.preventDefault(),R()}),wi(je,()=>n(w),ce=>p(w,ce)),C(Ze,At)};P(Bt,Ze=>{n(_)&&Ze(ui)})}var ee=h(Bt,2);{var ve=Ze=>{var At=kxe();C(Ze,At)};P(ee,Ze=>{n(q)&&Ze(ve)})}var Ce=h(ee,2);{var at=Ze=>{var At=Dxe();C(Ze,At)};P(Ce,Ze=>{n(v)&&Ze(at)})}C(r,Re),vs()}bs(["click"]);bR(Bxe,{target:document.getElementById("app")});export{DB as t};